aboutsummaryrefslogtreecommitdiff
path: root/gdb/jv-typeprint.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1997-09-17 03:38:30 +0000
committerPer Bothner <per@bothner.com>1997-09-17 03:38:30 +0000
commitfc655dc202bb59777269eeb2331aac40049140c2 (patch)
treedaa8e68446981dcd6e2dc3662a22a8ca60e123ed /gdb/jv-typeprint.c
parent1a6eb36b628c19e1064c342f98a7f6cb9eb3033a (diff)
downloadfsf-binutils-gdb-fc655dc202bb59777269eeb2331aac40049140c2.zip
fsf-binutils-gdb-fc655dc202bb59777269eeb2331aac40049140c2.tar.gz
fsf-binutils-gdb-fc655dc202bb59777269eeb2331aac40049140c2.tar.bz2
* jv-exp.y (push_fieldnames): New, to handle EXP.FIELD1....FIELDN.
(push_expression_name): New, to handle expression names. (push_qualified_expression_name): New, for qualified expression names. (parse_number): Fix bugs in parsing of non-decimal integers. * jv-lang.h, jv-lang.c (java_demangle_type_signature): New. * jv-lang.c (type_from_class): Just use name with java_lookup_class. (java_link_class_type): Add dummy "class" field. (java_lookup_type): New. (evaluate_subexp_java case STRUCTOP_STRUCT): Force to address. * jv-typeprint.c (java_type_print_base): Don't print "class" field. Use java_demangle_type_signature to print array class types. * jv-valprint.c (java_value_print): Preliminary array support. Print pointer as TYPE@HEXADDR, instead of (TYPE)0xHEXADDR. (java_val_print): Move check for object type to java_value_print. Check for null. Print pointer as @HEXADDR, not 0xHEXADDR.
Diffstat (limited to 'gdb/jv-typeprint.c')
-rw-r--r--gdb/jv-typeprint.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gdb/jv-typeprint.c b/gdb/jv-typeprint.c
index b3a20cc..4c5a204 100644
--- a/gdb/jv-typeprint.c
+++ b/gdb/jv-typeprint.c
@@ -103,8 +103,20 @@ java_type_print_base (type, stream, show, level)
switch (TYPE_CODE (type))
{
+ case TYPE_CODE_PTR:
+ java_type_print_base (TYPE_TARGET_TYPE (type), stream, show, level);
+ break;
+
case TYPE_CODE_STRUCT:
- fprintf_filtered (stream, "class ");
+ if (TYPE_TAG_NAME (type) != NULL && TYPE_TAG_NAME (type)[0] == '[')
+ { /* array type */
+ char *name = java_demangle_type_signature (TYPE_TAG_NAME (type));
+ fputs (name, stream);
+ free (name);
+ break;
+ }
+ if (show >= 0)
+ fprintf_filtered (stream, "class ");
if (TYPE_TAG_NAME (type) != NULL)
{
fputs_filtered (TYPE_TAG_NAME (type), stream);
@@ -143,8 +155,9 @@ java_type_print_base (type, stream, show, level)
&& is_cplus_marker ((TYPE_FIELD_NAME (type, i))[5]))
continue;
- /* If this is a C++ class we can print the various C++ section
- labels. */
+ /* Don't print the dummy field "class". */
+ if (STREQN (TYPE_FIELD_NAME (type, i), "class", 5))
+ continue;
print_spaces_filtered (level + 4, stream);
if (HAVE_CPLUS_STRUCT (type))