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 B975C384AB64 for ; Wed, 8 May 2024 16:46:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B975C384AB64 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 B975C384AB64 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=1715186821; cv=none; b=vZ6wbWIYV2K+oRcB0T+B6M07mW3MYTLNTGddyq9ogqziV2tRPku+/GPeWhiILIeqtfDJ8+sOCzGRDQoDk3F74xCB4ydCoB68RwUl0vaof+PrQs24u20SfSGdPmF8SEtAbhuiFffUSvR52LebkHIj5wPEYLzolOAHWcO7/MqHUYE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715186821; c=relaxed/simple; bh=Cc9RY17pLyzo1U/P1qA1KCLDIjwMfNvEKJJzNgnV3Ks=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=dbIn2vTmNqLLDp3w4s9tW5q2f08HmITx4IulEYKLo/YqZv+kUDnJFwLpr3kFhsu4tzwRO4f+Y9riavC2o4QcqVGchmbj9HEXzbdSGnp5fkojvCtbp0RmUcHGVS9zIkOqyFBVhOA2LcLzLdHpre4lZlpg9TCRwe+dMe+7NaB6uU4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715186815; 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=XBhV9X8GKy7XGYDixSkd0KphFA109YWEI0EQGs7UQbI=; b=jA+tJ/8gDR3iDwtF+Ki1gVFgZHubtPTn0173t8Uyfcumza2zF36rqBmK2vNkjXut4AXpMs 0iOBLH/5P4BADY+/0zv/gGgPBvcvw7jILPknFje4UEB3iwkwZ6HVKEnngJ4Iyhv5YmPeHj Gq4XRTDH63jPq4ksyf77SAd2GGOeyKI= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-441-jksxdXYtOiK7muU-53RvYA-1; Wed, 08 May 2024 12:46:54 -0400 X-MC-Unique: jksxdXYtOiK7muU-53RvYA-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-34da03e19beso3287834f8f.1 for ; Wed, 08 May 2024 09:46:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715186812; x=1715791612; 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=XBhV9X8GKy7XGYDixSkd0KphFA109YWEI0EQGs7UQbI=; b=hN5iJumNGOhFWeFgIdTbwXfjV+0OUNjD9xR1ROCDSWRQQ93feaVrvVRn0lrba1JrzY qOJGenXtVmSAHJhLwbyg7dWMEgdXrsPYlxa1BurllpJ1rcnWbc/26UHqhJZQPiJe8+6/ ZKVqMJrL3o+E4sxcdsDamzdqMjkPoR7+EGYp760gBxjzzzrOu2JMW/nrtiB5o+yVezE+ 3VPeEGoP48TfpTk8iYa8Stlzs5EK3964VeUbZMn1BPQ3cL6KSO/HYGLyaSShpSP4SlNH ZkuOglWiJhENRkyXRNLTLFljx1xzID3NcmqzRm/qivmYRkHZKTkC5UBIlgnygNFnO68q TpvA== X-Gm-Message-State: AOJu0YwbvXw8s/E5sURi1LB02atUTxzYuvWFyOKnTrrrPtooHkqxNGMh AJDFlN6Qk55wR3GPyuQx1QVsXwISHGudjvKSr/aTO8Yq/Z1dLBadgzLcuB7eCndeR+uKRR2jnfV fO8zWqle25/OPAI3ci2Jdr5iRny/yUhEZmUxB/wPHPzlphZG1Ls8MUM3mv5nxoE6jzvsV4B7OcW CLJOdfixc13bWLTYtWMlzHbBk9jF4seDuSIy2r5tDdgPA= X-Received: by 2002:adf:fa8a:0:b0:34c:ab55:bf1 with SMTP id ffacd0b85a97d-34fca05485dmr2393455f8f.2.1715186812438; Wed, 08 May 2024 09:46:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVh+B+nW8D/bgVkbEsiJqeOm+hhENrytHp7jfQd+aH1Oo3eNykNPxZS1LY8ysRYJCRSNh0dw== X-Received: by 2002:adf:fa8a:0:b0:34c:ab55:bf1 with SMTP id ffacd0b85a97d-34fca05485dmr2393435f8f.2.1715186811928; Wed, 08 May 2024 09:46:51 -0700 (PDT) Received: from localhost ([31.111.84.240]) by smtp.gmail.com with ESMTPSA id h18-20020a056000001200b0034c78001f6asm15731056wrx.109.2024.05.08.09.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 09:46:51 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess , felix.willgerodt@intel.com, jhb@FreeBSD.org Subject: [PATCHv6 4/9] gdb/x86: move have_ptrace_getregset global into gdb/nat directory Date: Wed, 8 May 2024 17:46:40 +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=-12.0 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 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: Just like the previous commit, this commit moves have_ptrace_getregset into the nat/ directory. This global is currently declared and defined in both GDB and gdbserver, but this can be merged and shared. There should be no user visible changes after this commit. --- gdb/linux-nat.c | 3 --- gdb/linux-nat.h | 3 --- gdb/nat/x86-linux.c | 3 +++ gdb/nat/x86-linux.h | 3 +++ gdbserver/linux-low.cc | 3 --- gdbserver/linux-low.h | 2 -- 6 files changed, 6 insertions(+), 11 deletions(-) diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 48ecd3627ca..38d3af56f39 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -243,9 +243,6 @@ PTRACE_PEEKTEXT/PTRACE_POKETEXT or process_vm_readv/process_vm_writev: struct linux_nat_target *linux_target; -/* Does the current host support PTRACE_GETREGSET? */ -enum tribool have_ptrace_getregset = TRIBOOL_UNKNOWN; - /* When true, print debug messages relating to the linux native target. */ static bool debug_linux_nat; 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/x86-linux.c b/gdb/nat/x86-linux.c index f394dc5d5e1..ed1d06bd623 100644 --- a/gdb/nat/x86-linux.c +++ b/gdb/nat/x86-linux.c @@ -29,6 +29,9 @@ tribool have_ptrace_getfpxregs = #endif ; +/* See nat/x86-linux.h. */ +tribool have_ptrace_getregset = TRIBOOL_UNKNOWN; + /* Per-thread arch-specific data we want to keep. */ struct arch_lwp_info diff --git a/gdb/nat/x86-linux.h b/gdb/nat/x86-linux.h index 936e20154a0..cb5f44f4b49 100644 --- a/gdb/nat/x86-linux.h +++ b/gdb/nat/x86-linux.h @@ -36,6 +36,9 @@ variable. */ extern tribool have_ptrace_getfpxregs; +/* Does the current host support PTRACE_GETREGSET? */ +extern tribool have_ptrace_getregset; + /* Set whether our local mirror of LWP's debug registers has been changed since the values were last written to the thread. Nonzero indicates that a change has been made, zero indicates no change. */ diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc index ac7f9807ecc..4ba56cd34ff 100644 --- a/gdbserver/linux-low.cc +++ b/gdbserver/linux-low.cc @@ -133,9 +133,6 @@ typedef struct } Elf64_auxv_t; #endif -/* Does the current host support PTRACE_GETREGSET? */ -enum tribool have_ptrace_getregset = TRIBOOL_UNKNOWN; - /* Return TRUE if THREAD is the leader thread of the process. */ static bool 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