btrace: uppercase btrace_read_type
[deliverable/binutils-gdb.git] / gdb / auto-load.c
index 02b08bef76273d74533458b5b7f19ffbd4a5169f..46d063c9dd3890b407f21ac9884043b588914418 100644 (file)
@@ -1,6 +1,6 @@
 /* GDB routines for supporting auto-loaded scripts.
 
-   Copyright (C) 2012-2013 Free Software Foundation, Inc.
+   Copyright (C) 2012-2014 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -36,7 +36,6 @@
 #include "gdb_vecs.h"
 #include "readline/tilde.h"
 #include "completer.h"
-#include "observer.h"
 #include "fnmatch.h"
 #include "top.h"
 #include "filestuff.h"
@@ -596,7 +595,7 @@ get_auto_load_pspace_data (struct program_space *pspace)
   info = program_space_data (pspace, auto_load_pspace_data);
   if (info == NULL)
     {
-      info = XZALLOC (struct auto_load_pspace_info);
+      info = XCNEW (struct auto_load_pspace_info);
       set_program_space_data (pspace, auto_load_pspace_data, info);
     }
 
@@ -1015,12 +1014,17 @@ auto_load_section_scripts (struct objfile *objfile, const char *section_name)
 void
 load_auto_scripts_for_objfile (struct objfile *objfile)
 {
+  /* Return immediately if auto-loading has been globally disabled.
+     This is to handle sequencing of operations during gdb startup.
+     Also return immediately if OBJFILE is not actually a file.  */
   if (!global_auto_load || (objfile->flags & OBJF_NOT_FILENAME) != 0)
     return;
 
+  /* Load any scripts for this objfile. e.g. foo-gdb.gdb, foo-gdb.py.  */
   auto_load_objfile_script (objfile, &script_language_gdb);
   auto_load_objfile_script (objfile, gdbpy_script_language_defn ());
 
+  /* Load any scripts mentioned in AUTO_SECTION_NAME (.debug_gdb_scripts).  */
   auto_load_section_scripts (objfile, AUTO_SECTION_NAME);
 }
 
This page took 0.025489 seconds and 4 git commands to generate.