diff options
Diffstat (limited to 'gdb/amd64-fbsd-nat.c')
-rw-r--r-- | gdb/amd64-fbsd-nat.c | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/gdb/amd64-fbsd-nat.c b/gdb/amd64-fbsd-nat.c index 07963f5..57e6ff2 100644 --- a/gdb/amd64-fbsd-nat.c +++ b/gdb/amd64-fbsd-nat.c @@ -32,11 +32,25 @@ #include "fbsd-nat.h" #include "amd64-tdep.h" #include "amd64-nat.h" -#include "x86-bsd-nat.h" +#include "amd64-bsd-nat.h" #include "x86-nat.h" #include "x86-xstate.h" +class amd64_fbsd_nat_target final + : public amd64_bsd_nat_target<fbsd_nat_target> +{ +public: + /* Add some extra features to the common *BSD/amd64 target. */ + const struct target_desc *read_description () override; + +#if defined(HAVE_PT_GETDBREGS) && defined(USE_SIGTRAP_SIGINFO) + int supports_stopped_by_hw_breakpoint () override; +#endif +}; + +static amd64_fbsd_nat_target the_amd64_fbsd_nat_target; + /* Offset in `struct reg' where MEMBER is stored. */ #define REG_OFFSET(member) offsetof (struct reg, member) @@ -141,10 +155,10 @@ amd64fbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb) } -/* Implement the to_read_description method. */ +/* Implement the read_description method. */ -static const struct target_desc * -amd64fbsd_read_description (struct target_ops *ops) +const struct target_desc * +amd64_fbsd_nat_target::read_description () { #ifdef PT_GETXSTATE_INFO static int xsave_probed; @@ -185,20 +199,25 @@ amd64fbsd_read_description (struct target_ops *ops) return i386_target_description (X86_XSTATE_SSE_MASK); } +#if defined(HAVE_PT_GETDBREGS) && defined(USE_SIGTRAP_SIGINFO) +/* Implement the supports_stopped_by_hw_breakpoints method. */ + +int +amd64_fbsd_nat_target::supports_stopped_by_hw_breakpoint () +{ + return 1; +} +#endif + void _initialize_amd64fbsd_nat (void) { - struct target_ops *t; int offset; amd64_native_gregset32_reg_offset = amd64fbsd32_r_reg_offset; amd64_native_gregset64_reg_offset = amd64fbsd64_r_reg_offset; - /* Add some extra features to the common *BSD/i386 target. */ - t = amd64bsd_target (); - t->to_read_description = amd64fbsd_read_description; - - fbsd_nat_add_target (t); + add_target (&the_amd64_fbsd_nat_target); /* Support debugging kernel virtual memory images. */ bsd_kvm_add_target (amd64fbsd_supply_pcb); |