follow-fork-mode

Sysprogs forums Forums VisualGDB follow-fork-mode

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6444
    arenalds
    Participant

    I have a Windows 7 box running a CentOS 6.5 VM.  I have been provided with a debug version of a binary (myd) which is a daemon that just initializes upon startup and waits for further commands.  Upon receiving a command, it performs a fork/exec of another binary (child_job) which loads my .so and calls the OnStart() function.  I do not have the source for either myd or child_job.  I currently debug on my VM by:

    # gdb myd

    > set follow-fork-mode child

    > b OnStart

    > run

    It breaks in my .so perfectly.  I am trying to use “Quick Debug with GDB” from VS 2010 to do the same.  First, I just ran it without any additional commands before debugging starts.  Worked fine.  I then re-ran it and with “set follow-fork-mode child” as an additional command before debugging starts.  Seems to start ok but then exits.  This one command is the only difference.  Thoughts?

     

    #6457
    support
    Keymaster

    Most likely your daemon tries to launch some other executable before handling your command. VisualGDB “follows” that launch and ends the debug session when it exits.

    Please try running the set follow-fork-mode command manually via the GDB Session window just before you expect your binary to run the child job.

    You can also enable GDB logging in the Quick Debug window and examine the log for any additional clues.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.