aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Schauer <Peter.Schauer@mytum.de>1997-02-22 11:42:07 +0000
committerPeter Schauer <Peter.Schauer@mytum.de>1997-02-22 11:42:07 +0000
commitf3cc5a0ea42542dd745389414da0bb37581fa1d8 (patch)
tree71d9375896b2dd8dd398d240a6a292a9ddf19e73
parent50b264e375f49f5e0a15711206426cff21e055cb (diff)
downloadgdb-f3cc5a0ea42542dd745389414da0bb37581fa1d8.zip
gdb-f3cc5a0ea42542dd745389414da0bb37581fa1d8.tar.gz
gdb-f3cc5a0ea42542dd745389414da0bb37581fa1d8.tar.bz2
* 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.
-rw-r--r--gdb/ChangeLog10
-rw-r--r--gdb/stabsread.c24
2 files changed, 25 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 009a540..e82f3ba 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 175415d..e779c93 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -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);