For some reason, the synatax for setting a hardware watchpoint in GDB is impossible to find in google. Or rather, there are misleading instructions on how to set the watchpoint. The instructions you'll find say "watch for when variable x gets changed by writing 'watch x'". But this never solves a memory corruption bug. At least for me.
This post is for my own purposes. I never want to waste 10 minutes searching for the proper syntax again.
Let's say I know that location 0xABCD1234 is getting corrupted.
Then the gdb command is:
> watch *((int*) 0xABCD1234)
Subscribe to:
Post Comments (Atom)
2 comments:
I set a watchpoint on your mom's hardware last night.
... talk about a corrupted memory!
Post a Comment