From: John Gilmore Date: Thu, 11 Feb 1993 09:05:11 +0000 (+0000) Subject: * xcoffread.c (parmsym): Don't use an initializer to set up X-Git-Tag: gdb-4_18~20154 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5eeaaf86c6b7dba71e6b9f5e48047a1f05f04b5;p=external%2Fbinutils.git * xcoffread.c (parmsym): Don't use an initializer to set up this struct symbol. Set it up in initialize_xcoffread. [This broke when Fred changed "struct symbol".] (read_xcoff_symtab, xcoff_symfile_read): Surround code that only works on real rs/6000 target with #ifndef FAKING_RS6000. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 484adfd..32f7f9e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +Thu Feb 11 00:59:07 1993 John Gilmore (gnu@cygnus.com) + + * xcoffread.c (parmsym): Don't use an initializer to set up + this struct symbol. Set it up in initialize_xcoffread. + (read_xcoff_symtab, xcoff_symfile_read): Surround code that only + works on real rs/6000 target with #ifndef FAKING_RS6000. + Wed Feb 10 23:42:37 1993 John Gilmore (gnu@cygnus.com) * stabsread.c (rs6000_builtin_type): Move function from diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index f7aeb5e..6bc1d5b 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -21,7 +21,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Native only: Need struct tbtable in from host, and - need xcoff_add_toc_to_loadinfo in rs6000-tdep.c from target. */ + need xcoff_add_toc_to_loadinfo in rs6000-tdep.c from target. + need xcoff_init_loadinfo ditto. + However, if you grab and make it available on your + host, and define FAKING_RS6000, then this code will compile. */ #include "defs.h" #include "bfd.h" @@ -953,16 +956,11 @@ retrieve_traceback (abfd, textsec, cs, size) } -/* A parameter template, used by ADD_PARM_TO_PENDING. */ +/* A parameter template, used by ADD_PARM_TO_PENDING. It is initialized + in our initializer function at the bottom of the file, to avoid + dependencies on the exact "struct symbol" format. */ -static struct symbol parmsym = { /* default parameter symbol */ - "", /* name */ - VAR_NAMESPACE, /* namespace */ - LOC_ARG, /* class */ - NULL, /* type */ - 0, /* line number */ - 0, /* value */ -}; +static struct symbol parmsym; /* Add a parameter to a given pending symbol list. */ @@ -1599,7 +1597,9 @@ function_entry_point: If no XMC_TC0 is found, toc_offset should be zero. Another place to obtain this information would be file auxiliary header. */ +#ifndef FAKING_RS6000 xcoff_add_toc_to_loadinfo (toc_offset); +#endif } #define SYMBOL_DUP(SYMBOL1, SYMBOL2) \ @@ -2232,9 +2232,11 @@ xcoff_symfile_read (objfile, section_offset, mainline) init_minimal_symbol_collection (); make_cleanup (discard_minimal_symbols, 0); +#ifndef FAKING_RS6000 /* Initialize load info structure. */ if (mainline) xcoff_init_loadinfo (); +#endif /* Now that the executable file is positioned at symbol table, process it and define symbols accordingly. */ @@ -2296,4 +2298,11 @@ void _initialize_xcoffread () { add_symtab_fns(&xcoff_sym_fns); + + /* Initialize symbol template later used for arguments. */ + SYMBOL_NAME (&parmsym) = ""; + SYMBOL_INIT_LANGUAGE_SPECIFIC (&parmsym, language_c); + SYMBOL_NAMESPACE (&parmsym) = VAR_NAMESPACE; + SYMBOL_CLASS (&parmsym) = LOC_ARG; + /* Its other fields are zero, or are filled in later. */ }