read_frame_register_value and big endian arches
authorJoel Brobecker <brobecker@gnat.com>
Thu, 10 Nov 2011 17:14:41 +0000 (17:14 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Thu, 10 Nov 2011 17:14:41 +0000 (17:14 +0000)
commit22355c9080f27ed22e4aac714e95729970d48c4b
tree0b6ccbdda26946a879eb6020a8038ba070bf7857
parente28cade762a84feb67e0864b0e66e380f7cc60d5
read_frame_register_value and big endian arches

The read_frame_register_value function as it was implemented introduced
a regression on big-endian targets. The problem appears when trying to
get the value of an entity stored inside a register, and when the size
of the entity is smaller than the size of the register. In that case,
we were always reading the first N bytes of the register, which is wrong
for big-endian architectures, where we need to read the last N bytes of
the register.

gdb/ChangeLog:

        * findvar.c (read_frame_register_value): Read correct bytes from
        register on big-endian architectures.

gdb/testsuite/ChangeLog:

        * gdb.ada/small_reg_param: New testcase.
gdb/ChangeLog
gdb/findvar.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/small_reg_param.exp [new file with mode: 0644]
gdb/testsuite/gdb.ada/small_reg_param/foo.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/small_reg_param/pck.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/small_reg_param/pck.ads [new file with mode: 0644]