1

I was debugging under IBM AIX with dbx. I was seeing the following:

(dbx) print $r4
0x00000001614aa050 
(dbx) print *((int64*)0x00000001614aa050)
-1 
(dbx) print $r3
0x0000000165e08468 
Then I "stepi" my 64bit program which executed the following instruction:
std   r3,0x0(r4)

I then immediately checked the content of that memory:

(dbx) print *((int64*)0x00000001614aa050)
-1 

Still -1? I was expecting the content in $r3 should be saved to that memory. I then manually assigned the value to that address using my variables:

(dbx) print &bmc._pLong
0x00000001614aa050 
(dbx) assign bmc._pLong=(int64 *)0x0000000165e08468
(dbx) print *((int64*)0x00000001614aa050)
6004180072 (which is 0x0000000165e08468)

How could that happen?

mtvec
  • 17,846
  • 5
  • 52
  • 83
Didu
  • 11
  • 1

1 Answers1

0

I assume, somehow, this is "pilot" error. e.g. you did stepi and then the std instruction was displayed? which means that that is the instruction it is about to execute -- not the instruction it executed -- at least I think that's right.

I would do some stepi's before and after and make sure I am understanding what stepi is doing. And, of course, print out the iar, and the instruction at the iar, to verify that dbx is not fibbing on you.

pedz
  • 2,271
  • 1
  • 17
  • 20