aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2023-09-08 22:55:41 +0200
committerJohannes Stoelp <johannes.stoelp@gmail.com>2023-09-08 22:55:41 +0200
commit09c22a5f544c87bffcb5c68f0965201ae1d29044 (patch)
treec484e202a1e1c300ae72268326a3a01fd8d6a5f4 /src/tools
parent9bb639287cae88b32fc1b17b7a4b494340e54434 (diff)
downloadnotes-09c22a5f544c87bffcb5c68f0965201ae1d29044.tar.gz
notes-09c22a5f544c87bffcb5c68f0965201ae1d29044.zip
gdb: add watch -l in watchpoint example
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/gdb.md8
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