x/nfu-viewing memory with GDB

Source: Internet
Author: User
Tags md5

View memory with GDB

2007-12-08 12:43

View memory with GDB

Format: X/nfu <addr>

Description
X is the abbreviation of examine

n indicates the number of memory units to display

F represents the display mode, the following values are preferable
x Displays the variable in hexadecimal format.
D Displays the variable in decimal format.
u displays unsigned integers in decimal format.
o Displays the variable in octal format.
T displays the variable in binary format.
A displays the variable in hexadecimal format.
I instruction address format
C Displays the variable in character format.
F Displays the variable in floating-point number format.

U represents the length of an address unit
b represents a single byte,
H represents double-byte,
W represents four bytes,
g = Eight bytes


Format Letters is O (octal), X (hex), D (decimal), U (unsigned decimal),
T (binary), F (float), a (address), I (instruction), C (char) and S (String).
Size Letters is B (byte), H (Halfword), W (word), G (Giant, 8 bytes)

Example
X/3uh BUF
Indicates that the contents are read from the memory address buf.
H represents a unit in double-byte,
3 means three units,
U indicates hexadecimal display

Detailed Examples:

(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 ten
Breakpoint 1 at 0x8048372:file test.c, line.
(GDB) Run
Starting program:/data/compiler/g_platform/bradenwu/md5/test.out

Breakpoint 1, Main () at Test.c: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

x/nfu-viewing memory with GDB

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.