用gdb查看内存
用gdb查看内存 格式: x /nfu <addr> 说明 n表示要显示的内存单元的个数 f表示显示方式, 可取如下值 u表示一个地址单元的长度 Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal), 举例 |
详细例子:
(gdb) list
1 #include<stdio.h>
2 int main()
3 {
4
5 //char a[1];
6 //a[0]='a';
7 unsigned long long md5=14126471717450151013;
8
9 //printf("%d\n",a[0]);
10 return 0;
(gdb) break 10
Breakpoint 1 at 0x8048372: file test.c, line 10.
(gdb) run
Starting program: /data/compiler/g_platform/bradenwu/md5/test.out
Breakpoint 1, main () at test.c:10
10 return 0;
(gdb) x/8xb md5
0x8837f465: Cannot access memory at address 0x8837f465
(gdb) x/8xb &md5
0xbfffefa0: 0x65 0xf4 0x37 0x88 0x2e 0x4f 0x0b 0xc4