Is there a way to set a breakpoint at every line in the code with GDB? Obviously I don't want to hit b *addr
for every single line, so I'm wondering if there's a fast way to do this.
Edit Note that I am running a binary created by someone else and I do not have access to the source code. Unfortunately, that binary has not been compiled with the -g flag. Therefore, I cannot just single step through each line in the code.
Further Edit
As Jason points out below, you can indeed single step through the code so long as you use si
or ni
, as opposed to just simply s
(step) or n
(next). n
or s
work fine, though, if the source code had been compiled with -g, but it steps through lines of source code, as opposed to stepping through every assembly instruction like ni
or si
do in a binary that was compiled without -g.
list
: stackoverflow.com/questions/4362581/… – Ciro Santilli 新疆再教育营六四事件法轮功郝海东