diff options
author | Michael Tiemann <tiemann@cygnus> | 1991-04-30 20:19:02 +0000 |
---|---|---|
committer | Michael Tiemann <tiemann@cygnus> | 1991-04-30 20:19:02 +0000 |
commit | aec4cb918e549e6eafb8a49c741d0b417956d445 (patch) | |
tree | b4787df0a972acd17e51b5362d07ba285cc798c9 /gdb/valprint.c | |
parent | 98c1b9e79b2344c48de7900574035670c3f91afb (diff) | |
download | gdb-aec4cb918e549e6eafb8a49c741d0b417956d445.zip gdb-aec4cb918e549e6eafb8a49c741d0b417956d445.tar.gz gdb-aec4cb918e549e6eafb8a49c741d0b417956d445.tar.bz2 |
Tue Apr 30 13:13:33 1991 Michael Tiemann (tiemann at cygint.cygnus.com)
* valprint.c (type_print_base): If the type being printed is a
struct containing undefined types, print "<undefine type>"
as the type instead of crashing.
* values.c (value_headof): Get the vtable pointer taking
TYPE_VPTR_BASETYPE into account.
* symtab.c, symtab.h, dbxread.c: Fix various whitespace splotches.
Diffstat (limited to 'gdb/valprint.c')
-rw-r--r-- | gdb/valprint.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gdb/valprint.c b/gdb/valprint.c index 42248cc..4dc9778 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -301,7 +301,7 @@ value_print (val, stream, format, pretty) printf_filtered ("<value optimized out>"); return 0; } - + /* A "repeated" value really contains several values in a row. They are made by the @ operator. Print such values as if they were arrays. */ @@ -1640,7 +1640,15 @@ type_print_base (type, stream, show, level) fprintf_filtered (stream, "virtual "); else if (TYPE_FN_FIELD_STATIC_P (f, j)) fprintf_filtered (stream, "static "); - type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)), "", stream, 0); + if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) == 0) + { + /* Keep GDB from crashing here. */ + fprintf (stream, "<undefined type> %s;\n", + TYPE_FN_FIELD_PHYSNAME (f, j)); + break; + } + else + type_print (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)), "", stream, 0); if (TYPE_FLAGS (TYPE_FN_FIELD_TYPE (f, j)) & TYPE_FLAG_STUB) { /* Build something we can demangle. */ |