]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2003-02-04 David Carlton <carlton@math.stanford.edu>
authorDavid Carlton <carlton@bactrian.org>
Tue, 4 Feb 2003 21:59:00 +0000 (21:59 +0000)
committerDavid Carlton <carlton@bactrian.org>
Tue, 4 Feb 2003 21:59:00 +0000 (21:59 +0000)
* objfiles.c (allocate_objfile): Always set name.  Add comment at
start of function.
* jv-lang.c (get_dynamics_objfile): Add comment.

gdb/ChangeLog
gdb/jv-lang.c
gdb/objfiles.c

index 9ecc3d343da21ec5bdb6898cdc56b885d36b9de0..1ff487caab2192367be484f3e8001b80b154f511 100644 (file)
@@ -1,3 +1,9 @@
+2003-02-04  David Carlton  <carlton@math.stanford.edu>
+
+       * objfiles.c (allocate_objfile): Always set name.  Add comment at
+       start of function.
+       * jv-lang.c (get_dynamics_objfile): Add comment.
+
 2003-02-03  Michal Ludvig  <mludvig@suse.cz>
 
        * dwarf2cfi.c (pointer_encoding): Added new parameter.
index 3afdebdb46727fdbe622493f1c4c167d525a66da..b283f36cbc869f58a8487df47bef80c3b0126a36 100644 (file)
@@ -68,6 +68,12 @@ static struct objfile *dynamics_objfile = NULL;
 
 static struct type *java_link_class_type (struct type *, struct value *);
 
+/* FIXME: carlton/2003-02-04: This is the main or only caller of
+   allocate_objfile with first argument NULL; as a result, this code
+   breaks every so often.  Somebody should write a test case that
+   exercises GDB in various ways (e.g. something involving loading a
+   dynamic library) after this code has been called.  */
+
 static struct objfile *
 get_dynamics_objfile (void)
 {
index 9c5e49fde608a42ff6ec62d7efeb4f361892a9ac..042c72def5f1cfb71639e17c2df5de73a4755357 100644 (file)
@@ -149,6 +149,15 @@ build_objfile_section_table (struct objfile *objfile)
    OBJF_SHARED are simply copied through to the new objfile flags
    member. */
 
+/* NOTE: carlton/2003-02-04: This function is called with args NULL, 0
+   by jv-lang.c, to create an artificial objfile used to hold
+   information about dynamically-loaded Java classes.  Unfortunately,
+   that branch of this function doesn't get tested very frequently, so
+   it's prone to breakage.  (E.g. at one time the name was set to NULL
+   in that situation, which broke a loop over all names in the dynamic
+   library loader.)  If you change this function, please try to leave
+   things in a consistent state even if abfd is NULL.  */
+
 struct objfile *
 allocate_objfile (bfd *abfd, int flags)
 {
@@ -305,6 +314,10 @@ allocate_objfile (bfd *abfd, int flags)
                 objfile->name, bfd_errmsg (bfd_get_error ()));
        }
     }
+  else
+    {
+      objfile->name = "<<anonymous objfile>>";
+    }
 
   /* Initialize the section indexes for this objfile, so that we can
      later detect if they are used w/o being properly assigned to. */