]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: move have_ptrace_getregset declaration into gdb/nat directory
authorAndrew Burgess <aburgess@redhat.com>
Wed, 8 May 2024 14:04:56 +0000 (15:04 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Fri, 14 Jun 2024 08:08:45 +0000 (09:08 +0100)
In a later commit I want to access have_ptrace_getregset from a .c
file in the nat/ directory.  To achieve this I need access to the
declaration of have_ptrace_getregset.

Currently have_ptrace_getregset is declared (and defined) twice, once
in GDB and once in gdbserver.

This commit moves the declaration into nat/linux-nat.h, but leaves the
two definitions where they are.  Now, in my later commit, I can pull
in the declaration from nat/linux-nat.h.

There should be no user visible changes after this commit.

Approved-By: Felix Willgerodt <felix.willgerodt@intel.com>
gdb/linux-nat.c
gdb/linux-nat.h
gdb/nat/linux-nat.h
gdbserver/linux-low.cc
gdbserver/linux-low.h

index c95d420d416e4c0cdbb130a9a659faf641608d14..c0fe08a2a8b5944560fbe706f38ad3058e354a72 100644 (file)
@@ -243,7 +243,7 @@ PTRACE_PEEKTEXT/PTRACE_POKETEXT or process_vm_readv/process_vm_writev:
 
 struct linux_nat_target *linux_target;
 
-/* Does the current host support PTRACE_GETREGSET?  */
+/* See nat/linux-nat.h.  */
 enum tribool have_ptrace_getregset = TRIBOOL_UNKNOWN;
 
 /* When true, print debug messages relating to the linux native target.  */
index 92b16f7414e00f99041fa95c410ca5dbb527a13b..f30a5f90e2a86d3d4b8366ef16dbda1398924bde 100644 (file)
@@ -299,9 +299,6 @@ lwp_info_range all_lwps ();
 
 lwp_info_safe_range all_lwps_safe ();
 
-/* Does the current host support PTRACE_GETREGSET?  */
-extern enum tribool have_ptrace_getregset;
-
 /* Called from the LWP layer to inform the thread_db layer that PARENT
    spawned CHILD.  Both LWPs are currently stopped.  This function
    does whatever is required to have the child LWP under the
index d4a36cbb601030e71d8cf89969e22901f8020476..b9fba7924b9abcfc44ffbba3d7b8657e63fd3bdd 100644 (file)
@@ -36,6 +36,9 @@ struct arch_lwp_info;
    instead SIGTRAP with bit 7 set.  */
 #define SYSCALL_SIGTRAP (SIGTRAP | 0x80)
 
+/* Does the current host support PTRACE_GETREGSET?  */
+extern tribool have_ptrace_getregset;
+
 /* Return the ptid of the current lightweight process.  With NPTL
    threads and LWPs map 1:1, so this is equivalent to returning the
    ptid of the current thread.  This function must be provided by
index ac7f9807eccb19aae1911ec81dc124c3ced7a13f..266c7de8fb8bc810f9a7e1c52058dda30005e809 100644 (file)
@@ -133,7 +133,7 @@ typedef struct
 } Elf64_auxv_t;
 #endif
 
-/* Does the current host support PTRACE_GETREGSET?  */
+/* See nat/linux-nat.h.  */
 enum tribool have_ptrace_getregset = TRIBOOL_UNKNOWN;
 
 /* Return TRUE if THREAD is the leader thread of the process.  */
index eaf875273386e83c8dbb48a5d745f3b1d626a019..273c04626b876f6818a6f815d39be0e9860784d1 100644 (file)
@@ -951,8 +951,6 @@ void thread_db_notice_clone (struct thread_info *parent_thr, ptid_t child_ptid);
 
 bool thread_db_thread_handle (ptid_t ptid, gdb_byte **handle, int *handle_len);
 
-extern enum tribool have_ptrace_getregset;
-
 /* Search for the value with type MATCH in the auxv vector, with entries of
    length WORDSIZE bytes, of process with pid PID.  If found, store the
    value in *VALP and return 1.  If not found or if there is an error,