How to continue to operate the gdb command console

debugginggdb

Maybe a simple question.

When I attach to a process, I run "continue" to make it continue to run.

Then I want to some other job like "add-symbol-file" with need not interactive with target process, but after the "continue" command, the gdb console will block, so I can not do any action before I break the process.

Is there any way that I can do such thing without suspend the process?

Best Answer

Make sure the console which gdb is running in has keyboard focus, then press CTRL-C. This will usually result in a SIGINT signal to be sent to gdb. With me, GDB then pauses execution of the program and accepts user commands again.

Should the CTRL-C not work (perhaps different config) try to send the signal manually: Find out the pid of gdb such as with command top and then send a SIGINT to gdb:

kill -2 pidhere