Add macros to handle NOP insertion.
[deliverable/binutils-gdb.git] / gdb / ch-valprint.c
index fcc821f6e92c780637d9376e4f61a13ded9890da..911c693f3c0e8ca5163fe2e3089076949aa66685 100644 (file)
@@ -422,11 +422,15 @@ chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
          switch (TYPE_CODE (inner))
            {
            case TYPE_CODE_STRING:
-             if (length > TYPE_LENGTH (type))
+             if (length > TYPE_LENGTH (type) - 2)
                {
                  fprintf_filtered (stream,
-                                   "<dynamic length %ld > static length %d>",
+                                   "<dynamic length %ld > static length %d> *invalid*",
                                    length, TYPE_LENGTH (type));
+
+                 /* Don't print the string; doing so might produce a
+                    segfault.  */
+                 return length;
                }
              LA_PRINT_STRING (stream, data_addr, length, 0);
              return length;
@@ -459,7 +463,8 @@ chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
                value_at
                  (TYPE_TARGET_TYPE (type),
                   unpack_pointer (lookup_pointer_type (builtin_type_void),
-                                  valaddr));
+                                  valaddr),
+                  NULL);
              val_print (VALUE_TYPE (deref_val),
                         VALUE_CONTENTS (deref_val),
                         VALUE_ADDRESS (deref_val), stream, format,
This page took 0.023283 seconds and 4 git commands to generate.