New flag OBJF_NOT_FILENAME
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 9 Oct 2013 13:22:36 +0000 (13:22 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 9 Oct 2013 13:22:36 +0000 (13:22 +0000)
gdb/
2013-10-09  Jan Kratochvil  <jan.kratochvil@redhat.com>

New flag OBJF_NOT_FILENAME.
* auto-load.c (auto_load_objfile_script): Check also OBJF_NOT_FILENAME.
* jit.c (jit_object_close_impl): Use OBJF_NOT_FILENAME for
allocate_objfile.
(jit_bfd_try_read_symtab): Use OBJF_NOT_FILENAME for
symbol_file_add_from_bfd.
* jv-lang.c (get_dynamics_objfile): Use OBJF_NOT_FILENAME for
allocate_objfile.
* objfiles.c (allocate_objfile): Assert OBJF_NOT_FILENAME if NAME is
NULL.
* objfiles.h (OBJF_NOT_FILENAME): New.

gdb/ChangeLog
gdb/auto-load.c
gdb/jit.c
gdb/jv-lang.c
gdb/objfiles.c
gdb/objfiles.h

index 5f964d1098090a90d4f79920205ca3f99e5112c0..c2e87d65fd21e29b149b42d1408738bc74b8c66a 100644 (file)
@@ -1,3 +1,17 @@
+2013-10-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       New flag OBJF_NOT_FILENAME.
+       * auto-load.c (auto_load_objfile_script): Check also OBJF_NOT_FILENAME.
+       * jit.c (jit_object_close_impl): Use OBJF_NOT_FILENAME for
+       allocate_objfile.
+       (jit_bfd_try_read_symtab): Use OBJF_NOT_FILENAME for
+       symbol_file_add_from_bfd.
+       * jv-lang.c (get_dynamics_objfile): Use OBJF_NOT_FILENAME for
+       allocate_objfile.
+       * objfiles.c (allocate_objfile): Assert OBJF_NOT_FILENAME if NAME is
+       NULL.
+       * objfiles.h (OBJF_NOT_FILENAME): New.
+
 2013-10-08  Tom Tromey  <tromey@redhat.com>
 
        * Makefile.in (SFILES): Add build-id.c.
index 6d0d6d98c2e0795f7b0856e56a271ade3eaae10a..4eb7cdd499eff613ee22bc5bc9bf06cbe90d8282 100644 (file)
@@ -840,7 +840,7 @@ auto_load_objfile_script (struct objfile *objfile,
 void
 load_auto_scripts_for_objfile (struct objfile *objfile)
 {
-  if (!global_auto_load)
+  if (!global_auto_load || (objfile->flags & OBJF_NOT_FILENAME) != 0)
     return;
 
   if (auto_load_gdb_scripts)
index c7edd4a3273ecd94f2e6842f086f685708e33c63..ba0be5e440e80e00c4bcc09052c0c50393d77dfe 100644 (file)
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -785,7 +785,8 @@ jit_object_close_impl (struct gdb_symbol_callbacks *cb,
 
   priv_data = cb->priv_data;
 
-  objfile = allocate_objfile (NULL, "<< JIT compiled code >>", 0);
+  objfile = allocate_objfile (NULL, "<< JIT compiled code >>",
+                             OBJF_NOT_FILENAME);
   objfile->per_bfd->gdbarch = target_gdbarch ();
 
   terminate_minimal_symbol_table (objfile);
@@ -926,7 +927,7 @@ JITed symbol file is not an object file, ignoring it.\n"));
   /* This call does not take ownership of SAI.  */
   make_cleanup_bfd_unref (nbfd);
   objfile = symbol_file_add_from_bfd (nbfd, bfd_get_filename (nbfd), 0, sai,
-                                     OBJF_SHARED, NULL);
+                                     OBJF_SHARED | OBJF_NOT_FILENAME, NULL);
 
   do_cleanups (old_cleanups);
   add_objfile_entry (objfile, entry_addr);
index 0d07bbd2913707678a437b7cf1e97a660297e60e..63bcc98fcd6663141114eb0be52935a0b4f22e85 100644 (file)
@@ -118,7 +118,8 @@ get_dynamics_objfile (struct gdbarch *gdbarch)
 
       /* Mark it as shared so that it is cleared when the inferior is
         re-run.  */
-      dynamics_objfile = allocate_objfile (NULL, NULL, OBJF_SHARED);
+      dynamics_objfile = allocate_objfile (NULL, NULL,
+                                          OBJF_SHARED | OBJF_NOT_FILENAME);
       dynamics_objfile->per_bfd->gdbarch = gdbarch;
 
       data = XCNEW (struct jv_per_objfile_data);
index a10540a5852ecda3bc2d5194f336eb157416fe17..d1f312141dad20c81be79ebcbc9099ab0327c68f 100644 (file)
@@ -289,6 +289,7 @@ allocate_objfile (bfd *abfd, const char *name, int flags)
   if (name == NULL)
     {
       gdb_assert (abfd == NULL);
+      gdb_assert ((flags & OBJF_NOT_FILENAME) != 0);
       name = "<<anonymous objfile>>";
     }
   objfile->original_name = obstack_copy0 (&objfile->objfile_obstack, name,
index 8586e5a12bfc3a8ab7a5a59864e4d73de09f5f22..08771d0925678564da20ccd03b63f0c0d8413c87 100644 (file)
@@ -429,6 +429,11 @@ struct objfile
 
 #define OBJF_MAINLINE (1 << 5)
 
+/* ORIGINAL_NAME and OBFD->FILENAME correspond to text description unrelated to
+   filesystem names.  It can be for example "<image in memory>".  */
+
+#define OBJF_NOT_FILENAME (1 << 6)
+
 /* Declarations for functions defined in objfiles.c */
 
 extern struct objfile *allocate_objfile (bfd *, const char *name, int);
This page took 0.034448 seconds and 4 git commands to generate.