From the documentation at [1], an example output for the gdb x
command in c format is as follows:
(gdb) x/c testArray
0xbfffef7b: 48 '0'
(gdb) x/5c testArray
0xbfffef7b: 48 '0' 49 '1' 50 '2' 51 '3' 52 '4'
What does these numbers, such as 48, 49, 50
in the output mean?
Is it some kind of relative address?
Thank you very much!
x
is displaying the memory contents at a given address using the given format.
In your specific case, x/5c
is displaying the first 5 bytes at the memory location testArray
, and printing the bytes as a char
.
The first 5 bytes of testArray
are the characters 0
, 1
, 2
, 3
, 4
(the value in single quotes). The value before is the decimal value of the char.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.