GNU Binutils with patches for OS216
Révision | e60eb2880368b4e4752577c626ab0dadf0499cb5 (tree) |
---|---|
l'heure | 2017-08-18 17:30:12 |
Auteur | Yao Qi <yao.qi@lina...> |
Commiter | Yao Qi |
[ARM] Mark USER_SPECIFIED_MACHINE_TYPE in disassemble_info.flags
opcodes/arm-dis.c:print_insn may update disassemble_info.mach to
bfd_mach_arm_unknown unless USER_SPECIFIED_MACHINE_TYPE is marked.
When default_print_insn is called for the first time,
disassemble_info.mach is correctly set in GDB, but arm-dis.c:print_insn
sets it to bfd_mach_arm_unknown. Then, when default_print_insn is
called again (in a loop), it triggers the assert.
The patch fixes the assert by marking USER_SPECIFIED_MACHINE_TYPE so that
opcodes won't reset disassemble_info.mach.
gdb:
2017-08-18 Yao Qi <yao.qi@linaro.org>
PR tdep/21818
* arm-tdep.c (gdb_print_insn_arm): Mark
USER_SPECIFIED_MACHINE_TYPE if exec_bfd isn't NULL.
@@ -1,5 +1,11 @@ | ||
1 | 1 | 2017-08-18 Yao Qi <yao.qi@linaro.org> |
2 | 2 | |
3 | + PR tdep/21818 | |
4 | + * arm-tdep.c (gdb_print_insn_arm): Mark | |
5 | + USER_SPECIFIED_MACHINE_TYPE if exec_bfd isn't NULL. | |
6 | + | |
7 | +2017-08-18 Yao Qi <yao.qi@linaro.org> | |
8 | + | |
3 | 9 | * NEWS: Mention GDBserver's new option "--selftest". |
4 | 10 | * Makefile.in (SFILES): Remove selftest.c, add common/selftest.c. |
5 | 11 | * selftest.c: Move it to common/selftest.c. |
@@ -7773,6 +7773,14 @@ gdb_print_insn_arm (bfd_vma memaddr, disassemble_info *info) | ||
7773 | 7773 | else |
7774 | 7774 | info->symbols = NULL; |
7775 | 7775 | |
7776 | + /* GDB is able to get bfd_mach from the exe_bfd, info->mach is | |
7777 | + accurate, so mark USER_SPECIFIED_MACHINE_TYPE bit. Otherwise, | |
7778 | + opcodes/arm-dis.c:print_insn reset info->mach, and it will trigger | |
7779 | + the assert on the mismatch of info->mach and bfd_get_mach (exec_bfd) | |
7780 | + in default_print_insn. */ | |
7781 | + if (exec_bfd != NULL) | |
7782 | + info->flags |= USER_SPECIFIED_MACHINE_TYPE; | |
7783 | + | |
7776 | 7784 | return default_print_insn (memaddr, info); |
7777 | 7785 | } |
7778 | 7786 |