diff options
Diffstat (limited to 'dev/c/debugging.html')
-rw-r--r-- | dev/c/debugging.html | 27 |
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> |