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. Application launched by another program, how to debug?

Application launched by another program, how to debug?

Scheduled Pinned Locked Moved C / C++ / MFC
debugginghelptutorialquestion
9 Posts 2 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.
  • C Offline
    C Offline
    charlieg
    wrote on last edited by
    #1

    Vaguely years ago I recall being able to do this, but I'm having a senior moment. I have a program, lets call it test.exe, that is launched by another program that starts as a service. Is there a way to configure VS2015 to launch and run test.exe in the debugger?

    Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

    L 2 Replies Last reply
    0
    • C charlieg

      Vaguely years ago I recall being able to do this, but I'm having a senior moment. I have a program, lets call it test.exe, that is launched by another program that starts as a service. Is there a way to configure VS2015 to launch and run test.exe in the debugger?

      Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hi, You are probably looking for the 'Image File Execution' registry key: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options If you want to avoid manually editing registry keys... you can download GFlags[^] to enable automatic debugger attachment. All it really does is set those registry keys for you. Best Wishes, -David Delaune

      C 1 Reply Last reply
      0
      • L Lost User

        Hi, You are probably looking for the 'Image File Execution' registry key: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options If you want to avoid manually editing registry keys... you can download GFlags[^] to enable automatic debugger attachment. All it really does is set those registry keys for you. Best Wishes, -David Delaune

        C Offline
        C Offline
        charlieg
        wrote on last edited by
        #3

        ooookay, I didn't expect that answer. Totally new to me, I'll look into it.

        Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

        L 1 Reply Last reply
        0
        • C charlieg

          ooookay, I didn't expect that answer. Totally new to me, I'll look into it.

          Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          charlieg wrote:

          ooookay, I didn't expect that answer.

          Liquid Nitrogen. It's what I use for branding my cattle[^].

          charlieg wrote:

          Totally new to me

          I highly recommend learning how to use all of the debugging tools. Best Wishes, -David Delaune

          C 1 Reply Last reply
          0
          • C charlieg

            Vaguely years ago I recall being able to do this, but I'm having a senior moment. I have a program, lets call it test.exe, that is launched by another program that starts as a service. Is there a way to configure VS2015 to launch and run test.exe in the debugger?

            Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Assuming that test.exe is a Debug version, or you have the source, you can just launch it directly from Visual Studio. But if it is not a Debug version you will not get much useful information from the debugger. [edit] Also you can attach the debugger to a running process. [/edit]

            C 1 Reply Last reply
            0
            • L Lost User

              charlieg wrote:

              ooookay, I didn't expect that answer.

              Liquid Nitrogen. It's what I use for branding my cattle[^].

              charlieg wrote:

              Totally new to me

              I highly recommend learning how to use all of the debugging tools. Best Wishes, -David Delaune

              C Offline
              C Offline
              charlieg
              wrote on last edited by
              #6

              Lol, just perused the gflags area. Might be a little heavy for what I need, but very interesting items. Thanks

              Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

              L 1 Reply Last reply
              0
              • L Lost User

                Assuming that test.exe is a Debug version, or you have the source, you can just launch it directly from Visual Studio. But if it is not a Debug version you will not get much useful information from the debugger. [edit] Also you can attach the debugger to a running process. [/edit]

                C Offline
                C Offline
                charlieg
                wrote on last edited by
                #7

                I have the debug code, so this approach might work. I normally live in the embedded world, and the magic of attaching to running processes to debug is mostly a foreign concept. I hope this works....

                Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

                L 1 Reply Last reply
                0
                • C charlieg

                  I have the debug code, so this approach might work. I normally live in the embedded world, and the magic of attaching to running processes to debug is mostly a foreign concept. I hope this works....

                  Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  It helps to have all the source code also, and/or the .PDB file with the debug information, so you can see proper details of what is going on. Sounds complicated, but it's really useful.

                  1 Reply Last reply
                  0
                  • C charlieg

                    Lol, just perused the gflags area. Might be a little heavy for what I need, but very interesting items. Thanks

                    Charlie Gilley <italic>Stuck in a dysfunctional matrix from which I must escape... "Where liberty dwells, there is my country." B. Franklin, 1783 “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    charlieg wrote:

                    Might be a little heavy for what I need, but very interesting items.

                    Two thoughts: 1.) If you actually want to debug an error occuring when ProgramB is launched from ProgramA. There is no other way. 2.) If your question was worded incorrectly and you just simply need to debug ProgramB then just attach a debugger to it. Best Wishes, -David Delaune

                    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