2

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?

3 Answers 3

4

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 
Sign up to request clarification or add additional context in comments.

1 Comment

better to use the symbolic name, kill -INT pid.
3

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

Comments

1

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.