Message ID | 20221117194241.1776125-7-simon.marchi@efficios.com |
---|---|
State | Committed |
Commit | c0cb02a4cf590f3cb64cdcc1b5bf539196333160 |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 329C4384F6C7 for <patchwork@sourceware.org>; Thu, 17 Nov 2022 19:43:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 329C4384F6C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668714198; bh=WnwvFYVnaRvNgww3L7g3SPdAxEqZLMzx6khPvtADvGE=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=jHJQH7LjWBLsBt5M4amRJOmgXdjSwH1quQnukqAmesRq5UYDDfd/ug+TbSRctFZMF vAL5SEnuCZWgx15OG2UDXnlDg9IAmLAxonT53XO6DHadBo6q4VFhXsc2qOgItjJ8Ou k/J/qCB4XjM/YPMhfkrYmVoIVWi74jxTz4l1i3Tc= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id AA6E23852C62 for <gdb-patches@sourceware.org>; Thu, 17 Nov 2022 19:42:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AA6E23852C62 X-ASG-Debug-ID: 1668714162-0c856e02a015b8f0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id xV6fVDHbW9rySttH (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Thu, 17 Nov 2022 14:42:42 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from epycamd.internal.efficios.com (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtp.ebox.ca (Postfix) with ESMTP id B9910441D67; Thu, 17 Nov 2022 14:42:42 -0500 (EST) X-Barracuda-RBL-IP: 192.222.180.24 X-Barracuda-Effective-Source-IP: 192-222-180-24.qc.cable.ebox.net[192.222.180.24] X-Barracuda-Apparent-Source-IP: 192.222.180.24 To: gdb-patches@sourceware.org Cc: Simon Marchi <simon.marchi@efficios.com> Subject: [PATCH 6/8] gdbserver: use current_process in ps_getpid Date: Thu, 17 Nov 2022 14:42:39 -0500 X-ASG-Orig-Subj: [PATCH 6/8] gdbserver: use current_process in ps_getpid Message-Id: <20221117194241.1776125-7-simon.marchi@efficios.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221117194241.1776125-1-simon.marchi@efficios.com> References: <20221117194241.1776125-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1668714162 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 1053 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=5.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.102207 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-3498.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Simon Marchi <simon.marchi@efficios.com> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Fix some commit_resumed_state assertion failures (PR 28275)
|
|
Commit Message
Simon Marchi
Nov. 17, 2022, 7:42 p.m. UTC
The following patch ("gdbserver: switch to right process in find_one_thread") makes it so find_one_thread calls into libthread_db with a current process but no current thread. This tripped on ps_getpid using current_thread in order to get the process' pid. Get the pid from `current_process ()` instead, which removes the need to have a current thread. Eventually, it would be good to get it from the gdb_ps_prochandle_t structure, to avoid the need for a current process as well. Change-Id: I9d2fae266419199a2fbc2fde0a5104c6e0dbd2d5 --- gdbserver/proc-service.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes: > The following patch ("gdbserver: switch to right process in > find_one_thread") makes it so find_one_thread calls into libthread_db > with a current process but no current thread. This tripped on ps_getpid > using current_thread in order to get the process' pid. Get the pid from > `current_process ()` instead, which removes the need to have a current > thread. Eventually, it would be good to get it from the > gdb_ps_prochandle_t structure, to avoid the need for a current process > as well. LGTM. Reviewed-By: Andrew Burgess <aburgess@redhat.com> Thanks, Andrew > > Change-Id: I9d2fae266419199a2fbc2fde0a5104c6e0dbd2d5 > --- > gdbserver/proc-service.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gdbserver/proc-service.cc b/gdbserver/proc-service.cc > index a49e2b25a47..f86c0e99923 100644 > --- a/gdbserver/proc-service.cc > +++ b/gdbserver/proc-service.cc > @@ -158,5 +158,5 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prfpregset_t *fpregs > pid_t > ps_getpid (gdb_ps_prochandle_t ph) > { > - return pid_of (current_thread); > + return current_process ()->pid; > } > -- > 2.37.3
On 11/18/22 06:33, Andrew Burgess via Gdb-patches wrote: > Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes: > >> The following patch ("gdbserver: switch to right process in >> find_one_thread") makes it so find_one_thread calls into libthread_db >> with a current process but no current thread. This tripped on ps_getpid >> using current_thread in order to get the process' pid. Get the pid from >> `current_process ()` instead, which removes the need to have a current >> thread. Eventually, it would be good to get it from the >> gdb_ps_prochandle_t structure, to avoid the need for a current process >> as well. > > LGTM. > > Reviewed-By: Andrew Burgess <aburgess@redhat.com> > > Thanks, > Andrew Thanks, pushed. Simon
diff --git a/gdbserver/proc-service.cc b/gdbserver/proc-service.cc index a49e2b25a47..f86c0e99923 100644 --- a/gdbserver/proc-service.cc +++ b/gdbserver/proc-service.cc @@ -158,5 +158,5 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prfpregset_t *fpregs pid_t ps_getpid (gdb_ps_prochandle_t ph) { - return pid_of (current_thread); + return current_process ()->pid; }