Can't attach to existing process

Sysprogs forums Forums VisualGDB Can't attach to existing process

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #7837
    BitFlipper
    Participant

    I’m having problems attaching to a running process. The two different approaches that fail are:

    1. When I configure VGDB to ask for the process to attach to, it shows an empty list of processes, so I can’t select anything.
    2. When I configure VGDB to take a specific PID, I can’t set the PID of the running process in the VGDB settings since for example the PID could be something like 1000169805, while VGDB only accepts values up to 1000000000.

    Any help appreciated, thanks.

    #7840
    support
    Keymaster

    Hi,

    You can override the attach PID by adding a custom pre-debug action that will set the AttachPID variable (on the Custom Debug Steps page). Let us know if you need more details.

    #7845
    BitFlipper
    Participant

    I actually found out that adding the following as part of the gdb command for the PID works:

    pidof my_program

    This assumes there is only 1 instance of my_program running at the time.

     

    [EDIT] It appears the forum software is removing the grave accents from the above command. It needs to be inside “`”.

    • This reply was modified 8 years, 8 months ago by BitFlipper.
    • This reply was modified 8 years, 8 months ago by BitFlipper.
    • This reply was modified 8 years, 8 months ago by BitFlipper.
    • This reply was modified 8 years, 8 months ago by BitFlipper.
    #7852
    support
    Keymaster

    Hi,

    Yes, that will also work if there is only one instance of your program running.

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