This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Fix display of shared library events on DLL targets

Yet another way in which the flow of control in handle_inferior_event
is confusing: stop_print_frame is a global, which is not always set
before it is checked.  I looked briefly at overhauling this into a
local flag, but got scared off by the number of places currently
missing a setting.  So this patch fixes only a specific instance that
we encountered.

On a target with SVR4 shared libraries, stop_print_frame is set on
shared library events a bit further down in the file.  Then the event
is detected using BPSTAT_WHAT_CHECK_SHLIBS.  On a DLL target, like
Windows or SymbianOS, we get TARGET_WAITKIND_LOADED instead.  So set
stop_print_frame before calling stop_stepping, which will eventually
lead to a read of the variable in normal_stop.

Tested on arm-none-eabi and x86_64-linux.  It's also been in our local
tree for some months, and tested on Windows et al.  Checked in.

2009-11-13  Pedro Alves  <>

	* infrun.c (handle_inferior_event): Set stop_print_frame on
	TARGET_WAITKIND_LOADED events, if stopping on solib-events.

 gdb/infrun.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: gdb/infrun.c
--- gdb/infrun.c.orig	2009-10-29 00:44:53.000000000 -0700
+++ gdb/infrun.c	2009-11-12 14:50:44.000000000 -0800
@@ -2821,6 +2821,10 @@ handle_inferior_event (struct execution_
 	     dynamically loaded objects (among other things).  */
 	  if (stop_on_solib_events)
+	      /* Make sure we print "Stopped due to solib-event" in
+		 normal_stop.  */
+	      stop_print_frame = 1;
 	      stop_stepping (ecs);

Daniel Jacobowitz

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]