Electrolysis/Debugging: Difference between revisions

reusing the same gdb session
(reusing the same gdb session)
Line 77: Line 77:


You can attach to the newly launched child process with "gdb attach [PID]", or, for emacs gud-gdb, with M-x gdb, gdb --annotate 3 attach PID.
You can attach to the newly launched child process with "gdb attach [PID]", or, for emacs gud-gdb, with M-x gdb, gdb --annotate 3 attach PID.
The same gdb session can be used to debug subsequent child processes.
However, even if the previous process has exited, an explicit "detach" is required before the next "attach [NEWPID]" to persuade gdb to reread the shared library mappings so that symbols have the right addresses.


== To debug both the parent and children ==
== To debug both the parent and children ==
Confirmed users
86

edits