diff options
author | Tom Tromey <tromey@redhat.com> | 2010-02-17 22:25:05 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2010-02-17 22:25:05 +0000 |
commit | 6f451e5ec454cf6611b99df727ba77bf8bc71da7 (patch) | |
tree | 675438e301d67eae23ddace9fed23f93fb5c5839 /gdb | |
parent | ef801a0e1d880aa6ecd4655527f1f8218c741122 (diff) | |
download | gdb-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')
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/objfiles.c | 7 | ||||
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.java/jprint.exp | 3 | ||||
-rw-r--r-- | gdb/testsuite/gdb.java/jprint.java | 6 |
5 files changed, 23 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 70d1c20..425e8c8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2010-02-17 Tom Tromey <tromey@redhat.com> + + * objfiles.c (gdb_bfd_ref): Handle abfd==NULL. + 2010-02-17 Jan Kratochvil <jan.kratochvil@redhat.com> * symfile.c (build_section_addr_info_from_objfile): Include sections 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) { diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 9497fd5..c2827ef 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-02-17 Tom Tromey <tromey@redhat.com> + + * gdb.java/jprint.java (jprint.props): New field. + * gdb.java/jprint.exp (set_lang_java): Add regression test. + 2010-02-17 Pedro Alves <pedro@codesourcery.com> * gdb.base/charset.exp: Don't assume new `regsub' syntax diff --git a/gdb/testsuite/gdb.java/jprint.exp b/gdb/testsuite/gdb.java/jprint.exp index bb929aa..29dbf4b 100644 --- a/gdb/testsuite/gdb.java/jprint.exp +++ b/gdb/testsuite/gdb.java/jprint.exp @@ -84,4 +84,7 @@ if ![set_lang_java] then { gdb_test "call x.dothat(55)" "new value is 58\r\n.*= 62.*" "virtual fn call" gdb_test "p x.addprint(1,2,3)" "sum is 6\r\n.*" "inherited static call" gdb_test "call x.addk(44)" "adding k gives 121\r\n.*= 121.*" "inherited virtual fn call" + + # Regression test for a crasher. + gdb_test "print *jprint.props" " = .*" "print a java.util.Properties" } diff --git a/gdb/testsuite/gdb.java/jprint.java b/gdb/testsuite/gdb.java/jprint.java index bd4fa96..01ebdbc 100644 --- a/gdb/testsuite/gdb.java/jprint.java +++ b/gdb/testsuite/gdb.java/jprint.java @@ -1,6 +1,6 @@ // jprint.java test program. // -// Copyright 2004 +// Copyright 2004, 2010 // Free Software Foundation, Inc. // // Written by Jeff Johnston <jjohnstn@redhat.com> @@ -21,6 +21,8 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. +import java.util.Properties; + class jvclass { public static int k; static { @@ -39,6 +41,8 @@ class jvclass { } public class jprint extends jvclass { + public static Properties props = new Properties (); + public int dothat (int x) { int y = x + 3; System.out.println ("new value is " + y); |