about summary refs log tree commit diff stats
path: root/dev/c/debugging.html
diff options
context:
space:
mode:
authorSilvino Silva <silvino@bk.ru>2019-12-24 04:10:14 +0000
committerSilvino Silva <silvino@bk.ru>2019-12-24 04:10:14 +0000
commit9a72a6e5cc23d29d510625c0c1677fb7ae465032 (patch)
tree89267b4bcf5852460bcf88fb9fac069a06d8ee3f /dev/c/debugging.html
parent994cbeef3795b659e166d9aea93d4a6ca3010246 (diff)
downloaddoc-9a72a6e5cc23d29d510625c0c1677fb7ae465032.tar.gz
better c debugging and git tags doc
Diffstat (limited to 'dev/c/debugging.html')
-rw-r--r--dev/c/debugging.html27
1 files changed, 17 insertions, 10 deletions
diff --git a/dev/c/debugging.html b/dev/c/debugging.html
index 90dca1b..c26ae7e 100644
--- a/dev/c/debugging.html
+++ b/dev/c/debugging.html
@@ -42,7 +42,7 @@
 
         <h2 id="gdb">GDB</h2>
 
-        <p>If the program needs arguments you can set it;</p>
+        <p>If the program needs arguments you can set it at start or later;</p>
 
         <pre>
         (gdb)set args -parameter1 -parameter2
@@ -63,16 +63,24 @@
             <dd>TUI single key mode.</dd>
             <dt>Ctrl-L s</dt>
             <dd>Refresh screen.</dd>
-            <dt>Up</dt>
-            <dd>Scroll</dd>
-            <dt>Down</dt>
-            <dd>Scroll</dd>
-            <dt>Left</dt>
-            <dd>Scroll</dd>
-            <dt>Right</dt>
-            <dd>Scroll</dd>
         </dl>
 
+        <p>To attach to a process (pid 5922) and start UI with disassemble;<p>
+
+        <pre>
+        $ gdb -p 5922
+        (gdb) layout asm
+        (gdb) disassemble
+        (gdb) set disassembly-flavor intel
+        </pre>
+
+        <p>Break on memory address and inspect area of the memory;</p>
+
+        <pre>
+        (gdb) b *0x400671
+        (gdb) x/16gx 0x7ffe5217c03d
+        </pre>
+
         <pre>
         (gdb) info win
         (gdb) fs next
@@ -85,7 +93,6 @@
         info locals
         display
         print
-        x
         catch syscall open
         </pre>