gdb/testsuite: Don't allow paths to appear in test name
[deliverable/binutils-gdb.git] / gdb / agent.c
index b751cfe4c205568b9d8ccf95ce4cf20950bba928..fe3dcb555ad03498ecc99280ed3bc2dde5f227e9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -44,19 +44,30 @@ show_can_use_agent (struct ui_file *file, int from_tty,
 }
 
 static void
-set_can_use_agent (char *args, int from_tty, struct cmd_list_element *c)
+set_can_use_agent (const char *args, int from_tty, struct cmd_list_element *c)
 {
   if (target_use_agent (can_use_agent == can_use_agent_on) == 0)
     /* Something wrong during setting, set flag to default value.  */
     can_use_agent = can_use_agent_off;
 }
 
-/* -Wmissing-prototypes */
-extern initialize_file_ftype _initialize_agent;
+#include "observable.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)
 {
+  gdb::observers::new_objfile.attach (agent_new_objfile);
+
   add_setshow_enum_cmd ("agent", class_run,
                        can_use_agent_enum,
                        &can_use_agent, _("\
This page took 0.023992 seconds and 4 git commands to generate.