summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Carlton <carlton@bactrian.org>2003-02-04 21:55:26 +0000
committerDavid Carlton <carlton@bactrian.org>2003-02-04 21:55:26 +0000
commit4d46f3e4e6fc38cc8ddd87089b33c0d97611b65c (patch)
treef273f2426a0a82d310794d94229fc6972d8585ad
parentf48b0ff4b17cc374864fdacf85d460ff984237a4 (diff)
downloadgdb-4d46f3e4e6fc38cc8ddd87089b33c0d97611b65c.tar.gz
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.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/jv-lang.c6
-rw-r--r--gdb/objfiles.c13
3 files changed, 25 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7ec013545b1..4136db9bc96 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
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-04 David Carlton <carlton@math.stanford.edu>
+
* symtab.h (SYMBOL_LINKAGE_NAME): Delete.
* printcmd.c (build_address_symbolic): Replace uses of
SYMBOL_LINKAGE_NAME by equivalent uses of SYMBOL_SOURCE_NAME,
diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c
index 3afdebdb467..b283f36cbc8 100644
--- a/gdb/jv-lang.c
+++ b/gdb/jv-lang.c
@@ -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)
{
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 90844018fc4..dd4ef62b268 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -150,6 +150,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)
{
@@ -313,6 +322,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. */