binutils-gdb/gdb/testsuite/gdb.arch/powerpc-power7.s

122 lines
6.2 KiB
ArmAsm
Raw Normal View History

GDB: Add support for the new set/show disassembler-options commands. 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.
2017-03-01 02:32:07 +08:00
/* This testcase is part of GDB, the GNU debugger.
Copyright 2014-2018 Free Software Foundation, Inc.
GDB: Add support for the new set/show disassembler-options commands. 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.
2017-03-01 02:32:07 +08:00
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 0x7c642e98 /* lxvd2x vs3,r4,r5 */
.long 0x7d642e99 /* lxvd2x vs43,r4,r5 */
.long 0x7c642f98 /* stxvd2x vs3,r4,r5 */
.long 0x7d642f99 /* stxvd2x vs43,r4,r5 */
.long 0xf0642850 /* xxmrghd vs3,vs4,vs5 */
.long 0xf16c6857 /* xxmrghd vs43,vs44,vs45 */
.long 0xf0642b50 /* xxmrgld vs3,vs4,vs5 */
.long 0xf16c6b57 /* xxmrgld vs43,vs44,vs45 */
.long 0xf0642850 /* xxmrghd vs3,vs4,vs5 */
.long 0xf16c6857 /* xxmrghd vs43,vs44,vs45 */
.long 0xf0642b50 /* xxmrgld vs3,vs4,vs5 */
.long 0xf16c6b57 /* xxmrgld vs43,vs44,vs45 */
.long 0xf0642950 /* xxpermdi vs3,vs4,vs5,1 */
.long 0xf16c6957 /* xxpermdi vs43,vs44,vs45,1 */
.long 0xf0642a50 /* xxpermdi vs3,vs4,vs5,2 */
.long 0xf16c6a57 /* xxpermdi vs43,vs44,vs45,2 */
.long 0xf0642780 /* xvmovdp vs3,vs4 */
.long 0xf16c6787 /* xvmovdp vs43,vs44 */
.long 0xf0642780 /* xvmovdp vs3,vs4 */
.long 0xf16c6787 /* xvmovdp vs43,vs44 */
.long 0xf0642f80 /* xvcpsgndp vs3,vs4,vs5 */
.long 0xf16c6f87 /* xvcpsgndp vs43,vs44,vs45 */
.long 0x4c000324 /* doze */
.long 0x4c000364 /* nap */
.long 0x4c0003a4 /* sleep */
.long 0x4c0003e4 /* rvwinkle */
.long 0x7c830134 /* prtyw r3,r4 */
.long 0x7dcd0174 /* prtyd r13,r14 */
.long 0x7d5c02a6 /* mfcfar r10 */
.long 0x7d7c03a6 /* mtcfar r11 */
.long 0x7c832bf8 /* cmpb r3,r4,r5 */
.long 0x7d4b662a /* lwzcix r10,r11,r12 */
.long 0xee119004 /* dadd f16,f17,f18 */
.long 0xfe96c004 /* daddq f20,f22,f24 */
.long 0x7c60066c /* dss 3 */
.long 0x7e00066c /* dssall */
.long 0x7c2522ac /* dst r5,r4,1 */
.long 0x7e083aac /* dstt r8,r7,0 */
.long 0x7c6532ec /* dstst r5,r6,3 */
.long 0x7e442aec /* dststt r4,r5,2 */
.long 0x7d4b6356 /* divwe r10,r11,r12 */
.long 0x7d6c6b57 /* divwe. r11,r12,r13 */
.long 0x7d8d7756 /* divweo r12,r13,r14 */
.long 0x7dae7f57 /* divweo. r13,r14,r15 */
.long 0x7d4b6316 /* divweu r10,r11,r12 */
.long 0x7d6c6b17 /* divweu. r11,r12,r13 */
.long 0x7d8d7716 /* divweuo r12,r13,r14 */
.long 0x7dae7f17 /* divweuo. r13,r14,r15 */
.long 0x7e27d9f8 /* bpermd r7,r17,r27 */
.long 0x7e8a02f4 /* popcntw r10,r20 */
.long 0x7e8a03f4 /* popcntd r10,r20 */
.long 0x7e95b428 /* ldbrx r20,r21,r22 */
.long 0x7e95b528 /* stdbrx r20,r21,r22 */
.long 0x7d4056ee /* lfiwzx f10,0,r10 */
.long 0x7d4956ee /* lfiwzx f10,r9,r10 */
.long 0xec802e9c /* fcfids f4,f5 */
.long 0xec802e9d /* fcfids. f4,f5 */
.long 0xec802f9c /* fcfidus f4,f5 */
.long 0xec802f9d /* fcfidus. f4,f5 */
.long 0xfc80291c /* fctiwu f4,f5 */
.long 0xfc80291d /* fctiwu. f4,f5 */
.long 0xfc80291e /* fctiwuz f4,f5 */
.long 0xfc80291f /* fctiwuz. f4,f5 */
.long 0xfc802f5c /* fctidu f4,f5 */
.long 0xfc802f5d /* fctidu. f4,f5 */
.long 0xfc802f5e /* fctiduz f4,f5 */
.long 0xfc802f5f /* fctiduz. f4,f5 */
.long 0xfc802f9c /* fcfidu f4,f5 */
.long 0xfc802f9d /* fcfidu. f4,f5 */
.long 0xfc0a5900 /* ftdiv cr0,f10,f11 */
.long 0xff8a5900 /* ftdiv cr7,f10,f11 */
.long 0xfc005140 /* ftsqrt cr0,f10 */
.long 0xff805140 /* ftsqrt cr7,f10 */
.long 0x7e084a2c /* dcbtt r8,r9 */
.long 0x7e0849ec /* dcbtstt r8,r9 */
.long 0xed406644 /* dcffix f10,f12 */
.long 0xee80b645 /* dcffix. f20,f22 */
.long 0xfdc07830 /* fre f14,f15 */
.long 0xfdc07831 /* fre. f14,f15 */
.long 0xedc07830 /* fres f14,f15 */
.long 0xedc07831 /* fres. f14,f15 */
.long 0xfdc07834 /* frsqrte f14,f15 */
.long 0xfdc07835 /* frsqrte. f14,f15 */
.long 0xedc07834 /* frsqrtes f14,f15 */
.long 0xedc07835 /* frsqrtes. f14,f15 */
.long 0x7c43271e /* isel r2,r3,r4,28 */
.long 0x7f7bdb78 /* yield */
.long 0x7f7bdb78 /* yield */
.long 0x60420000 /* ori r2,r2,0 */
.long 0x60000000 /* nop */
.long 0x60000000 /* nop */
.long 0x60420000 /* ori r2,r2,0 */
.long 0x7fbdeb78 /* mdoio */
.long 0x7fbdeb78 /* mdoio */
.long 0x7fdef378 /* mdoom */
.long 0x7fdef378 /* mdoom */
.long 0x7d40e2a6 /* mfppr r10 */
.long 0x7d62e2a6 /* mfppr32 r11 */
.long 0x7d80e3a6 /* mtppr r12 */
.long 0x7da2e3a6 /* mtppr32 r13 */
.long 0x7d605264 /* tlbie r10,r11 */