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 | |
parent | 98c1b9e79b2344c48de7900574035670c3f91afb (diff) | |
download | ppe42-binutils-aec4cb918e549e6eafb8a49c741d0b417956d445.tar.gz ppe42-binutils-aec4cb918e549e6eafb8a49c741d0b417956d445.zip |
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.
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/dbxread.c | 2 | ||||
-rw-r--r-- | gdb/symtab.c | 2 | ||||
-rw-r--r-- | gdb/symtab.h | 2 | ||||
-rw-r--r-- | gdb/valprint.c | 12 | ||||
-rw-r--r-- | gdb/values.c | 14 |
6 files changed, 31 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e88a0986d3..93535740b2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +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. + Mon Apr 29 13:22:51 1991 Jim Kingdon (kingdon at cygint.cygnus.com) * Move BROKEN_LARGE_ALLOCA from tm-sun386.h to xm-sun386.h. diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 8c72ad565c..176065627c 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -3309,7 +3309,7 @@ define_symbol (valu, string, desc, type) } else { SYMBOL_LINE(sym) = 0; /* unknown */ } - + if (string[0] == CPLUS_MARKER) { /* Special GNU C++ names. */ diff --git a/gdb/symtab.c b/gdb/symtab.c index 15e2ad6806..17cc62693d 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -1933,7 +1933,7 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line) p = *argptr; while (*p && *p != ' ' && *p != '\t' && *p != ',' && *p !=':') p++; q = operator_chars (*argptr, &q1); - + copy = (char *) alloca (p - *argptr + 1 + (q1 - q)); if (q1 - q) { diff --git a/gdb/symtab.h b/gdb/symtab.h index 26328123b9..d9746e8baf 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -759,7 +759,7 @@ int current_source_line; /* The virtual function table is now an array of structures which have the form { int16 offset, delta; void *pfn; }. - + In normal virtual function tables, OFFSET is unused. DELTA is the amount which is added to the apparent object's base address in order to point to the actual object to which the diff --git a/gdb/valprint.c b/gdb/valprint.c index 42248ccac7..4dc9778622 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. */ diff --git a/gdb/values.c b/gdb/values.c index 2981265b57..670ed245be 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -50,7 +50,6 @@ struct value_history_chunk static struct value_history_chunk *value_history_chain; static int value_history_count; /* Abs number of last entry stored */ - /* List of all value objects currently allocated (except for those released by calls to release_value) @@ -930,7 +929,13 @@ value_headof (arg, btype, dtype) CORE_ADDR pc_for_sym; char *demangled_name; - vtbl = value_ind (value_field (value_ind (arg), TYPE_VPTR_FIELDNO (dtype))); + btype = TYPE_VPTR_BASETYPE (dtype); + check_stub_type (btype); + if (btype != dtype) + vtbl = value_cast (lookup_pointer_type (btype), arg); + else + vtbl = arg; + vtbl = value_ind (value_field (value_ind (vtbl), TYPE_VPTR_FIELDNO (btype))); /* Check that VTBL looks like it points to a virtual function table. */ i = find_pc_misc_function (VALUE_ADDRESS (vtbl)); @@ -1021,7 +1026,6 @@ value_static_field (type, fieldname, fieldno) if (fieldno < 0) { - register struct type *t = type; /* Look for static field. */ int i; for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--) @@ -1084,7 +1088,7 @@ baseclass_addr (type, index, valaddr, valuep, errp) if (errp) *errp = 0; - + if (BASETYPE_VIA_VIRTUAL (type, index)) { /* Must hunt for the pointer to this virtual baseclass. */ @@ -1255,7 +1259,7 @@ check_stub_method (type, i, j) argtypes[argcount] = NULL; /* List terminator */ free (demangled_name); - + type = lookup_method_type (type, TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)), argtypes); /* Free the stub type...it's no longer needed. */ free (TYPE_FN_FIELD_TYPE (f, j)); |