In: Computer Science
Please explain answer.
data in address 0x00000004: 0x15
Get 4 bytes of data from address 0x00000004, assume Little-Endian byte ordering in memory
I am guessing you are trying to examine a memory address while you are debugging. In gdb you can do this:
For this purpose we can use the examine command. This command is used to look at a certain address of memory in a variety of ways. This command expects two arguments when it's used: the location is memory to examine and how to display that memory.
Syntax:- x/FMT Size_letter(without space) Address
FMT is how you want to format content when it is displayed on screen. The possible values are:
t : binary; f : float; a : address; c : char; z : hex; s : string,....
Size Letter represent the size of the output.
b : byte; h : halfword(2 byte); w : word(4byte); g : giant(8byte)
Now the command we need will be
x/zw 0x00000004
This means that print 4 bytes of the given memory location in hexadecimal.
Hope this helps. If you have any queries or suggestions regarding the answers please leave them in the comments section so I can update and improve the answer. Thank you.