gdb: watchpoint with -l flag vs address

1

I was trying to set a breakpoint on a heap struct variable programmatically: when a function is called, set a watchpoint to the memory pointed by one of its arguments. However, doing awatch *0xDEADBEEF, as expected watches when the struct is used explicitly; awatch *(my_struct*)0xDEADBEEF watches whenever something writes in my variable memory; however, I'd expect awatch -l my_struct to work as one of these two. However, it gives a weird behavior and seems to break in random places.

Are awatch *(my_struct*)0xDEADBEEF and awatch -l my_struct supposed to do the same thing?

Running on Android, arm64 with gdbserver/client through adb

debugging
gdb
adb
xdebug
gdbserver
asked on Stack Overflow Apr 6, 2020 by InfiniteSnow

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0