2003-01-13 Elena Zannoni <ezannoni@redhat.com>
* stabsread.h (process_later, resolve_cfront_continuation): Obsolete. Update copyright years. * buildsym.c (start_subfile): Obsolete comment pertinent to Cfront. Update copyright year. * dbxread.c(struct cont_elem): Obsolete. (process_later, process_now): Obsolete functions. (read_dbx_symtab, read_ofile_symtab): Obsolete cfront support. Update copyright year. * gdbtypes.c (INIT_EXTRA, ADD_EXTRA): Obsolete macros. (add_name, add_mangled_type, cfront_mangle_name): Obsolete functions. * mdebugread.c (parse_type): Obsolete comment pertinent to Cfront. (parse_partial_symbols): Obsolete cfront support. * stabsread.c (CFRONT_VISIBILITY_PRIVATE,CFRONT_VISIBILITY_PUBLIC): Obsolete macros. (get_substring, get_cfront_method_physname, msg_unknown_complaint, read_cfront_baseclasses, read_cfront_member_functions, resolve_cfront_continuation,read_cfront_static_fields, copy_cfront_struct_fields): Obsolete functions. (define_symbol, read_one_struct_field): Obsolete cfront support. * xcoffread.c (scan_xcoff_symtab): Obsolete CFront support. Update Copyright year.
This commit is contained in:
parent
7789c6f56a
commit
25caa7a88b
8 changed files with 1011 additions and 953 deletions
|
@ -1,3 +1,29 @@
|
|||
2003-01-13 Elena Zannoni <ezannoni@redhat.com>
|
||||
|
||||
* stabsread.h (process_later, resolve_cfront_continuation):
|
||||
Obsolete.
|
||||
Update copyright years.
|
||||
* buildsym.c (start_subfile): Obsolete comment pertinent to Cfront.
|
||||
Update copyright year.
|
||||
* dbxread.c(struct cont_elem): Obsolete.
|
||||
(process_later, process_now): Obsolete functions.
|
||||
(read_dbx_symtab, read_ofile_symtab): Obsolete cfront support.
|
||||
Update copyright year.
|
||||
* gdbtypes.c (INIT_EXTRA, ADD_EXTRA): Obsolete macros.
|
||||
(add_name, add_mangled_type, cfront_mangle_name): Obsolete functions.
|
||||
* mdebugread.c (parse_type): Obsolete comment pertinent to Cfront.
|
||||
(parse_partial_symbols): Obsolete cfront support.
|
||||
* stabsread.c
|
||||
(CFRONT_VISIBILITY_PRIVATE,CFRONT_VISIBILITY_PUBLIC): Obsolete
|
||||
macros.
|
||||
(get_substring, get_cfront_method_physname, msg_unknown_complaint,
|
||||
read_cfront_baseclasses, read_cfront_member_functions,
|
||||
resolve_cfront_continuation,read_cfront_static_fields,
|
||||
copy_cfront_struct_fields): Obsolete functions.
|
||||
(define_symbol, read_one_struct_field): Obsolete cfront support.
|
||||
* xcoffread.c (scan_xcoff_symtab): Obsolete CFront support.
|
||||
Update Copyright year.
|
||||
|
||||
2003-01-13 Elena Zannoni <ezannoni@redhat.com>
|
||||
|
||||
* stack.c (print_frame_info, print_stack_frame_base_stub,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* Support routines for building symbol tables in GDB's internal format.
|
||||
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
|
||||
1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
|
@ -609,15 +610,17 @@ start_subfile (char *name, char *dirname)
|
|||
later via a call to record_debugformat. */
|
||||
subfile->debugformat = NULL;
|
||||
|
||||
/* cfront output is a C program, so in most ways it looks like a C
|
||||
program. But to demangle we need to set the language to C++. We
|
||||
can distinguish cfront code by the fact that it has #line
|
||||
directives which specify a file name ending in .C.
|
||||
|
||||
So if the filename of this subfile ends in .C, then change the
|
||||
#if 0 /* OBSOLETE CFront */
|
||||
// OBSOLETE /* cfront output is a C program, so in most ways it looks like a C
|
||||
// OBSOLETE program. But to demangle we need to set the language to C++. We
|
||||
// OBSOLETE can distinguish cfront code by the fact that it has #line
|
||||
// OBSOLETE directives which specify a file name ending in .C. */
|
||||
#endif /* OBSOLETE CFront */
|
||||
|
||||
/* If the filename of this subfile ends in .C, then change the
|
||||
language of any pending subfiles from C to C++. We also accept
|
||||
any other C++ suffixes accepted by deduce_language_from_filename
|
||||
(in particular, some people use .cxx with cfront). */
|
||||
any other C++ suffixes accepted by deduce_language_from_filename. */
|
||||
/* OBSOLETE (in particular, some people use .cxx with cfront). */
|
||||
/* Likewise for f2c. */
|
||||
|
||||
if (subfile->name)
|
||||
|
|
230
gdb/dbxread.c
230
gdb/dbxread.c
|
@ -1,6 +1,6 @@
|
|||
/* Read dbx symbol tables and convert to internal format, for GDB.
|
||||
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
|
||||
1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003.
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
@ -257,7 +257,9 @@ static int bincls_allocated;
|
|||
|
||||
extern void _initialize_dbxread (void);
|
||||
|
||||
static void process_now (struct objfile *);
|
||||
#if 0 /* OBSOLETE CFront */
|
||||
// OBSOLETE static void process_now (struct objfile *);
|
||||
#endif /* OBSOLETE CFront */
|
||||
|
||||
static void read_ofile_symtab (struct partial_symtab *);
|
||||
|
||||
|
@ -770,105 +772,106 @@ static struct external_nlist symbuf[4096];
|
|||
static int symbuf_idx;
|
||||
static int symbuf_end;
|
||||
|
||||
/* cont_elem is used for continuing information in cfront.
|
||||
It saves information about which types need to be fixed up and
|
||||
completed after all the stabs are read. */
|
||||
struct cont_elem
|
||||
{
|
||||
/* sym and stabstring for continuing information in cfront */
|
||||
struct symbol *sym;
|
||||
char *stabs;
|
||||
/* state dependencies (statics that must be preserved) */
|
||||
int sym_idx;
|
||||
int sym_end;
|
||||
int symnum;
|
||||
int (*func) (struct objfile *, struct symbol *, char *);
|
||||
/* other state dependencies include:
|
||||
(assumption is that these will not change since process_now FIXME!!)
|
||||
stringtab_global
|
||||
n_stabs
|
||||
objfile
|
||||
symfile_bfd */
|
||||
};
|
||||
#if 0 /* OBSOLETE CFront */
|
||||
// OBSOLETE /* cont_elem is used for continuing information in cfront.
|
||||
// OBSOLETE It saves information about which types need to be fixed up and
|
||||
// OBSOLETE completed after all the stabs are read. */
|
||||
// OBSOLETE struct cont_elem
|
||||
// OBSOLETE {
|
||||
// OBSOLETE /* sym and stabstring for continuing information in cfront */
|
||||
// OBSOLETE struct symbol *sym;
|
||||
// OBSOLETE char *stabs;
|
||||
// OBSOLETE /* state dependencies (statics that must be preserved) */
|
||||
// OBSOLETE int sym_idx;
|
||||
// OBSOLETE int sym_end;
|
||||
// OBSOLETE int symnum;
|
||||
// OBSOLETE int (*func) (struct objfile *, struct symbol *, char *);
|
||||
// OBSOLETE /* other state dependencies include:
|
||||
// OBSOLETE (assumption is that these will not change since process_now FIXME!!)
|
||||
// OBSOLETE stringtab_global
|
||||
// OBSOLETE n_stabs
|
||||
// OBSOLETE objfile
|
||||
// OBSOLETE symfile_bfd */
|
||||
// OBSOLETE };
|
||||
|
||||
static struct cont_elem *cont_list = 0;
|
||||
static int cont_limit = 0;
|
||||
static int cont_count = 0;
|
||||
// OBSOLETE static struct cont_elem *cont_list = 0;
|
||||
// OBSOLETE static int cont_limit = 0;
|
||||
// OBSOLETE static int cont_count = 0;
|
||||
|
||||
/* Arrange for function F to be called with arguments SYM and P later
|
||||
in the stabs reading process. */
|
||||
void
|
||||
process_later (struct symbol *sym, char *p,
|
||||
int (*f) (struct objfile *, struct symbol *, char *))
|
||||
{
|
||||
// OBSOLETE /* Arrange for function F to be called with arguments SYM and P later
|
||||
// OBSOLETE in the stabs reading process. */
|
||||
// OBSOLETE void
|
||||
// OBSOLETE process_later (struct symbol *sym, char *p,
|
||||
// OBSOLETE int (*f) (struct objfile *, struct symbol *, char *))
|
||||
// OBSOLETE {
|
||||
|
||||
/* Allocate more space for the deferred list. */
|
||||
if (cont_count >= cont_limit - 1)
|
||||
{
|
||||
cont_limit += 32; /* chunk size */
|
||||
// OBSOLETE /* Allocate more space for the deferred list. */
|
||||
// OBSOLETE if (cont_count >= cont_limit - 1)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE cont_limit += 32; /* chunk size */
|
||||
|
||||
cont_list
|
||||
= (struct cont_elem *) xrealloc (cont_list,
|
||||
(cont_limit
|
||||
* sizeof (struct cont_elem)));
|
||||
if (!cont_list)
|
||||
error ("Virtual memory exhausted\n");
|
||||
}
|
||||
// OBSOLETE cont_list
|
||||
// OBSOLETE = (struct cont_elem *) xrealloc (cont_list,
|
||||
// OBSOLETE (cont_limit
|
||||
// OBSOLETE * sizeof (struct cont_elem)));
|
||||
// OBSOLETE if (!cont_list)
|
||||
// OBSOLETE error ("Virtual memory exhausted\n");
|
||||
// OBSOLETE }
|
||||
|
||||
/* Save state variables so we can process these stabs later. */
|
||||
cont_list[cont_count].sym_idx = symbuf_idx;
|
||||
cont_list[cont_count].sym_end = symbuf_end;
|
||||
cont_list[cont_count].symnum = symnum;
|
||||
cont_list[cont_count].sym = sym;
|
||||
cont_list[cont_count].stabs = p;
|
||||
cont_list[cont_count].func = f;
|
||||
cont_count++;
|
||||
}
|
||||
// OBSOLETE /* Save state variables so we can process these stabs later. */
|
||||
// OBSOLETE cont_list[cont_count].sym_idx = symbuf_idx;
|
||||
// OBSOLETE cont_list[cont_count].sym_end = symbuf_end;
|
||||
// OBSOLETE cont_list[cont_count].symnum = symnum;
|
||||
// OBSOLETE cont_list[cont_count].sym = sym;
|
||||
// OBSOLETE cont_list[cont_count].stabs = p;
|
||||
// OBSOLETE cont_list[cont_count].func = f;
|
||||
// OBSOLETE cont_count++;
|
||||
// OBSOLETE }
|
||||
|
||||
/* Call deferred funtions in CONT_LIST. */
|
||||
// OBSOLETE /* Call deferred funtions in CONT_LIST. */
|
||||
|
||||
static void
|
||||
process_now (struct objfile *objfile)
|
||||
{
|
||||
int i;
|
||||
int save_symbuf_idx;
|
||||
int save_symbuf_end;
|
||||
int save_symnum;
|
||||
struct symbol *sym;
|
||||
char *stabs;
|
||||
int err;
|
||||
int (*func) (struct objfile *, struct symbol *, char *);
|
||||
// OBSOLETE static void
|
||||
// OBSOLETE process_now (struct objfile *objfile)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int i;
|
||||
// OBSOLETE int save_symbuf_idx;
|
||||
// OBSOLETE int save_symbuf_end;
|
||||
// OBSOLETE int save_symnum;
|
||||
// OBSOLETE struct symbol *sym;
|
||||
// OBSOLETE char *stabs;
|
||||
// OBSOLETE int err;
|
||||
// OBSOLETE int (*func) (struct objfile *, struct symbol *, char *);
|
||||
|
||||
/* Save the state of our caller, we'll want to restore it before
|
||||
returning. */
|
||||
save_symbuf_idx = symbuf_idx;
|
||||
save_symbuf_end = symbuf_end;
|
||||
save_symnum = symnum;
|
||||
// OBSOLETE /* Save the state of our caller, we'll want to restore it before
|
||||
// OBSOLETE returning. */
|
||||
// OBSOLETE save_symbuf_idx = symbuf_idx;
|
||||
// OBSOLETE save_symbuf_end = symbuf_end;
|
||||
// OBSOLETE save_symnum = symnum;
|
||||
|
||||
/* Iterate over all the deferred stabs. */
|
||||
for (i = 0; i < cont_count; i++)
|
||||
{
|
||||
/* Restore the state for this deferred stab. */
|
||||
symbuf_idx = cont_list[i].sym_idx;
|
||||
symbuf_end = cont_list[i].sym_end;
|
||||
symnum = cont_list[i].symnum;
|
||||
sym = cont_list[i].sym;
|
||||
stabs = cont_list[i].stabs;
|
||||
func = cont_list[i].func;
|
||||
// OBSOLETE /* Iterate over all the deferred stabs. */
|
||||
// OBSOLETE for (i = 0; i < cont_count; i++)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE /* Restore the state for this deferred stab. */
|
||||
// OBSOLETE symbuf_idx = cont_list[i].sym_idx;
|
||||
// OBSOLETE symbuf_end = cont_list[i].sym_end;
|
||||
// OBSOLETE symnum = cont_list[i].symnum;
|
||||
// OBSOLETE sym = cont_list[i].sym;
|
||||
// OBSOLETE stabs = cont_list[i].stabs;
|
||||
// OBSOLETE func = cont_list[i].func;
|
||||
|
||||
/* Call the function to handle this deferrd stab. */
|
||||
err = (*func) (objfile, sym, stabs);
|
||||
if (err)
|
||||
error ("Internal error: unable to resolve stab.\n");
|
||||
}
|
||||
|
||||
/* Restore our caller's state. */
|
||||
symbuf_idx = save_symbuf_idx;
|
||||
symbuf_end = save_symbuf_end;
|
||||
symnum = save_symnum;
|
||||
cont_count = 0;
|
||||
}
|
||||
// OBSOLETE /* Call the function to handle this deferrd stab. */
|
||||
// OBSOLETE err = (*func) (objfile, sym, stabs);
|
||||
// OBSOLETE if (err)
|
||||
// OBSOLETE error ("Internal error: unable to resolve stab.\n");
|
||||
// OBSOLETE }
|
||||
|
||||
// OBSOLETE /* Restore our caller's state. */
|
||||
// OBSOLETE symbuf_idx = save_symbuf_idx;
|
||||
// OBSOLETE symbuf_end = save_symbuf_end;
|
||||
// OBSOLETE symnum = save_symnum;
|
||||
// OBSOLETE cont_count = 0;
|
||||
// OBSOLETE }
|
||||
#endif /* OBSOLETE CFront */
|
||||
|
||||
/* Name of last function encountered. Used in Solaris to approximate
|
||||
object file boundaries. */
|
||||
|
@ -1775,20 +1778,22 @@ read_dbx_symtab (struct objfile *objfile)
|
|||
psymtab_language, objfile);
|
||||
p += 1;
|
||||
}
|
||||
/* The semantics of C++ state that "struct foo { ... }"
|
||||
also defines a typedef for "foo". Unfortuantely, cfront
|
||||
never makes the typedef when translating from C++ to C.
|
||||
We make the typedef here so that "ptype foo" works as
|
||||
expected for cfront translated code. */
|
||||
else if (psymtab_language == language_cplus)
|
||||
{
|
||||
/* Also a typedef with the same name. */
|
||||
add_psymbol_to_list (namestring, p - namestring,
|
||||
VAR_NAMESPACE, LOC_TYPEDEF,
|
||||
&objfile->static_psymbols,
|
||||
nlist.n_value, 0,
|
||||
psymtab_language, objfile);
|
||||
}
|
||||
#if 0 /* OBSOLETE CFront */
|
||||
// OBSOLETE /* The semantics of C++ state that "struct foo { ... }"
|
||||
// OBSOLETE also defines a typedef for "foo". Unfortuantely, cfront
|
||||
// OBSOLETE never makes the typedef when translating from C++ to C.
|
||||
// OBSOLETE We make the typedef here so that "ptype foo" works as
|
||||
// OBSOLETE expected for cfront translated code. */
|
||||
// OBSOLETE else if (psymtab_language == language_cplus)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE /* Also a typedef with the same name. */
|
||||
// OBSOLETE add_psymbol_to_list (namestring, p - namestring,
|
||||
// OBSOLETE VAR_NAMESPACE, LOC_TYPEDEF,
|
||||
// OBSOLETE &objfile->static_psymbols,
|
||||
// OBSOLETE nlist.n_value, 0,
|
||||
// OBSOLETE psymtab_language, objfile);
|
||||
// OBSOLETE }
|
||||
#endif /* OBSOLETE CFront */
|
||||
}
|
||||
goto check_enum;
|
||||
case 't':
|
||||
|
@ -2023,9 +2028,11 @@ read_dbx_symtab (struct objfile *objfile)
|
|||
case '9':
|
||||
case '-':
|
||||
case '#': /* for symbol identification (used in live ranges) */
|
||||
/* added to support cfront stabs strings */
|
||||
case 'Z': /* for definition continuations */
|
||||
case 'P': /* for prototypes */
|
||||
#if 0 /* OBSOLETE CFront */
|
||||
// OBSOLETE /* added to support cfront stabs strings */
|
||||
// OBSOLETE case 'Z': /* for definition continuations */
|
||||
// OBSOLETE case 'P': /* for prototypes */
|
||||
#endif /* OBSOLETE CFront */
|
||||
continue;
|
||||
|
||||
case ':':
|
||||
|
@ -2682,10 +2689,11 @@ read_ofile_symtab (struct partial_symtab *pst)
|
|||
|
||||
pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile));
|
||||
|
||||
/* Process items which we had to "process_later" due to dependencies
|
||||
on other stabs. */
|
||||
process_now (objfile);
|
||||
|
||||
#if 0 /* OBSOLETE CFront */
|
||||
// OBSOLETE /* Process items which we had to "process_later" due to dependencies
|
||||
// OBSOLETE on other stabs. */
|
||||
// OBSOLETE process_now (objfile);
|
||||
#endif /* OBSOLETE CFront */
|
||||
end_stabs ();
|
||||
}
|
||||
|
||||
|
|
356
gdb/gdbtypes.c
356
gdb/gdbtypes.c
|
@ -128,9 +128,9 @@ struct extra
|
|||
|
||||
static void add_name (struct extra *, char *);
|
||||
static void add_mangled_type (struct extra *, struct type *);
|
||||
#if 0
|
||||
static void cfront_mangle_name (struct type *, int, int);
|
||||
#endif
|
||||
#if 0 /* OBSOLETE CFront */
|
||||
// OBSOLETE static void cfront_mangle_name (struct type *, int, int);
|
||||
#endif /* OBSOLETE CFront */
|
||||
static void print_bit_vector (B_TYPE *, int);
|
||||
static void print_arg_types (struct field *, int, int);
|
||||
static void dump_fn_fieldlists (struct type *, int);
|
||||
|
@ -1458,193 +1458,193 @@ check_typedef (struct type *type)
|
|||
return type;
|
||||
}
|
||||
|
||||
/* New code added to support parsing of Cfront stabs strings */
|
||||
#define INIT_EXTRA { pextras->len=0; pextras->str[0]='\0'; }
|
||||
#define ADD_EXTRA(c) { pextras->str[pextras->len++]=c; }
|
||||
#if 0 /* OBSOLETE CFront */
|
||||
// OBSOLETE /* New code added to support parsing of Cfront stabs strings */
|
||||
// OBSOLETE #define INIT_EXTRA { pextras->len=0; pextras->str[0]='\0'; }
|
||||
// OBSOLETE #define ADD_EXTRA(c) { pextras->str[pextras->len++]=c; }
|
||||
|
||||
static void
|
||||
add_name (struct extra *pextras, char *n)
|
||||
{
|
||||
int nlen;
|
||||
// OBSOLETE static void
|
||||
// OBSOLETE add_name (struct extra *pextras, char *n)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int nlen;
|
||||
|
||||
if ((nlen = (n ? strlen (n) : 0)) == 0)
|
||||
return;
|
||||
sprintf (pextras->str + pextras->len, "%d%s", nlen, n);
|
||||
pextras->len = strlen (pextras->str);
|
||||
}
|
||||
// OBSOLETE if ((nlen = (n ? strlen (n) : 0)) == 0)
|
||||
// OBSOLETE return;
|
||||
// OBSOLETE sprintf (pextras->str + pextras->len, "%d%s", nlen, n);
|
||||
// OBSOLETE pextras->len = strlen (pextras->str);
|
||||
// OBSOLETE }
|
||||
|
||||
static void
|
||||
add_mangled_type (struct extra *pextras, struct type *t)
|
||||
{
|
||||
enum type_code tcode;
|
||||
int tlen, tflags;
|
||||
char *tname;
|
||||
// OBSOLETE static void
|
||||
// OBSOLETE add_mangled_type (struct extra *pextras, struct type *t)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE enum type_code tcode;
|
||||
// OBSOLETE int tlen, tflags;
|
||||
// OBSOLETE char *tname;
|
||||
|
||||
tcode = TYPE_CODE (t);
|
||||
tlen = TYPE_LENGTH (t);
|
||||
tflags = TYPE_FLAGS (t);
|
||||
tname = TYPE_NAME (t);
|
||||
/* args of "..." seem to get mangled as "e" */
|
||||
// OBSOLETE tcode = TYPE_CODE (t);
|
||||
// OBSOLETE tlen = TYPE_LENGTH (t);
|
||||
// OBSOLETE tflags = TYPE_FLAGS (t);
|
||||
// OBSOLETE tname = TYPE_NAME (t);
|
||||
// OBSOLETE /* args of "..." seem to get mangled as "e" */
|
||||
|
||||
switch (tcode)
|
||||
{
|
||||
case TYPE_CODE_INT:
|
||||
if (tflags == 1)
|
||||
ADD_EXTRA ('U');
|
||||
switch (tlen)
|
||||
{
|
||||
case 1:
|
||||
ADD_EXTRA ('c');
|
||||
break;
|
||||
case 2:
|
||||
ADD_EXTRA ('s');
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
char *pname;
|
||||
if ((pname = strrchr (tname, 'l'), pname) && !strcmp (pname, "long"))
|
||||
{
|
||||
ADD_EXTRA ('l');
|
||||
}
|
||||
else
|
||||
{
|
||||
ADD_EXTRA ('i');
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
complaint (&symfile_complaints, "Bad int type code length x%x",
|
||||
tlen);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TYPE_CODE_FLT:
|
||||
switch (tlen)
|
||||
{
|
||||
case 4:
|
||||
ADD_EXTRA ('f');
|
||||
break;
|
||||
case 8:
|
||||
ADD_EXTRA ('d');
|
||||
break;
|
||||
case 16:
|
||||
ADD_EXTRA ('r');
|
||||
break;
|
||||
default:
|
||||
{
|
||||
complaint (&symfile_complaints, "Bad float type code length x%x",
|
||||
tlen);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TYPE_CODE_REF:
|
||||
ADD_EXTRA ('R');
|
||||
/* followed by what it's a ref to */
|
||||
break;
|
||||
case TYPE_CODE_PTR:
|
||||
ADD_EXTRA ('P');
|
||||
/* followed by what it's a ptr to */
|
||||
break;
|
||||
case TYPE_CODE_TYPEDEF:
|
||||
{
|
||||
complaint (&symfile_complaints,
|
||||
"Typedefs in overloaded functions not yet supported");
|
||||
}
|
||||
/* followed by type bytes & name */
|
||||
break;
|
||||
case TYPE_CODE_FUNC:
|
||||
ADD_EXTRA ('F');
|
||||
/* followed by func's arg '_' & ret types */
|
||||
break;
|
||||
case TYPE_CODE_VOID:
|
||||
ADD_EXTRA ('v');
|
||||
break;
|
||||
case TYPE_CODE_METHOD:
|
||||
ADD_EXTRA ('M');
|
||||
/* followed by name of class and func's arg '_' & ret types */
|
||||
add_name (pextras, tname);
|
||||
ADD_EXTRA ('F'); /* then mangle function */
|
||||
break;
|
||||
case TYPE_CODE_STRUCT: /* C struct */
|
||||
case TYPE_CODE_UNION: /* C union */
|
||||
case TYPE_CODE_ENUM: /* Enumeration type */
|
||||
/* followed by name of type */
|
||||
add_name (pextras, tname);
|
||||
break;
|
||||
// OBSOLETE switch (tcode)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE case TYPE_CODE_INT:
|
||||
// OBSOLETE if (tflags == 1)
|
||||
// OBSOLETE ADD_EXTRA ('U');
|
||||
// OBSOLETE switch (tlen)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE case 1:
|
||||
// OBSOLETE ADD_EXTRA ('c');
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case 2:
|
||||
// OBSOLETE ADD_EXTRA ('s');
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case 4:
|
||||
// OBSOLETE {
|
||||
// OBSOLETE char *pname;
|
||||
// OBSOLETE if ((pname = strrchr (tname, 'l'), pname) && !strcmp (pname, "long"))
|
||||
// OBSOLETE {
|
||||
// OBSOLETE ADD_EXTRA ('l');
|
||||
// OBSOLETE }
|
||||
// OBSOLETE else
|
||||
// OBSOLETE {
|
||||
// OBSOLETE ADD_EXTRA ('i');
|
||||
// OBSOLETE }
|
||||
// OBSOLETE }
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE default:
|
||||
// OBSOLETE {
|
||||
// OBSOLETE complaint (&symfile_complaints, "Bad int type code length x%x",
|
||||
// OBSOLETE tlen);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE }
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case TYPE_CODE_FLT:
|
||||
// OBSOLETE switch (tlen)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE case 4:
|
||||
// OBSOLETE ADD_EXTRA ('f');
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case 8:
|
||||
// OBSOLETE ADD_EXTRA ('d');
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case 16:
|
||||
// OBSOLETE ADD_EXTRA ('r');
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE default:
|
||||
// OBSOLETE {
|
||||
// OBSOLETE complaint (&symfile_complaints, "Bad float type code length x%x",
|
||||
// OBSOLETE tlen);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE }
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case TYPE_CODE_REF:
|
||||
// OBSOLETE ADD_EXTRA ('R');
|
||||
// OBSOLETE /* followed by what it's a ref to */
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case TYPE_CODE_PTR:
|
||||
// OBSOLETE ADD_EXTRA ('P');
|
||||
// OBSOLETE /* followed by what it's a ptr to */
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case TYPE_CODE_TYPEDEF:
|
||||
// OBSOLETE {
|
||||
// OBSOLETE complaint (&symfile_complaints,
|
||||
// OBSOLETE "Typedefs in overloaded functions not yet supported");
|
||||
// OBSOLETE }
|
||||
// OBSOLETE /* followed by type bytes & name */
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case TYPE_CODE_FUNC:
|
||||
// OBSOLETE ADD_EXTRA ('F');
|
||||
// OBSOLETE /* followed by func's arg '_' & ret types */
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case TYPE_CODE_VOID:
|
||||
// OBSOLETE ADD_EXTRA ('v');
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case TYPE_CODE_METHOD:
|
||||
// OBSOLETE ADD_EXTRA ('M');
|
||||
// OBSOLETE /* followed by name of class and func's arg '_' & ret types */
|
||||
// OBSOLETE add_name (pextras, tname);
|
||||
// OBSOLETE ADD_EXTRA ('F'); /* then mangle function */
|
||||
// OBSOLETE break;
|
||||
// OBSOLETE case TYPE_CODE_STRUCT: /* C struct */
|
||||
// OBSOLETE case TYPE_CODE_UNION: /* C union */
|
||||
// OBSOLETE case TYPE_CODE_ENUM: /* Enumeration type */
|
||||
// OBSOLETE /* followed by name of type */
|
||||
// OBSOLETE add_name (pextras, tname);
|
||||
// OBSOLETE break;
|
||||
|
||||
/* errors possible types/not supported */
|
||||
case TYPE_CODE_CHAR:
|
||||
case TYPE_CODE_ARRAY: /* Array type */
|
||||
case TYPE_CODE_MEMBER: /* Member type */
|
||||
case TYPE_CODE_BOOL:
|
||||
case TYPE_CODE_COMPLEX: /* Complex float */
|
||||
case TYPE_CODE_UNDEF:
|
||||
case TYPE_CODE_SET: /* Pascal sets */
|
||||
case TYPE_CODE_RANGE:
|
||||
case TYPE_CODE_STRING:
|
||||
case TYPE_CODE_BITSTRING:
|
||||
case TYPE_CODE_ERROR:
|
||||
default:
|
||||
{
|
||||
complaint (&symfile_complaints, "Unknown type code x%x", tcode);
|
||||
}
|
||||
}
|
||||
if (TYPE_TARGET_TYPE (t))
|
||||
add_mangled_type (pextras, TYPE_TARGET_TYPE (t));
|
||||
}
|
||||
// OBSOLETE /* errors possible types/not supported */
|
||||
// OBSOLETE case TYPE_CODE_CHAR:
|
||||
// OBSOLETE case TYPE_CODE_ARRAY: /* Array type */
|
||||
// OBSOLETE case TYPE_CODE_MEMBER: /* Member type */
|
||||
// OBSOLETE case TYPE_CODE_BOOL:
|
||||
// OBSOLETE case TYPE_CODE_COMPLEX: /* Complex float */
|
||||
// OBSOLETE case TYPE_CODE_UNDEF:
|
||||
// OBSOLETE case TYPE_CODE_SET: /* Pascal sets */
|
||||
// OBSOLETE case TYPE_CODE_RANGE:
|
||||
// OBSOLETE case TYPE_CODE_STRING:
|
||||
// OBSOLETE case TYPE_CODE_BITSTRING:
|
||||
// OBSOLETE case TYPE_CODE_ERROR:
|
||||
// OBSOLETE default:
|
||||
// OBSOLETE {
|
||||
// OBSOLETE complaint (&symfile_complaints, "Unknown type code x%x", tcode);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE }
|
||||
// OBSOLETE if (TYPE_TARGET_TYPE (t))
|
||||
// OBSOLETE add_mangled_type (pextras, TYPE_TARGET_TYPE (t));
|
||||
// OBSOLETE }
|
||||
|
||||
#if 0
|
||||
void
|
||||
cfront_mangle_name (struct type *type, int i, int j)
|
||||
{
|
||||
struct fn_field *f;
|
||||
char *mangled_name = gdb_mangle_name (type, i, j);
|
||||
// OBSOLETE void
|
||||
// OBSOLETE cfront_mangle_name (struct type *type, int i, int j)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE struct fn_field *f;
|
||||
// OBSOLETE char *mangled_name = gdb_mangle_name (type, i, j);
|
||||
|
||||
f = TYPE_FN_FIELDLIST1 (type, i); /* moved from below */
|
||||
// OBSOLETE f = TYPE_FN_FIELDLIST1 (type, i); /* moved from below */
|
||||
|
||||
/* kludge to support cfront methods - gdb expects to find "F" for
|
||||
ARM_mangled names, so when we mangle, we have to add it here */
|
||||
if (ARM_DEMANGLING)
|
||||
{
|
||||
int k;
|
||||
char *arm_mangled_name;
|
||||
struct fn_field *method = &f[j];
|
||||
char *field_name = TYPE_FN_FIELDLIST_NAME (type, i);
|
||||
char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
|
||||
char *newname = type_name_no_tag (type);
|
||||
// OBSOLETE /* kludge to support cfront methods - gdb expects to find "F" for
|
||||
// OBSOLETE ARM_mangled names, so when we mangle, we have to add it here */
|
||||
// OBSOLETE if (ARM_DEMANGLING)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE int k;
|
||||
// OBSOLETE char *arm_mangled_name;
|
||||
// OBSOLETE struct fn_field *method = &f[j];
|
||||
// OBSOLETE char *field_name = TYPE_FN_FIELDLIST_NAME (type, i);
|
||||
// OBSOLETE char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
|
||||
// OBSOLETE char *newname = type_name_no_tag (type);
|
||||
|
||||
struct type *ftype = TYPE_FN_FIELD_TYPE (f, j);
|
||||
int nargs = TYPE_NFIELDS (ftype); /* number of args */
|
||||
struct extra extras, *pextras = &extras;
|
||||
INIT_EXTRA
|
||||
// OBSOLETE struct type *ftype = TYPE_FN_FIELD_TYPE (f, j);
|
||||
// OBSOLETE int nargs = TYPE_NFIELDS (ftype); /* number of args */
|
||||
// OBSOLETE struct extra extras, *pextras = &extras;
|
||||
// OBSOLETE INIT_EXTRA
|
||||
|
||||
if (TYPE_FN_FIELD_STATIC_P (f, j)) /* j for sublist within this list */
|
||||
ADD_EXTRA ('S')
|
||||
ADD_EXTRA ('F')
|
||||
/* add args here! */
|
||||
if (nargs <= 1) /* no args besides this */
|
||||
ADD_EXTRA ('v')
|
||||
else
|
||||
{
|
||||
for (k = 1; k < nargs; k++)
|
||||
{
|
||||
struct type *t;
|
||||
t = TYPE_FIELD_TYPE (ftype, k);
|
||||
add_mangled_type (pextras, t);
|
||||
}
|
||||
}
|
||||
ADD_EXTRA ('\0')
|
||||
printf ("add_mangled_type: %s\n", extras.str); /* FIXME */
|
||||
xasprintf (&arm_mangled_name, "%s%s", mangled_name, extras.str);
|
||||
xfree (mangled_name);
|
||||
mangled_name = arm_mangled_name;
|
||||
}
|
||||
}
|
||||
#endif /* 0 */
|
||||
// OBSOLETE if (TYPE_FN_FIELD_STATIC_P (f, j)) /* j for sublist within this list */
|
||||
// OBSOLETE ADD_EXTRA ('S')
|
||||
// OBSOLETE ADD_EXTRA ('F')
|
||||
// OBSOLETE /* add args here! */
|
||||
// OBSOLETE if (nargs <= 1) /* no args besides this */
|
||||
// OBSOLETE ADD_EXTRA ('v')
|
||||
// OBSOLETE else
|
||||
// OBSOLETE {
|
||||
// OBSOLETE for (k = 1; k < nargs; k++)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE struct type *t;
|
||||
// OBSOLETE t = TYPE_FIELD_TYPE (ftype, k);
|
||||
// OBSOLETE add_mangled_type (pextras, t);
|
||||
// OBSOLETE }
|
||||
// OBSOLETE }
|
||||
// OBSOLETE ADD_EXTRA ('\0')
|
||||
// OBSOLETE printf ("add_mangled_type: %s\n", extras.str); /* FIXME */
|
||||
// OBSOLETE xasprintf (&arm_mangled_name, "%s%s", mangled_name, extras.str);
|
||||
// OBSOLETE xfree (mangled_name);
|
||||
// OBSOLETE mangled_name = arm_mangled_name;
|
||||
// OBSOLETE }
|
||||
// OBSOLETE }
|
||||
|
||||
#undef ADD_EXTRA
|
||||
/* End of new code added to support parsing of Cfront stabs strings */
|
||||
// OBSOLETE #undef ADD_EXTRA
|
||||
// OBSOLETE /* End of new code added to support parsing of Cfront stabs strings */
|
||||
#endif /* OBSOLETE CFront */
|
||||
|
||||
/* Parse a type expression in the string [P..P+LENGTH). If an error occurs,
|
||||
silently return builtin_type_void. */
|
||||
|
|
|
@ -1517,9 +1517,11 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
|
|||
if (t->fBitfield)
|
||||
{
|
||||
int width = AUX_GET_WIDTH (bigend, ax);
|
||||
|
||||
/* Inhibit core dumps with some cfront generated objects that
|
||||
corrupt the TIR. */
|
||||
#if 0 /* OBSOLETE CFront */
|
||||
// OBSOLETE /* Inhibit core dumps with some cfront generated objects that
|
||||
// OBSOLETE corrupt the TIR. */
|
||||
#endif /* OBSOLETE CFront */
|
||||
/* Inhibit core dumps if TIR is corrupted. */
|
||||
if (bs == (int *) NULL)
|
||||
{
|
||||
/* Alpha cc -migrate encodes char and unsigned char types
|
||||
|
@ -3036,20 +3038,22 @@ parse_partial_symbols (struct objfile *objfile)
|
|||
psymtab_language, objfile);
|
||||
p += 1;
|
||||
}
|
||||
/* The semantics of C++ state that "struct foo { ... }"
|
||||
also defines a typedef for "foo". Unfortuantely, cfront
|
||||
never makes the typedef when translating from C++ to C.
|
||||
We make the typedef here so that "ptype foo" works as
|
||||
expected for cfront translated code. */
|
||||
else if (psymtab_language == language_cplus)
|
||||
{
|
||||
/* Also a typedef with the same name. */
|
||||
add_psymbol_to_list (namestring, p - namestring,
|
||||
VAR_NAMESPACE, LOC_TYPEDEF,
|
||||
&objfile->static_psymbols,
|
||||
sh.value, 0,
|
||||
psymtab_language, objfile);
|
||||
}
|
||||
#if 0 /* OBSOLETE CFront */
|
||||
// OBSOLETE /* The semantics of C++ state that "struct foo { ... }"
|
||||
// OBSOLETE also defines a typedef for "foo". Unfortuantely, cfront
|
||||
// OBSOLETE never makes the typedef when translating from C++ to C.
|
||||
// OBSOLETE We make the typedef here so that "ptype foo" works as
|
||||
// OBSOLETE expected for cfront translated code. */
|
||||
// OBSOLETE else if (psymtab_language == language_cplus)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE /* Also a typedef with the same name. */
|
||||
// OBSOLETE add_psymbol_to_list (namestring, p - namestring,
|
||||
// OBSOLETE VAR_NAMESPACE, LOC_TYPEDEF,
|
||||
// OBSOLETE &objfile->static_psymbols,
|
||||
// OBSOLETE sh.value, 0,
|
||||
// OBSOLETE psymtab_language, objfile);
|
||||
// OBSOLETE }
|
||||
#endif /* OBSOLETE CFront */
|
||||
}
|
||||
goto check_enum;
|
||||
case 't':
|
||||
|
@ -3196,9 +3200,11 @@ parse_partial_symbols (struct objfile *objfile)
|
|||
case '9':
|
||||
case '-':
|
||||
case '#': /* for symbol identification (used in live ranges) */
|
||||
/* added to support cfront stabs strings */
|
||||
case 'Z': /* for definition continuations */
|
||||
case 'P': /* for prototypes */
|
||||
#if 0 /* OBSOLETE CFront */
|
||||
// OBSOLETE /* added to support cfront stabs strings */
|
||||
// OBSOLETE case 'Z': /* for definition continuations */
|
||||
// OBSOLETE case 'P': /* for prototypes */
|
||||
#endif /* OBSOLETE CFront */
|
||||
continue;
|
||||
|
||||
case ':':
|
||||
|
|
1227
gdb/stabsread.c
1227
gdb/stabsread.c
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
|||
/* Include file for stabs debugging format support functions.
|
||||
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
|
||||
1996, 1997, 1999, 2000 Free Software Foundation, Inc.
|
||||
1996, 1997, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
|
@ -198,10 +198,11 @@ extern void stabsect_build_psymtabs
|
|||
|
||||
extern void elfstab_offset_sections (struct objfile *,
|
||||
struct partial_symtab *);
|
||||
|
||||
extern void process_later
|
||||
(struct symbol *, char *,
|
||||
int (*f) (struct objfile *, struct symbol *, char *));
|
||||
#if 0 /* OBSOLETE CFront */
|
||||
// OBSOLETE extern void process_later
|
||||
// OBSOLETE (struct symbol *, char *,
|
||||
// OBSOLETE int (*f) (struct objfile *, struct symbol *, char *));
|
||||
#endif /* OBSOLETE CFront */
|
||||
|
||||
extern int symbol_reference_defined (char **);
|
||||
|
||||
|
@ -209,9 +210,10 @@ extern void ref_add (int, struct symbol *, char *, CORE_ADDR);
|
|||
|
||||
extern struct symbol *ref_search (int);
|
||||
|
||||
extern int resolve_cfront_continuation
|
||||
(struct objfile *objfile, struct symbol *sym, char *p);
|
||||
|
||||
#if 0 /* OBSOLETE CFront */
|
||||
// OBSOLETE extern int resolve_cfront_continuation
|
||||
// OBSOLETE (struct objfile *objfile, struct symbol *sym, char *p);
|
||||
#endif /* OBSOLETE CFront */
|
||||
extern void free_header_files (void);
|
||||
|
||||
extern void init_header_files (void);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Read AIX xcoff symbol tables and convert to internal format, for GDB.
|
||||
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
|
||||
1996, 1997, 1998, 1999, 2000, 2001
|
||||
1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
Free Software Foundation, Inc.
|
||||
Derived from coffread.c, dbxread.c, and a lot of hacking.
|
||||
Contributed by IBM Corporation.
|
||||
|
@ -2636,20 +2636,22 @@ scan_xcoff_symtab (struct objfile *objfile)
|
|||
psymtab_language, objfile);
|
||||
p += 1;
|
||||
}
|
||||
/* The semantics of C++ state that "struct foo { ... }"
|
||||
also defines a typedef for "foo". Unfortuantely, cfront
|
||||
never makes the typedef when translating from C++ to C.
|
||||
We make the typedef here so that "ptype foo" works as
|
||||
expected for cfront translated code. */
|
||||
else if (psymtab_language == language_cplus)
|
||||
{
|
||||
/* Also a typedef with the same name. */
|
||||
add_psymbol_to_list (namestring, p - namestring,
|
||||
VAR_NAMESPACE, LOC_TYPEDEF,
|
||||
&objfile->static_psymbols,
|
||||
symbol.n_value, 0,
|
||||
psymtab_language, objfile);
|
||||
}
|
||||
#if 0 /* OBSOLETE CFront */
|
||||
// OBSOLETE /* The semantics of C++ state that "struct foo { ... }"
|
||||
// OBSOLETE also defines a typedef for "foo". Unfortuantely, cfront
|
||||
// OBSOLETE never makes the typedef when translating from C++ to C.
|
||||
// OBSOLETE We make the typedef here so that "ptype foo" works as
|
||||
// OBSOLETE expected for cfront translated code. */
|
||||
// OBSOLETE else if (psymtab_language == language_cplus)
|
||||
// OBSOLETE {
|
||||
// OBSOLETE /* Also a typedef with the same name. */
|
||||
// OBSOLETE add_psymbol_to_list (namestring, p - namestring,
|
||||
// OBSOLETE VAR_NAMESPACE, LOC_TYPEDEF,
|
||||
// OBSOLETE &objfile->static_psymbols,
|
||||
// OBSOLETE symbol.n_value, 0,
|
||||
// OBSOLETE psymtab_language, objfile);
|
||||
// OBSOLETE }
|
||||
#endif /* OBSOLETE CFront */
|
||||
}
|
||||
goto check_enum;
|
||||
|
||||
|
@ -2798,9 +2800,11 @@ scan_xcoff_symtab (struct objfile *objfile)
|
|||
case '9':
|
||||
case '-':
|
||||
case '#': /* for symbol identification (used in live ranges) */
|
||||
/* added to support cfront stabs strings */
|
||||
case 'Z': /* for definition continuations */
|
||||
case 'P': /* for prototypes */
|
||||
#if 0 /* OBSOLETE CFront */
|
||||
// OBSOLETE /* added to support cfront stabs strings */
|
||||
// OBSOLETE case 'Z': /* for definition continuations */
|
||||
// OBSOLETE case 'P': /* for prototypes */
|
||||
#endif /* OBSOLETE CFront */
|
||||
continue;
|
||||
|
||||
case ':':
|
||||
|
|
Loading…
Add table
Reference in a new issue