• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Révisione60eb2880368b4e4752577c626ab0dadf0499cb5 (tree)
l'heure2017-08-18 17:30:12
AuteurYao Qi <yao.qi@lina...>
CommiterYao Qi

Message de Log

[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.

Change Summary

Modification

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
11 2017-08-18 Yao Qi <yao.qi@linaro.org>
22
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+
39 * NEWS: Mention GDBserver's new option "--selftest".
410 * Makefile.in (SFILES): Remove selftest.c, add common/selftest.c.
511 * selftest.c: Move it to common/selftest.c.
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -7773,6 +7773,14 @@ gdb_print_insn_arm (bfd_vma memaddr, disassemble_info *info)
77737773 else
77747774 info->symbols = NULL;
77757775
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+
77767784 return default_print_insn (memaddr, info);
77777785 }
77787786