Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Debug child process

Debug child process

Scheduled Pinned Locked Moved C / C++ / MFC
visual-studiodebuggingquestionlounge
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LiYS
    wrote on last edited by
    #1

    Hi all, How do I debug a child process inside VC 6.0 or VS in general. The scenario: The main program loads a dll which loads another exe(the process that I wanted to debug), I can debug the dll code fine but can't even set the breakpoint inside created process code. All the related source code was opened inside main program's IDE and all the .pdb files were copied to main program's "debug" dir. Thanks,


    _ I 2 Replies Last reply
    0
    • L LiYS

      Hi all, How do I debug a child process inside VC 6.0 or VS in general. The scenario: The main program loads a dll which loads another exe(the process that I wanted to debug), I can debug the dll code fine but can't even set the breakpoint inside created process code. All the related source code was opened inside main program's IDE and all the .pdb files were copied to main program's "debug" dir. Thanks,


      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      Go to HKEY_LOCAL_MACHINE>Software>Microsoft>WindowsNT>CurrentVersion>ImageFileExecution Options. Here you can create a key with the name of your exe.[Assuming you are running windowsXP] eg MyProcess.exe.Create a new string value with the following properties. [Name = debugger, data = vsjitdebugger.exe]. Close the registry editor and start your application. When your child process with the name as "MyProcess.exe" gets launched you would be prompted to attach it with vsjitdebugger. This would only be one way to attach a debugger to your process no sooner than it is launched.

      Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

      L 1 Reply Last reply
      0
      • _ _AnsHUMAN_

        Go to HKEY_LOCAL_MACHINE>Software>Microsoft>WindowsNT>CurrentVersion>ImageFileExecution Options. Here you can create a key with the name of your exe.[Assuming you are running windowsXP] eg MyProcess.exe.Create a new string value with the following properties. [Name = debugger, data = vsjitdebugger.exe]. Close the registry editor and start your application. When your child process with the name as "MyProcess.exe" gets launched you would be prompted to attach it with vsjitdebugger. This would only be one way to attach a debugger to your process no sooner than it is launched.

        Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

        L Offline
        L Offline
        LiYS
        wrote on last edited by
        #3

        Thanks. I just tried out the IFEO method, the debugger did get triggered but it only left me with a new instance of VS 2008 debugger option(I have both VC6.0 and 9.0 installed) for which I have no way to specify the symbol for the debugger. Is it possible to using the existing VC6.0 debugger(I'm using the VC6.0). In addition, will DebugBreak for the debugee do the same thing? Thanks,


        _ 1 Reply Last reply
        0
        • L LiYS

          Thanks. I just tried out the IFEO method, the debugger did get triggered but it only left me with a new instance of VS 2008 debugger option(I have both VC6.0 and 9.0 installed) for which I have no way to specify the symbol for the debugger. Is it possible to using the existing VC6.0 debugger(I'm using the VC6.0). In addition, will DebugBreak for the debugee do the same thing? Thanks,


          _ Offline
          _ Offline
          _AnsHUMAN_
          wrote on last edited by
          #4

          LiYS wrote:

          ith a new instance of VS 2008 debugger option

          You can keep VS 6.0 open and then it would show in the list to select from

          LiYS wrote:

          n addition, will DebugBreak for the debugee do the same thing?

          MSDN:The DebugBreak function causes a breakpoint exception to occur in the current process. This allows the calling thread to signal the debugger to handle the exception. The essence is clear now :)

          Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

          1 Reply Last reply
          0
          • L LiYS

            Hi all, How do I debug a child process inside VC 6.0 or VS in general. The scenario: The main program loads a dll which loads another exe(the process that I wanted to debug), I can debug the dll code fine but can't even set the breakpoint inside created process code. All the related source code was opened inside main program's IDE and all the .pdb files were copied to main program's "debug" dir. Thanks,


            I Offline
            I Offline
            Iain Clarke Warrior Programmer
            wrote on last edited by
            #5

            If you have all the source code, you could simply add the following line very early in the exe:

            __asm { int 3 }

            This will fire a breakpoint for you to debug. Don't forgot to remove it! Iain.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups