X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fsparc64-linux-tdep.c;h=a7f439fbb04dcc001181b719ac2f94ffa0f310e2;hb=refs%2Fheads%2Fconcurrent-displaced-stepping-2020-04-01;hp=2da978fbf80ced7a3593f292d690cf25935c1362;hpb=58afddc6c7c5eaacdb68cdc3cacd0f76a3d01490;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/sparc64-linux-tdep.c b/gdb/sparc64-linux-tdep.c index 2da978fbf8..a7f439fbb0 100644 --- a/gdb/sparc64-linux-tdep.c +++ b/gdb/sparc64-linux-tdep.c @@ -1,6 +1,6 @@ /* Target-dependent code for GNU/Linux UltraSPARC. - Copyright (C) 2003-2017 Free Software Foundation, Inc. + Copyright (C) 2003-2020 Free Software Foundation, Inc. This file is part of GDB. @@ -20,7 +20,7 @@ #include "defs.h" #include "frame.h" #include "frame-unwind.h" -#include "dwarf2-frame.h" +#include "dwarf2/frame.h" #include "regset.h" #include "regcache.h" #include "gdbarch.h" @@ -64,9 +64,9 @@ static const struct tramp_frame sparc64_linux_rt_sigframe = SIGTRAMP_FRAME, 4, { - { 0x82102065, -1 }, /* mov __NR_rt_sigreturn, %g1 */ - { 0x91d0206d, -1 }, /* ta 0x6d */ - { TRAMP_SENTINEL_INSN, -1 } + { 0x82102065, ULONGEST_MAX }, /* mov __NR_rt_sigreturn, %g1 */ + { 0x91d0206d, ULONGEST_MAX }, /* ta 0x6d */ + { TRAMP_SENTINEL_INSN, ULONGEST_MAX } }, sparc64_linux_sigframe_init }; @@ -120,7 +120,7 @@ sparc64_linux_sigframe_init (const struct tramp_frame *self, gdbarch hook. Displays information related to ADI memory corruptions. */ -void +static void sparc64_linux_handle_segmentation_fault (struct gdbarch *gdbarch, struct ui_out *uiout) { @@ -130,7 +130,7 @@ sparc64_linux_handle_segmentation_fault (struct gdbarch *gdbarch, CORE_ADDR addr = 0; long si_code = 0; - TRY + try { /* Evaluate si_code to see if the segfault is ADI related. */ si_code = parse_and_eval_long ("$_siginfo.si_code\n"); @@ -138,11 +138,10 @@ sparc64_linux_handle_segmentation_fault (struct gdbarch *gdbarch, if (si_code >= SEGV_ACCADI && si_code <= SEGV_ADIPERR) addr = parse_and_eval_long ("$_siginfo._sifields._sigfault.si_addr"); } - CATCH (exception, RETURN_MASK_ALL) + catch (const gdb_exception &exception) { return; } - END_CATCH /* Print out ADI event based on sig_code value */ switch (si_code) @@ -151,19 +150,19 @@ sparc64_linux_handle_segmentation_fault (struct gdbarch *gdbarch, uiout->text ("\n"); uiout->field_string ("sigcode-meaning", _("ADI disabled")); uiout->text (_(" while accessing address ")); - uiout->field_fmt ("bound-access", "%s", paddress (gdbarch, addr)); + uiout->field_core_addr ("bound-access", gdbarch, addr); break; case SEGV_ADIDERR: /* disrupting mismatch */ uiout->text ("\n"); uiout->field_string ("sigcode-meaning", _("ADI deferred mismatch")); uiout->text (_(" while accessing address ")); - uiout->field_fmt ("bound-access", "%s", paddress (gdbarch, addr)); + uiout->field_core_addr ("bound-access", gdbarch, addr); break; case SEGV_ADIPERR: /* precise mismatch */ uiout->text ("\n"); uiout->field_string ("sigcode-meaning", _("ADI precise mismatch")); uiout->text (_(" while accessing address ")); - uiout->field_fmt ("bound-access", "%s", paddress (gdbarch, addr)); + uiout->field_core_addr ("bound-access", gdbarch, addr); break; default: break; @@ -261,7 +260,7 @@ sparc64_linux_collect_core_fpregset (const struct regset *regset, static void sparc64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc) { - struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache)); + struct gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ()); ULONGEST state; regcache_cooked_write_unsigned (regcache, tdep->pc_regnum, pc); @@ -282,9 +281,9 @@ sparc64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc) static LONGEST sparc64_linux_get_syscall_number (struct gdbarch *gdbarch, - ptid_t ptid) + thread_info *thread) { - struct regcache *regcache = get_thread_regcache (ptid); + struct regcache *regcache = get_thread_regcache (thread); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); /* The content of a register. */ gdb_byte buf[8]; @@ -294,7 +293,7 @@ sparc64_linux_get_syscall_number (struct gdbarch *gdbarch, /* Getting the system call number from the register. When dealing with the sparc architecture, this information is stored at the %g1 register. */ - regcache_cooked_read (regcache, SPARC_G1_REGNUM, buf); + regcache->cooked_read (SPARC_G1_REGNUM, buf); ret = extract_signed_integer (buf, 8, byte_order); @@ -408,13 +407,10 @@ sparc64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_handle_segmentation_fault (gdbarch, sparc64_linux_handle_segmentation_fault); } - - -/* Provide a prototype to silence -Wmissing-prototypes. */ -extern void _initialize_sparc64_linux_tdep (void); +void _initialize_sparc64_linux_tdep (); void -_initialize_sparc64_linux_tdep (void) +_initialize_sparc64_linux_tdep () { gdbarch_register_osabi (bfd_arch_sparc, bfd_mach_sparc_v9, GDB_OSABI_LINUX, sparc64_linux_init_abi);