* top.c (init_main): Make `set history file name' complete on file
[deliverable/binutils-gdb.git] / gdb / jv-valprint.c
index e19a307dac7c6de907dc93a3c95e5518812ad191..8ea67ce15fcd85bd07b825687e01e192bc93a9ae 100644 (file)
@@ -1,5 +1,5 @@
 /* Support for printing Java values for GDB, the GNU debugger.
-   Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+   Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 
 /* Local functions */
 
-static void java_print_value_fields PARAMS ((struct type * type, char *valaddr, CORE_ADDR address, GDB_FILE * stream, int format, int recurse, enum val_prettyprint pretty));
+static void java_print_value_fields (struct type * type, char *valaddr,
+                                    CORE_ADDR address,
+                                    struct ui_file *stream, int format,
+                                    int recurse,
+                                    enum val_prettyprint pretty);
 
 
 int
-java_value_print (val, stream, format, pretty)
-     value_ptr val;
-     GDB_FILE *stream;
-     int format;
-     enum val_prettyprint pretty;
+java_value_print (value_ptr val, struct ui_file *stream, int format,
+                 enum val_prettyprint pretty)
 {
   struct type *type;
   CORE_ADDR address;
@@ -95,8 +96,9 @@ java_value_print (val, stream, format, pretty)
 
          while (i < length && things_printed < print_max)
            {
-             char buf[TARGET_PTR_BIT / HOST_CHAR_BIT];
+             char *buf;
 
+             buf = alloca (TARGET_PTR_BIT / HOST_CHAR_BIT);
              fputs_filtered (", ", stream);
              wrap_here (n_spaces (2));
 
@@ -126,7 +128,7 @@ java_value_print (val, stream, format, pretty)
              if (element == 0)
                fprintf_filtered (stream, "null");
              else
-               fprintf_filtered (stream, "@%x", element);
+               fprintf_filtered (stream, "@%s", paddr_nz (element));
 
              things_printed++;
              i += reps;
@@ -196,9 +198,10 @@ java_value_print (val, stream, format, pretty)
   if (TYPE_CODE (type) == TYPE_CODE_PTR
       && TYPE_TARGET_TYPE (type)
       && TYPE_NAME (TYPE_TARGET_TYPE (type))
-    && strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "java.lang.String") == 0
+      && strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "java.lang.String") == 0
       && (format == 0 || format == 's')
-      && address != 0)
+      && address != 0
+      && value_as_pointer (val) != 0)
     {
       value_ptr data_val;
       CORE_ADDR data;
@@ -237,15 +240,9 @@ java_value_print (val, stream, format, pretty)
    should not print, or zero if called from top level.  */
 
 static void
-java_print_value_fields (type, valaddr, address, stream,
-                        format, recurse, pretty)
-     struct type *type;
-     char *valaddr;
-     CORE_ADDR address;
-     GDB_FILE *stream;
-     int format;
-     int recurse;
-     enum val_prettyprint pretty;
+java_print_value_fields (struct type *type, char *valaddr, CORE_ADDR address,
+                        struct ui_file *stream, int format, int recurse,
+                        enum val_prettyprint pretty)
 {
   int i, len, n_baseclasses;
 
@@ -446,16 +443,9 @@ java_print_value_fields (type, valaddr, address, stream,
    The PRETTY parameter controls prettyprinting.  */
 
 int
-java_val_print (type, valaddr, embedded_offset, address, stream, format,
-               deref_ref, recurse, pretty)
-     struct type *type;
-     char *valaddr;
-     CORE_ADDR address;
-     GDB_FILE *stream;
-     int format;
-     int deref_ref;
-     int recurse;
-     enum val_prettyprint pretty;
+java_val_print (struct type *type, char *valaddr, int embedded_offset,
+               CORE_ADDR address, struct ui_file *stream, int format,
+               int deref_ref, int recurse, enum val_prettyprint pretty)
 {
   register unsigned int i = 0; /* Number of characters printed */
   struct type *target_type;
This page took 0.025224 seconds and 4 git commands to generate.