From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ALRNA8p+YWYlUygAWB0awg (envelope-from ) for ; Thu, 06 Jun 2024 05:18:02 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=L07K7hYS; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 06EBD1E0C0; Thu, 6 Jun 2024 05:18:02 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id E37621E092 for ; Thu, 6 Jun 2024 05:17:59 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 701B438FC320 for ; Thu, 6 Jun 2024 09:17:59 +0000 (GMT) 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 924EF38F981D for ; Thu, 6 Jun 2024 09:16:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 924EF38F981D 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 924EF38F981D 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=1717665388; cv=none; b=plyDicZpeDSb1k1QxsbsF0mrkpi3kuC9T/tLM9v2umMddMP9JhW9uzl/L/OYtAjBRWxIIw6bRRfpvwhwPevZvsruL/1Und5UAcErb2+Vznp24UiQ8QsU8wPG2qbSqOgms9nv2F+lRtnEx9HSmZJXHX0OAArq8C+42F9qeX8rWYI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717665388; c=relaxed/simple; bh=vLleiqWqQVxilJpJ8X5A1CQcHGj9nmLfcHRmQYrIpe8=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=m77RpPmov0yGn8d2vbx0jKRhJz2E8rJ4o16CboRX1Mx+kABr9f8fLaGOmoDFca1sVLyCKUGctnUK4qjzY3YR+cQZJhYZGaEe7AJC0ym+Wrkj82BMaCD+TnXufFSOPSgvTKuzRaYFoxzAcRmq14z7T2iRcENbsMHahrCmEBLr+i0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717665384; 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=zS9kQ19FVvmdNFIQHwVuhCWPK43DE/z3GbvJDCEw2m8=; b=L07K7hYSOTkB5O7bd9hH4GCSSSNNRmRl6Yr38NWK9GtYI4t9N1cCNGkBiuyTepc1JEi0Ra 697fHiDVPEY7pWGAhAkD7zD7lAuPz4SPo9hBvRqFfKOKSwgc8zkNeUzQ2NPqSIKXslsgsb uE5kkD23ejifWZ8sXDL/CDHHlDKwyXk= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-179-4zJ6WFuPOLKv8okf15zaZQ-1; Thu, 06 Jun 2024 05:16:23 -0400 X-MC-Unique: 4zJ6WFuPOLKv8okf15zaZQ-1 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-52b963aa3feso585372e87.2 for ; Thu, 06 Jun 2024 02:16:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717665380; x=1718270180; 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=zS9kQ19FVvmdNFIQHwVuhCWPK43DE/z3GbvJDCEw2m8=; b=UEv+4uXqkd1RivhIEUkO1mTL2/m3usZa8A/bDlOrsxv9T0DQukOKgBFzQynA0B+V8o lAbLfE5HI/HfknwbO0JS4cftu4JF4HsXR9STUsTYXtdlF1WX1rKK+qAi6TfMnCnar4Vv 7bikAQcZE8E2yCa/XHz6TXwGDhow6QhOnMNlvXrdRfkgLOzCvOYVQDb6OWYk3o8/OnCH B5KuigCe/gpjYpaIvWl66yxT8dQzIYTW4ayK3LfrToWXU8VIzfi28HN1B+5OtOmcxQMp VLEvtfXek/mAPba8tcB1H9ERCOeUCXv9khCRsVHRnSXUYjD+8/wmt0ixiJ6LqfnQPhVZ sFrQ== X-Gm-Message-State: AOJu0YyUuh+Bt0bmdglYEDvGNwagwF3ZAzK1MAOs6uQrtfqKUyljcX/i 4OfuGcG+ul7GZ6p00DJv0RiQtSW8dtOFlq2oW7F0tuI6tdUSrIm+CjoSq2QLElYyiPgXOv3UC3m djXfHM/0ottt9pUZlSDFVA7tqeklK3+avkAP3akNR1ywnkrHzee30pqHYhzSa0CAk8I3lw/Hakp /+Hx5c++3x4+ojtwisCTjKX9rQM0Jig9lmFNQ/TDfDhWQ= X-Received: by 2002:a05:6512:3c82:b0:52b:7bde:896b with SMTP id 2adb3069b0e04-52bab4cb8e1mr3272471e87.14.1717665380470; Thu, 06 Jun 2024 02:16:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IED0XhE0QX3MseNzG2Yj0ATYCzRumZgxFZv4tWJCw4psX35Cq9oJCGpSTv+OxTC4oK9g0VcIw== X-Received: by 2002:a05:6512:3c82:b0:52b:7bde:896b with SMTP id 2adb3069b0e04-52bab4cb8e1mr3272455e87.14.1717665379989; Thu, 06 Jun 2024 02:16:19 -0700 (PDT) Received: from localhost ([31.111.84.186]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215814f64fsm49402805e9.47.2024.06.06.02.16.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 02:16:17 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess , felix.willgerodt@intel.com Subject: [PATCHv8 4/9] gdb: move have_ptrace_getregset declaration into gdb/nat directory Date: Thu, 6 Jun 2024 10:16:00 +0100 Message-Id: <99962649827dfe847a1bafaa6f039c1f4402aa5e.1717664371.git.aburgess@redhat.com> 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=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org 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 c95d420d416..c0fe08a2a8b 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 92b16f7414e..f30a5f90e2a 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