From a871ab927b2b14985d14d079d20946aceea72aea Mon Sep 17 00:00:00 2001 From: Peter Schauer Date: Fri, 1 May 1998 16:31:51 +0000 Subject: [PATCH] * breakpoint.c (delete_command): Skip internal breakpoints when all breakpoints are requested. * stabsread.c (define_symbol): Record parameter types from Sunpro function stabs in the TYPE_FIELDS of the function type. --- gdb/ChangeLog | 8 ++++++++ gdb/stabsread.c | 49 +++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 47 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7a56bcc36c..b307fe51d7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +Fri May 1 09:29:56 1998 Peter Schauer + + * breakpoint.c (delete_command): Skip internal breakpoints when + all breakpoints are requested. + + * stabsread.c (define_symbol): Record parameter types from Sunpro + function stabs in the TYPE_FIELDS of the function type. + Thu Apr 30 15:59:54 1998 Jason Molenda (crash@bugshack.cygnus.com) * Makefile.in (config-check-targets, config-check-hosts): Removed. diff --git a/gdb/stabsread.c b/gdb/stabsread.c index ba1f6f4806..e873610ba1 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -1,5 +1,5 @@ /* Support routines for decoding "stabs" debugging information format. - Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 1997 + Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. This file is part of GDB. @@ -1616,18 +1616,47 @@ define_symbol (valu, string, desc, type, objfile) /* fall into process_prototype_types */ process_prototype_types: - /* Sun acc puts declared types of arguments here. We don't care - about their actual types (FIXME -- we should remember the whole - function prototype), but the list may define some new types - that we have to remember, so we must scan it now. */ + /* Sun acc puts declared types of arguments here. */ if (*p == ';') { - TYPE_FLAGS (SYMBOL_TYPE (sym)) |= TYPE_FLAG_PROTOTYPED; + struct type *ftype = SYMBOL_TYPE (sym); + int nsemi = 0; + int nparams = 0; + char *p1 = p; - while (*p == ';') { - p++; - read_type (&p, objfile); - } + /* Obtain a worst case guess for the number of arguments + by counting the semicolons. */ + while (*p1) + { + if (*p1++ == ';') + nsemi++; + } + + /* Allocate parameter information fields and fill them in. */ + TYPE_FIELDS (ftype) = (struct field *) + TYPE_ALLOC (ftype, nsemi * sizeof (struct field)); + while (*p++ == ';') + { + struct type *ptype; + + /* A type number of zero indicates the start of varargs. + FIXME: GDB currently ignores vararg functions. */ + if (p[0] == '0' && p[1] == '\0') + break; + ptype = read_type (&p, objfile); + + /* The Sun compilers mark integer arguments, which should + be promoted to the width of the calling conventions, with + a type which references itself. This type is turned into + a TYPE_CODE_VOID type by read_type, and we have to turn + it back into builtin_type_int here. + FIXME: Do we need a new builtin_type_promoted_int_arg ? */ + if (TYPE_CODE (ptype) == TYPE_CODE_VOID) + ptype = builtin_type_int; + TYPE_FIELD_TYPE (ftype, nparams++) = ptype; + } + TYPE_NFIELDS (ftype) = nparams; + TYPE_FLAGS (ftype) |= TYPE_FLAG_PROTOTYPED; } break;