aboutsummaryrefslogtreecommitdiff
path: root/gdb/agent.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/agent.c')
-rw-r--r--gdb/agent.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/agent.c b/gdb/agent.c
index b751cfe..a8958d7 100644
--- a/gdb/agent.c
+++ b/gdb/agent.c
@@ -54,9 +54,23 @@ set_can_use_agent (char *args, int from_tty, struct cmd_list_element *c)
/* -Wmissing-prototypes */
extern initialize_file_ftype _initialize_agent;
+#include "observer.h"
+#include "objfiles.h"
+
+static void
+agent_new_objfile (struct objfile *objfile)
+{
+ if (objfile == NULL || agent_loaded_p ())
+ return;
+
+ agent_look_up_symbols (objfile);
+}
+
void
_initialize_agent (void)
{
+ observer_attach_new_objfile (agent_new_objfile);
+
add_setshow_enum_cmd ("agent", class_run,
can_use_agent_enum,
&can_use_agent, _("\