for example, my code is :
int main(){
f();
g();
while(1){
h();
}
..
}
I set break point on f, g. of course, the program will stop at f()/g(), but when I type "c" and then it will keep running. currently I have to type "CTL+C" to stop it. program also be killed.
is there any other graceful ways to exit from gdb without killing program if the program is running?
thanks
I have to type "CTL+C" to stop it. program also be killed.
type "CTL+C" then gdb will catch SIGINT, then type detach
and then "Ctrl-D" or quit
. gdb will detach from you process and exit. Your program will go on running and its parent process will become init
(PID=1)
(gdb) info signals SIGINT Signal Stop Print Pass to program Description SIGINT Yes Yes No Interrupt
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.