diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2023-09-08 22:55:41 +0200 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2023-09-08 22:55:41 +0200 |
commit | 09c22a5f544c87bffcb5c68f0965201ae1d29044 (patch) | |
tree | c484e202a1e1c300ae72268326a3a01fd8d6a5f4 | |
parent | 9bb639287cae88b32fc1b17b7a4b494340e54434 (diff) | |
download | notes-09c22a5f544c87bffcb5c68f0965201ae1d29044.tar.gz notes-09c22a5f544c87bffcb5c68f0965201ae1d29044.zip |
gdb: add watch -l in watchpoint example
-rw-r--r-- | src/tools/gdb.md | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tools/gdb.md b/src/tools/gdb.md index 126795e..c8c04df 100644 --- a/src/tools/gdb.md +++ b/src/tools/gdb.md @@ -401,10 +401,16 @@ which its expression is valid. main () at test.c:10 10 set(&s, 2); +# Define the watchpoint on the location of the object to watch. + +(gdb) watch -l s->v + +# This is equivalent to the following. + (gdb) p &s->v $1 = (int *) 0x7fffffffe594 -# Define a watchpoint o the address of the member variable of the s instance. +# Define a watchpoint to the address of the member variable of the s instance. # This of course only makes sense as long as the s instance is not moved in memory. (gdb) watch *0x7fffffffe594 |