From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 4E8A13870879 for ; Sat, 11 May 2024 10:09:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4E8A13870879 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4E8A13870879 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715422142; cv=none; b=HAODhNG/CpPM9vjUba/xFy1YITCxuPMG+bTIlY/tiIyJXWlC6ZCbeEq2t7f6xDNOkt/7NBKMR3KyDX8hh70jTm+fye5O7g9WthRsZChWaH3Vtrk0yp8SkvkHm/oCzhSRLYAk95tg3ZaK3TM/plJJZak92van2rq9I5tNOrFCbCY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715422142; c=relaxed/simple; bh=qnCvlbll2Ks1a83d+MtZcCImE/tYmOzu1/fkk8zs9/A=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=XdomADFjAESC3WHhbVvywv8AhUylGCkywXslVYz1Y5OtHVpQMnOcqNUPMZXrI+OxojMANiX3nws/geONEURHzrmD2pwKm5HRYgNEXZ2+Y1r9ITSq+nd7wPV3JyJuSnBbP+rk2jtkpIpaoywuCJnZyOTWHLSYWrvfxISuCfivKTE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715422139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dKk0xRQF8UjVvY03T3b9YvS0c8m504L8/vDhlC69pcg=; b=i8KMT75KOalgYt5AaG1n3PEAm2pidb2ta8a1LJk6qu3WqM2LjtHcBHCPEoSZwlCmWzWhLC sBnWhBmc0HpQ0Vwx+xBOaE31fvT+rNzEynwe22zNm5hsR8tZndsJDVNxXVAoU2YbQjYUX1 bOb6a86qYFyTMBHDzwrA7sMBGWpJABA= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-607-sUdiiqIcOqmmoI7ZHwubZg-1; Sat, 11 May 2024 06:08:58 -0400 X-MC-Unique: sUdiiqIcOqmmoI7ZHwubZg-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-41fef7df68eso7445145e9.3 for ; Sat, 11 May 2024 03:08:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715422137; x=1716026937; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dKk0xRQF8UjVvY03T3b9YvS0c8m504L8/vDhlC69pcg=; b=iUMMhIUdDTQvBip+mvKxIgZSUGJKicuDseVQbmQVXLKV1DyVyQPSV2p1HwpMGlBRXf 3UqHYYAJBiW96wSM3SV6P9+YXPgEPnif9QQ3odBAD/DeFjuBTc963QoE87vN+1DvQjIp OWmOrzYjJ/UjXfxdEBTLalyw2aLhG0IA1/wiR7OGwzaeiq7+epQGbbWb0aOpPZt5pPX2 /p1NMkevV6t34y9V0OsA8jAY47DtZyc5BpC2/lG3qhUDMeALHmwtf9MrDzvLOPKPkfMv zEtl9DCujuqmAdMOrnQGebhDoinzPKiNk9Iw8a95rBN87DDLww1PPvkR96kyEVebVtcP 3kXQ== X-Gm-Message-State: AOJu0YwYymm6NJ8da01ftQEAlzqMrvTSe3Aikej9seWyhaHOgp9FZMZf na4rPMOH4k3MdjfKBiBq6Mx8tfM9EG1qz6uvsG+hFYqd/utVh8lm4I142xg7gP4Dc0MbaTDKK7E OirhiW8QVbJ6HZbP0sLz+yw3G39R2cFHo/swVpVX4r8QhPOyCvy0gQTaOtAZHXoXvLbYaNzIrYm Q6FWjX1GFmb5diMYGPaHaQhld8pNvs4+9lTpBq5DjilyU= X-Received: by 2002:a05:600c:450e:b0:41c:8754:8796 with SMTP id 5b1f17b1804b1-41feac4960bmr33450305e9.30.1715422136714; Sat, 11 May 2024 03:08:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkwb9PjJSYL9mX8i4JebADigcvri0G8S88FmqiTP2KTcnBnNUtngLgwNm2oki392sBJ6982A== X-Received: by 2002:a05:600c:450e:b0:41c:8754:8796 with SMTP id 5b1f17b1804b1-41feac4960bmr33450175e9.30.1715422136238; Sat, 11 May 2024 03:08:56 -0700 (PDT) Received: from localhost (92.40.185.101.threembb.co.uk. [92.40.185.101]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccfe1527sm91831615e9.44.2024.05.11.03.08.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 03:08:55 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess , felix.willgerodt@intel.com, jhb@FreeBSD.org Subject: [PATCHv7 4/9] gdb: move have_ptrace_getregset declaration into gdb/nat directory Date: Sat, 11 May 2024 11:08:34 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_ABUSEAT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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. --- gdb/linux-nat.c | 2 +- gdb/linux-nat.h | 3 --- gdb/nat/linux-nat.h | 3 +++ gdbserver/linux-low.cc | 2 +- gdbserver/linux-low.h | 2 -- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 48ecd3627ca..a342e06fd53 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -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. */ diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h index 4dcbe9e170a..fd393df5020 100644 --- a/gdb/linux-nat.h +++ b/gdb/linux-nat.h @@ -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 diff --git a/gdb/nat/linux-nat.h b/gdb/nat/linux-nat.h index d4a36cbb601..b9fba7924b9 100644 --- a/gdb/nat/linux-nat.h +++ b/gdb/nat/linux-nat.h @@ -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 diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc index ac7f9807ecc..266c7de8fb8 100644 --- a/gdbserver/linux-low.cc +++ b/gdbserver/linux-low.cc @@ -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. */ diff --git a/gdbserver/linux-low.h b/gdbserver/linux-low.h index eaf87527338..273c04626b8 100644 --- a/gdbserver/linux-low.h +++ b/gdbserver/linux-low.h @@ -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, -- 2.25.4