aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2009-02-18 07:28:34 +0000
committerVladimir Prus <vladimir@codesourcery.com>2009-02-18 07:28:34 +0000
commitc86cf029308edd78d12d1bb67a1d4ae1c14a9155 (patch)
tree8bbde8319811ab5834de6e902c8be4e3bcfd42b4 /gdb/mi
parent62f59e66f8f3df327032d365d24884c69f79e759 (diff)
downloadgdb-c86cf029308edd78d12d1bb67a1d4ae1c14a9155.zip
gdb-c86cf029308edd78d12d1bb67a1d4ae1c14a9155.tar.gz
gdb-c86cf029308edd78d12d1bb67a1d4ae1c14a9155.tar.bz2
* mi/mi-interp.c (mi_solib_loaded, mi_solib_unloaded): New.
(mi_interpreter_init): Register the above. * solib.c (clear_solib): Notify solib unload. * breakpoint.c (disable_breakpoints_in_unloaded_shlib): Do not disable breakpoints on a.out targets.
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-interp.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 95dfdf4..65c1b4f 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -34,6 +34,7 @@
#include "mi-common.h"
#include "observer.h"
#include "gdbthread.h"
+#include "solist.h"
/* These are the interpreter setup, etc. functions for the MI interpreter */
static void mi_execute_command_wrapper (char *cmd);
@@ -58,6 +59,8 @@ static void mi_thread_exit (struct thread_info *t);
static void mi_new_inferior (int pid);
static void mi_inferior_exit (int pid);
static void mi_on_resume (ptid_t ptid);
+static void mi_solib_loaded (struct so_list *solib);
+static void mi_solib_unloaded (struct so_list *solib);
static void *
mi_interpreter_init (int top_level)
@@ -86,6 +89,8 @@ mi_interpreter_init (int top_level)
observer_attach_inferior_exit (mi_inferior_exit);
observer_attach_normal_stop (mi_on_normal_stop);
observer_attach_target_resumed (mi_on_resume);
+ observer_attach_solib_loaded (mi_solib_loaded);
+ observer_attach_solib_unloaded (mi_solib_unloaded);
}
return mi;
@@ -408,6 +413,31 @@ mi_on_resume (ptid_t ptid)
gdb_flush (raw_stdout);
}
+static void
+mi_solib_loaded (struct so_list *solib)
+{
+ struct mi_interp *mi = top_level_interpreter_data ();
+ target_terminal_ours ();
+ fprintf_unfiltered (mi->event_channel,
+ "library-loaded,id=\"%s\",target-name=\"%s\",host-name=\"%s\",symbols-loaded=\"%d\"",
+ solib->so_original_name, solib->so_original_name,
+ solib->so_name, solib->symbols_loaded);
+ gdb_flush (mi->event_channel);
+}
+
+static void
+mi_solib_unloaded (struct so_list *solib)
+{
+ struct mi_interp *mi = top_level_interpreter_data ();
+ target_terminal_ours ();
+ fprintf_unfiltered (mi->event_channel,
+ "library-unloaded,id=\"%s\",target-name=\"%s\",host-name=\"%s\"",
+ solib->so_original_name, solib->so_original_name,
+ solib->so_name);
+ gdb_flush (mi->event_channel);
+}
+
+
extern initialize_file_ftype _initialize_mi_interp; /* -Wmissing-prototypes */
void