From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B73F43847802; Wed, 14 Jul 2021 15:30:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B73F43847802 From: "simark at simark dot ca" To: gdb-prs@sourceware.org Subject: [Bug record/28086] inferior.c:303: internal-error: inferior* find_inferior _pid(process_stratum_target*, int): Assertion `pid != 0' failed. Date: Wed, 14 Jul 2021 15:30:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: record X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simark at simark dot ca X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jul 2021 15:30:16 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28086 --- Comment #7 from Simon Marchi --- The issue with the patch was that the switch_to_thread was in a too narrow scope. This works for me. We should investigate if this would be needed f= or btrace_compute_ftrace_pt as well (even if it happens to work today). If so= , it could be done in the caller, btrace_compute_ftrace or btrace_compute_ftrace= _1. >>From e1fc3728b950844f12cbfd5bed6b5bd317867cde Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 14 Jul 2021 11:11:25 -0400 Subject: [PATCH] fix Change-Id: I4b56d1cb8fb4c5651ba9d1e4f0782c2a13ab28dd --- gdb/btrace.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdb/btrace.c b/gdb/btrace.c index 5e689c11d4bd..0e53c7de390e 100644 --- a/gdb/btrace.c +++ b/gdb/btrace.c @@ -1052,6 +1052,11 @@ btrace_compute_ftrace_bts (struct thread_info *tp, const struct btrace_data_bts *btrace, std::vector &gaps) { + /* gdb_insn_length will need to read memory from TP, which may + not be the current thread on entryt. Make sure it is. */ + scoped_restore_current_thread restore_thread; + switch_to_thread (tp); + struct btrace_thread_info *btinfo; struct gdbarch *gdbarch; unsigned int blk; --=20 2.26.2 --=20 You are receiving this mail because: You are on the CC list for the bug.=