From 9a72a6e5cc23d29d510625c0c1677fb7ae465032 Mon Sep 17 00:00:00 2001 From: Silvino Silva Date: Tue, 24 Dec 2019 04:10:14 +0000 Subject: better c debugging and git tags doc --- dev/c/debugging.html | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'dev/c') 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 @@

GDB

-

If the program needs arguments you can set it;

+

If the program needs arguments you can set it at start or later;

         (gdb)set args -parameter1 -parameter2
@@ -63,16 +63,24 @@
             
TUI single key mode.
Ctrl-L s
Refresh screen.
-
Up
-
Scroll
-
Down
-
Scroll
-
Left
-
Scroll
-
Right
-
Scroll
+

To attach to a process (pid 5922) and start UI with disassemble;

+ +

+        $ gdb -p 5922
+        (gdb) layout asm
+        (gdb) disassemble
+        (gdb) set disassembly-flavor intel
+        
+ +

Break on memory address and inspect area of the memory;

+ +
+        (gdb) b *0x400671
+        (gdb) x/16gx 0x7ffe5217c03d
+        
+
         (gdb) info win
         (gdb) fs next
@@ -85,7 +93,6 @@
         info locals
         display
         print
-        x
         catch syscall open
         
-- cgit 1.4.1-2-gfad0