[v6,5/7] fix issue: gdb hangs in the command following a commad returning with TARGET_WAITKIND_NO_HISTORY

Message ID 20210531213307.275079-6-zied.guermazi@trande.de
State New
Headers show
Series
  • extend branch tracing to use ARM CoreSight traces
Related show

Commit Message

Zied Guermazi May 31, 2021, 9:33 p.m.
This patch fixes an issue observed with btrace when replaying the execution.
The issue was observed on ARMv7 processors.
To reproduce the issue, the user needs to replay in forward direction
until he reaches the end of history, then replay backwards
(e.g a reverse-next) and then replay forwards. GDB hangs and the user
can not issue new commands.
This fix keeps the same behaviour of gdb as when TARGET_WAITKIND_NO_HISTORY
is hit on other architectures.

gdb/ChangeLog

	* infrun.c (set_step_over_info): add debug print.
	(handle_inferior_event): clear step over info
	in case TARGET_WAITKIND_NO_HISTORY.
---
 gdb/infrun.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.25.1

Comments

Weimin Pan via Gdb-patches June 23, 2021, 8:08 a.m. | #1
Hello Zied,

>This patch fixes an issue observed with btrace when replaying the execution.

>The issue was observed on ARMv7 processors.

>To reproduce the issue, the user needs to replay in forward direction

>until he reaches the end of history, then replay backwards

>(e.g a reverse-next) and then replay forwards. GDB hangs and the user

>can not issue new commands.

>This fix keeps the same behaviour of gdb as when

>TARGET_WAITKIND_NO_HISTORY

>is hit on other architectures.

>

>gdb/ChangeLog

>

>	* infrun.c (set_step_over_info): add debug print.

>	(handle_inferior_event): clear step over info

>	in case TARGET_WAITKIND_NO_HISTORY.

>---

> gdb/infrun.c | 3 ++-

> 1 file changed, 2 insertions(+), 1 deletion(-)


Please drop this patch.  My series is still waiting for reviews but the fix below
is not sufficient.

Regards,
Markus.
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

Patch

diff --git a/gdb/infrun.c b/gdb/infrun.c
index e9624d2a9b6..c52c8505983 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1311,6 +1311,7 @@  set_step_over_info (const address_space *aspace, CORE_ADDR address,
 		    int nonsteppable_watchpoint_p,
 		    int thread)
 {
+  infrun_debug_printf ("setting step over info");
   step_over_info.aspace = aspace;
   step_over_info.address = address;
   step_over_info.nonsteppable_watchpoint_p = nonsteppable_watchpoint_p;
@@ -5739,7 +5740,7 @@  handle_inferior_event (struct execution_control_state *ecs)
       delete_just_stopped_threads_single_step_breakpoints ();
       ecs->event_thread->suspend.stop_pc
 	= regcache_read_pc (get_thread_regcache (inferior_thread ()));
-
+      clear_step_over_info ();
       if (handle_stop_requested (ecs))
 	return;