* stabsread.c (read_type): Fix handling of template names

with template parameters containing `::'.

	* valops.c (search_struct_field, search_struct_method):
	Pass correct valaddr parameter to baseclass_offset.
	Prevent gdb crashes by making sure that the virtual base pointer
	from an user object still points to accessible memory.
This commit is contained in:
Peter Schauer 1997-02-22 11:42:07 +00:00
parent 50b264e375
commit f3cc5a0ea4
2 changed files with 25 additions and 9 deletions

View file

@ -1,3 +1,13 @@
Sat Feb 22 03:39:50 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* stabsread.c (read_type): Fix handling of template names
with template parameters containing `::'.
* valops.c (search_struct_field, search_struct_method):
Pass correct valaddr parameter to baseclass_offset.
Prevent gdb crashes by making sure that the virtual base pointer
from an user object still points to accessible memory.
Tue Feb 18 13:36:34 1997 Mark Alexander <marka@cygnus.com>
* maint.c: Eliminate -Wall warnings by including some header files.

View file

@ -1,5 +1,5 @@
/* Support routines for decoding "stabs" debugging information format.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996
Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 1997
Free Software Foundation, Inc.
This file is part of GDB.
@ -1957,15 +1957,21 @@ read_type (pp, objfile)
p = strchr(*pp, ':');
if (p == NULL)
return error_type (pp, objfile);
while (q1 && p > q1 && p[1] == ':')
if (q1 && p > q1 && p[1] == ':')
{
q2 = strchr(q1, '>');
if (!q2 || q2 < p)
break;
p += 2;
p = strchr(p, ':');
if (p == NULL)
return error_type (pp, objfile);
int nesting_level = 0;
for (q2 = q1; *q2; q2++)
{
if (*q2 == '<')
nesting_level++;
else if (*q2 == '>')
nesting_level--;
else if (*q2 == ':' && nesting_level == 0)
break;
}
p = q2;
if (*p != ':')
return error_type (pp, objfile);
}
to = type_name =
(char *)obstack_alloc (&objfile->type_obstack, p - *pp + 1);