aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-02-17 22:25:05 +0000
committerTom Tromey <tromey@redhat.com>2010-02-17 22:25:05 +0000
commit6f451e5ec454cf6611b99df727ba77bf8bc71da7 (patch)
tree675438e301d67eae23ddace9fed23f93fb5c5839 /gdb/objfiles.c
parentef801a0e1d880aa6ecd4655527f1f8218c741122 (diff)
downloadgdb-6f451e5ec454cf6611b99df727ba77bf8bc71da7.zip
gdb-6f451e5ec454cf6611b99df727ba77bf8bc71da7.tar.gz
gdb-6f451e5ec454cf6611b99df727ba77bf8bc71da7.tar.bz2
gdb
* objfiles.c (gdb_bfd_ref): Handle abfd==NULL. gdb/testsuite * gdb.java/jprint.java (jprint.props): New field. * gdb.java/jprint.exp (set_lang_java): Add regression test.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 489b812..c2763c2 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -1504,7 +1504,12 @@ objfiles_changed (void)
struct bfd *
gdb_bfd_ref (struct bfd *abfd)
{
- int *p_refcount = bfd_usrdata (abfd);
+ int *p_refcount;
+
+ if (abfd == NULL)
+ return NULL;
+
+ p_refcount = bfd_usrdata (abfd);
if (p_refcount != NULL)
{