Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Insert breakpoint while gdb is executing

Tags:

c++

c

gdb

I want to add some breakpoints while gdb is executing . How to suspend running gdb and insert breakpoint and continue from there . I tried ctrl+z , it kills the gdb process.

like image 525
Avinash Kumar Avatar asked Nov 15 '13 09:11

Avinash Kumar


1 Answers

Ctrl-c breaks the execution of your program within gdb, and allows you to insert any breakpoints you like. Stopping is very well explained in the manual. I would suggest you read it, it gives you an huge advantage when debugging.

like image 83
daramarak Avatar answered Nov 06 '22 12:11

daramarak