* 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.
+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
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)
{
+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
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"
}
// jprint.java test program.
//
-// Copyright 2004
+// Copyright 2004, 2010
// Free Software Foundation, Inc.
//
// Written by Jeff Johnston <jjohnstn@redhat.com>
// 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 {
}
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);