* 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.
This commit is contained in:
Tom Tromey 2010-02-17 22:25:05 +00:00
parent ef801a0e1d
commit 6f451e5ec4
5 changed files with 23 additions and 2 deletions

View File

@ -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

View File

@ -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)
{

View File

@ -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

View File

@ -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"
}

View File

@ -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);