gdb: Add aliases for read_core_file_mappings callbacks
[binutils-gdb.git] / gdb / agent.c
index da251a3af7b7c52b83d31709a540b9e5ddce7d85..5e52865b3788bd7b92bcf458aed9f1f9324638d2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2012-2019 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -27,7 +27,7 @@
 
 static const char can_use_agent_on[] = "on";
 static const char can_use_agent_off[] = "off";
-static const char *can_use_agent_enum[] =
+static const char * const can_use_agent_enum[] =
 {
   can_use_agent_on,
   can_use_agent_off,
@@ -52,7 +52,7 @@ set_can_use_agent (const char *args, int from_tty, struct cmd_list_element *c)
   if (can_use && !agent_loaded_p ())
     {
       /* Since the setting was off, we may not have observed the objfiles and
-         therefore not looked up the required symbols.  Do so now.  */
+        therefore not looked up the required symbols.  Do so now.  */
       for (objfile *objfile : current_program_space->objfiles ())
        if (agent_look_up_symbols (objfile) == 0)
          break;
@@ -74,10 +74,12 @@ agent_new_objfile (struct objfile *objfile)
   agent_look_up_symbols (objfile);
 }
 
+void _initialize_agent ();
 void
-_initialize_agent (void)
+_initialize_agent ()
 {
-  gdb::observers::new_objfile.attach (agent_new_objfile);
+  gdb::observers::new_objfile.attach (agent_new_objfile,
+                                     "agent");
 
   add_setshow_enum_cmd ("agent", class_run,
                        can_use_agent_enum,