From 90b81c5f158b2b0565ce5c45270103cc0cfb5b1b Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Sat, 30 May 2015 13:00:32 +0300 Subject: [PATCH] xtensa: initialize call_abi in xtensa_tdep 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 gdb/ * xtensa-tdep.h (XTENSA_GDBARCH_TDEP_INSTANTIATE): Initialize call_abi using XSHAL_ABI macro. --- gdb/ChangeLog | 5 +++++ gdb/xtensa-tdep.h | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9dd591ce382..b26402df61d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2015-08-31 Max Filippov + + * xtensa-tdep.h (XTENSA_GDBARCH_TDEP_INSTANTIATE): Initialize + call_abi using XSHAL_ABI macro. + 2015-08-29 Doug Evans * symtab.h (struct symbol): Tweak comment. diff --git a/gdb/xtensa-tdep.h b/gdb/xtensa-tdep.h index 5b28cab417e..fbf0e1d9d0f 100644 --- a/gdb/xtensa-tdep.h +++ b/gdb/xtensa-tdep.h @@ -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, \ -- 2.30.2