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

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

Commit Message

Zied Guermazi April 22, 2021, 2:09 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

Lancelot SIX via Gdb-patches April 27, 2021, 5:32 p.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.


This and related hangs are addressed in
https://sourceware.org/pipermail/gdb-patches/2021-March/177015.html

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
Zied Guermazi April 30, 2021, 1:43 a.m. | #2
hi Markus,

great! will this patch set be committed in near future? I will test it 
and remove my fix, if the problem is also solved properly for armv7.

/Zied

On 27.04.21 19:32, Metzger, Markus T wrote:
> 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.

> This and related hangs are addressed in

> https://sourceware.org/pipermail/gdb-patches/2021-March/177015.html

>

> 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

>
Lancelot SIX via Gdb-patches April 30, 2021, 9:04 a.m. | #3
Hello Zied,

>great! will this patch set be committed in near future? I will test it

>and remove my fix, if the problem is also solved properly for armv7.


I hope so.  I'm waiting for reviews from a Global maintainer.  Those
changes are in infrun.

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 2c31cf452b1..b53428b872a 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1310,6 +1310,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;