tags:

views:

124

answers:

3

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?

+1  A: 

You may want to study the remote gdb mechanisms a bit for something like that.
For understanding the debugging process more read this short article.

nik
+3  A: 

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
Patrick
better to use the symbolic name, `kill -INT pid`.
Flame
+2  A: 

Until recently you couldn't do what you want, but the newly released version 7.0 of gdb has what is called a "non-stop" mode, in which the gdb prompt / console can be used while the program is running.

See http://sourceware.org/gdb/current/onlinedocs/gdb_6.html#SEC47

Michael Snyder
@MichaelSnyder, thanks!
arsane