Gdb

From Attie's Wiki
(Difference between revisions)
Jump to: navigation, search
m
m
Line 29: Line 29:
 
! - !! -
 
! - !! -
 
|-
 
|-
| <code>x ''<address>''</code> || examine memory
+
| <code>x/x ''<address>''</code> || examine memory
 
|-
 
|-
| <code>x ''<variable>''</code> || dump variable contents
+
| <code>x/x ''<variable>''</code> || dump variable contents
 
|-
 
|-
| <code>x/128b ''<variable>''</code> || dump variable contents, 128 bytes (<code>b</code> byte / <code>h</code> halfword / <code>w</code> word / <code>g</code> giant, 8-bytes )
+
| <code>x/128xb ''<variable>''</code> || dump variable contents, 128 bytes (<code>b</code> byte / <code>h</code> halfword / <code>w</code> word / <code>g</code> giant, 8-bytes )
 
|-
 
|-
 
| <code>x/s ''<variable>''</code> || dump variable contents, as a nul-terminated string
 
| <code>x/s ''<variable>''</code> || dump variable contents, as a nul-terminated string
 +
|-
 +
| <code>x/32i ''<variable>''</code> || dump variable contents, as 32 machine instructions
 
|}
 
|}

Revision as of 11:52, 29 September 2014

Useful GDB commands...

Command Description
bt or backtrace show a backtrace from the current location
frame <frameno> move to a different stack frame
- -
info threads list of running threads
thread <threadno> switch to a different thread
- -
info breakpoints list of breakpoints
break <file>:<lineno> set a breakpoint
step step into the current line
next step over the current line
fin step out
cont continue execution
- -
x/x <address> examine memory
x/x <variable> dump variable contents
x/128xb <variable> dump variable contents, 128 bytes (b byte / h halfword / w word / g giant, 8-bytes )
x/s <variable> dump variable contents, as a nul-terminated string
x/32i <variable> dump variable contents, as 32 machine instructions
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox