While examining 4 addresses from $rip as bytes in GDB, it shows 4 individual values. However, when I examine the same addresses as words, it combines that 4 byte values into a single word value. Why does GDB combine the byte values when examining memory as words as well as in half word? its not only in rip also in other registers.
I started to examine registers. I found that it combines the value, not only in rip also in rbp, etc. I understand the LSB is in left side, but I don’t know why it’s combining, I expected that it expand the value because it needs to give the value in word, but instead it shows the value from a nearby address why and how.
You can see in the image that combines bytes value-first two to half words-first value. and in word-first two value of half word combine and is shown in the word’s first value.
Naresh Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
7