X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Famd64-fbsd-nat.c;h=7f85b6a44894ed20a012bb4b79b4fa8ab759c187;hb=refs%2Fheads%2Fconcurrent-displaced-stepping-2020-04-01;hp=57e6ff2813b5a09fa8fdd71f56233c47954c468e;hpb=f6ac5f3d63e03a81c4ff3749aba234961cc9090e;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/amd64-fbsd-nat.c b/gdb/amd64-fbsd-nat.c index 57e6ff2813..7f85b6a448 100644 --- a/gdb/amd64-fbsd-nat.c +++ b/gdb/amd64-fbsd-nat.c @@ -1,6 +1,6 @@ /* Native-dependent code for FreeBSD/amd64. - Copyright (C) 2003-2018 Free Software Foundation, Inc. + Copyright (C) 2003-2020 Free Software Foundation, Inc. This file is part of GDB. @@ -34,7 +34,7 @@ #include "amd64-nat.h" #include "amd64-bsd-nat.h" #include "x86-nat.h" -#include "x86-xstate.h" +#include "gdbsupport/x86-xstate.h" class amd64_fbsd_nat_target final @@ -45,7 +45,7 @@ public: const struct target_desc *read_description () override; #if defined(HAVE_PT_GETDBREGS) && defined(USE_SIGTRAP_SIGINFO) - int supports_stopped_by_hw_breakpoint () override; + bool supports_stopped_by_hw_breakpoint () override; #endif }; @@ -131,24 +131,24 @@ amd64fbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb) return 0; pcb->pcb_rsp += 8; - regcache_raw_supply (regcache, AMD64_RIP_REGNUM, &pcb->pcb_rip); - regcache_raw_supply (regcache, AMD64_RBX_REGNUM, &pcb->pcb_rbx); - regcache_raw_supply (regcache, AMD64_RSP_REGNUM, &pcb->pcb_rsp); - regcache_raw_supply (regcache, AMD64_RBP_REGNUM, &pcb->pcb_rbp); - regcache_raw_supply (regcache, 12, &pcb->pcb_r12); - regcache_raw_supply (regcache, 13, &pcb->pcb_r13); - regcache_raw_supply (regcache, 14, &pcb->pcb_r14); - regcache_raw_supply (regcache, 15, &pcb->pcb_r15); + regcache->raw_supply (AMD64_RIP_REGNUM, &pcb->pcb_rip); + regcache->raw_supply (AMD64_RBX_REGNUM, &pcb->pcb_rbx); + regcache->raw_supply (AMD64_RSP_REGNUM, &pcb->pcb_rsp); + regcache->raw_supply (AMD64_RBP_REGNUM, &pcb->pcb_rbp); + regcache->raw_supply (12, &pcb->pcb_r12); + regcache->raw_supply (13, &pcb->pcb_r13); + regcache->raw_supply (14, &pcb->pcb_r14); + regcache->raw_supply (15, &pcb->pcb_r15); #if (__FreeBSD_version < 800075) && (__FreeBSD_kernel_version < 800075) /* struct pcb provides the pcb_ds/pcb_es/pcb_fs/pcb_gs fields only up until __FreeBSD_version 800074: The removal of these fields occurred on 2009-04-01 while the __FreeBSD_version number was bumped to 800075 on 2009-04-06. So 800075 is the closest version number where we should not try to access these fields. */ - regcache_raw_supply (regcache, AMD64_DS_REGNUM, &pcb->pcb_ds); - regcache_raw_supply (regcache, AMD64_ES_REGNUM, &pcb->pcb_es); - regcache_raw_supply (regcache, AMD64_FS_REGNUM, &pcb->pcb_fs); - regcache_raw_supply (regcache, AMD64_GS_REGNUM, &pcb->pcb_gs); + regcache->raw_supply (AMD64_DS_REGNUM, &pcb->pcb_ds); + regcache->raw_supply (AMD64_ES_REGNUM, &pcb->pcb_es); + regcache->raw_supply (AMD64_FS_REGNUM, &pcb->pcb_fs); + regcache->raw_supply (AMD64_GS_REGNUM, &pcb->pcb_gs); #endif return 1; @@ -167,7 +167,7 @@ amd64_fbsd_nat_target::read_description () struct reg regs; int is64; - if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), + if (ptrace (PT_GETREGS, inferior_ptid.pid (), (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); is64 = (regs.r_cs == GSEL (GUCODE_SEL, SEL_UPL)); @@ -176,7 +176,7 @@ amd64_fbsd_nat_target::read_description () { struct ptrace_xstate_info info; - if (ptrace (PT_GETXSTATE_INFO, ptid_get_pid (inferior_ptid), + if (ptrace (PT_GETXSTATE_INFO, inferior_ptid.pid (), (PTRACE_TYPE_ARG3) &info, sizeof (info)) == 0) { x86bsd_xsave_len = info.xsave_len; @@ -188,36 +188,37 @@ amd64_fbsd_nat_target::read_description () if (x86bsd_xsave_len != 0) { if (is64) - return amd64_target_description (xcr0); + return amd64_target_description (xcr0, true); else - return i386_target_description (xcr0); + return i386_target_description (xcr0, true); } #endif if (is64) - return amd64_target_description (X86_XSTATE_SSE_MASK); + return amd64_target_description (X86_XSTATE_SSE_MASK, true); else - return i386_target_description (X86_XSTATE_SSE_MASK); + return i386_target_description (X86_XSTATE_SSE_MASK, true); } #if defined(HAVE_PT_GETDBREGS) && defined(USE_SIGTRAP_SIGINFO) /* Implement the supports_stopped_by_hw_breakpoints method. */ -int +bool amd64_fbsd_nat_target::supports_stopped_by_hw_breakpoint () { - return 1; + return true; } #endif +void _initialize_amd64fbsd_nat (); void -_initialize_amd64fbsd_nat (void) +_initialize_amd64fbsd_nat () { int offset; amd64_native_gregset32_reg_offset = amd64fbsd32_r_reg_offset; amd64_native_gregset64_reg_offset = amd64fbsd64_r_reg_offset; - add_target (&the_amd64_fbsd_nat_target); + add_inf_child_target (&the_amd64_fbsd_nat_target); /* Support debugging kernel virtual memory images. */ bsd_kvm_add_target (amd64fbsd_supply_pcb);