xtensa: initialize call_abi in xtensa_tdep
authorMax Filippov <jcmvbkbc@gmail.com>
Sat, 30 May 2015 10:00:32 +0000 (13:00 +0300)
committerMax Filippov <jcmvbkbc@gmail.com>
Mon, 31 Aug 2015 08:59:02 +0000 (11:59 +0300)
Use XSHAL_ABI value provided by xtensa-config.h to correctly initialize
xtensa_tdep.call_abi
This fixes calls to functions from GDB that otherwise fail with the
following assertion in call0 configuration:

  gdb/regcache.c:602: internal-error: regcache_raw_read: Assertion
  `regnum >= 0 && regnum < regcache->descr->nr_raw_registers' failed.

2015-08-31  Max Filippov  <jcmvbkbc@gmail.com>
gdb/
* xtensa-tdep.h (XTENSA_GDBARCH_TDEP_INSTANTIATE): Initialize
call_abi using XSHAL_ABI macro.

gdb/ChangeLog
gdb/xtensa-tdep.h

index 9dd591ce382e5390013845b25e2d130418b1dacc..b26402df61d599d415059df0d2362c122a202ee0 100644 (file)
@@ -1,3 +1,8 @@
+2015-08-31  Max Filippov  <jcmvbkbc@gmail.com>
+
+       * xtensa-tdep.h (XTENSA_GDBARCH_TDEP_INSTANTIATE): Initialize
+       call_abi using XSHAL_ABI macro.
+
 2015-08-29  Doug Evans  <xdje42@gmail.com>
 
        * symtab.h (struct symbol): Tweak comment.
index 5b28cab417ea02d5ea51b3ff372cafb092a4b9c1..fbf0e1d9d0f7b3c6019cd85ced5b6570d978cb04 100644 (file)
@@ -226,7 +226,9 @@ struct gdbarch_tdep
          .spill_location = -1,                                 \
          .spill_size = (spillsz),                              \
          .unused = 0,                                          \
-         .call_abi = CallAbiDefault,                           \
+         .call_abi = (XSHAL_ABI == XTHAL_ABI_CALL0             \
+                      ? CallAbiCall0Only                       \
+                      : CallAbiDefault),                       \
          .debug_interrupt_level = XCHAL_DEBUGLEVEL,            \
          .icache_line_bytes = XCHAL_ICACHE_LINESIZE,           \
          .dcache_line_bytes = XCHAL_DCACHE_LINESIZE,           \