Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gdb: breakpoint when register will have value 0xffaa

Tags:

Can I set the breakpoint/watchpoint/smth else in gdb for register value?

I want to break when $eax will have value 0x0000ffaa.

Is it possible with gdb or dbx or any other unix debugger?

like image 368
osgx Avatar asked Feb 08 '10 17:02

osgx


1 Answers

Yes in gdb you would set a watchpoint like so:

watch $eax == 0x0000ffaa

But it is dependent on watchpoint support being available for the target. You should note that this may slow down execution significantly.

If you would like to break in a certain location you can do so, by setting a conditional breakpoint:

break test.c:120 if $eax == 0x0000ffaa
like image 149
Marc Butler Avatar answered Sep 18 '22 17:09

Marc Butler