Fix comments on `struct frame_info'.
[deliverable/binutils-gdb.git] / gdb / jv-valprint.c
index 6fd1691b2e7aebb2e0862d754ad7510fc39fb41e..9ba953ee66a09a9d9c2f03607e9ebce6c9027207 100644 (file)
@@ -1,5 +1,5 @@
 /* Support for printing Java values for GDB, the GNU debugger.
-   Copyright 1997-2000 Free Software Foundation, Inc.
+   Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -90,14 +90,16 @@ java_value_print (value_ptr val, struct ui_file *stream, int format,
 
       if (el_type == NULL)
        {
-         CORE_ADDR element, next_element;
+         CORE_ADDR element;
+         CORE_ADDR next_element = -1; /* dummy initial value */
 
          address += JAVA_OBJECT_SIZE + 4;      /* Skip object header and length. */
 
          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));
 
@@ -197,9 +199,10 @@ java_value_print (value_ptr val, struct ui_file *stream, int format,
   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;
This page took 0.02413 seconds and 4 git commands to generate.