diff options
author | John Baldwin <jhb@FreeBSD.org> | 2021-06-14 14:28:26 -0700 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2021-06-14 14:55:48 -0700 |
commit | 09db4332c6017ab57cd136788c48e5a81e3b9399 (patch) | |
tree | d0c6e194cab1c0161bd3c4b94f8980a6b5eb5614 /gdb/fbsd-nat.h | |
parent | c9923e71ff57ce6e824833560aae59057c6f5783 (diff) | |
download | gdb-09db4332c6017ab57cd136788c48e5a81e3b9399.zip gdb-09db4332c6017ab57cd136788c48e5a81e3b9399.tar.gz gdb-09db4332c6017ab57cd136788c48e5a81e3b9399.tar.bz2 |
fbsd nat: Disable address space randomization when requested.
Use procctl(2) with PROC_ASLR_CTL to disable address space
randomization in the current gdb process before forking a child
process for a new inferior when address space randomization is
disabled.
gdb/ChangeLog:
* configure.ac: Check for <sys/procctl.h>.
* config.in, configure: Regenerate.
* fbsd-nat.c: Include <sys/procctl.h> if present.
[PROC_ASLR_CTL] (maybe_disable_address_space_randomization): New.
(fbsd_nat_target::create_inferior)
(fbsd_nat_target::supports_disable_randomization): New.
* fbsd-nat.h (fbsd_nat_target::create_inferior)
(fbsd_nat_target::supports_disable_randomization): New.
Diffstat (limited to 'gdb/fbsd-nat.h')
-rw-r--r-- | gdb/fbsd-nat.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/fbsd-nat.h b/gdb/fbsd-nat.h index 772655d..1fdb939 100644 --- a/gdb/fbsd-nat.h +++ b/gdb/fbsd-nat.h @@ -67,6 +67,9 @@ public: thread_control_capabilities get_thread_control_capabilities () override { return tc_schedlock; } + void create_inferior (const char *, const std::string &, + char **, int) override; + void resume (ptid_t, int, enum gdb_signal) override; ptid_t wait (ptid_t, struct target_waitstatus *, target_wait_flags) override; @@ -98,6 +101,8 @@ public: #endif bool supports_multi_process () override; + + bool supports_disable_randomization () override; }; #endif /* fbsd-nat.h */ |