Index: gdb/jv-valprint.c |
diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c |
index d1274dd81a375577ffe7ed84aa4f295dd797a505..f465ca09e35ca2b3d382fb705b78825b99b06c40 100644 |
--- a/gdb/jv-valprint.c |
+++ b/gdb/jv-valprint.c |
@@ -1,6 +1,6 @@ |
/* Support for printing Java values for GDB, the GNU debugger. |
- Copyright (C) 1997-2005, 2007-2012 Free Software Foundation, Inc. |
+ Copyright (C) 1997-2013 Free Software Foundation, Inc. |
This file is part of GDB. |
@@ -29,7 +29,7 @@ |
#include "jv-lang.h" |
#include "c-lang.h" |
#include "annotate.h" |
-#include "gdb_string.h" |
+#include <string.h> |
/* Local functions */ |
@@ -299,7 +299,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr, |
boffset = 0; |
- if (options->pretty) |
+ if (options->prettyformat) |
{ |
fprintf_filtered (stream, "\n"); |
print_spaces_filtered (2 * (recurse + 1), stream); |
@@ -341,7 +341,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr, |
fprintf_filtered (stream, ", "); |
else if (n_baseclasses > 0) |
{ |
- if (options->pretty) |
+ if (options->prettyformat) |
{ |
fprintf_filtered (stream, "\n"); |
print_spaces_filtered (2 + 2 * recurse, stream); |
@@ -352,7 +352,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr, |
} |
fields_seen = 1; |
- if (options->pretty) |
+ if (options->prettyformat) |
{ |
fprintf_filtered (stream, "\n"); |
print_spaces_filtered (2 + 2 * recurse, stream); |
@@ -361,36 +361,17 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr, |
{ |
wrap_here (n_spaces (2 + 2 * recurse)); |
} |
- if (options->inspect_it) |
- { |
- if (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_PTR) |
- fputs_filtered ("\"( ptr \"", stream); |
- else |
- fputs_filtered ("\"( nodef \"", stream); |
- if (field_is_static (&TYPE_FIELD (type, i))) |
- fputs_filtered ("static ", stream); |
- fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), |
- language_cplus, |
- DMGL_PARAMS | DMGL_ANSI); |
- fputs_filtered ("\" \"", stream); |
- fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), |
- language_cplus, |
- DMGL_PARAMS | DMGL_ANSI); |
- fputs_filtered ("\") \"", stream); |
- } |
- else |
- { |
- annotate_field_begin (TYPE_FIELD_TYPE (type, i)); |
- |
- if (field_is_static (&TYPE_FIELD (type, i))) |
- fputs_filtered ("static ", stream); |
- fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), |
- language_cplus, |
- DMGL_PARAMS | DMGL_ANSI); |
- annotate_field_name_end (); |
- fputs_filtered (": ", stream); |
- annotate_field_value (); |
- } |
+ |
+ annotate_field_begin (TYPE_FIELD_TYPE (type, i)); |
+ |
+ if (field_is_static (&TYPE_FIELD (type, i))) |
+ fputs_filtered ("static ", stream); |
+ fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), |
+ language_cplus, |
+ DMGL_PARAMS | DMGL_ANSI); |
+ annotate_field_name_end (); |
+ fputs_filtered (": ", stream); |
+ annotate_field_value (); |
if (!field_is_static (&TYPE_FIELD (type, i)) |
&& TYPE_FIELD_PACKED (type, i)) |
@@ -414,7 +395,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr, |
else if (!value_bits_valid (val, TYPE_FIELD_BITPOS (type, i), |
TYPE_FIELD_BITSIZE (type, i))) |
{ |
- val_print_optimized_out (stream); |
+ val_print_optimized_out (val, stream); |
} |
else |
{ |
@@ -436,22 +417,16 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr, |
} |
else if (field_is_static (&TYPE_FIELD (type, i))) |
{ |
+ struct value_print_options opts; |
struct value *v = value_static_field (type, i); |
+ struct type *t = check_typedef (value_type (v)); |
- if (v == NULL) |
- val_print_optimized_out (stream); |
- else |
- { |
- struct value_print_options opts; |
- struct type *t = check_typedef (value_type (v)); |
- |
- if (TYPE_CODE (t) == TYPE_CODE_STRUCT) |
- v = value_addr (v); |
- opts = *options; |
- opts.deref_ref = 0; |
- common_val_print (v, stream, recurse + 1, |
- &opts, current_language); |
- } |
+ if (TYPE_CODE (t) == TYPE_CODE_STRUCT) |
+ v = value_addr (v); |
+ opts = *options; |
+ opts.deref_ref = 0; |
+ common_val_print (v, stream, recurse + 1, |
+ &opts, current_language); |
} |
else if (TYPE_FIELD_TYPE (type, i) == NULL) |
fputs_filtered ("<unknown type>", stream); |
@@ -470,7 +445,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr, |
annotate_field_end (); |
} |
- if (options->pretty) |
+ if (options->prettyformat) |
{ |
fprintf_filtered (stream, "\n"); |
print_spaces_filtered (2 * recurse, stream); |
@@ -490,7 +465,6 @@ java_val_print (struct type *type, const gdb_byte *valaddr, |
const struct value_print_options *options) |
{ |
struct gdbarch *gdbarch = get_type_arch (type); |
- unsigned int i = 0; /* Number of characters printed. */ |
struct type *target_type; |
CORE_ADDR addr; |