X-Git-Url: http://drtracing.org/?a=blobdiff_plain;ds=sidebyside;f=gdb%2Fppc-nbsd-tdep.c;h=ba4e943a01a82a2c3c6dd847c6dd612227159b82;hb=bb6e55f3ee440c5d03fd47ec32255c20b9f895fe;hp=331540d1d67172f076bbfceeca00fee10a57d001;hpb=1736a7bd96e8927c3f889a35f9153df4fd19d833;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/ppc-nbsd-tdep.c b/gdb/ppc-nbsd-tdep.c index 331540d1d6..ba4e943a01 100644 --- a/gdb/ppc-nbsd-tdep.c +++ b/gdb/ppc-nbsd-tdep.c @@ -1,6 +1,6 @@ /* Target-dependent code for NetBSD/powerpc. - Copyright (C) 2002-2016 Free Software Foundation, Inc. + Copyright (C) 2002-2020 Free Software Foundation, Inc. Contributed by Wasabi Systems, Inc. @@ -28,7 +28,8 @@ #include "tramp-frame.h" #include "ppc-tdep.h" -#include "ppc-nbsd-tdep.h" +#include "nbsd-tdep.h" +#include "ppc-tdep.h" #include "solib-svr4.h" /* Register offsets from . */ @@ -59,8 +60,8 @@ ppcnbsd_iterate_over_regset_sections (struct gdbarch *gdbarch, void *cb_data, const struct regcache *regcache) { - cb (".reg", 148, &ppcnbsd_gregset, NULL, cb_data); - cb (".reg2", 264, &ppcnbsd_fpregset, NULL, cb_data); + cb (".reg", 148, 148, &ppcnbsd_gregset, NULL, cb_data); + cb (".reg2", 264, 264, &ppcnbsd_fpregset, NULL, cb_data); } @@ -74,8 +75,8 @@ ppcnbsd_return_value (struct gdbarch *gdbarch, struct value *function, gdb_byte *readbuf, const gdb_byte *writebuf) { #if 0 - if ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT - || TYPE_CODE (valtype) == TYPE_CODE_UNION) + if ((valtype->code () == TYPE_CODE_STRUCT + || valtype->code () == TYPE_CODE_UNION) && !((TYPE_LENGTH (valtype) == 16 || TYPE_LENGTH (valtype) == 8) && TYPE_VECTOR (valtype)) && !(TYPE_LENGTH (valtype) == 1 @@ -137,14 +138,14 @@ static const struct tramp_frame ppcnbsd_sigtramp = SIGTRAMP_FRAME, 4, { - { 0x3821fff0, -1 }, /* add r1,r1,-16 */ - { 0x4e800021, -1 }, /* blrl */ - { 0x38610018, -1 }, /* addi r3,r1,24 */ - { 0x38000127, -1 }, /* li r0,295 */ - { 0x44000002, -1 }, /* sc */ - { 0x38000001, -1 }, /* li r0,1 */ - { 0x44000002, -1 }, /* sc */ - { TRAMP_SENTINEL_INSN, -1 } + { 0x3821fff0, ULONGEST_MAX }, /* add r1,r1,-16 */ + { 0x4e800021, ULONGEST_MAX }, /* blrl */ + { 0x38610018, ULONGEST_MAX }, /* addi r3,r1,24 */ + { 0x38000127, ULONGEST_MAX }, /* li r0,295 */ + { 0x44000002, ULONGEST_MAX }, /* sc */ + { 0x38000001, ULONGEST_MAX }, /* li r0,1 */ + { 0x44000002, ULONGEST_MAX }, /* sc */ + { TRAMP_SENTINEL_INSN, ULONGEST_MAX } }, ppcnbsd_sigtramp_cache_init }; @@ -156,14 +157,14 @@ const struct tramp_frame ppcnbsd2_sigtramp = SIGTRAMP_FRAME, 4, { - { 0x3821fff0, -1 }, /* add r1,r1,-16 */ - { 0x4e800021, -1 }, /* blrl */ - { 0x38610010, -1 }, /* addi r3,r1,16 */ - { 0x38000127, -1 }, /* li r0,295 */ - { 0x44000002, -1 }, /* sc */ - { 0x38000001, -1 }, /* li r0,1 */ - { 0x44000002, -1 }, /* sc */ - { TRAMP_SENTINEL_INSN, -1 } + { 0x3821fff0, ULONGEST_MAX }, /* add r1,r1,-16 */ + { 0x4e800021, ULONGEST_MAX }, /* blrl */ + { 0x38610010, ULONGEST_MAX }, /* addi r3,r1,16 */ + { 0x38000127, ULONGEST_MAX }, /* li r0,295 */ + { 0x44000002, ULONGEST_MAX }, /* sc */ + { 0x38000001, ULONGEST_MAX }, /* li r0,1 */ + { 0x44000002, ULONGEST_MAX }, /* sc */ + { TRAMP_SENTINEL_INSN, ULONGEST_MAX } }, ppcnbsd_sigtramp_cache_init }; @@ -173,6 +174,8 @@ static void ppcnbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { + nbsd_init_abi (info, gdbarch); + /* For NetBSD, this is an on again, off again thing. Some systems do use the broken struct convention, and some don't. */ set_gdbarch_return_value (gdbarch, ppcnbsd_return_value); @@ -187,13 +190,10 @@ ppcnbsd_init_abi (struct gdbarch_info info, tramp_frame_prepend_unwinder (gdbarch, &ppcnbsd_sigtramp); tramp_frame_prepend_unwinder (gdbarch, &ppcnbsd2_sigtramp); } - - -/* Provide a prototype to silence -Wmissing-prototypes. */ -void _initialize_ppcnbsd_tdep (void); +void _initialize_ppcnbsd_tdep (); void -_initialize_ppcnbsd_tdep (void) +_initialize_ppcnbsd_tdep () { gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_NETBSD, ppcnbsd_init_abi); @@ -219,9 +219,5 @@ _initialize_ppcnbsd_tdep (void) ppcnbsd_reg_offsets.fpscr_offset = 256; ppcnbsd_reg_offsets.fpscr_size = 4; - /* AltiVec registers. */ - ppcnbsd_reg_offsets.vr0_offset = 0; - ppcnbsd_reg_offsets.vrsave_offset = 512; - ppcnbsd_reg_offsets.vscr_offset = 524; } }