mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-24 12:35:55 +08:00
gdb: xtensa: clean up xtensa_default_isa initialization
This fixes segfault in native gdb because isa is not initialized at the point of call to xtensa_isa_maxlength. gdb/ 2017-03-27 Max Filippov <jcmvbkbc@gmail.com> * xtensa-tdep.c (xtensa_scan_prologue, call0_analyze_prologue): Drop xtensa_default_isa initialization. (xtensa_gdbarch_init): Initialize xtensa_default_isa.
This commit is contained in:
parent
8c43009f48
commit
a43986283d
@ -1,3 +1,9 @@
|
||||
2017-03-27 Max Filippov <jcmvbkbc@gmail.com>
|
||||
|
||||
* xtensa-tdep.c (xtensa_scan_prologue, call0_analyze_prologue):
|
||||
Drop xtensa_default_isa initialization.
|
||||
(xtensa_gdbarch_init): Initialize xtensa_default_isa.
|
||||
|
||||
2017-03-27 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* dwarf2read.c (file_entry) <dir_index>: Add comment.
|
||||
|
@ -1151,8 +1151,6 @@ xtensa_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR current_pc)
|
||||
if (start_addr == 0)
|
||||
return fp_regnum;
|
||||
|
||||
if (!xtensa_default_isa)
|
||||
xtensa_default_isa = xtensa_isa_init (0, 0);
|
||||
isa = xtensa_default_isa;
|
||||
gdb_assert (XTENSA_ISA_BSZ >= xtensa_isa_maxlength (isa));
|
||||
ins = xtensa_insnbuf_alloc (isa);
|
||||
@ -2427,8 +2425,6 @@ call0_analyze_prologue (struct gdbarch *gdbarch,
|
||||
cache->call0 = 1;
|
||||
rtmp = (xtensa_c0reg_t*) alloca(nregs * sizeof(xtensa_c0reg_t));
|
||||
|
||||
if (!xtensa_default_isa)
|
||||
xtensa_default_isa = xtensa_isa_init (0, 0);
|
||||
isa = xtensa_default_isa;
|
||||
gdb_assert (XTENSA_ISA_BSZ >= xtensa_isa_maxlength (isa));
|
||||
ins = xtensa_insnbuf_alloc (isa);
|
||||
@ -3186,6 +3182,9 @@ xtensa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
|
||||
DEBUGTRACE ("gdbarch_init()\n");
|
||||
|
||||
if (!xtensa_default_isa)
|
||||
xtensa_default_isa = xtensa_isa_init (0, 0);
|
||||
|
||||
/* We have to set the byte order before we call gdbarch_alloc. */
|
||||
info.byte_order = XCHAL_HAVE_BE ? BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user