aboutsummaryrefslogtreecommitdiff
path: root/gdb/cp-valprint.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-07-30 01:42:09 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-07-30 01:42:09 +0000
commit1410f5f13bd8bcaeeedfbb8c642a0d1545b703ce (patch)
treed29eb6dbe46a19520c227708c9479ba5cc17bb1c /gdb/cp-valprint.c
parent0ccc65ec790860deb3630665bfacafbe71ffd5b1 (diff)
downloadgdb-1410f5f13bd8bcaeeedfbb8c642a0d1545b703ce.zip
gdb-1410f5f13bd8bcaeeedfbb8c642a0d1545b703ce.tar.gz
gdb-1410f5f13bd8bcaeeedfbb8c642a0d1545b703ce.tar.bz2
* cp-valprint.c (cplus_print_value): Don't dump core if the
baseclass doesn't have a name. * values.c (vb_match): New function, which finds the virtual base class pointer even if the types are nameless. (baseclass_{addr,offset}): Use it.
Diffstat (limited to 'gdb/cp-valprint.c')
-rw-r--r--gdb/cp-valprint.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 680a75d..bde5879 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -338,6 +338,7 @@ cplus_print_value (type, valaddr, stream, format, recurse, pretty, dont_print)
{
char *baddr;
int err;
+ char *basename = TYPE_NAME (TYPE_BASECLASS (type, i));
if (BASETYPE_VIA_VIRTUAL (type, i))
{
@@ -357,8 +358,8 @@ cplus_print_value (type, valaddr, stream, format, recurse, pretty, dont_print)
/* Fix to use baseclass_offset instead. FIXME */
baddr = baseclass_addr (type, i, valaddr, 0, &err);
if (err == 0 && baddr == 0)
- error ("could not find virtual baseclass `%s'\n",
- type_name_no_tag (TYPE_BASECLASS (type, i)));
+ error ("could not find virtual baseclass %s\n",
+ basename ? basename : "");
if (pretty)
{
@@ -366,7 +367,9 @@ cplus_print_value (type, valaddr, stream, format, recurse, pretty, dont_print)
print_spaces_filtered (2 * recurse, stream);
}
fputs_filtered ("<", stream);
- fputs_filtered (type_name_no_tag (TYPE_BASECLASS (type, i)), stream);
+ /* Not sure what the best notation is in the case where there is no
+ baseclass name. */
+ fputs_filtered (basename ? basename : "", stream);
fputs_filtered ("> = ", stream);
if (err != 0)
fprintf_filtered (stream, "<invalid address 0x%x>", baddr);