From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C8CF93874C0C; Mon, 8 Feb 2021 02:00:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C8CF93874C0C From: "simon.marchi at polymtl dot ca" To: gdb-prs@sourceware.org Subject: [Bug gdb/26819] RISC-V: internal-error: int finish_step_over(execution_control_state*): Assertion Date: Mon, 08 Feb 2021 02:00:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simon.marchi at polymtl dot ca X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: andrew.burgess at embecosm dot com 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: Mon, 08 Feb 2021 02:00:10 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26819 --- Comment #26 from Simon Marchi --- Hi Jan, (off list)=20 I just went into paternity leave, so I will probably won't be able to take a look before a few weeks. If you want to submit the patch for merging and g= et a review, please send it to the gdb-patches list as described here. https://sourceware.org/gdb/wiki/ContributionChecklist Thanks, Simon=20 On February 7, 2021 4:20:24 PM EST, jmatyas at codasip dot com wrote: >https://sourceware.org/bugzilla/show_bug.cgi?id=3D26819 > >--- Comment #25 from Jan Matyas --- >(In reply to Simon Marchi from comment #24) >> [...] The steps missing are: >>=20 >> - Write a good commit message that explains why things fail currently >and >> why the patch fixes them (including a ChangeLog entry) >> - Enhance the test (gdb.server/stop-reply-no-thread.exp I think) so >it >> covers the two scenarios I mentioned ("--disable-packet=3DT >> --disable-packet=3DqfThreadInfo" and "--disable-packet=3Dthreads") >> - Send the patch to the mailing list for review. > >Hi Simon, >I have rebased your patch from Jan-17 and enhanced the test case as >suggested. >Please, check if that is all right. > >As my knowledge of gdb code is low, I'd appreciate if you could write >the >commit message as the author of the patch (and submit it to the mailing >list). > >Thank you, regards, >Jan > > > >>From c99eb5f06a0c25129875ed5addcc2cf2e7a9ab39 Mon Sep 17 00:00:00 2001 >From: Jan Matyas >Date: Sun, 7 Feb 2021 22:04:50 +0100 >Subject: [PATCH] Patch for gdb/26819 > >TODO: Proper commit message > >- Rebased Simon Marchi's patch from Jan/17. >- Extended the gdb.server/stop-reply-no-thread.exp test case > to cover the situation when the gdbserver does not report > any threads. >--- > gdb/remote.c | 9 ++++++--- > gdb/testsuite/gdb.server/stop-reply-no-thread.exp | 9 +++++++++ > 2 files changed, 15 insertions(+), 3 deletions(-) > >diff --git a/gdb/remote.c b/gdb/remote.c >index 31c6e17a1c..4cda15470e 100644 >--- a/gdb/remote.c >+++ b/gdb/remote.c >@@ -741,7 +741,7 @@ class remote_target : public process_stratum_target > int remote_resume_with_vcont (ptid_t ptid, int step, > gdb_signal siggnal); > >- void add_current_inferior_and_thread (const char *wait_status); >+ thread_info *add_current_inferior_and_thread (const char >*wait_status); > > ptid_t wait_ns (ptid_t ptid, struct target_waitstatus *status, > target_wait_flags options); >@@ -4411,7 +4411,7 @@ remote_target::get_current_thread (const char >*wait_status) > qC query, we infer the current thread from that stop reply, passed > in in WAIT_STATUS, which may be NULL. */ > >-void >+thread_info * >remote_target::add_current_inferior_and_thread (const char >*wait_status) > { > struct remote_state *rs =3D get_remote_state (); >@@ -4445,6 +4445,8 @@ remote_target::add_current_inferior_and_thread >(const >char *wait_status) > yet. */ > thread_info *tp =3D add_thread_silent (this, curr_ptid); > switch_to_thread_no_regs (tp); >+ >+ return tp; > } > > /* Print info about a thread that was found already stopped on >@@ -4800,7 +4802,8 @@ remote_target::start_remote (int from_tty, int >extended_p) > /* Target has no concept of threads at all. GDB treats > non-threaded target as single-threaded; add a main > thread. */ >- add_current_inferior_and_thread (wait_status); >+ thread_info *tp =3D add_current_inferior_and_thread >(wait_status); >+ get_remote_thread_info (tp)->set_resumed (); > } > else > { >diff --git a/gdb/testsuite/gdb.server/stop-reply-no-thread.exp >b/gdb/testsuite/gdb.server/stop-reply-no-thread.exp >index 68bf42ac1a..e698eaff6e 100644 >--- a/gdb/testsuite/gdb.server/stop-reply-no-thread.exp >+++ b/gdb/testsuite/gdb.server/stop-reply-no-thread.exp >@@ -112,3 +112,12 @@ foreach_with_prefix to_disable { "" Tthread T } { > run_test $to_disable $t_nonstop > } > } >+ >+# Regression for gdb/26819: Cover the case when GDBserver does not >report >+# any threads. Non-stop Mode is off. >+# >+# Scenario 1: Disable 'T' and 'qfThreadInfo' packets >+# Scenario 2: Disable all threading packets >+foreach_with_prefix to_disable { "T,qfThreadInfo" "threads" } { >+ run_test $to_disable off >+} >--=20 >2.20.1 > >--=20 >You are receiving this mail because: >You are on the CC list for the bug. --=20 You are receiving this mail because: You are on the CC list for the bug.=