Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFC: hacky fix for PR 12406
@ 2012-01-11 19:25 Tom Tromey
  2012-01-12  0:12 ` Jan Kratochvil
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Tom Tromey @ 2012-01-11 19:25 UTC (permalink / raw)
  To: gdb-patches

I would like to get some feedback on this.

PR 12406 concerns what is printed when stop-on-solib-events is set:

    (gdb) set stop-on-solib-events 1
    (gdb) r
    Starting program: /tmp/q 
    Stopped due to shared library event

What is missing here is any indication of what library was loaded.

This patch changes the output to:

    (gdb) set stop-on-solib-events 1
    (gdb) r
    Starting program: /tmp/q 
    [Inferior loaded library /lib64/ld-linux-x86-64.so.2]
    Stopped due to shared library event

I could not find a good way to get the information about what library
was loaded from the library-loading code to the bpstat_print code.  This
approach seems like a hack to me -- so I was wondering if anyone has a
better suggestion.

This regtests fine on x86-64 F15.

Tom

2012-01-11  Tom Tromey  <tromey@redhat.com>

	PR symtab/12406:
	* solib.c (update_solib_list): Print message if
	stop_on_solib_events is set.

diff --git a/gdb/solib.c b/gdb/solib.c
index f591785..66e2f94 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -810,6 +810,11 @@ update_solib_list (int from_tty, struct target_ops *target)
 			       _("Error while mapping shared "
 				 "library sections:\n"));
 
+	  if (stop_on_solib_events)
+	    ui_out_message (current_uiout, 0,
+			    _("[Inferior loaded library %s]\n"),
+			    i->so_name);
+
 	  /* Notify any observer that the shared object has been
 	     loaded now that we've added it to GDB's tables.  */
 	  observer_notify_solib_loaded (i);


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-01-13 15:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-11 19:25 RFC: hacky fix for PR 12406 Tom Tromey
2012-01-12  0:12 ` Jan Kratochvil
2012-01-12  5:59 ` Joel Brobecker
2012-01-12 21:41   ` Tom Tromey
2012-01-13 15:48     ` Gary Benson
2012-01-12 11:40 ` Gary Benson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox