From 7284e1bed8f26d644523bcf82dbfc03ff594ff36 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Sat, 3 May 2008 17:16:44 +0000 Subject: [PATCH] ChangeLog: * Makefile.in (ppc_linux_tdep_h): New macro. (powerpc_32l_c, powerpc_altivec32_c, powerpc_altivec32l_c): Likewise. (powerpc_64l_c, powerpc_altivec64_c, powerpc_altivec64l_c): Likewise. (powerpc_e500l_c): Likewise. (ppc-linux-nat.o): Update dependencies. (ppc-linux-tdep.o): Update dependencies. (rs6000-tdep.o): Update dependencies. * ppc-tdep.h (ppc_linux_memory_remove_breakpoint): Remove. (ppc_linux_svr4_fetch_link_map_offsets): Remove. (ppc_linux_gregset, ppc_linux_fpregset): Move to ppc-linux-tdep.h (ppc_supply_reg, ppc_collect_reg): Add prototypes. (tdesc_powerpc_e500): Remove. * rs6000.c: Include "features/rs6000/powerpc-altivec32.c" and "features/rs6000/powerpc-altivec64.c". (ppc_supply_reg, ppc_collect_reg): Make global. (variants): Use tdesc_powerpc_32 for "powerpc" and tdesc_powerpc_altivec64 for "powerpc64". (_initialize_rs6000_tdep): Initialize AltiVec descriptions. * ppc-linux-tdep.h: New file. * ppc-linux-tdep.c: Include "ppc-linux-tdep.c". Include "features/rs6000/powerpc-32l.c". Include "features/rs6000/powerpc-altivec32l.c". Include "features/rs6000/powerpc-64l.c". Include "features/rs6000/powerpc-altivec64l.c". Include "features/rs6000/powerpc-e500l.c". (ppc_linux_supply_gregset): New function. (ppc_linux_collect_gregset): Handle orig_r3 and trap registers. (ppc32_linux_gregset): Use ppc_linux_supply_gregset. (ppc64_linux_gregset): Likewise. (ppc_linux_sigtramp_cache): Handle orig_r3 and trap registers. (ppc_linux_trap_reg_p): New function. (ppc_linux_write_pc): New function. (ppc_linux_core_read_description): New function. (ppc_linux_init_abi): Install ppc_linux_write_pc and ppc_linux_core_read_description. Install orig_r3 and trap registers if present in the target description. (_initialize_ppc_linux_tdep): Initialize Linux target descriptions. * ppc-linux-nat.c: Include "ppc-linux-tdep.h". (PT_ORIG_R3, PT_TRAP): Define if necessary. (ppc_register_u_addr): Handle orig_r3 and trap registers. (fetch_ppc_registers): Likewise. (store_ppc_registers): Likewise. (store_register): Likewise. (ppc_linux_read_description): Check whether AltiVec is supported. Check whether inferior is 32-bit or 64-bit. Return the appropriate Linux target description. * features/Makefile (WHICH): Use rs6000/powerpc-32l and rs6000/powerpc-altivec32l instead of rs6000/powerpc-32. Use rs6000/powerpc-64l and rs6000/powerpc-altivec64l instead of rs6000/powerpc-64. Use rs6000/powerpc-e500l instead of rs6000/powerpc-e500. Update -expedite variables accordingly. * features/rs6000/power-spe.xml: Use regnum 73 for "acc". * features/rs6000/powerpc-32.xml: Do not include power-altivec.xml. * features/rs6000/powerpc-64.xml: Do not include power-altivec.xml. * features/rs6000/powerpc-e500.c: Regenerate. * features/rs6000/powerpc-32.c: Regenerate. * features/rs6000/powerpc-64.c: Regenerate. * features/rs6000/power-linux.xml: New file. * features/rs6000/power64-linux.xml: New file. * features/rs6000/powerpc-32l.xml: New file. * features/rs6000/powerpc-altivec32l.xml: New file. * features/rs6000/powerpc-64l.xml: New file. * features/rs6000/powerpc-altivec64l.xml: New file. * features/rs6000/powerpc-e500l.xml: New file. * features/rs6000/powerpc-32l.c: New (generated) file. * features/rs6000/powerpc-altivec32l.c: New (generated) file. * features/rs6000/powerpc-64l.c: New (generated) file. * features/rs6000/powerpc-altivec64l.c: New (generated) file. * features/rs6000/powerpc-e500l.xml: New (generated) file. * regformats/reg-ppc.dat: Remove. * regformats/reg-ppc64.dat: Remove. * regformats/rs6000/powerpc-32.dat: Remove. * regformats/rs6000/powerpc-64.dat: Remove. * regformats/rs6000/powerpc-e500.dat: Remove. * regformats/rs6000/powerpc-32l.dat: New (generated) file. * regformats/rs6000/powerpc-altivec32l.dat: New (generated) file. * regformats/rs6000/powerpc-64l.dat: New (generated) file. * regformats/rs6000/powerpc-altivec64l.dat: New (generated) file. * regformats/rs6000/powerpc-e500l.dat: New (generated) file. gdbserver/ChangeLog: * configure.srv (powerpc*-*-linux*): Set srv_regobj to powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o, powerpc-64l.o, and powerpc-altivec64l.o. Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml, rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml, rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml, rs6000/power-linux.xml, and rs6000/power64-linux.xml to srv_xmlfiles. * Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ... (powerpc-32l.o, powerpc-32l.c): ... these new rules. (powerpc-32.o, powerpc-32.c): Remove, replace by ... (powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules. (powerpc-e500.o, powerpc-e500.c): Remove, replace by ... (powerpc-e500l.o, powerpc-e500l.c): ... these new rules. (reg-ppc64.o, reg-ppc64.c): Remove, replace by ... (powerpc-64l.o, powerpc-64l.c): ... these new rules. (powerpc-64.o, powerpc-64.c): Remove, replace by ... (powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules. (clean): Update. * linux-ppc-low.c (init_registers_ppc): Remove, replace by ... (init_registers_powerpc_32l): ... this new prototype. (init_registers_powerpc_32): Remove, replace by ... (init_registers_powerpc_altivec32l): ... this new prototype. (init_registers_powerpc_e500): Remove, replace by ... (init_registers_powerpc_e500l): ... this new prototype. (init_registers_ppc64): Remove, replace by ... (init_registers_powerpc_64l): ... this new prototype. (init_registers_powerpc_64): Remove, replace by ... (init_registers_powerpc_altivec64l): ... this new prototype. (ppc_num_regs): Set to 73. (PT_ORIG_R3, PT_TRAP): Define if necessary. (ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap. (ppc_cannot_store_register): Handle orig_r3 and trap. (ppc_arch_setup): Update init_registers_... calls. (ppc_fill_gregset): Handle orig_r3 and trap. * inferiors.c (clear_inferiors): Reset current_inferior. --- gdb/ChangeLog | 91 ++++++++++ gdb/Makefile.in | 27 ++- gdb/features/Makefile | 11 +- gdb/features/rs6000/power-linux.xml | 12 ++ gdb/features/rs6000/power-spe.xml | 2 +- gdb/features/rs6000/power64-linux.xml | 12 ++ gdb/features/rs6000/powerpc-32.c | 71 -------- gdb/features/rs6000/powerpc-32.xml | 1 - gdb/features/rs6000/powerpc-32l.c | 97 ++++++++++ gdb/features/rs6000/powerpc-32l.xml | 17 ++ gdb/features/rs6000/powerpc-64.c | 71 -------- gdb/features/rs6000/powerpc-64.xml | 1 - gdb/features/rs6000/powerpc-64l.c | 97 ++++++++++ gdb/features/rs6000/powerpc-64l.xml | 17 ++ gdb/features/rs6000/powerpc-altivec32.c | 164 +++++++++++++++++ gdb/features/rs6000/powerpc-altivec32.xml | 17 ++ gdb/features/rs6000/powerpc-altivec32l.c | 168 ++++++++++++++++++ gdb/features/rs6000/powerpc-altivec32l.xml | 19 ++ gdb/features/rs6000/powerpc-altivec64.c | 164 +++++++++++++++++ gdb/features/rs6000/powerpc-altivec64.xml | 17 ++ gdb/features/rs6000/powerpc-altivec64l.c | 168 ++++++++++++++++++ gdb/features/rs6000/powerpc-altivec64l.xml | 19 ++ gdb/features/rs6000/powerpc-e500.c | 4 +- gdb/features/rs6000/powerpc-e500l.c | 98 ++++++++++ gdb/features/rs6000/powerpc-e500l.xml | 14 ++ gdb/gdbserver/ChangeLog | 43 +++++ gdb/gdbserver/Makefile.in | 35 ++-- gdb/gdbserver/configure.srv | 17 +- gdb/gdbserver/inferiors.c | 2 + gdb/gdbserver/linux-ppc-low.c | 59 +++--- gdb/ppc-linux-nat.c | 83 +++++++-- gdb/ppc-linux-tdep.c | 157 +++++++++++++++- gdb/ppc-linux-tdep.h | 48 +++++ gdb/ppc-tdep.h | 14 +- .../{reg-ppc.dat => rs6000/powerpc-32l.dat} | 9 +- .../{reg-ppc64.dat => rs6000/powerpc-64l.dat} | 9 +- ...{powerpc-32.dat => powerpc-altivec32l.dat} | 8 +- ...{powerpc-64.dat => powerpc-altivec64l.dat} | 8 +- .../{powerpc-e500.dat => powerpc-e500l.dat} | 8 +- gdb/rs6000-tdep.c | 12 +- 40 files changed, 1641 insertions(+), 250 deletions(-) create mode 100644 gdb/features/rs6000/power-linux.xml create mode 100644 gdb/features/rs6000/power64-linux.xml create mode 100644 gdb/features/rs6000/powerpc-32l.c create mode 100644 gdb/features/rs6000/powerpc-32l.xml create mode 100644 gdb/features/rs6000/powerpc-64l.c create mode 100644 gdb/features/rs6000/powerpc-64l.xml create mode 100644 gdb/features/rs6000/powerpc-altivec32.c create mode 100644 gdb/features/rs6000/powerpc-altivec32.xml create mode 100644 gdb/features/rs6000/powerpc-altivec32l.c create mode 100644 gdb/features/rs6000/powerpc-altivec32l.xml create mode 100644 gdb/features/rs6000/powerpc-altivec64.c create mode 100644 gdb/features/rs6000/powerpc-altivec64.xml create mode 100644 gdb/features/rs6000/powerpc-altivec64l.c create mode 100644 gdb/features/rs6000/powerpc-altivec64l.xml create mode 100644 gdb/features/rs6000/powerpc-e500l.c create mode 100644 gdb/features/rs6000/powerpc-e500l.xml create mode 100644 gdb/ppc-linux-tdep.h rename gdb/regformats/{reg-ppc.dat => rs6000/powerpc-32l.dat} (81%) rename gdb/regformats/{reg-ppc64.dat => rs6000/powerpc-64l.dat} (81%) rename gdb/regformats/rs6000/{powerpc-32.dat => powerpc-altivec32l.dat} (85%) rename gdb/regformats/rs6000/{powerpc-64.dat => powerpc-altivec64l.dat} (85%) rename gdb/regformats/rs6000/{powerpc-e500.dat => powerpc-e500l.dat} (82%) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7aed9278d8e..a15345a042d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,94 @@ +2008-05-03 Ulrich Weigand + + * Makefile.in (ppc_linux_tdep_h): New macro. + (powerpc_32l_c, powerpc_altivec32_c, powerpc_altivec32l_c): Likewise. + (powerpc_64l_c, powerpc_altivec64_c, powerpc_altivec64l_c): Likewise. + (powerpc_e500l_c): Likewise. + (ppc-linux-nat.o): Update dependencies. + (ppc-linux-tdep.o): Update dependencies. + (rs6000-tdep.o): Update dependencies. + + * ppc-tdep.h (ppc_linux_memory_remove_breakpoint): Remove. + (ppc_linux_svr4_fetch_link_map_offsets): Remove. + (ppc_linux_gregset, ppc_linux_fpregset): Move to ppc-linux-tdep.h + (ppc_supply_reg, ppc_collect_reg): Add prototypes. + (tdesc_powerpc_e500): Remove. + + * rs6000.c: Include "features/rs6000/powerpc-altivec32.c" + and "features/rs6000/powerpc-altivec64.c". + (ppc_supply_reg, ppc_collect_reg): Make global. + (variants): Use tdesc_powerpc_32 for "powerpc" and + tdesc_powerpc_altivec64 for "powerpc64". + (_initialize_rs6000_tdep): Initialize AltiVec descriptions. + + * ppc-linux-tdep.h: New file. + + * ppc-linux-tdep.c: Include "ppc-linux-tdep.c". + Include "features/rs6000/powerpc-32l.c". + Include "features/rs6000/powerpc-altivec32l.c". + Include "features/rs6000/powerpc-64l.c". + Include "features/rs6000/powerpc-altivec64l.c". + Include "features/rs6000/powerpc-e500l.c". + (ppc_linux_supply_gregset): New function. + (ppc_linux_collect_gregset): Handle orig_r3 and trap registers. + (ppc32_linux_gregset): Use ppc_linux_supply_gregset. + (ppc64_linux_gregset): Likewise. + (ppc_linux_sigtramp_cache): Handle orig_r3 and trap registers. + (ppc_linux_trap_reg_p): New function. + (ppc_linux_write_pc): New function. + (ppc_linux_core_read_description): New function. + (ppc_linux_init_abi): Install ppc_linux_write_pc and + ppc_linux_core_read_description. Install orig_r3 and trap + registers if present in the target description. + (_initialize_ppc_linux_tdep): Initialize Linux target descriptions. + + * ppc-linux-nat.c: Include "ppc-linux-tdep.h". + (PT_ORIG_R3, PT_TRAP): Define if necessary. + (ppc_register_u_addr): Handle orig_r3 and trap registers. + (fetch_ppc_registers): Likewise. + (store_ppc_registers): Likewise. + (store_register): Likewise. + (ppc_linux_read_description): Check whether AltiVec is supported. + Check whether inferior is 32-bit or 64-bit. Return the appropriate + Linux target description. + + * features/Makefile (WHICH): Use rs6000/powerpc-32l and + rs6000/powerpc-altivec32l instead of rs6000/powerpc-32. + Use rs6000/powerpc-64l and rs6000/powerpc-altivec64l instead + of rs6000/powerpc-64. Use rs6000/powerpc-e500l instead of + rs6000/powerpc-e500. Update -expedite variables accordingly. + + * features/rs6000/power-spe.xml: Use regnum 73 for "acc". + * features/rs6000/powerpc-32.xml: Do not include power-altivec.xml. + * features/rs6000/powerpc-64.xml: Do not include power-altivec.xml. + * features/rs6000/powerpc-e500.c: Regenerate. + * features/rs6000/powerpc-32.c: Regenerate. + * features/rs6000/powerpc-64.c: Regenerate. + + * features/rs6000/power-linux.xml: New file. + * features/rs6000/power64-linux.xml: New file. + * features/rs6000/powerpc-32l.xml: New file. + * features/rs6000/powerpc-altivec32l.xml: New file. + * features/rs6000/powerpc-64l.xml: New file. + * features/rs6000/powerpc-altivec64l.xml: New file. + * features/rs6000/powerpc-e500l.xml: New file. + * features/rs6000/powerpc-32l.c: New (generated) file. + * features/rs6000/powerpc-altivec32l.c: New (generated) file. + * features/rs6000/powerpc-64l.c: New (generated) file. + * features/rs6000/powerpc-altivec64l.c: New (generated) file. + * features/rs6000/powerpc-e500l.xml: New (generated) file. + + * regformats/reg-ppc.dat: Remove. + * regformats/reg-ppc64.dat: Remove. + * regformats/rs6000/powerpc-32.dat: Remove. + * regformats/rs6000/powerpc-64.dat: Remove. + * regformats/rs6000/powerpc-e500.dat: Remove. + * regformats/rs6000/powerpc-32l.dat: New (generated) file. + * regformats/rs6000/powerpc-altivec32l.dat: New (generated) file. + * regformats/rs6000/powerpc-64l.dat: New (generated) file. + * regformats/rs6000/powerpc-altivec64l.dat: New (generated) file. + * regformats/rs6000/powerpc-e500l.dat: New (generated) file. + 2008-05-03 Pedro Alves * thread.c (delete_thread): Call observer_notify_thread_exit. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 269ccf70e7d..d120bd0cf24 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -859,6 +859,7 @@ p_lang_h = p-lang.h ppcnbsd_tdep_h = ppcnbsd-tdep.h ppcobsd_tdep_h = ppcobsd-tdep.h ppc_tdep_h = ppc-tdep.h +ppc_linux_tdep_h = ppc-linux-tdep.h proc_utils_h = proc-utils.h prologue_value_h = prologue-value.h regcache_h = regcache.h @@ -970,6 +971,9 @@ arm_with_iwmmxt_c = $(srcdir)/features/arm-with-iwmmxt.c $(features_headers) mips_linux_c = $(srcdir)/features/mips-linux.c $(features_headers) mips64_linux_c = $(srcdir)/features/mips64-linux.c $(features_headers) powerpc_32_c = $(srcdir)/features/rs6000/powerpc-32.c $(features_headers) +powerpc_32l_c = $(srcdir)/features/rs6000/powerpc-32l.c $(features_headers) +powerpc_altivec32_c = $(srcdir)/features/rs6000/powerpc-altivec32.c $(features_headers) +powerpc_altivec32l_c = $(srcdir)/features/rs6000/powerpc-altivec32l.c $(features_headers) powerpc_403_c = $(srcdir)/features/rs6000/powerpc-403.c $(features_headers) powerpc_403gc_c = $(srcdir)/features/rs6000/powerpc-403gc.c $(features_headers) powerpc_505_c = $(srcdir)/features/rs6000/powerpc-505.c $(features_headers) @@ -978,10 +982,14 @@ powerpc_602_c = $(srcdir)/features/rs6000/powerpc-602.c $(features_headers) powerpc_603_c = $(srcdir)/features/rs6000/powerpc-603.c $(features_headers) powerpc_604_c = $(srcdir)/features/rs6000/powerpc-604.c $(features_headers) powerpc_64_c = $(srcdir)/features/rs6000/powerpc-64.c $(features_headers) +powerpc_64l_c = $(srcdir)/features/rs6000/powerpc-64l.c $(features_headers) +powerpc_altivec64_c = $(srcdir)/features/rs6000/powerpc-altivec64.c $(features_headers) +powerpc_altivec64l_c = $(srcdir)/features/rs6000/powerpc-altivec64l.c $(features_headers) powerpc_7400_c = $(srcdir)/features/rs6000/powerpc-7400.c $(features_headers) powerpc_750_c = $(srcdir)/features/rs6000/powerpc-750.c $(features_headers) powerpc_860_c = $(srcdir)/features/rs6000/powerpc-860.c $(features_headers) powerpc_e500_c = $(srcdir)/features/rs6000/powerpc-e500.c $(features_headers) +powerpc_e500l_c = $(srcdir)/features/rs6000/powerpc-e500l.c $(features_headers) rs6000_c = $(srcdir)/features/rs6000/rs6000.c $(features_headers) # Header files that need to have srcdir added. Note that in the cases @@ -2592,13 +2600,15 @@ ppcbug-rom.o: ppcbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \ $(serial_h) $(regcache_h) ppc-linux-nat.o: ppc-linux-nat.c $(defs_h) $(gdb_string_h) $(frame_h) \ $(inferior_h) $(gdbcore_h) $(regcache_h) $(gdb_assert_h) \ - $(gdb_wait_h) $(gregset_h) $(ppc_tdep_h) $(target_h) \ - $(linux_nat_h) + $(gdb_wait_h) $(gregset_h) $(ppc_tdep_h) $(ppc_linux_tdep_h) \ + $(target_h) $(linux_nat_h) ppc-linux-tdep.o: ppc-linux-tdep.c $(defs_h) $(frame_h) $(inferior_h) \ $(symtab_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(symfile_h) \ $(objfiles_h) $(regcache_h) $(value_h) $(osabi_h) $(regset_h) \ - $(solib_svr4_h) $(ppc_tdep_h) $(trad_frame_h) $(frame_unwind_h) \ - $(tramp_frame_h) + $(solib_svr4_h) $(ppc_tdep_h) $(ppc_linux_tdep_h) $(trad_frame_h) \ + $(frame_unwind_h) $(tramp_frame_h) \ + $(powerpc_32l_c) $(powerpc_altivec32l_c) $(powerpc_e500l_c) \ + $(powerpc_64l_c) $(powerpc_altivec64l_c) ppcnbsd-nat.o: ppcnbsd-nat.c $(defs_h) $(inferior_h) $(gdb_assert_h) \ $(gdbcore_h) $(regcache_h) $(bsd_kvm_h) $(ppc_tdep_h) \ $(ppcnbsd_tdep_h) $(inf_ptrace_h) @@ -2684,10 +2694,11 @@ rs6000-tdep.o: rs6000-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \ $(ppc_tdep_h) $(gdb_assert_h) $(dis_asm_h) $(trad_frame_h) \ $(frame_unwind_h) $(frame_base_h) $(rs6000_tdep_h) $(dwarf2_frame_h) \ $(target_descriptions) $(user_regs_h) $(elf_ppc_h) \ - $(powerpc_32_c) $(powerpc_403_c) $(powerpc_403gc_c) $(powerpc_505_c) \ - $(powerpc_601_c) $(powerpc_602_c) $(powerpc_603_c) $(powerpc_604_c) \ - $(powerpc_64_c) $(powerpc_7400_c) $(powerpc_750_c) $(powerpc_860_c) \ - $(powerpc_e500_c) $(rs6000_c) + $(powerpc_32_c) $(powerpc_altivec32_c) $(powerpc_403_c) \ + $(powerpc_403gc_c) $(powerpc_505_c) $(powerpc_601_c) \ + $(powerpc_602_c) $(powerpc_603_c) $(powerpc_604_c) \ + $(powerpc_64_c) $(powerpc_altivec64_c) $(powerpc_7400_c) \ + $(powerpc_750_c) $(powerpc_860_c) $(powerpc_e500_c) $(rs6000_c) rs6000-aix-tdep.o: rs6000-aix-tdep.c $(defs_h) $(gdb_string_h) $(osabi_h) \ $(regcache_h) $(regset_h) $(rs6000_tdep_h) $(ppc_tdep_h) s390-nat.o: s390-nat.c $(defs_h) $(regcache_h) $(inferior_h) \ diff --git a/gdb/features/Makefile b/gdb/features/Makefile index cedc57a1131..378f764dd77 100644 --- a/gdb/features/Makefile +++ b/gdb/features/Makefile @@ -32,15 +32,18 @@ # make GDB=/path/to/gdb XMLTOC="xml files" cfiles WHICH = arm-with-iwmmxt mips-linux mips64-linux \ - rs6000/powerpc-32 rs6000/powerpc-e500 rs6000/powerpc-64 + rs6000/powerpc-32l rs6000/powerpc-altivec32l rs6000/powerpc-e500l \ + rs6000/powerpc-64l rs6000/powerpc-altivec64l # Record which registers should be sent to GDB by default after stop. arm-with-iwmmxt-expedite = r11,sp,pc mips-linux-expedite = r29,pc mips64-linux-expedite = r29,pc -rs6000/powerpc-32-expedite = r1,pc -rs6000/powerpc-e500-expedite = r1,pc -rs6000/powerpc-64-expedite = r1,pc +rs6000/powerpc-32l-expedite = r1,pc +rs6000/powerpc-altivec32l-expedite = r1,pc +rs6000/powerpc-e500l-expedite = r1,pc +rs6000/powerpc-64l-expedite = r1,pc +rs6000/powerpc-altivec64l-expedite = r1,pc XSLTPROC = xsltproc outdir = ../regformats diff --git a/gdb/features/rs6000/power-linux.xml b/gdb/features/rs6000/power-linux.xml new file mode 100644 index 00000000000..1cb45172023 --- /dev/null +++ b/gdb/features/rs6000/power-linux.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/gdb/features/rs6000/power-spe.xml b/gdb/features/rs6000/power-spe.xml index d9488c0a5f7..ac76fa19d69 100644 --- a/gdb/features/rs6000/power-spe.xml +++ b/gdb/features/rs6000/power-spe.xml @@ -40,6 +40,6 @@ - + diff --git a/gdb/features/rs6000/power64-linux.xml b/gdb/features/rs6000/power64-linux.xml new file mode 100644 index 00000000000..52c0db6a270 --- /dev/null +++ b/gdb/features/rs6000/power64-linux.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/gdb/features/rs6000/powerpc-32.c b/gdb/features/rs6000/powerpc-32.c index 4c0ffbb37de..6f9be6b21ab 100644 --- a/gdb/features/rs6000/powerpc-32.c +++ b/gdb/features/rs6000/powerpc-32.c @@ -89,76 +89,5 @@ initialize_tdesc_powerpc_32 (void) tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double"); tdesc_create_reg (feature, "fpscr", 70, 1, "float", 32, "int"); - feature = tdesc_create_feature (result, "org.gnu.gdb.power.altivec"); - field_type = tdesc_named_type (feature, "ieee_single"); - type = init_vector_type (field_type, 4); - TYPE_NAME (type) = xstrdup ("v4f"); - tdesc_record_type (feature, type); - - field_type = tdesc_named_type (feature, "int32"); - type = init_vector_type (field_type, 4); - TYPE_NAME (type) = xstrdup ("v4i32"); - tdesc_record_type (feature, type); - - field_type = tdesc_named_type (feature, "int16"); - type = init_vector_type (field_type, 8); - TYPE_NAME (type) = xstrdup ("v8i16"); - tdesc_record_type (feature, type); - - field_type = tdesc_named_type (feature, "int8"); - type = init_vector_type (field_type, 16); - TYPE_NAME (type) = xstrdup ("v16i8"); - tdesc_record_type (feature, type); - - type = init_composite_type (NULL, TYPE_CODE_UNION); - TYPE_NAME (type) = xstrdup ("vec128"); - field_type = tdesc_named_type (feature, "uint128"); - append_composite_type_field (type, xstrdup ("uint128"), field_type); - field_type = tdesc_named_type (feature, "v4f"); - append_composite_type_field (type, xstrdup ("v4_float"), field_type); - field_type = tdesc_named_type (feature, "v4i32"); - append_composite_type_field (type, xstrdup ("v4_int32"), field_type); - field_type = tdesc_named_type (feature, "v8i16"); - append_composite_type_field (type, xstrdup ("v8_int16"), field_type); - field_type = tdesc_named_type (feature, "v16i8"); - append_composite_type_field (type, xstrdup ("v16_int8"), field_type); - TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR; - tdesc_record_type (feature, type); - - tdesc_create_reg (feature, "vr0", 71, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr1", 72, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr2", 73, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr3", 74, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr4", 75, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr5", 76, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr6", 77, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr7", 78, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr8", 79, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr9", 80, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr10", 81, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr11", 82, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr12", 83, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr13", 84, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr14", 85, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr15", 86, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr16", 87, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr17", 88, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr18", 89, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr19", 90, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr20", 91, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr21", 92, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr22", 93, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr23", 94, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr24", 95, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr25", 96, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr26", 97, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr27", 98, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr28", 99, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr29", 100, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr30", 101, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr31", 102, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vscr", 103, 1, "vector", 32, "int"); - tdesc_create_reg (feature, "vrsave", 104, 1, "vector", 32, "int"); - tdesc_powerpc_32 = result; } diff --git a/gdb/features/rs6000/powerpc-32.xml b/gdb/features/rs6000/powerpc-32.xml index 3558c9cec05..697eba7cf85 100644 --- a/gdb/features/rs6000/powerpc-32.xml +++ b/gdb/features/rs6000/powerpc-32.xml @@ -13,5 +13,4 @@ powerpc:common - diff --git a/gdb/features/rs6000/powerpc-32l.c b/gdb/features/rs6000/powerpc-32l.c new file mode 100644 index 00000000000..97e6bda5e5f --- /dev/null +++ b/gdb/features/rs6000/powerpc-32l.c @@ -0,0 +1,97 @@ +/* THIS FILE IS GENERATED. Original: powerpc-32l.xml */ + +#include "defs.h" +#include "gdbtypes.h" +#include "target-descriptions.h" + +struct target_desc *tdesc_powerpc_32l; +static void +initialize_tdesc_powerpc_32l (void) +{ + struct target_desc *result = allocate_target_description (); + struct tdesc_feature *feature; + struct type *field_type, *type; + + set_tdesc_architecture (result, bfd_scan_arch ("powerpc:common")); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.core"); + tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r13", 13, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r14", 14, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r15", 15, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r16", 16, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r17", 17, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r18", 18, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r19", 19, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r20", 20, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r21", 21, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r22", 22, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r24", 24, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r25", 25, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r26", 26, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r27", 27, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r28", 28, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r29", 29, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r30", 30, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r31", 31, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "pc", 64, 1, NULL, 32, "code_ptr"); + tdesc_create_reg (feature, "msr", 65, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "lr", 67, 1, NULL, 32, "code_ptr"); + tdesc_create_reg (feature, "ctr", 68, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32"); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.fpu"); + tdesc_create_reg (feature, "f0", 32, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f1", 33, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f2", 34, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f3", 35, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f4", 36, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f5", 37, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f6", 38, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f7", 39, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f8", 40, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f9", 41, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f10", 42, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f11", 43, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f12", 44, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f13", 45, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f14", 46, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f15", 47, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f16", 48, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f17", 49, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f18", 50, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f19", 51, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f20", 52, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f21", 53, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f22", 54, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f23", 55, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f24", 56, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f25", 57, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f26", 58, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f27", 59, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f28", 60, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f29", 61, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f30", 62, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "fpscr", 70, 1, "float", 32, "int"); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.linux"); + tdesc_create_reg (feature, "orig_r3", 71, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "trap", 72, 1, NULL, 32, "int"); + + tdesc_powerpc_32l = result; +} diff --git a/gdb/features/rs6000/powerpc-32l.xml b/gdb/features/rs6000/powerpc-32l.xml new file mode 100644 index 00000000000..079c9d56240 --- /dev/null +++ b/gdb/features/rs6000/powerpc-32l.xml @@ -0,0 +1,17 @@ + + + + + + + + powerpc:common + + + + diff --git a/gdb/features/rs6000/powerpc-64.c b/gdb/features/rs6000/powerpc-64.c index 1a4567253c9..afbaf448416 100644 --- a/gdb/features/rs6000/powerpc-64.c +++ b/gdb/features/rs6000/powerpc-64.c @@ -89,76 +89,5 @@ initialize_tdesc_powerpc_64 (void) tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double"); tdesc_create_reg (feature, "fpscr", 70, 1, "float", 32, "int"); - feature = tdesc_create_feature (result, "org.gnu.gdb.power.altivec"); - field_type = tdesc_named_type (feature, "ieee_single"); - type = init_vector_type (field_type, 4); - TYPE_NAME (type) = xstrdup ("v4f"); - tdesc_record_type (feature, type); - - field_type = tdesc_named_type (feature, "int32"); - type = init_vector_type (field_type, 4); - TYPE_NAME (type) = xstrdup ("v4i32"); - tdesc_record_type (feature, type); - - field_type = tdesc_named_type (feature, "int16"); - type = init_vector_type (field_type, 8); - TYPE_NAME (type) = xstrdup ("v8i16"); - tdesc_record_type (feature, type); - - field_type = tdesc_named_type (feature, "int8"); - type = init_vector_type (field_type, 16); - TYPE_NAME (type) = xstrdup ("v16i8"); - tdesc_record_type (feature, type); - - type = init_composite_type (NULL, TYPE_CODE_UNION); - TYPE_NAME (type) = xstrdup ("vec128"); - field_type = tdesc_named_type (feature, "uint128"); - append_composite_type_field (type, xstrdup ("uint128"), field_type); - field_type = tdesc_named_type (feature, "v4f"); - append_composite_type_field (type, xstrdup ("v4_float"), field_type); - field_type = tdesc_named_type (feature, "v4i32"); - append_composite_type_field (type, xstrdup ("v4_int32"), field_type); - field_type = tdesc_named_type (feature, "v8i16"); - append_composite_type_field (type, xstrdup ("v8_int16"), field_type); - field_type = tdesc_named_type (feature, "v16i8"); - append_composite_type_field (type, xstrdup ("v16_int8"), field_type); - TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR; - tdesc_record_type (feature, type); - - tdesc_create_reg (feature, "vr0", 71, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr1", 72, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr2", 73, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr3", 74, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr4", 75, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr5", 76, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr6", 77, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr7", 78, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr8", 79, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr9", 80, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr10", 81, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr11", 82, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr12", 83, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr13", 84, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr14", 85, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr15", 86, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr16", 87, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr17", 88, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr18", 89, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr19", 90, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr20", 91, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr21", 92, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr22", 93, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr23", 94, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr24", 95, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr25", 96, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr26", 97, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr27", 98, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr28", 99, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr29", 100, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr30", 101, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vr31", 102, 1, NULL, 128, "vec128"); - tdesc_create_reg (feature, "vscr", 103, 1, "vector", 32, "int"); - tdesc_create_reg (feature, "vrsave", 104, 1, "vector", 32, "int"); - tdesc_powerpc_64 = result; } diff --git a/gdb/features/rs6000/powerpc-64.xml b/gdb/features/rs6000/powerpc-64.xml index 3c9eba1a968..15ee85e4e76 100644 --- a/gdb/features/rs6000/powerpc-64.xml +++ b/gdb/features/rs6000/powerpc-64.xml @@ -13,5 +13,4 @@ powerpc:common64 - diff --git a/gdb/features/rs6000/powerpc-64l.c b/gdb/features/rs6000/powerpc-64l.c new file mode 100644 index 00000000000..990c4250ce9 --- /dev/null +++ b/gdb/features/rs6000/powerpc-64l.c @@ -0,0 +1,97 @@ +/* THIS FILE IS GENERATED. Original: powerpc-64l.xml */ + +#include "defs.h" +#include "gdbtypes.h" +#include "target-descriptions.h" + +struct target_desc *tdesc_powerpc_64l; +static void +initialize_tdesc_powerpc_64l (void) +{ + struct target_desc *result = allocate_target_description (); + struct tdesc_feature *feature; + struct type *field_type, *type; + + set_tdesc_architecture (result, bfd_scan_arch ("powerpc:common64")); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.core"); + tdesc_create_reg (feature, "r0", 0, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r1", 1, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r2", 2, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r3", 3, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r4", 4, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r5", 5, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r6", 6, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r7", 7, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r8", 8, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r9", 9, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r10", 10, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r11", 11, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r12", 12, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r13", 13, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r14", 14, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r15", 15, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r16", 16, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r17", 17, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r18", 18, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r19", 19, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r20", 20, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r21", 21, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r22", 22, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r23", 23, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r24", 24, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r25", 25, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r26", 26, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r27", 27, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r28", 28, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r29", 29, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r30", 30, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r31", 31, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "pc", 64, 1, NULL, 64, "code_ptr"); + tdesc_create_reg (feature, "msr", 65, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "lr", 67, 1, NULL, 64, "code_ptr"); + tdesc_create_reg (feature, "ctr", 68, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32"); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.fpu"); + tdesc_create_reg (feature, "f0", 32, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f1", 33, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f2", 34, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f3", 35, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f4", 36, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f5", 37, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f6", 38, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f7", 39, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f8", 40, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f9", 41, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f10", 42, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f11", 43, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f12", 44, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f13", 45, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f14", 46, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f15", 47, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f16", 48, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f17", 49, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f18", 50, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f19", 51, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f20", 52, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f21", 53, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f22", 54, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f23", 55, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f24", 56, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f25", 57, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f26", 58, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f27", 59, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f28", 60, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f29", 61, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f30", 62, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "fpscr", 70, 1, "float", 32, "int"); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.linux"); + tdesc_create_reg (feature, "orig_r3", 71, 1, NULL, 64, "int"); + tdesc_create_reg (feature, "trap", 72, 1, NULL, 64, "int"); + + tdesc_powerpc_64l = result; +} diff --git a/gdb/features/rs6000/powerpc-64l.xml b/gdb/features/rs6000/powerpc-64l.xml new file mode 100644 index 00000000000..af818004f69 --- /dev/null +++ b/gdb/features/rs6000/powerpc-64l.xml @@ -0,0 +1,17 @@ + + + + + + + + powerpc:common64 + + + + diff --git a/gdb/features/rs6000/powerpc-altivec32.c b/gdb/features/rs6000/powerpc-altivec32.c new file mode 100644 index 00000000000..ff2aefaa906 --- /dev/null +++ b/gdb/features/rs6000/powerpc-altivec32.c @@ -0,0 +1,164 @@ +/* THIS FILE IS GENERATED. Original: powerpc-altivec32.xml */ + +#include "defs.h" +#include "gdbtypes.h" +#include "target-descriptions.h" + +struct target_desc *tdesc_powerpc_altivec32; +static void +initialize_tdesc_powerpc_altivec32 (void) +{ + struct target_desc *result = allocate_target_description (); + struct tdesc_feature *feature; + struct type *field_type, *type; + + set_tdesc_architecture (result, bfd_scan_arch ("powerpc:common")); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.core"); + tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r13", 13, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r14", 14, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r15", 15, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r16", 16, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r17", 17, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r18", 18, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r19", 19, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r20", 20, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r21", 21, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r22", 22, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r24", 24, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r25", 25, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r26", 26, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r27", 27, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r28", 28, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r29", 29, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r30", 30, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r31", 31, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "pc", 64, 1, NULL, 32, "code_ptr"); + tdesc_create_reg (feature, "msr", 65, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "lr", 67, 1, NULL, 32, "code_ptr"); + tdesc_create_reg (feature, "ctr", 68, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32"); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.fpu"); + tdesc_create_reg (feature, "f0", 32, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f1", 33, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f2", 34, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f3", 35, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f4", 36, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f5", 37, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f6", 38, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f7", 39, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f8", 40, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f9", 41, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f10", 42, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f11", 43, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f12", 44, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f13", 45, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f14", 46, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f15", 47, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f16", 48, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f17", 49, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f18", 50, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f19", 51, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f20", 52, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f21", 53, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f22", 54, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f23", 55, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f24", 56, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f25", 57, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f26", 58, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f27", 59, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f28", 60, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f29", 61, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f30", 62, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "fpscr", 70, 1, "float", 32, "int"); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.altivec"); + field_type = tdesc_named_type (feature, "ieee_single"); + type = init_vector_type (field_type, 4); + TYPE_NAME (type) = xstrdup ("v4f"); + tdesc_record_type (feature, type); + + field_type = tdesc_named_type (feature, "int32"); + type = init_vector_type (field_type, 4); + TYPE_NAME (type) = xstrdup ("v4i32"); + tdesc_record_type (feature, type); + + field_type = tdesc_named_type (feature, "int16"); + type = init_vector_type (field_type, 8); + TYPE_NAME (type) = xstrdup ("v8i16"); + tdesc_record_type (feature, type); + + field_type = tdesc_named_type (feature, "int8"); + type = init_vector_type (field_type, 16); + TYPE_NAME (type) = xstrdup ("v16i8"); + tdesc_record_type (feature, type); + + type = init_composite_type (NULL, TYPE_CODE_UNION); + TYPE_NAME (type) = xstrdup ("vec128"); + field_type = tdesc_named_type (feature, "uint128"); + append_composite_type_field (type, xstrdup ("uint128"), field_type); + field_type = tdesc_named_type (feature, "v4f"); + append_composite_type_field (type, xstrdup ("v4_float"), field_type); + field_type = tdesc_named_type (feature, "v4i32"); + append_composite_type_field (type, xstrdup ("v4_int32"), field_type); + field_type = tdesc_named_type (feature, "v8i16"); + append_composite_type_field (type, xstrdup ("v8_int16"), field_type); + field_type = tdesc_named_type (feature, "v16i8"); + append_composite_type_field (type, xstrdup ("v16_int8"), field_type); + TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR; + tdesc_record_type (feature, type); + + tdesc_create_reg (feature, "vr0", 71, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr1", 72, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr2", 73, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr3", 74, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr4", 75, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr5", 76, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr6", 77, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr7", 78, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr8", 79, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr9", 80, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr10", 81, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr11", 82, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr12", 83, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr13", 84, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr14", 85, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr15", 86, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr16", 87, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr17", 88, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr18", 89, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr19", 90, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr20", 91, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr21", 92, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr22", 93, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr23", 94, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr24", 95, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr25", 96, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr26", 97, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr27", 98, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr28", 99, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr29", 100, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr30", 101, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr31", 102, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vscr", 103, 1, "vector", 32, "int"); + tdesc_create_reg (feature, "vrsave", 104, 1, "vector", 32, "int"); + + tdesc_powerpc_altivec32 = result; +} diff --git a/gdb/features/rs6000/powerpc-altivec32.xml b/gdb/features/rs6000/powerpc-altivec32.xml new file mode 100644 index 00000000000..c8491db5a50 --- /dev/null +++ b/gdb/features/rs6000/powerpc-altivec32.xml @@ -0,0 +1,17 @@ + + + + + + + + powerpc:common + + + + diff --git a/gdb/features/rs6000/powerpc-altivec32l.c b/gdb/features/rs6000/powerpc-altivec32l.c new file mode 100644 index 00000000000..c139c600f0a --- /dev/null +++ b/gdb/features/rs6000/powerpc-altivec32l.c @@ -0,0 +1,168 @@ +/* THIS FILE IS GENERATED. Original: powerpc-altivec32l.xml */ + +#include "defs.h" +#include "gdbtypes.h" +#include "target-descriptions.h" + +struct target_desc *tdesc_powerpc_altivec32l; +static void +initialize_tdesc_powerpc_altivec32l (void) +{ + struct target_desc *result = allocate_target_description (); + struct tdesc_feature *feature; + struct type *field_type, *type; + + set_tdesc_architecture (result, bfd_scan_arch ("powerpc:common")); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.core"); + tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r13", 13, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r14", 14, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r15", 15, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r16", 16, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r17", 17, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r18", 18, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r19", 19, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r20", 20, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r21", 21, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r22", 22, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r24", 24, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r25", 25, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r26", 26, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r27", 27, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r28", 28, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r29", 29, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r30", 30, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r31", 31, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "pc", 64, 1, NULL, 32, "code_ptr"); + tdesc_create_reg (feature, "msr", 65, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "lr", 67, 1, NULL, 32, "code_ptr"); + tdesc_create_reg (feature, "ctr", 68, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32"); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.fpu"); + tdesc_create_reg (feature, "f0", 32, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f1", 33, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f2", 34, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f3", 35, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f4", 36, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f5", 37, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f6", 38, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f7", 39, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f8", 40, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f9", 41, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f10", 42, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f11", 43, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f12", 44, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f13", 45, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f14", 46, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f15", 47, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f16", 48, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f17", 49, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f18", 50, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f19", 51, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f20", 52, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f21", 53, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f22", 54, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f23", 55, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f24", 56, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f25", 57, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f26", 58, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f27", 59, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f28", 60, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f29", 61, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f30", 62, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "fpscr", 70, 1, "float", 32, "int"); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.linux"); + tdesc_create_reg (feature, "orig_r3", 71, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "trap", 72, 1, NULL, 32, "int"); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.altivec"); + field_type = tdesc_named_type (feature, "ieee_single"); + type = init_vector_type (field_type, 4); + TYPE_NAME (type) = xstrdup ("v4f"); + tdesc_record_type (feature, type); + + field_type = tdesc_named_type (feature, "int32"); + type = init_vector_type (field_type, 4); + TYPE_NAME (type) = xstrdup ("v4i32"); + tdesc_record_type (feature, type); + + field_type = tdesc_named_type (feature, "int16"); + type = init_vector_type (field_type, 8); + TYPE_NAME (type) = xstrdup ("v8i16"); + tdesc_record_type (feature, type); + + field_type = tdesc_named_type (feature, "int8"); + type = init_vector_type (field_type, 16); + TYPE_NAME (type) = xstrdup ("v16i8"); + tdesc_record_type (feature, type); + + type = init_composite_type (NULL, TYPE_CODE_UNION); + TYPE_NAME (type) = xstrdup ("vec128"); + field_type = tdesc_named_type (feature, "uint128"); + append_composite_type_field (type, xstrdup ("uint128"), field_type); + field_type = tdesc_named_type (feature, "v4f"); + append_composite_type_field (type, xstrdup ("v4_float"), field_type); + field_type = tdesc_named_type (feature, "v4i32"); + append_composite_type_field (type, xstrdup ("v4_int32"), field_type); + field_type = tdesc_named_type (feature, "v8i16"); + append_composite_type_field (type, xstrdup ("v8_int16"), field_type); + field_type = tdesc_named_type (feature, "v16i8"); + append_composite_type_field (type, xstrdup ("v16_int8"), field_type); + TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR; + tdesc_record_type (feature, type); + + tdesc_create_reg (feature, "vr0", 73, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr1", 74, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr2", 75, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr3", 76, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr4", 77, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr5", 78, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr6", 79, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr7", 80, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr8", 81, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr9", 82, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr10", 83, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr11", 84, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr12", 85, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr13", 86, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr14", 87, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr15", 88, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr16", 89, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr17", 90, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr18", 91, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr19", 92, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr20", 93, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr21", 94, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr22", 95, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr23", 96, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr24", 97, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr25", 98, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr26", 99, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr27", 100, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr28", 101, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr29", 102, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr30", 103, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr31", 104, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vscr", 105, 1, "vector", 32, "int"); + tdesc_create_reg (feature, "vrsave", 106, 1, "vector", 32, "int"); + + tdesc_powerpc_altivec32l = result; +} diff --git a/gdb/features/rs6000/powerpc-altivec32l.xml b/gdb/features/rs6000/powerpc-altivec32l.xml new file mode 100644 index 00000000000..d0bde9bc16a --- /dev/null +++ b/gdb/features/rs6000/powerpc-altivec32l.xml @@ -0,0 +1,19 @@ + + + + + + + + powerpc:common + + + + + diff --git a/gdb/features/rs6000/powerpc-altivec64.c b/gdb/features/rs6000/powerpc-altivec64.c new file mode 100644 index 00000000000..404a92d954c --- /dev/null +++ b/gdb/features/rs6000/powerpc-altivec64.c @@ -0,0 +1,164 @@ +/* THIS FILE IS GENERATED. Original: powerpc-altivec64.xml */ + +#include "defs.h" +#include "gdbtypes.h" +#include "target-descriptions.h" + +struct target_desc *tdesc_powerpc_altivec64; +static void +initialize_tdesc_powerpc_altivec64 (void) +{ + struct target_desc *result = allocate_target_description (); + struct tdesc_feature *feature; + struct type *field_type, *type; + + set_tdesc_architecture (result, bfd_scan_arch ("powerpc:common64")); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.core"); + tdesc_create_reg (feature, "r0", 0, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r1", 1, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r2", 2, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r3", 3, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r4", 4, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r5", 5, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r6", 6, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r7", 7, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r8", 8, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r9", 9, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r10", 10, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r11", 11, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r12", 12, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r13", 13, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r14", 14, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r15", 15, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r16", 16, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r17", 17, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r18", 18, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r19", 19, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r20", 20, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r21", 21, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r22", 22, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r23", 23, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r24", 24, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r25", 25, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r26", 26, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r27", 27, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r28", 28, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r29", 29, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r30", 30, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r31", 31, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "pc", 64, 1, NULL, 64, "code_ptr"); + tdesc_create_reg (feature, "msr", 65, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "lr", 67, 1, NULL, 64, "code_ptr"); + tdesc_create_reg (feature, "ctr", 68, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32"); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.fpu"); + tdesc_create_reg (feature, "f0", 32, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f1", 33, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f2", 34, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f3", 35, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f4", 36, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f5", 37, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f6", 38, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f7", 39, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f8", 40, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f9", 41, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f10", 42, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f11", 43, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f12", 44, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f13", 45, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f14", 46, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f15", 47, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f16", 48, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f17", 49, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f18", 50, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f19", 51, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f20", 52, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f21", 53, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f22", 54, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f23", 55, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f24", 56, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f25", 57, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f26", 58, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f27", 59, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f28", 60, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f29", 61, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f30", 62, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "fpscr", 70, 1, "float", 32, "int"); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.altivec"); + field_type = tdesc_named_type (feature, "ieee_single"); + type = init_vector_type (field_type, 4); + TYPE_NAME (type) = xstrdup ("v4f"); + tdesc_record_type (feature, type); + + field_type = tdesc_named_type (feature, "int32"); + type = init_vector_type (field_type, 4); + TYPE_NAME (type) = xstrdup ("v4i32"); + tdesc_record_type (feature, type); + + field_type = tdesc_named_type (feature, "int16"); + type = init_vector_type (field_type, 8); + TYPE_NAME (type) = xstrdup ("v8i16"); + tdesc_record_type (feature, type); + + field_type = tdesc_named_type (feature, "int8"); + type = init_vector_type (field_type, 16); + TYPE_NAME (type) = xstrdup ("v16i8"); + tdesc_record_type (feature, type); + + type = init_composite_type (NULL, TYPE_CODE_UNION); + TYPE_NAME (type) = xstrdup ("vec128"); + field_type = tdesc_named_type (feature, "uint128"); + append_composite_type_field (type, xstrdup ("uint128"), field_type); + field_type = tdesc_named_type (feature, "v4f"); + append_composite_type_field (type, xstrdup ("v4_float"), field_type); + field_type = tdesc_named_type (feature, "v4i32"); + append_composite_type_field (type, xstrdup ("v4_int32"), field_type); + field_type = tdesc_named_type (feature, "v8i16"); + append_composite_type_field (type, xstrdup ("v8_int16"), field_type); + field_type = tdesc_named_type (feature, "v16i8"); + append_composite_type_field (type, xstrdup ("v16_int8"), field_type); + TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR; + tdesc_record_type (feature, type); + + tdesc_create_reg (feature, "vr0", 71, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr1", 72, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr2", 73, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr3", 74, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr4", 75, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr5", 76, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr6", 77, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr7", 78, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr8", 79, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr9", 80, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr10", 81, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr11", 82, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr12", 83, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr13", 84, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr14", 85, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr15", 86, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr16", 87, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr17", 88, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr18", 89, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr19", 90, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr20", 91, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr21", 92, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr22", 93, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr23", 94, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr24", 95, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr25", 96, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr26", 97, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr27", 98, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr28", 99, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr29", 100, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr30", 101, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr31", 102, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vscr", 103, 1, "vector", 32, "int"); + tdesc_create_reg (feature, "vrsave", 104, 1, "vector", 32, "int"); + + tdesc_powerpc_altivec64 = result; +} diff --git a/gdb/features/rs6000/powerpc-altivec64.xml b/gdb/features/rs6000/powerpc-altivec64.xml new file mode 100644 index 00000000000..173afe185be --- /dev/null +++ b/gdb/features/rs6000/powerpc-altivec64.xml @@ -0,0 +1,17 @@ + + + + + + + + powerpc:common64 + + + + diff --git a/gdb/features/rs6000/powerpc-altivec64l.c b/gdb/features/rs6000/powerpc-altivec64l.c new file mode 100644 index 00000000000..a5d4be7db64 --- /dev/null +++ b/gdb/features/rs6000/powerpc-altivec64l.c @@ -0,0 +1,168 @@ +/* THIS FILE IS GENERATED. Original: powerpc-altivec64l.xml */ + +#include "defs.h" +#include "gdbtypes.h" +#include "target-descriptions.h" + +struct target_desc *tdesc_powerpc_altivec64l; +static void +initialize_tdesc_powerpc_altivec64l (void) +{ + struct target_desc *result = allocate_target_description (); + struct tdesc_feature *feature; + struct type *field_type, *type; + + set_tdesc_architecture (result, bfd_scan_arch ("powerpc:common64")); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.core"); + tdesc_create_reg (feature, "r0", 0, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r1", 1, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r2", 2, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r3", 3, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r4", 4, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r5", 5, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r6", 6, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r7", 7, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r8", 8, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r9", 9, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r10", 10, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r11", 11, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r12", 12, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r13", 13, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r14", 14, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r15", 15, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r16", 16, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r17", 17, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r18", 18, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r19", 19, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r20", 20, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r21", 21, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r22", 22, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r23", 23, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r24", 24, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r25", 25, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r26", 26, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r27", 27, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r28", 28, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r29", 29, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r30", 30, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "r31", 31, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "pc", 64, 1, NULL, 64, "code_ptr"); + tdesc_create_reg (feature, "msr", 65, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "lr", 67, 1, NULL, 64, "code_ptr"); + tdesc_create_reg (feature, "ctr", 68, 1, NULL, 64, "uint64"); + tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32"); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.fpu"); + tdesc_create_reg (feature, "f0", 32, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f1", 33, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f2", 34, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f3", 35, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f4", 36, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f5", 37, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f6", 38, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f7", 39, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f8", 40, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f9", 41, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f10", 42, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f11", 43, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f12", 44, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f13", 45, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f14", 46, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f15", 47, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f16", 48, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f17", 49, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f18", 50, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f19", 51, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f20", 52, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f21", 53, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f22", 54, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f23", 55, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f24", 56, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f25", 57, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f26", 58, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f27", 59, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f28", 60, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f29", 61, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f30", 62, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "f31", 63, 1, NULL, 64, "ieee_double"); + tdesc_create_reg (feature, "fpscr", 70, 1, "float", 32, "int"); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.linux"); + tdesc_create_reg (feature, "orig_r3", 71, 1, NULL, 64, "int"); + tdesc_create_reg (feature, "trap", 72, 1, NULL, 64, "int"); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.altivec"); + field_type = tdesc_named_type (feature, "ieee_single"); + type = init_vector_type (field_type, 4); + TYPE_NAME (type) = xstrdup ("v4f"); + tdesc_record_type (feature, type); + + field_type = tdesc_named_type (feature, "int32"); + type = init_vector_type (field_type, 4); + TYPE_NAME (type) = xstrdup ("v4i32"); + tdesc_record_type (feature, type); + + field_type = tdesc_named_type (feature, "int16"); + type = init_vector_type (field_type, 8); + TYPE_NAME (type) = xstrdup ("v8i16"); + tdesc_record_type (feature, type); + + field_type = tdesc_named_type (feature, "int8"); + type = init_vector_type (field_type, 16); + TYPE_NAME (type) = xstrdup ("v16i8"); + tdesc_record_type (feature, type); + + type = init_composite_type (NULL, TYPE_CODE_UNION); + TYPE_NAME (type) = xstrdup ("vec128"); + field_type = tdesc_named_type (feature, "uint128"); + append_composite_type_field (type, xstrdup ("uint128"), field_type); + field_type = tdesc_named_type (feature, "v4f"); + append_composite_type_field (type, xstrdup ("v4_float"), field_type); + field_type = tdesc_named_type (feature, "v4i32"); + append_composite_type_field (type, xstrdup ("v4_int32"), field_type); + field_type = tdesc_named_type (feature, "v8i16"); + append_composite_type_field (type, xstrdup ("v8_int16"), field_type); + field_type = tdesc_named_type (feature, "v16i8"); + append_composite_type_field (type, xstrdup ("v16_int8"), field_type); + TYPE_FLAGS (type) |= TYPE_FLAG_VECTOR; + tdesc_record_type (feature, type); + + tdesc_create_reg (feature, "vr0", 73, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr1", 74, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr2", 75, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr3", 76, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr4", 77, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr5", 78, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr6", 79, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr7", 80, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr8", 81, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr9", 82, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr10", 83, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr11", 84, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr12", 85, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr13", 86, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr14", 87, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr15", 88, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr16", 89, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr17", 90, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr18", 91, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr19", 92, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr20", 93, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr21", 94, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr22", 95, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr23", 96, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr24", 97, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr25", 98, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr26", 99, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr27", 100, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr28", 101, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr29", 102, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr30", 103, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vr31", 104, 1, NULL, 128, "vec128"); + tdesc_create_reg (feature, "vscr", 105, 1, "vector", 32, "int"); + tdesc_create_reg (feature, "vrsave", 106, 1, "vector", 32, "int"); + + tdesc_powerpc_altivec64l = result; +} diff --git a/gdb/features/rs6000/powerpc-altivec64l.xml b/gdb/features/rs6000/powerpc-altivec64l.xml new file mode 100644 index 00000000000..86720b64ea6 --- /dev/null +++ b/gdb/features/rs6000/powerpc-altivec64l.xml @@ -0,0 +1,19 @@ + + + + + + + + powerpc:common64 + + + + + diff --git a/gdb/features/rs6000/powerpc-e500.c b/gdb/features/rs6000/powerpc-e500.c index df409bb8789..968915f205d 100644 --- a/gdb/features/rs6000/powerpc-e500.c +++ b/gdb/features/rs6000/powerpc-e500.c @@ -87,8 +87,8 @@ initialize_tdesc_powerpc_e500 (void) tdesc_create_reg (feature, "ev29h", 61, 1, NULL, 32, "int"); tdesc_create_reg (feature, "ev30h", 62, 1, NULL, 32, "int"); tdesc_create_reg (feature, "ev31h", 63, 1, NULL, 32, "int"); - tdesc_create_reg (feature, "acc", 71, 1, NULL, 64, "int"); - tdesc_create_reg (feature, "spefscr", 72, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "acc", 73, 1, NULL, 64, "int"); + tdesc_create_reg (feature, "spefscr", 74, 1, NULL, 32, "int"); tdesc_powerpc_e500 = result; } diff --git a/gdb/features/rs6000/powerpc-e500l.c b/gdb/features/rs6000/powerpc-e500l.c new file mode 100644 index 00000000000..0c85e6f07b8 --- /dev/null +++ b/gdb/features/rs6000/powerpc-e500l.c @@ -0,0 +1,98 @@ +/* THIS FILE IS GENERATED. Original: powerpc-e500l.xml */ + +#include "defs.h" +#include "gdbtypes.h" +#include "target-descriptions.h" + +struct target_desc *tdesc_powerpc_e500l; +static void +initialize_tdesc_powerpc_e500l (void) +{ + struct target_desc *result = allocate_target_description (); + struct tdesc_feature *feature; + struct type *field_type, *type; + + set_tdesc_architecture (result, bfd_scan_arch ("powerpc:e500")); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.core"); + tdesc_create_reg (feature, "r0", 0, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r1", 1, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r2", 2, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r3", 3, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r4", 4, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r5", 5, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r6", 6, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r7", 7, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r8", 8, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r9", 9, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r10", 10, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r11", 11, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r12", 12, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r13", 13, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r14", 14, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r15", 15, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r16", 16, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r17", 17, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r18", 18, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r19", 19, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r20", 20, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r21", 21, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r22", 22, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r23", 23, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r24", 24, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r25", 25, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r26", 26, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r27", 27, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r28", 28, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r29", 29, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r30", 30, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "r31", 31, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "pc", 64, 1, NULL, 32, "code_ptr"); + tdesc_create_reg (feature, "msr", 65, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "cr", 66, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "lr", 67, 1, NULL, 32, "code_ptr"); + tdesc_create_reg (feature, "ctr", 68, 1, NULL, 32, "uint32"); + tdesc_create_reg (feature, "xer", 69, 1, NULL, 32, "uint32"); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.spe"); + tdesc_create_reg (feature, "ev0h", 32, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev1h", 33, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev2h", 34, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev3h", 35, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev4h", 36, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev5h", 37, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev6h", 38, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev7h", 39, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev8h", 40, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev9h", 41, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev10h", 42, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev11h", 43, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev12h", 44, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev13h", 45, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev14h", 46, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev15h", 47, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev16h", 48, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev17h", 49, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev18h", 50, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev19h", 51, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev20h", 52, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev21h", 53, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev22h", 54, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev23h", 55, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev24h", 56, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev25h", 57, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev26h", 58, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev27h", 59, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev28h", 60, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev29h", 61, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev30h", 62, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "ev31h", 63, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "acc", 73, 1, NULL, 64, "int"); + tdesc_create_reg (feature, "spefscr", 74, 1, NULL, 32, "int"); + + feature = tdesc_create_feature (result, "org.gnu.gdb.power.linux"); + tdesc_create_reg (feature, "orig_r3", 71, 1, NULL, 32, "int"); + tdesc_create_reg (feature, "trap", 72, 1, NULL, 32, "int"); + + tdesc_powerpc_e500l = result; +} diff --git a/gdb/features/rs6000/powerpc-e500l.xml b/gdb/features/rs6000/powerpc-e500l.xml new file mode 100644 index 00000000000..0a502399508 --- /dev/null +++ b/gdb/features/rs6000/powerpc-e500l.xml @@ -0,0 +1,14 @@ + + + + + + powerpc:e500 + + + + diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index ea0ba8b38c3..da5402ce8bf 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,46 @@ +2008-05-03 Ulrich Weigand + + * configure.srv (powerpc*-*-linux*): Set srv_regobj to + powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o, + powerpc-64l.o, and powerpc-altivec64l.o. + Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and + rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml, + rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml, + rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml, + rs6000/power-linux.xml, and rs6000/power64-linux.xml + to srv_xmlfiles. + + * Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ... + (powerpc-32l.o, powerpc-32l.c): ... these new rules. + (powerpc-32.o, powerpc-32.c): Remove, replace by ... + (powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules. + (powerpc-e500.o, powerpc-e500.c): Remove, replace by ... + (powerpc-e500l.o, powerpc-e500l.c): ... these new rules. + (reg-ppc64.o, reg-ppc64.c): Remove, replace by ... + (powerpc-64l.o, powerpc-64l.c): ... these new rules. + (powerpc-64.o, powerpc-64.c): Remove, replace by ... + (powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules. + (clean): Update. + + * linux-ppc-low.c (init_registers_ppc): Remove, replace by ... + (init_registers_powerpc_32l): ... this new prototype. + (init_registers_powerpc_32): Remove, replace by ... + (init_registers_powerpc_altivec32l): ... this new prototype. + (init_registers_powerpc_e500): Remove, replace by ... + (init_registers_powerpc_e500l): ... this new prototype. + (init_registers_ppc64): Remove, replace by ... + (init_registers_powerpc_64l): ... this new prototype. + (init_registers_powerpc_64): Remove, replace by ... + (init_registers_powerpc_altivec64l): ... this new prototype. + (ppc_num_regs): Set to 73. + (PT_ORIG_R3, PT_TRAP): Define if necessary. + (ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap. + (ppc_cannot_store_register): Handle orig_r3 and trap. + (ppc_arch_setup): Update init_registers_... calls. + (ppc_fill_gregset): Handle orig_r3 and trap. + + * inferiors.c (clear_inferiors): Reset current_inferior. + 2008-04-23 Paolo Bonzini * acinclude.m4: Add override.m4. diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index 1bdd7b7ff79..9b040ccbe01 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -219,10 +219,11 @@ clean: rm -f version.c rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log rm -f reg-arm.c reg-i386.c reg-ia64.c reg-m32r.c reg-m68k.c - rm -f reg-ppc.c reg-sh.c reg-spu.c reg-x86-64.c reg-i386-linux.c + rm -f reg-sh.c reg-spu.c reg-x86-64.c reg-i386-linux.c rm -f reg-cris.c reg-crisv32.c reg-x86-64-linux.c reg-xtensa.c rm -f arm-with-iwmmxt.c mips-linux.c mips64-linux.c - rm -f powerpc-32.c powerpc-64.c powerpc-e500.c + rm -f powerpc-32l.c powerpc-64l.c powerpc-e500l.c + rm -f powerpc-altivec32l.c powerpc-altivec64l.c rm -f xml-builtin.c stamp-xml maintainer-clean realclean distclean: clean @@ -360,21 +361,21 @@ mips-linux.c : $(srcdir)/../regformats/mips-linux.dat $(regdat_sh) mips64-linux.o : mips64-linux.c $(regdef_h) mips64-linux.c : $(srcdir)/../regformats/mips64-linux.dat $(regdat_sh) $(SHELL) $(regdat_sh) $(srcdir)/../regformats/mips64-linux.dat mips64-linux.c -reg-ppc.o : reg-ppc.c $(regdef_h) -reg-ppc.c : $(srcdir)/../regformats/reg-ppc.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-ppc.dat reg-ppc.c -reg-ppc64.o : reg-ppc64.c $(regdef_h) -reg-ppc64.c : $(srcdir)/../regformats/reg-ppc64.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-ppc64.dat reg-ppc64.c -powerpc-32.o : powerpc-32.c $(regdef_h) -powerpc-32.c : $(srcdir)/../regformats/rs6000/powerpc-32.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-32.dat powerpc-32.c -powerpc-e500.o : powerpc-e500.c $(regdef_h) -powerpc-e500.c : $(srcdir)/../regformats/rs6000/powerpc-e500.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-e500.dat powerpc-e500.c -powerpc-64.o : powerpc-64.c $(regdef_h) -powerpc-64.c : $(srcdir)/../regformats/rs6000/powerpc-64.dat $(regdat_sh) - $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-64.dat powerpc-64.c +powerpc-32l.o : powerpc-32l.c $(regdef_h) +powerpc-32l.c : $(srcdir)/../regformats/rs6000/powerpc-32l.dat $(regdat_sh) + $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-32l.dat powerpc-32l.c +powerpc-altivec32l.o : powerpc-altivec32l.c $(regdef_h) +powerpc-altivec32l.c : $(srcdir)/../regformats/rs6000/powerpc-altivec32l.dat $(regdat_sh) + $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-altivec32l.dat powerpc-altivec32l.c +powerpc-e500l.o : powerpc-e500l.c $(regdef_h) +powerpc-e500l.c : $(srcdir)/../regformats/rs6000/powerpc-e500l.dat $(regdat_sh) + $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-e500l.dat powerpc-e500l.c +powerpc-64l.o : powerpc-64l.c $(regdef_h) +powerpc-64l.c : $(srcdir)/../regformats/rs6000/powerpc-64l.dat $(regdat_sh) + $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-64l.dat powerpc-64l.c +powerpc-altivec64l.o : powerpc-altivec64l.c $(regdef_h) +powerpc-altivec64l.c : $(srcdir)/../regformats/rs6000/powerpc-altivec64l.dat $(regdat_sh) + $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-altivec64l.dat powerpc-altivec64l.c reg-s390.o : reg-s390.c $(regdef_h) reg-s390.c : $(srcdir)/../regformats/reg-s390.dat $(regdat_sh) $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-s390.dat reg-s390.c diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv index c97e11e24f9..74b6b950a98 100644 --- a/gdb/gdbserver/configure.srv +++ b/gdb/gdbserver/configure.srv @@ -106,17 +106,24 @@ case "${target}" in srv_linux_usrregs=yes srv_linux_thread_db=yes ;; - powerpc*-*-linux*) srv_regobj="reg-ppc.o powerpc-32.o powerpc-e500.o" - srv_regobj="${srv_regobj} reg-ppc64.o powerpc-64.o" + powerpc*-*-linux*) srv_regobj="powerpc-32l.o" + srv_regobj="${srv_regobj} powerpc-altivec32l.o" + srv_regobj="${srv_regobj} powerpc-e500l.o" + srv_regobj="${srv_regobj} powerpc-64l.o" + srv_regobj="${srv_regobj} powerpc-altivec64l.o" srv_tgtobj="linux-low.o linux-ppc-low.o" - srv_xmlfiles="rs6000/powerpc-32.xml" + srv_xmlfiles="rs6000/powerpc-32l.xml" + srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-altivec32l.xml" srv_xmlfiles="${srv_xmlfiles} rs6000/power-altivec.xml" srv_xmlfiles="${srv_xmlfiles} rs6000/power-core.xml" + srv_xmlfiles="${srv_xmlfiles} rs6000/power-linux.xml" srv_xmlfiles="${srv_xmlfiles} rs6000/power-fpu.xml" - srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-e500.xml" + srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-e500l.xml" srv_xmlfiles="${srv_xmlfiles} rs6000/power-spe.xml" - srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-64.xml" + srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-64l.xml" + srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-altivec64l.xml" srv_xmlfiles="${srv_xmlfiles} rs6000/power64-core.xml" + srv_xmlfiles="${srv_xmlfiles} rs6000/power64-linux.xml" srv_linux_usrregs=yes srv_linux_regsets=yes srv_linux_thread_db=yes diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c index daf7aaf0a1f..f35cfa06b17 100644 --- a/gdb/gdbserver/inferiors.c +++ b/gdb/gdbserver/inferiors.c @@ -302,6 +302,8 @@ clear_inferiors (void) clear_list (&all_threads); clear_list (&all_dlls); + + current_inferior = NULL; } /* Two utility functions for a truly degenerate inferior_list: a simple diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c index 4c3e4efc4bf..84f9d374e92 100644 --- a/gdb/gdbserver/linux-ppc-low.c +++ b/gdb/gdbserver/linux-ppc-low.c @@ -31,18 +31,26 @@ static unsigned long ppc_hwcap; -/* Defined in auto-generated file reg-ppc.c. */ -void init_registers_ppc (void); -/* Defined in auto-generated file powerpc-32.c. */ -void init_registers_powerpc_32 (void); -/* Defined in auto-generated file powerpc-e500.c. */ -void init_registers_powerpc_e500 (void); -/* Defined in auto-generated file reg-ppc64.c. */ -void init_registers_ppc64 (void); -/* Defined in auto-generated file powerpc-64.c. */ -void init_registers_powerpc_64 (void); - -#define ppc_num_regs 71 +/* Defined in auto-generated file powerpc-32l.c. */ +void init_registers_powerpc_32l (void); +/* Defined in auto-generated file powerpc-altivec32l.c. */ +void init_registers_powerpc_altivec32l (void); +/* Defined in auto-generated file powerpc-e500l.c. */ +void init_registers_powerpc_e500l (void); +/* Defined in auto-generated file powerpc-64l.c. */ +void init_registers_powerpc_64l (void); +/* Defined in auto-generated file powerpc-altivec64l.c. */ +void init_registers_powerpc_altivec64l (void); + +#define ppc_num_regs 73 + +/* This sometimes isn't defined. */ +#ifndef PT_ORIG_R3 +#define PT_ORIG_R3 34 +#endif +#ifndef PT_TRAP +#define PT_TRAP 40 +#endif #ifdef __powerpc64__ /* We use a constant for FPSCR instead of PT_FPSCR, because @@ -65,7 +73,8 @@ static int ppc_regmap[] = PT_FPR0*8+192, PT_FPR0*8+200, PT_FPR0*8+208, PT_FPR0*8+216, PT_FPR0*8+224, PT_FPR0*8+232, PT_FPR0*8+240, PT_FPR0*8+248, PT_NIP * 8, PT_MSR * 8, PT_CCR * 8, PT_LNK * 8, - PT_CTR * 8, PT_XER * 8, PT_FPR0*8 + 256 }; + PT_CTR * 8, PT_XER * 8, PT_FPR0*8 + 256, + PT_ORIG_R3 * 8, PT_TRAP * 8 }; #else /* Currently, don't check/send MQ. */ static int ppc_regmap[] = @@ -86,7 +95,8 @@ static int ppc_regmap[] = PT_FPR0*4+192, PT_FPR0*4+200, PT_FPR0*4+208, PT_FPR0*4+216, PT_FPR0*4+224, PT_FPR0*4+232, PT_FPR0*4+240, PT_FPR0*4+248, PT_NIP * 4, PT_MSR * 4, PT_CCR * 4, PT_LNK * 4, - PT_CTR * 4, PT_XER * 4, PT_FPSCR * 4 + PT_CTR * 4, PT_XER * 4, PT_FPSCR * 4, + PT_ORIG_R3 * 4, PT_TRAP * 4 }; static int ppc_regmap_e500[] = @@ -107,7 +117,8 @@ static int ppc_regmap_e500[] = -1, -1, -1, -1, -1, -1, -1, -1, PT_NIP * 4, PT_MSR * 4, PT_CCR * 4, PT_LNK * 4, - PT_CTR * 4, PT_XER * 4, -1 + PT_CTR * 4, PT_XER * 4, -1, + PT_ORIG_R3 * 4, PT_TRAP * 4 }; #endif @@ -120,6 +131,11 @@ ppc_cannot_store_register (int regno) return 2; #endif + /* Some kernels do not allow us to store orig_r3 or trap. */ + if (regno == find_regno ("orig_r3") + || regno == find_regno ("trap")) + return 2; + return 0; } @@ -226,7 +242,7 @@ ppc_arch_setup (void) /* On a 64-bit host, assume 64-bit inferior process with no AltiVec registers. Reset ppc_hwcap to ensure that the collect_register call below does not fail. */ - init_registers_ppc64 (); + init_registers_powerpc_64l (); ppc_hwcap = 0; /* Only if the high bit of the MSR is set, we actually have @@ -236,18 +252,18 @@ ppc_arch_setup (void) { ppc_get_hwcap (&ppc_hwcap); if (ppc_hwcap & PPC_FEATURE_HAS_ALTIVEC) - init_registers_powerpc_64 (); + init_registers_powerpc_altivec64l (); return; } #endif /* OK, we have a 32-bit inferior. */ - init_registers_ppc (); + init_registers_powerpc_32l (); ppc_get_hwcap (&ppc_hwcap); if (ppc_hwcap & PPC_FEATURE_HAS_ALTIVEC) - init_registers_powerpc_32 (); + init_registers_powerpc_altivec32l (); /* On 32-bit machines, check for SPE registers. Set the low target's regmap field as appropriately. */ @@ -255,7 +271,7 @@ ppc_arch_setup (void) the_low_target.regmap = ppc_regmap; if (ppc_hwcap & PPC_FEATURE_HAS_SPE) { - init_registers_powerpc_e500 (); + init_registers_powerpc_e500l (); the_low_target.regmap = ppc_regmap_e500; } #endif @@ -292,6 +308,9 @@ static void ppc_fill_gregset (void *buf) for (i = 64; i < 70; i++) ppc_collect_ptrace_register (i, (char *) buf + ppc_regmap[i]); + + for (i = 71; i < 73; i++) + ppc_collect_ptrace_register (i, (char *) buf + ppc_regmap[i]); } #ifndef PTRACE_GETVRREGS diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index 548658822b8..f9ea8389614 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -42,6 +42,15 @@ /* Prototypes for supply_gregset etc. */ #include "gregset.h" #include "ppc-tdep.h" +#include "ppc-linux-tdep.h" + +/* This sometimes isn't defined. */ +#ifndef PT_ORIG_R3 +#define PT_ORIG_R3 34 +#endif +#ifndef PT_TRAP +#define PT_TRAP 40 +#endif /* Glibc's headers don't define PTRACE_GETVRREGS so we cannot use a configure time check. Some older glibc's (for instance 2.2.1) @@ -200,6 +209,10 @@ ppc_register_u_addr (struct gdbarch *gdbarch, int regno) #endif if (regno == tdep->ppc_ps_regnum) u_addr = PT_MSR * wordsize; + if (regno == PPC_ORIG_R3_REGNUM) + u_addr = PT_ORIG_R3 * wordsize; + if (regno == PPC_TRAP_REGNUM) + u_addr = PT_TRAP * wordsize; if (tdep->ppc_fpscr_regnum >= 0 && regno == tdep->ppc_fpscr_regnum) { @@ -476,6 +489,11 @@ fetch_ppc_registers (struct regcache *regcache, int tid) fetch_register (regcache, tid, tdep->ppc_xer_regnum); if (tdep->ppc_mq_regnum != -1) fetch_register (regcache, tid, tdep->ppc_mq_regnum); + if (ppc_linux_trap_reg_p (gdbarch)) + { + fetch_register (regcache, tid, PPC_ORIG_R3_REGNUM); + fetch_register (regcache, tid, PPC_TRAP_REGNUM); + } if (tdep->ppc_fpscr_regnum != -1) fetch_register (regcache, tid, tdep->ppc_fpscr_regnum); if (have_ptrace_getvrregs) @@ -676,9 +694,12 @@ store_register (const struct regcache *regcache, int tid, int regno) regaddr += sizeof (long); if (errno == EIO - && regno == tdep->ppc_fpscr_regnum) + && (regno == tdep->ppc_fpscr_regnum + || regno == PPC_ORIG_R3_REGNUM + || regno == PPC_TRAP_REGNUM)) { - /* Some older kernel versions don't allow fpscr to be written. */ + /* Some older kernel versions don't allow fpscr, orig_r3 + or trap to be written. */ continue; } @@ -765,6 +786,11 @@ store_ppc_registers (const struct regcache *regcache, int tid) store_register (regcache, tid, tdep->ppc_mq_regnum); if (tdep->ppc_fpscr_regnum != -1) store_register (regcache, tid, tdep->ppc_fpscr_regnum); + if (ppc_linux_trap_reg_p (gdbarch)) + { + store_register (regcache, tid, PPC_ORIG_R3_REGNUM); + store_register (regcache, tid, PPC_TRAP_REGNUM); + } if (have_ptrace_getvrregs) if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1) store_altivec_registers (regcache, tid); @@ -962,28 +988,51 @@ fill_fpregset (const struct regcache *regcache, static const struct target_desc * ppc_linux_read_description (struct target_ops *ops) { + int altivec = 0; + + int tid = TIDGET (inferior_ptid); + if (tid == 0) + tid = PIDGET (inferior_ptid); + if (have_ptrace_getsetevrregs) { struct gdb_evrregset_t evrregset; - int tid = TIDGET (inferior_ptid); - - if (tid == 0) - tid = PIDGET (inferior_ptid); if (ptrace (PTRACE_GETEVRREGS, tid, 0, &evrregset) >= 0) - return tdesc_powerpc_e500; - else - { - /* EIO means that the PTRACE_GETEVRREGS request isn't supported. */ - if (errno == EIO) - return NULL; - else - /* Anything else needs to be reported. */ - perror_with_name (_("Unable to fetch SPE registers")); - } + return tdesc_powerpc_e500l; + + /* EIO means that the PTRACE_GETEVRREGS request isn't supported. + Anything else needs to be reported. */ + else if (errno != EIO) + perror_with_name (_("Unable to fetch SPE registers")); + } + + if (have_ptrace_getvrregs) + { + gdb_vrregset_t vrregset; + + if (ptrace (PTRACE_GETVRREGS, tid, 0, &vrregset) >= 0) + altivec = 1; + + /* EIO means that the PTRACE_GETVRREGS request isn't supported. + Anything else needs to be reported. */ + else if (errno != EIO) + perror_with_name (_("Unable to fetch AltiVec registers")); } - return NULL; + /* Check for 64-bit inferior process. This is the case when the host is + 64-bit, and in addition the top bit of the MSR register is set. */ +#ifdef __powerpc64__ + { + long msr; + errno = 0; + msr = (long) ptrace (PTRACE_PEEKUSER, tid, PT_MSR * 8, 0); + if (errno == 0 && msr < 0) + return altivec? tdesc_powerpc_altivec64l : tdesc_powerpc_64l; + } +#endif + + return altivec? tdesc_powerpc_altivec32l : tdesc_powerpc_32l; } void _initialize_ppc_linux_nat (void); diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index 44b66acede5..2f776f5ff48 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -34,10 +34,17 @@ #include "regset.h" #include "solib-svr4.h" #include "ppc-tdep.h" +#include "ppc-linux-tdep.h" #include "trad-frame.h" #include "frame-unwind.h" #include "tramp-frame.h" +#include "features/rs6000/powerpc-32l.c" +#include "features/rs6000/powerpc-altivec32l.c" +#include "features/rs6000/powerpc-64l.c" +#include "features/rs6000/powerpc-altivec64l.c" +#include "features/rs6000/powerpc-e500l.c" + static CORE_ADDR ppc_linux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) { @@ -620,17 +627,60 @@ ppc_linux_convert_from_func_ptr_addr (struct gdbarch *gdbarch, return addr; } -/* This wrapper clears areas in the linux gregset not written by - ppc_collect_gregset. */ +/* Wrappers to handle Linux-only registers. */ + +static void +ppc_linux_supply_gregset (const struct regset *regset, + struct regcache *regcache, + int regnum, const void *gregs, size_t len) +{ + const struct ppc_reg_offsets *offsets = regset->descr; + + ppc_supply_gregset (regset, regcache, regnum, gregs, len); + + if (ppc_linux_trap_reg_p (get_regcache_arch (regcache))) + { + /* "orig_r3" is stored 2 slots after "pc". */ + if (regnum == -1 || regnum == PPC_ORIG_R3_REGNUM) + ppc_supply_reg (regcache, PPC_ORIG_R3_REGNUM, gregs, + offsets->pc_offset + 2 * offsets->gpr_size, + offsets->gpr_size); + + /* "trap" is stored 8 slots after "pc". */ + if (regnum == -1 || regnum == PPC_TRAP_REGNUM) + ppc_supply_reg (regcache, PPC_TRAP_REGNUM, gregs, + offsets->pc_offset + 8 * offsets->gpr_size, + offsets->gpr_size); + } +} static void ppc_linux_collect_gregset (const struct regset *regset, const struct regcache *regcache, int regnum, void *gregs, size_t len) { + const struct ppc_reg_offsets *offsets = regset->descr; + + /* Clear areas in the linux gregset not written elsewhere. */ if (regnum == -1) memset (gregs, 0, len); + ppc_collect_gregset (regset, regcache, regnum, gregs, len); + + if (ppc_linux_trap_reg_p (get_regcache_arch (regcache))) + { + /* "orig_r3" is stored 2 slots after "pc". */ + if (regnum == -1 || regnum == PPC_ORIG_R3_REGNUM) + ppc_collect_reg (regcache, PPC_ORIG_R3_REGNUM, gregs, + offsets->pc_offset + 2 * offsets->gpr_size, + offsets->gpr_size); + + /* "trap" is stored 8 slots after "pc". */ + if (regnum == -1 || regnum == PPC_TRAP_REGNUM) + ppc_collect_reg (regcache, PPC_TRAP_REGNUM, gregs, + offsets->pc_offset + 8 * offsets->gpr_size, + offsets->gpr_size); + } } /* Regset descriptions. */ @@ -686,14 +736,14 @@ static const struct ppc_reg_offsets ppc64_linux_reg_offsets = static const struct regset ppc32_linux_gregset = { &ppc32_linux_reg_offsets, - ppc_supply_gregset, + ppc_linux_supply_gregset, ppc_linux_collect_gregset, NULL }; static const struct regset ppc64_linux_gregset = { &ppc64_linux_reg_offsets, - ppc_supply_gregset, + ppc_linux_supply_gregset, ppc_linux_collect_gregset, NULL }; @@ -789,6 +839,14 @@ ppc_linux_sigtramp_cache (struct frame_info *this_frame, trad_frame_set_reg_addr (this_cache, tdep->ppc_cr_regnum, gpregs + 38 * tdep->wordsize); + if (ppc_linux_trap_reg_p (gdbarch)) + { + trad_frame_set_reg_addr (this_cache, PPC_ORIG_R3_REGNUM, + gpregs + 34 * tdep->wordsize); + trad_frame_set_reg_addr (this_cache, PPC_TRAP_REGNUM, + gpregs + 40 * tdep->wordsize); + } + if (ppc_floating_point_unit_p (gdbarch)) { /* Floating point registers. */ @@ -895,11 +953,69 @@ static struct tramp_frame ppc64_linux_sighandler_tramp_frame = { ppc64_linux_sighandler_cache_init }; + +/* Return 1 if PPC_ORIG_R3_REGNUM and PPC_TRAP_REGNUM are usable. */ +int +ppc_linux_trap_reg_p (struct gdbarch *gdbarch) +{ + /* If we do not have a target description with registers, then + the special registers will not be included in the register set. */ + if (!tdesc_has_registers (gdbarch_target_desc (gdbarch))) + return 0; + + /* If we do, then it is safe to check the size. */ + return register_size (gdbarch, PPC_ORIG_R3_REGNUM) > 0 + && register_size (gdbarch, PPC_TRAP_REGNUM) > 0; +} + +static void +ppc_linux_write_pc (struct regcache *regcache, CORE_ADDR pc) +{ + struct gdbarch *gdbarch = get_regcache_arch (regcache); + + regcache_cooked_write_unsigned (regcache, gdbarch_pc_regnum (gdbarch), pc); + + /* Set special TRAP register to -1 to prevent the kernel from + messing with the PC we just installed, if we happen to be + within an interrupted system call that the kernel wants to + restart. + + Note that after we return from the dummy call, the TRAP and + ORIG_R3 registers will be automatically restored, and the + kernel continues to restart the system call at this point. */ + if (ppc_linux_trap_reg_p (gdbarch)) + regcache_cooked_write_unsigned (regcache, PPC_TRAP_REGNUM, -1); +} + +static const struct target_desc * +ppc_linux_core_read_description (struct gdbarch *gdbarch, + struct target_ops *target, + bfd *abfd) +{ + asection *altivec = bfd_get_section_by_name (abfd, ".reg-ppc-vmx"); + asection *section = bfd_get_section_by_name (abfd, ".reg"); + if (! section) + return NULL; + + switch (bfd_section_size (abfd, section)) + { + case 48 * 4: + return altivec? tdesc_powerpc_altivec32l : tdesc_powerpc_32l; + + case 48 * 8: + return altivec? tdesc_powerpc_altivec64l : tdesc_powerpc_64l; + + default: + return NULL; + } +} + static void ppc_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + struct tdesc_arch_data *tdesc_data = (void *) info.tdep_info; /* PPC GNU/Linux uses either 64-bit or 128-bit long doubles; where 128-bit, they are IBM long double, not IEEE quad long double as @@ -914,6 +1030,9 @@ ppc_linux_init_abi (struct gdbarch_info info, set_gdbarch_convert_from_func_ptr_addr (gdbarch, ppc_linux_convert_from_func_ptr_addr); + /* Handle inferior calls during interrupted system calls. */ + set_gdbarch_write_pc (gdbarch, ppc_linux_write_pc); + if (tdep->wordsize == 4) { /* Until November 2001, gcc did not comply with the 32 bit SysV @@ -951,10 +1070,33 @@ ppc_linux_init_abi (struct gdbarch_info info, tramp_frame_prepend_unwinder (gdbarch, &ppc64_linux_sighandler_tramp_frame); } set_gdbarch_regset_from_core_section (gdbarch, ppc_linux_regset_from_core_section); + set_gdbarch_core_read_description (gdbarch, ppc_linux_core_read_description); /* Enable TLS support. */ set_gdbarch_fetch_tls_load_module_address (gdbarch, svr4_fetch_objfile_link_map); + + if (tdesc_data) + { + const struct tdesc_feature *feature; + + /* If we have target-described registers, then we can safely + reserve a number for PPC_ORIG_R3_REGNUM and PPC_TRAP_REGNUM + (whether they are described or not). */ + gdb_assert (gdbarch_num_regs (gdbarch) <= PPC_ORIG_R3_REGNUM); + set_gdbarch_num_regs (gdbarch, PPC_TRAP_REGNUM + 1); + + /* If they are present, then assign them to the reserved number. */ + feature = tdesc_find_feature (info.target_desc, + "org.gnu.gdb.power.linux"); + if (feature != NULL) + { + tdesc_numbered_register (feature, tdesc_data, + PPC_ORIG_R3_REGNUM, "orig_r3"); + tdesc_numbered_register (feature, tdesc_data, + PPC_TRAP_REGNUM, "trap"); + } + } } void @@ -968,4 +1110,11 @@ _initialize_ppc_linux_tdep (void) ppc_linux_init_abi); gdbarch_register_osabi (bfd_arch_rs6000, bfd_mach_rs6k, GDB_OSABI_LINUX, ppc_linux_init_abi); + + /* Initialize the Linux target descriptions. */ + initialize_tdesc_powerpc_32l (); + initialize_tdesc_powerpc_altivec32l (); + initialize_tdesc_powerpc_64l (); + initialize_tdesc_powerpc_altivec64l (); + initialize_tdesc_powerpc_e500l (); } diff --git a/gdb/ppc-linux-tdep.h b/gdb/ppc-linux-tdep.h new file mode 100644 index 00000000000..0ac76d37dbf --- /dev/null +++ b/gdb/ppc-linux-tdep.h @@ -0,0 +1,48 @@ +/* Target-dependent code for GDB, the GNU debugger. + + Copyright (C) 2008 Free Software Foundation, Inc. + + This file is part of GDB. + + 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 . */ + +#ifndef PPC_LINUX_TDEP_H +#define PPC_LINUX_TDEP_H + +struct regset; + +/* From ppc-linux-tdep.c ... */ +const struct regset *ppc_linux_gregset (int); +const struct regset *ppc_linux_fpregset (void); + +/* Extra register number constants. The Linux kernel stores a + "trap" code and the original value of r3 into special "registers"; + these need to be saved and restored when performing an inferior + call while the inferior was interrupted within a system call. */ +enum { + PPC_ORIG_R3_REGNUM = PPC_NUM_REGS, + PPC_TRAP_REGNUM, +}; + +/* Return 1 if PPC_ORIG_R3_REGNUM and PPC_TRAP_REGNUM are usable. */ +int ppc_linux_trap_reg_p (struct gdbarch *gdbarch); + +/* Linux target descriptions. */ +extern struct target_desc *tdesc_powerpc_32l; +extern struct target_desc *tdesc_powerpc_altivec32l; +extern struct target_desc *tdesc_powerpc_e500l; +extern struct target_desc *tdesc_powerpc_64l; +extern struct target_desc *tdesc_powerpc_altivec64l; + +#endif /* PPC_LINUX_TDEP_H */ diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h index 63423c9e19e..472371a1651 100644 --- a/gdb/ppc-tdep.h +++ b/gdb/ppc-tdep.h @@ -27,7 +27,7 @@ struct value; struct regcache; struct type; -/* From ppc-linux-tdep.c... */ +/* From ppc-sysv-tdep.c ... */ enum return_value_convention ppc_sysv_abi_return_value (struct gdbarch *gdbarch, struct type *func_type, struct type *valtype, @@ -56,10 +56,6 @@ CORE_ADDR ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR struct_addr); CORE_ADDR ppc64_sysv_abi_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr); -int ppc_linux_memory_remove_breakpoint (struct gdbarch *, struct bp_target_info *); -struct link_map_offsets *ppc_linux_svr4_fetch_link_map_offsets (void); -const struct regset *ppc_linux_gregset (int); -const struct regset *ppc_linux_fpregset (void); enum return_value_convention ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct type *func_type, @@ -107,6 +103,12 @@ struct ppc_reg_offsets int vrsave_offset; }; +extern void ppc_supply_reg (struct regcache *regcache, int regnum, + const gdb_byte *regs, size_t offset, int regsize); + +extern void ppc_collect_reg (const struct regcache *regcache, int regnum, + gdb_byte *regs, size_t offset, int regsize); + /* Supply register REGNUM in the general-purpose register set REGSET from the buffer specified by GREGS and LEN to register cache REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ @@ -268,6 +270,4 @@ enum { /* Estimate for the maximum number of instrctions in a function epilogue. */ #define PPC_MAX_EPILOGUE_INSTRUCTIONS 52 -extern struct target_desc *tdesc_powerpc_e500; - #endif /* ppc-tdep.h */ diff --git a/gdb/regformats/reg-ppc.dat b/gdb/regformats/rs6000/powerpc-32l.dat similarity index 81% rename from gdb/regformats/reg-ppc.dat rename to gdb/regformats/rs6000/powerpc-32l.dat index 2337d45d7e0..01e2542bd0c 100644 --- a/gdb/regformats/reg-ppc.dat +++ b/gdb/regformats/rs6000/powerpc-32l.dat @@ -1,4 +1,6 @@ -name:ppc +# DO NOT EDIT: generated from rs6000/powerpc-32l.xml +name:powerpc_32l +xmltarget:powerpc-32l.xml expedite:r1,pc 32:r0 32:r1 @@ -32,7 +34,6 @@ expedite:r1,pc 32:r29 32:r30 32:r31 - 64:f0 64:f1 64:f2 @@ -65,12 +66,12 @@ expedite:r1,pc 64:f29 64:f30 64:f31 - 32:pc 32:msr - 32:cr 32:lr 32:ctr 32:xer 32:fpscr +32:orig_r3 +32:trap diff --git a/gdb/regformats/reg-ppc64.dat b/gdb/regformats/rs6000/powerpc-64l.dat similarity index 81% rename from gdb/regformats/reg-ppc64.dat rename to gdb/regformats/rs6000/powerpc-64l.dat index 16d7440d9ec..28583bcb173 100644 --- a/gdb/regformats/reg-ppc64.dat +++ b/gdb/regformats/rs6000/powerpc-64l.dat @@ -1,4 +1,6 @@ -name:ppc64 +# DO NOT EDIT: generated from rs6000/powerpc-64l.xml +name:powerpc_64l +xmltarget:powerpc-64l.xml expedite:r1,pc 64:r0 64:r1 @@ -32,7 +34,6 @@ expedite:r1,pc 64:r29 64:r30 64:r31 - 64:f0 64:f1 64:f2 @@ -65,12 +66,12 @@ expedite:r1,pc 64:f29 64:f30 64:f31 - 64:pc 64:msr - 32:cr 64:lr 64:ctr 32:xer 32:fpscr +64:orig_r3 +64:trap diff --git a/gdb/regformats/rs6000/powerpc-32.dat b/gdb/regformats/rs6000/powerpc-altivec32l.dat similarity index 85% rename from gdb/regformats/rs6000/powerpc-32.dat rename to gdb/regformats/rs6000/powerpc-altivec32l.dat index 840d68e568d..52af0e33aad 100644 --- a/gdb/regformats/rs6000/powerpc-32.dat +++ b/gdb/regformats/rs6000/powerpc-altivec32l.dat @@ -1,6 +1,6 @@ -# DO NOT EDIT: generated from rs6000/powerpc-32.xml -name:powerpc_32 -xmltarget:powerpc-32.xml +# DO NOT EDIT: generated from rs6000/powerpc-altivec32l.xml +name:powerpc_altivec32l +xmltarget:powerpc-altivec32l.xml expedite:r1,pc 32:r0 32:r1 @@ -73,6 +73,8 @@ expedite:r1,pc 32:ctr 32:xer 32:fpscr +32:orig_r3 +32:trap 128:vr0 128:vr1 128:vr2 diff --git a/gdb/regformats/rs6000/powerpc-64.dat b/gdb/regformats/rs6000/powerpc-altivec64l.dat similarity index 85% rename from gdb/regformats/rs6000/powerpc-64.dat rename to gdb/regformats/rs6000/powerpc-altivec64l.dat index 1f2a68f76b4..dc14165fe1d 100644 --- a/gdb/regformats/rs6000/powerpc-64.dat +++ b/gdb/regformats/rs6000/powerpc-altivec64l.dat @@ -1,6 +1,6 @@ -# DO NOT EDIT: generated from rs6000/powerpc-64.xml -name:powerpc_64 -xmltarget:powerpc-64.xml +# DO NOT EDIT: generated from rs6000/powerpc-altivec64l.xml +name:powerpc_altivec64l +xmltarget:powerpc-altivec64l.xml expedite:r1,pc 64:r0 64:r1 @@ -73,6 +73,8 @@ expedite:r1,pc 64:ctr 32:xer 32:fpscr +64:orig_r3 +64:trap 128:vr0 128:vr1 128:vr2 diff --git a/gdb/regformats/rs6000/powerpc-e500.dat b/gdb/regformats/rs6000/powerpc-e500l.dat similarity index 82% rename from gdb/regformats/rs6000/powerpc-e500.dat rename to gdb/regformats/rs6000/powerpc-e500l.dat index a8e06d05ba4..579d5c288ea 100644 --- a/gdb/regformats/rs6000/powerpc-e500.dat +++ b/gdb/regformats/rs6000/powerpc-e500l.dat @@ -1,6 +1,6 @@ -# DO NOT EDIT: generated from rs6000/powerpc-e500.xml -name:powerpc_e500 -xmltarget:powerpc-e500.xml +# DO NOT EDIT: generated from rs6000/powerpc-e500l.xml +name:powerpc_e500l +xmltarget:powerpc-e500l.xml expedite:r1,pc 32:r0 32:r1 @@ -73,5 +73,7 @@ expedite:r1,pc 32:ctr 32:xer 0: +32:orig_r3 +32:trap 64:acc 32:spefscr diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 07f2b786282..8de3a602e33 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -64,6 +64,7 @@ #include "rs6000-tdep.h" #include "features/rs6000/powerpc-32.c" +#include "features/rs6000/powerpc-altivec32.c" #include "features/rs6000/powerpc-403.c" #include "features/rs6000/powerpc-403gc.c" #include "features/rs6000/powerpc-505.c" @@ -72,6 +73,7 @@ #include "features/rs6000/powerpc-603.c" #include "features/rs6000/powerpc-604.c" #include "features/rs6000/powerpc-64.c" +#include "features/rs6000/powerpc-altivec64.c" #include "features/rs6000/powerpc-7400.c" #include "features/rs6000/powerpc-750.c" #include "features/rs6000/powerpc-860.c" @@ -376,7 +378,7 @@ rs6000_register_sim_regno (struct gdbarch *gdbarch, int reg) /* REGS + OFFSET contains register REGNUM in a field REGSIZE wide. Write the register to REGCACHE. */ -static void +void ppc_supply_reg (struct regcache *regcache, int regnum, const gdb_byte *regs, size_t offset, int regsize) { @@ -397,7 +399,7 @@ ppc_supply_reg (struct regcache *regcache, int regnum, /* Read register REGNUM from REGCACHE and store to REGS + OFFSET in a field REGSIZE wide. Zero pad as necessary. */ -static void +void ppc_collect_reg (const struct regcache *regcache, int regnum, gdb_byte *regs, size_t offset, int regsize) { @@ -2857,7 +2859,7 @@ struct variant static struct variant variants[] = { {"powerpc", "PowerPC user-level", bfd_arch_powerpc, - bfd_mach_ppc, &tdesc_powerpc_32}, + bfd_mach_ppc, &tdesc_powerpc_altivec32}, {"power", "POWER user-level", bfd_arch_rs6000, bfd_mach_rs6k, &tdesc_rs6000}, {"403", "IBM PowerPC 403", bfd_arch_powerpc, @@ -2885,7 +2887,7 @@ static struct variant variants[] = /* 64-bit */ {"powerpc64", "PowerPC 64-bit user-level", bfd_arch_powerpc, - bfd_mach_ppc64, &tdesc_powerpc_64}, + bfd_mach_ppc64, &tdesc_powerpc_altivec64}, {"620", "Motorola PowerPC 620", bfd_arch_powerpc, bfd_mach_ppc_620, &tdesc_powerpc_64}, {"630", "Motorola PowerPC 630", bfd_arch_powerpc, @@ -3902,6 +3904,7 @@ _initialize_rs6000_tdep (void) /* Initialize the standard target descriptions. */ initialize_tdesc_powerpc_32 (); + initialize_tdesc_powerpc_altivec32 (); initialize_tdesc_powerpc_403 (); initialize_tdesc_powerpc_403gc (); initialize_tdesc_powerpc_505 (); @@ -3910,6 +3913,7 @@ _initialize_rs6000_tdep (void) initialize_tdesc_powerpc_603 (); initialize_tdesc_powerpc_604 (); initialize_tdesc_powerpc_64 (); + initialize_tdesc_powerpc_altivec64 (); initialize_tdesc_powerpc_7400 (); initialize_tdesc_powerpc_750 (); initialize_tdesc_powerpc_860 (); -- 2.30.2