GDB: The GNU Debugger
2024-12-04 20:17:13 +0000
The GNU Debugger (GDB) is a portable debugger that runs on many Unix-like systems and works for many programming languages, including Ada, Assembly, C, C++, D, Fortran, Haskell, Go, Objective-C, OpenCL C, Modula-2, Pascal, Rust,[2] and partially others.
Examining Memory
You can use the command x (for “examine”) to examine memory in any of several formats, independently of your program’s data types.
n
, f
, and u
are all optional parameters that specify how much memory to display and how to format it; addr
is an expression giving the address where you want to start displaying memory. If you use defaults for nfu
, you need not type the slash ‘/’. Several commands set convenient defaults for addr.
n |
Repeat count | The repeat count is a decimal integer; the default is 1. |
f |
Display format | The display format is one of the formats used by print. |
u |
Unit size | The unit size is any of b bytes h short w word g qword. |