mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-03-07 13:39:43 +08:00
This commit adds support to GDB so that it can modify the disassembler-options value that is passed to the disassembler, similar to objdump's -M option. Currently, the only supported targets are ARM, PowerPC and S/390, but adding support for a new target(s) is not difficult. include/ * dis-asm.h (disasm_options_t): New typedef. (parse_arm_disassembler_option): Remove prototype. (set_arm_regname_option): Likewise. (get_arm_regnames): Likewise. (get_arm_regname_num_options): Likewise. (disassemble_init_s390): New prototype. (disassembler_options_powerpc): Likewise. (disassembler_options_arm): Likewise. (disassembler_options_s390): Likewise. (remove_whitespace_and_extra_commas): Likewise. (disassembler_options_cmp): Likewise. (next_disassembler_option): New inline function. (FOR_EACH_DISASSEMBLER_OPTION): New macro. opcodes/ * disassemble.c Include "safe-ctype.h". (disassemble_init_for_target): Handle s390 init. (remove_whitespace_and_extra_commas): New function. (disassembler_options_cmp): Likewise. * arm-dis.c: Include "libiberty.h". (NUM_ELEM): Delete. (regnames): Use long disassembler style names. Add force-thumb and no-force-thumb options. (NUM_ARM_REGNAMES): Rename from this... (NUM_ARM_OPTIONS): ...to this. Use ARRAY_SIZE. (get_arm_regname_num_options): Delete. (set_arm_regname_option): Likewise. (get_arm_regnames): Likewise. (parse_disassembler_options): Likewise. (parse_arm_disassembler_option): Rename from this... (parse_arm_disassembler_options): ...to this. Make static. Use new FOR_EACH_DISASSEMBLER_OPTION macro to scan over options. (print_insn): Use parse_arm_disassembler_options. (disassembler_options_arm): New function. (print_arm_disassembler_options): Handle updated regnames. * ppc-dis.c: Include "libiberty.h". (ppc_opts): Add "32" and "64" entries. (ppc_parse_cpu): Use ARRAY_SIZE and disassembler_options_cmp. (powerpc_init_dialect): Add break to switch statement. Use new FOR_EACH_DISASSEMBLER_OPTION macro. (disassembler_options_powerpc): New function. (print_ppc_disassembler_options): Use ARRAY_SIZE. Remove printing of "32" and "64". * s390-dis.c: Include "libiberty.h". (init_flag): Remove unneeded variable. (struct s390_options_t): New structure type. (options): New structure. (init_disasm): Rename from this... (disassemble_init_s390): ...to this. Add initializations for current_arch_mask and option_use_insn_len_bits_p. Remove init_flag. (print_insn_s390): Delete call to init_disasm. (disassembler_options_s390): New function. (print_s390_disassembler_options): Print using information from struct 'options'. * po/opcodes.pot: Regenerate. binutils/ * objdump.c (main): Use remove_whitespace_and_extra_commas. gdb/ * NEWS: Mention new set/show disassembler-options commands. * doc/gdb.texinfo: Document new set/show disassembler-options commands. * disasm.c: Include "arch-utils.h", "gdbcmd.h" and "safe-ctype.h". (prospective_options): New static variable. (gdb_disassembler::gdb_disassembler): Initialize m_di.disassembler_options. (gdb_buffered_insn_length_init_dis): Initilize di->disassembler_options. (get_disassembler_options): New function. (set_disassembler_options): Likewise. (set_disassembler_options_sfunc): Likewise. (show_disassembler_options_sfunc): Likewise. (disassembler_options_completer): Likewise. (_initialize_disasm): Likewise. * disasm.h (get_disassembler_options): New prototype. (set_disassembler_options): Likewise. * gdbarch.sh (gdbarch_disassembler_options): New variable. (gdbarch_verify_disassembler_options): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Likewise. * arm-tdep.c (num_disassembly_options): Delete. (set_disassembly_style): Likewise. (arm_disassembler_options): New static variable. (set_disassembly_style_sfunc): Convert short style name into long option name. Call set_disassembler_options. (show_disassembly_style_sfunc): New function. (arm_gdbarch_init): Call set_gdbarch_disassembler_options and set_gdbarch_verify_disassembler_options. (_initialize_arm_tdep): Delete regnames variable and update callers. (arm_disassembler_options): Initialize. (disasm_options): New variable. (num_disassembly_options): Rename from this... (num_disassembly_styles): ...to this. Compute by scanning through disasm_options. (valid_disassembly_styles): Initialize using disasm_options. Remove calls to parse_arm_disassembler_option, get_arm_regnames and set_arm_regname_option. Pass show_disassembly_style_sfunc to the "disassembler" setshow command. * rs6000-tdep.c (powerpc_disassembler_options): New static variable. (rs6000_gdbarch_init): Call set_gdbarch_disassembler_options and set_gdbarch_verify_disassembler_options. * s390-tdep.c (s390_disassembler_options): New static variable. (s390_gdbarch_init):all set_gdbarch_disassembler_options and set_gdbarch_verify_disassembler_options. gdb/testsuite/ * gdb.arch/powerpc-power.exp: Delete test. * gdb.arch/powerpc-power.s: Likewise. * gdb.disasm/disassembler-options.exp: New test. * gdb.arch/powerpc-altivec.exp: Likewise. * gdb.arch/powerpc-altivec.s: Likewise. * gdb.arch/powerpc-altivec2.exp: Likewise. * gdb.arch/powerpc-altivec2.s: Likewise. * gdb.arch/powerpc-altivec3.exp: Likewise. * gdb.arch/powerpc-altivec3.s: Likewise. * gdb.arch/powerpc-power7.exp: Likewise. * gdb.arch/powerpc-power7.s: Likewise. * gdb.arch/powerpc-power8.exp: Likewise. * gdb.arch/powerpc-power8.s: Likewise. * gdb.arch/powerpc-power9.exp: Likewise. * gdb.arch/powerpc-power9.s: Likewise. * gdb.arch/powerpc-vsx.exp: Likewise. * gdb.arch/powerpc-vsx.s: Likewise. * gdb.arch/powerpc-vsx2.exp: Likewise. * gdb.arch/powerpc-vsx2.s: Likewise. * gdb.arch/powerpc-vsx3.exp: Likewise. * gdb.arch/powerpc-vsx3.s: Likewise. * gdb.arch/arm-disassembler-options.exp: Likewise. * gdb.arch/powerpc-disassembler-options.exp: Likewise. * gdb.arch/s390-disassembler-options.exp: Likewise.
89 lines
4.4 KiB
ArmAsm
89 lines
4.4 KiB
ArmAsm
/* This testcase is part of GDB, the GNU debugger.
|
|
|
|
Copyright 2014-2017 Free Software Foundation, Inc.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
.text
|
|
.globl func
|
|
func:
|
|
.long 0x117e0001 /* vmul10cuq v11,v30 */
|
|
.long 0x13c1b807 /* vcmpneb v30,v1,v23 */
|
|
.long 0x13d3f77b /* vpermr v30,v19,v30,v29 */
|
|
.long 0x12948841 /* vmul10ecuq v20,v20,v17 */
|
|
.long 0x1373f847 /* vcmpneh v27,v19,v31 */
|
|
.long 0x10c9b885 /* vrlwmi v6,v9,v23 */
|
|
.long 0x12da0887 /* vcmpnew v22,v26,v1 */
|
|
.long 0x131ec8c5 /* vrldmi v24,v30,v25 */
|
|
.long 0x127db107 /* vcmpnezb v19,v29,v22 */
|
|
.long 0x11179947 /* vcmpnezh v8,v23,v19 */
|
|
.long 0x13785985 /* vrlwnm v27,v24,v11 */
|
|
.long 0x12ad5187 /* vcmpnezw v21,v13,v10 */
|
|
.long 0x10b4e9c5 /* vrldnm v5,v20,v29 */
|
|
.long 0x13d30201 /* vmul10uq v30,v19 */
|
|
.long 0x130caa0d /* vextractub v24,v21,12 */
|
|
.long 0x1013e241 /* vmul10euq v0,v19,v28 */
|
|
.long 0x114c1a4d /* vextractuh v10,v3,12 */
|
|
.long 0x1387628d /* vextractuw v28,v12,7 */
|
|
.long 0x13c1dacd /* vextractd v30,v27,1 */
|
|
.long 0x1324fb0d /* vinsertb v25,v31,4 */
|
|
.long 0x12aef341 /* bcdcpsgn. v21,v14,v30 */
|
|
.long 0x12c5934d /* vinserth v22,v18,5 */
|
|
.long 0x13a1b38d /* vinsertw v29,v22,1 */
|
|
.long 0x13a76bcd /* vinsertd v29,v13,7 */
|
|
.long 0x12d94407 /* vcmpneb. v22,v25,v8 */
|
|
.long 0x120fac47 /* vcmpneh. v16,v15,v21 */
|
|
.long 0x12d5fc81 /* bcdus. v22,v21,v31 */
|
|
.long 0x102c6487 /* vcmpnew. v1,v12,v12 */
|
|
.long 0x10a346c1 /* bcds. v5,v3,v8,1 */
|
|
.long 0x13760d01 /* bcdtrunc. v27,v22,v1,0 */
|
|
.long 0x105a0507 /* vcmpnezb. v2,v26,v0 */
|
|
.long 0x134e3d41 /* bcdutrunc. v26,v14,v7 */
|
|
.long 0x12056547 /* vcmpnezh. v16,v5,v12 */
|
|
.long 0x13002d81 /* bcdctsq. v24,v5 */
|
|
.long 0x10e20581 /* bcdcfsq. v7,v0,0 */
|
|
.long 0x13c46781 /* bcdctz. v30,v12,1 */
|
|
.long 0x1225bd81 /* bcdctn. v17,v23 */
|
|
.long 0x10867f81 /* bcdcfz. v4,v15,1 */
|
|
.long 0x13a72f81 /* bcdcfn. v29,v5,1 */
|
|
.long 0x137f6581 /* bcdsetsgn. v27,v12,0 */
|
|
.long 0x11dccd87 /* vcmpnezw. v14,v28,v25 */
|
|
.long 0x104237c1 /* bcdsr. v2,v2,v6,1 */
|
|
.long 0x13202dcc /* vbpermd v25,v0,v5 */
|
|
.long 0x1380ce02 /* vclzlsbb r28,v25 */
|
|
.long 0x1041c602 /* vctzlsbb r2,v24 */
|
|
.long 0x12a65e02 /* vnegw v21,v11 */
|
|
.long 0x1227de02 /* vnegd v17,v27 */
|
|
.long 0x13e8be02 /* vprtybw v31,v23 */
|
|
.long 0x12a9be02 /* vprtybd v21,v23 */
|
|
.long 0x12aa9602 /* vprtybq v21,v18 */
|
|
.long 0x13d02602 /* vextsb2w v30,v4 */
|
|
.long 0x1071d602 /* vextsh2w v3,v26 */
|
|
.long 0x11788e02 /* vextsb2d v11,v17 */
|
|
.long 0x10b95602 /* vextsh2d v5,v10 */
|
|
.long 0x11bace02 /* vextsw2d v13,v25 */
|
|
.long 0x133c1602 /* vctzb v25,v2 */
|
|
.long 0x101d1e02 /* vctzh v0,v3 */
|
|
.long 0x12de3602 /* vctzw v22,v6 */
|
|
.long 0x135fc602 /* vctzd v26,v24 */
|
|
.long 0x10df160d /* vextublx r6,r31,v2 */
|
|
.long 0x11a0964d /* vextuhlx r13,r0,v18 */
|
|
.long 0x11defe8d /* vextuwlx r14,r30,v31 */
|
|
.long 0x11ec7704 /* vsrv v15,v12,v14 */
|
|
.long 0x128af70d /* vextubrx r20,r10,v30 */
|
|
.long 0x12b51744 /* vslv v21,v21,v2 */
|
|
.long 0x11e90f4d /* vextuhrx r15,r9,v1 */
|
|
.long 0x12b1878d /* vextuwrx r21,r17,v16 */
|
|
.long 0x1295b5e3 /* vmsumudm v20,v21,v22,v23 */
|