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. Attach debugger programatically

Attach debugger programatically

Scheduled Pinned Locked Moved C / C++ / MFC
debugginghelp
7 Posts 4 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.
  • J Offline
    J Offline
    jmkhael
    wrote on last edited by
    #1

    I need to do it from the code, to attach a debugger to a process id, just the same as we can do it from the task manager when u right click a process and click debug. Any help would be appreciated Papa while (TRUE) Papa.WillLove ( Bebe ) ;

    D 1 Reply Last reply
    0
    • J jmkhael

      I need to do it from the code, to attach a debugger to a process id, just the same as we can do it from the task manager when u right click a process and click debug. Any help would be appreciated Papa while (TRUE) Papa.WillLove ( Bebe ) ;

      D Offline
      D Offline
      Duncan Edwards Jones
      wrote on last edited by
      #2

      Check out the following API calls:- Private Declare Function DebugActiveProcess Lib "kernel32" (ByVal dwProcessId As Long) As Long Private Declare Function WaitForDebugEvent Lib "kernel32" (lpDebugEvent As DEBUG_EVENT_BUFFER, ByVal dwMilliseconds As Long) As Long Private Declare Function ContinueDebugEvent Lib "kernel32" (ByVal dwProcessId As Long, ByVal dwThreadId As Long, ByVal dwContinueStatus As Long) As Long I only have this in VB - I'm guessing you want a C/C++ example... '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

      J 1 Reply Last reply
      0
      • D Duncan Edwards Jones

        Check out the following API calls:- Private Declare Function DebugActiveProcess Lib "kernel32" (ByVal dwProcessId As Long) As Long Private Declare Function WaitForDebugEvent Lib "kernel32" (lpDebugEvent As DEBUG_EVENT_BUFFER, ByVal dwMilliseconds As Long) As Long Private Declare Function ContinueDebugEvent Lib "kernel32" (ByVal dwProcessId As Long, ByVal dwThreadId As Long, ByVal dwContinueStatus As Long) As Long I only have this in VB - I'm guessing you want a C/C++ example... '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

        J Offline
        J Offline
        jmkhael
        wrote on last edited by
        #3

        Thanks for your help but i already checked these APIs, and the prob is that im not developping my own debugger i just want to attach to the VC++ debugger. whereas these APIs are issued by the debugger. Hope you get what i mean Papa while (TRUE) Papa.WillLove ( Bebe ) ;

        S 1 Reply Last reply
        0
        • J jmkhael

          Thanks for your help but i already checked these APIs, and the prob is that im not developping my own debugger i just want to attach to the VC++ debugger. whereas these APIs are issued by the debugger. Hope you get what i mean Papa while (TRUE) Papa.WillLove ( Bebe ) ;

          S Offline
          S Offline
          Steve S
          wrote on last edited by
          #4

          Ah. You mean that you want your application to attach the VC++ debugger to it, rather than attach your program AS the debugger. Will "MSDEV -p procid -e procid" not do this? Steve S

          J 1 Reply Last reply
          0
          • S Steve S

            Ah. You mean that you want your application to attach the VC++ debugger to it, rather than attach your program AS the debugger. Will "MSDEV -p procid -e procid" not do this? Steve S

            J Offline
            J Offline
            jmkhael
            wrote on last edited by
            #5

            Exactly! Thank you all for your help Papa while (TRUE) Papa.WillLove ( Bebe ) ;

            M 1 Reply Last reply
            0
            • J jmkhael

              Exactly! Thank you all for your help Papa while (TRUE) Papa.WillLove ( Bebe ) ;

              M Offline
              M Offline
              Mike Dimmick
              wrote on last edited by
              #6

              If you want to use the same debugger as configured on the system for just-in-time debugging (which I think is the same as the one used by Task Manager), you can find the path in the Debugger value of the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug.

              S 1 Reply Last reply
              0
              • M Mike Dimmick

                If you want to use the same debugger as configured on the system for just-in-time debugging (which I think is the same as the one used by Task Manager), you can find the path in the Debugger value of the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug.

                S Offline
                S Offline
                Steve S
                wrote on last edited by
                #7

                Which, by an amazing coincidence ;P is where I checked the command line... Steve S

                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