From 0d4097aee091b3317d147dd92f959c9f7d13a303 Mon Sep 17 00:00:00 2001 From: drow Date: Mon, 14 May 2007 16:44:22 +0000 Subject: [PATCH] * jv-exp.y (push_fieldnames): Use STRUCTOP_PTR instead of STRUCTOP_STRUCT. * jv-lang.c (evaluate_subexp_java): Handle STRUCTOP_PTR instead of STRUCTOP_STRUCT. * jv-typeprint.c (java_print_type): Do not crash on NULL varstring. * gdb.java/jprint.java (public): Avoid invalid call to static method. --- gdb/ChangeLog | 8 ++++++++ gdb/jv-exp.y | 6 +++--- gdb/jv-lang.c | 2 +- gdb/jv-typeprint.c | 2 +- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.java/jprint.java | 2 +- 6 files changed, 19 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2861743fdd..27d67b5798 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2007-05-14 Daniel Jacobowitz + + * jv-exp.y (push_fieldnames): Use STRUCTOP_PTR instead of + STRUCTOP_STRUCT. + * jv-lang.c (evaluate_subexp_java): Handle STRUCTOP_PTR instead of + STRUCTOP_STRUCT. + * jv-typeprint.c (java_print_type): Do not crash on NULL varstring. + 2007-05-14 Ulrich Weigand * gdbarch.sh (read_sp): Remove. diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y index bb4e05e0e4..fcbb84f2c7 100644 --- a/gdb/jv-exp.y +++ b/gdb/jv-exp.y @@ -1265,7 +1265,7 @@ push_variable (struct stoken name) } /* Assuming a reference expression has been pushed, emit the - STRUCTOP_STRUCT ops to access the field named NAME. If NAME is a + STRUCTOP_PTR ops to access the field named NAME. If NAME is a qualified name (has '.'), generate a field access for each part. */ static void @@ -1281,9 +1281,9 @@ push_fieldnames (name) { /* token.ptr is start of current field name. */ token.length = &name.ptr[i] - token.ptr; - write_exp_elt_opcode (STRUCTOP_STRUCT); + write_exp_elt_opcode (STRUCTOP_PTR); write_exp_string (token); - write_exp_elt_opcode (STRUCTOP_STRUCT); + write_exp_elt_opcode (STRUCTOP_PTR); token.ptr += token.length + 1; } if (i >= name.length) diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index 07d1f45a66..17516e0975 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -928,7 +928,7 @@ evaluate_subexp_java (struct type *expect_type, struct expression *exp, goto nosideret; return java_value_string (&exp->elts[pc + 2].string, i); - case STRUCTOP_STRUCT: + case STRUCTOP_PTR: arg1 = evaluate_subexp_standard (expect_type, exp, pos, noside); /* Convert object field (such as TYPE.class) to reference. */ if (TYPE_CODE (value_type (arg1)) == TYPE_CODE_STRUCT) diff --git a/gdb/jv-typeprint.c b/gdb/jv-typeprint.c index 727f728d47..b004bf96e0 100644 --- a/gdb/jv-typeprint.c +++ b/gdb/jv-typeprint.c @@ -338,6 +338,6 @@ java_print_type (struct type *type, char *varstring, struct ui_file *stream, /* For demangled function names, we have the arglist as part of the name, so don't print an additional pair of ()'s */ - demangled_args = strchr (varstring, '(') != NULL; + demangled_args = varstring != NULL && strchr (varstring, '(') != NULL; c_type_print_varspec_suffix (type, stream, show, 0, demangled_args); } diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index fabd894a13..a6b1d9722f 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-05-14 Daniel Jacobowitz + + * gdb.java/jprint.java (public): Avoid invalid call to static + method. + 2007-05-14 Denis Pilat * gdb.mi/mi-console.exp, gdb.mi/gdb669.exp, gdb.mi/mi-cli.exp, diff --git a/gdb/testsuite/gdb.java/jprint.java b/gdb/testsuite/gdb.java/jprint.java index f17607efe7..4275e89e46 100644 --- a/gdb/testsuite/gdb.java/jprint.java +++ b/gdb/testsuite/gdb.java/jprint.java @@ -54,7 +54,7 @@ public class jprint extends jvclass { } public static void main(String[] args) { jprint x = new jprint (); - x.print (44); + x.dothat (44); print (k, 33); } } -- 2.11.0