Many changes, most related to creating entry point information on a per-objfile

basis.  See comments in objfiles.h and details in ChangeLog.  Also remove
redundant definitions of FRAME_CHAIN_VALID from most of the tm-* files and
use a default definition in frame.h.
This commit is contained in:
Fred Fish 1992-03-21 01:56:01 +00:00
parent 9abf940670
commit 5e2e79f859
32 changed files with 458 additions and 185 deletions

View File

@ -132,6 +132,7 @@ nindy-tdep.c
ns32k-opcode.h
ns32k-pinsn.c
objfiles.c
objfiles.h
os68k-xdep.c
parse.c
parser-defs.h

View File

@ -1,3 +1,67 @@
Fri Mar 20 17:43:27 1992 Fred Fish (fnf@cygnus.com)
* objfiles.h: New file
* Makefile.in (HFILES): Add objfiles.h
* blockframe.c: Remove entry_scope_lowpc, entry_scope_highpc,
main_scope_lowpc, main_scope_highpc.
* blockframe.c, buildsym.c, coffread.c, dbxread.c, dwarfread.c,
elfread.c, gdbtypes.h, minsyms.c, mipsread.c, objfiles.c, solib.c,
source.c, symfile.c, symmisc.c, symtab.c, target.c, xcoffexec.c,
xcoffread.c, : Include objfiles.h.
* tm-29k.h, tm-i386v.h, tm-merlin.h, tm-rs6000.h, tm-sun386.h,
tm-symmetry.h, tm-tahoe.h, tm-umax.h, tm-vax.h, m88k-tdep.c,
mips-tdep.c (FRAME_CHAIN): Renamed outside_startup_file to
inside_entry_file() and logic changed appropriately.
* blockframe.c (outside_startup_file): Renamed to
inside_entry_file() and logic changed appropriately.
* blockframe.c (inside_main_scope): Renamed to inside_main_func()
and logic changed to use per-objfile specific fields.
* blockframe.c (inside_entry_scope): Renamed to
inside_entry_func() and logic changed to use per-objfile specific
fields.
* blockframe.c, buildsym.h, coffread.c, dwarfread.c, mipsread.c,
symfile.c, mips-tdep.c (startup_file_start, startup_file_end):
Remove extern decls.
* symfile.c, symfile.h (entry_point): Remove extern decl.
* coffread.c (coff_symfile_init): Common entry point init code
moved to symfiles.c, call init_entry_point_info().
* coffread.c (complete_symtab): Use new per-objfile entry info.
* mip-tdep.c (mips_frame_chain): Use new per-objfile entry info.
* mipsread.c (parse_partial_symbols): Use new per-objfile entry
info.
* dbxread.c (read_dbx_symtab): Use new per-objfile entry info.
* defs.h (inside_entry_scope, outside_startup_file,
inside_main_scope): Prototypes changed for renames to
inside_entry_func, inside_entry_file, inside_main_func,
respectively.
* symfile.c (syms_from_objfile): Common entry point init code
moved to init_entry_point_info() and call init_entry_point_info().
* symfile.h (init_entry_point_info): Include prototype.
* xcoffread.c (aixcoff_symfile_init): Common entry point init code
moved to symfiles.c and call init_entry_point_info().
* dwarfread.c (entry_scope_lowpc, entry_scope_highpc,
main_scope_lowpc, main_scope_highpc): Remove extern decls.
* dwarfread.c (read_func_scope, read_file_scope): Use new per-
objfile entry info.
* frame.h (FRAME_CHAIN_VALID): Provide default definition that
works for the majority of targets.
* tm-68k.h, tm-convex.h, tm-h8300.h, tm-i386v.h, tm-irix3.h,
tm-merlin.h, tm-mips.h, tm-pyr.h, tm-rs6000.h, tm-sparc.h,
tm-sun386.h, tm-tahoe.h, tm-umax.h, tm-vax.h (FRAME_CHAIN_VALID):
Use default definition in frame.h.
* frame.h (selected_frame_level): Make decl extern.
* objfiles.c, symfile.c (current_objfile): Moved to objfiles.c
* objfiles.c, symfile.c (symfile_objfile): Moved to objfiles.c
* partial-stab.h: Use new per-objfile entry info.
* symfile.h (struct objfile): Removed, moved to objfiles.h.
* symfile.h, objfiles.h (allocate_objfile, free_objfile,
free_all_objfiles, iterate_over_objfiles, iterate_over_symtabs,
iterate_over_psymtabs, have_partial_symbols, have_full_symbols,
have_minimal_symbols): Prototypes moved to objfiles.h.
* symfile.h, objfiles.h (ALL_OBJFILES, ALL_OBJFILES_SAFE):
Macros moved to objfiles.h.
* tm-h8300.h, tm-i386v4.h (FRAME_CHAIN_VALID_ALTERNATE): Define.
Thu Mar 19 18:49:45 1992 Per Bothner (bothner@cygnus.com)
More C++ improvements (pointers to members, qualified names).

View File

@ -31,7 +31,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "breakpoint.h"
#include "gdbcore.h" /* for bfd stuff for symfile.h */
#include "symfile.h" /* Needed for "struct complaint" */
#include "aout/stab_gnu.h" /* We always use GNU stabs, not native */
#include "objfiles.h"
#include "aout/stab_gnu.h" /* We always use GNU stabs, not native */
#include <string.h>
#include <ctype.h>

View File

@ -185,9 +185,6 @@ struct pending_block
EXTERN struct pending_block *pending_blocks;
extern CORE_ADDR startup_file_start; /* From blockframe.c */
extern CORE_ADDR startup_file_end; /* From blockframe.c */
/* Global variable which, when set, indicates that we are processing a
.o file compiled with gcc */

View File

@ -62,6 +62,7 @@ other things to work on, if you get bored. :-)
#include "symtab.h"
#include "gdbtypes.h"
#include "symfile.h"
#include "objfiles.h"
#include "elf/dwarf.h"
#include "buildsym.h"
@ -95,12 +96,6 @@ typedef unsigned int DIEREF; /* Reference to a DIE */
/* External variables referenced. */
extern CORE_ADDR startup_file_start; /* From blockframe.c */
extern CORE_ADDR startup_file_end; /* From blockframe.c */
extern CORE_ADDR entry_scope_lowpc; /* From blockframe.c */
extern CORE_ADDR entry_scope_highpc; /* From blockframe.c */
extern CORE_ADDR main_scope_lowpc; /* From blockframe.c */
extern CORE_ADDR main_scope_highpc; /* From blockframe.c */
extern int info_verbose; /* From main.c; nonzero => verbose */
extern char *warning_pre_print; /* From utils.c */
@ -1439,15 +1434,16 @@ read_func_scope (dip, thisdie, enddie, objfile)
{
register struct context_stack *new;
if (entry_point >= dip -> at_low_pc && entry_point < dip -> at_high_pc)
if (objfile -> ei.entry_point >= dip -> at_low_pc &&
objfile -> ei.entry_point < dip -> at_high_pc)
{
entry_scope_lowpc = dip -> at_low_pc;
entry_scope_highpc = dip -> at_high_pc;
objfile -> ei.entry_func_lowpc = dip -> at_low_pc;
objfile -> ei.entry_func_highpc = dip -> at_high_pc;
}
if (STREQ (dip -> at_name, "main")) /* FIXME: hardwired name */
{
main_scope_lowpc = dip -> at_low_pc;
main_scope_highpc = dip -> at_high_pc;
objfile -> ei.main_func_lowpc = dip -> at_low_pc;
objfile -> ei.main_func_highpc = dip -> at_high_pc;
}
new = push_context (0, dip -> at_low_pc);
new -> name = new_symbol (dip, objfile);
@ -1492,10 +1488,11 @@ read_file_scope (dip, thisdie, enddie, objfile)
struct cleanup *back_to;
struct symtab *symtab;
if (entry_point >= dip -> at_low_pc && entry_point < dip -> at_high_pc)
if (objfile -> ei.entry_point >= dip -> at_low_pc &&
objfile -> ei.entry_point < dip -> at_high_pc)
{
startup_file_start = dip -> at_low_pc;
startup_file_end = dip -> at_high_pc;
objfile -> ei.entry_file_lowpc = dip -> at_low_pc;
objfile -> ei.entry_file_highpc = dip -> at_high_pc;
}
if (dip -> at_producer != NULL)
{

View File

@ -39,6 +39,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "bfd.h"
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
#define STREQ(a,b) (strcmp((a),(b))==0)

View File

@ -23,6 +23,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "bfd.h"
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
#include "gdbtypes.h"
#include "expression.h"
#include "language.h"

View File

@ -91,7 +91,7 @@ frame_chain_valid (chain, thisframe)
struct frame_info *thisframe;
{
return (chain != 0
&& outside_startup_file (FRAME_SAVED_PC (thisframe)));
&& !inside_entry_file (FRAME_SAVED_PC (thisframe)));
}
void

View File

@ -41,6 +41,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "symtab.h"
#include "bfd.h"
#include "symfile.h"
#include "objfiles.h"
/* Accumulate the minimal symbols for each objfile in bunches of BUNCH_SIZE.
At the end, copy them all into one newly allocated location on an objfile's

View File

@ -1,5 +1,5 @@
/* Target-dependent code for the MIPS architecture, for GDB, the GNU Debugger.
Copyright 1988, 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
Copyright 1988, 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
@ -141,7 +141,7 @@ CORE_ADDR heuristic_proc_start(pc)
{
CORE_ADDR start_pc = pc;
CORE_ADDR fence = start_pc - 10000;
CORE_ADDR fence = start_pc - 200;
if (fence < VM_MIN_ADDRESS) fence = VM_MIN_ADDRESS;
/* search back for previous return */
for (start_pc -= 4; ; start_pc -= 4)
@ -182,6 +182,7 @@ heuristic_proc_desc(start_pc, limit_pc, next_frame)
status = read_memory_nobpt (cur_pc, &word, 4);
if (status) memory_error (status, cur_pc);
SWAP_TARGET_AND_HOST (&word, sizeof (word));
if ((word & 0xFFFF0000) == 0x27bd0000) /* addiu $sp,$sp,-i */
frame_size += (-word) & 0xFFFF;
else if ((word & 0xFFFF0000) == 0x23bd0000) /* addu $sp,$sp,-i */
@ -284,12 +285,11 @@ mips_extra_func_info_t cached_proc_desc;
FRAME_ADDR mips_frame_chain(frame)
FRAME frame;
{
extern CORE_ADDR startup_file_start; /* From blockframe.c */
mips_extra_func_info_t proc_desc;
CORE_ADDR saved_pc = FRAME_SAVED_PC(frame);
if (startup_file_start)
if (current_objfile -> ei.entry_file_lowpc)
{ /* has at least the __start symbol */
if (saved_pc == 0 || !outside_startup_file (saved_pc)) return 0;
if (saved_pc == 0 || inside_entry_file (saved_pc)) return 0;
}
else
{ /* This hack depends on the internals of __start. */
@ -539,11 +539,16 @@ static
mips_print_register(regnum, all)
int regnum, all;
{
unsigned char raw_buffer[8];
unsigned char raw_buffer[MAX_REGISTER_RAW_SIZE];
REGISTER_TYPE val;
read_relative_register_raw_bytes (regnum, raw_buffer);
/* Get the data in raw format. */
if (read_relative_register_raw_bytes (regnum, raw_buffer))
{
printf_filtered ("%s: [Invalid]", reg_names[regnum]);
return;
}
/* If an even floating pointer register, also print as double. */
if (regnum >= FP0_REGNUM && regnum < FP0_REGNUM+32
&& !((regnum-FP0_REGNUM) & 1)) {
@ -573,6 +578,7 @@ mips_print_register(regnum, all)
long val;
bcopy (raw_buffer, &val, sizeof (long));
SWAP_TARGET_AND_HOST ((char *)&val, sizeof (long));
if (val == 0)
printf_filtered ("0");
else if (all)

View File

@ -54,6 +54,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "gdbtypes.h"
#include "gdbcore.h"
#include "symfile.h"
#include "objfiles.h"
#include "obstack.h"
#include "buildsym.h"
#include <sys/param.h>
@ -260,11 +261,6 @@ static char* mips_next_symbol_text ();
CORE_ADDR sigtramp_address, sigtramp_end;
/* The entry point (starting address) of the file, if it is an executable. */
extern CORE_ADDR startup_file_start; /* From blockframe.c */
extern CORE_ADDR startup_file_end; /* From blockframe.c */
void
mipscoff_new_init (objfile)
struct objfile *objfile;
@ -2100,14 +2096,15 @@ parse_partial_symbols(end_of_text_seg, objfile)
end_psymtab (save_pst, psymtab_include_list, includes_used,
-1, save_pst->texthigh,
dependency_list, dependencies_used);
if (entry_point < save_pst->texthigh
&& entry_point >= save_pst->textlow) {
startup_file_start = save_pst->textlow;
startup_file_end = save_pst->texthigh;
}
if (objfile -> ei.entry_point >= save_pst->textlow &&
objfile -> ei.entry_point < save_pst->texthigh)
{
objfile -> ei.entry_file_lowpc = save_pst->textlow;
objfile -> ei.entry_file_highpc = save_pst->texthigh;
}
}
/* Mark the last code address, and remember it for later */
/* Mark the last code address, and remember it for later */
hdr->cbDnOffset = end_of_text_seg;
/* Now scan the FDRs for dependencies */

View File

@ -25,6 +25,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "bfd.h" /* Binary File Description */
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
#include <sys/types.h>
#include <sys/stat.h>
@ -39,9 +40,13 @@ open_mapped_file PARAMS ((char *filename, long mtime, int mapped));
static CORE_ADDR
map_to_address PARAMS ((void));
/* Externally visible variables that are owned by this module. */
/* Externally visible variables that are owned by this module.
See declarations in objfile.h for more info. */
struct objfile *object_files; /* Linked list of all objfiles */
struct objfile *current_objfile; /* For symbol file being read in */
struct objfile *symfile_objfile; /* Main symbol table loaded from */
int mapped_symbol_files; /* Try to use mapped symbol files */
/* Given a pointer to an initialized bfd (ABFD) and a flag that indicates

313
gdb/objfiles.h Normal file
View File

@ -0,0 +1,313 @@
/* Definitions for symbol file management in GDB.
Copyright (C) 1992 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !defined (OBJFILES_H)
#define OBJFILES_H
/* This structure maintains information on a per-objfile basis about the
"entry point" of the objfile, and the scope within which the entry point
exists. It is possible that gdb will see more than one objfile that is
executable, each with it's own entry point.
For example, for dynamically linked executables in SVR4, the dynamic linker
code is contained within the shared C library, which is actually executable
and is run by the kernel first when an exec is done of a user executable
that is dynamically linked. The dynamic linker within the shared C library
then maps in the various program segments in the user executable and jumps
to the user executable's recorded entry point, as if the call had been made
directly by the kernel.
The traditional gdb method of using this info is to use the recorded entry
point to set the variables entry_file_lowpc and entry_file_highpc from
the debugging information, where these values are the starting address
(inclusive) and ending address (exclusive) of the instruction space in the
executable which correspond to the "startup file", I.E. crt0.o in most
cases. This file is assumed to be a startup file and frames with pc's
inside it are treated as nonexistent. Setting these variables is necessary
so that backtraces do not fly off the bottom of the stack (or top, depending
upon your stack orientation).
Gdb also supports an alternate method to avoid running off the top/bottom
of the stack.
There are two frames that are "special", the frame for the function
containing the process entry point, since it has no predecessor frame,
and the frame for the function containing the user code entry point
(the main() function), since all the predecessor frames are for the
process startup code. Since we have no guarantee that the linked
in startup modules have any debugging information that gdb can use,
we need to avoid following frame pointers back into frames that might
have been built in the startup code, as we might get hopelessly
confused. However, we almost always have debugging information
available for main().
These variables are used to save the range of PC values which are valid
within the main() function and within the function containing the process
entry point. If we always consider the frame for main() as the outermost
frame when debugging user code, and the frame for the process entry
point function as the outermost frame when debugging startup code, then
all we have to do is have FRAME_CHAIN_VALID return false whenever a
frame's current PC is within the range specified by these variables.
In essence, we set "ceilings" in the frame chain beyond which we will
not proceed when following the frame chain back up the stack.
A nice side effect is that we can still debug startup code without
running off the end of the frame chain, assuming that we have usable
debugging information in the startup modules, and if we choose to not
use the block at main, or can't find it for some reason, everything
still works as before. And if we have no startup code debugging
information but we do have usable information for main(), backtraces
from user code don't go wandering off into the startup code.
To use this method, define your FRAME_CHAIN_VALID macro like:
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 \
&& !(inside_main_func ((thisframe)->pc)) \
&& !(inside_entry_func ((thisframe)->pc)))
and add initializations of the four scope controlling variables inside
the object file / debugging information processing modules. */
struct entry_info
{
/* The value we should use for this objects entry point.
The illegal/unknown value needs to be something other than 0, ~0
for instance, which is much less likely than 0. */
CORE_ADDR entry_point;
/* Start (inclusive) and end (exclusive) of function containing the
entry point. */
CORE_ADDR entry_func_lowpc;
CORE_ADDR entry_func_highpc;
/* Start (inclusive) and end (exclusive) of object file containing the
entry point. */
CORE_ADDR entry_file_lowpc;
CORE_ADDR entry_file_highpc;
/* Start (inclusive) and end (exclusive) of the user code main() function. */
CORE_ADDR main_func_lowpc;
CORE_ADDR main_func_highpc;
};
/* Master structure for keeping track of each input file from which
gdb reads symbols. One of these is allocated for each such file we
access, e.g. the exec_file, symbol_file, and any shared library object
files. */
struct objfile
{
/* All struct objfile's are chained together by their next pointers.
The global variable "object_files" points to the first link in this
chain. */
struct objfile *next;
/* The object file's name. Malloc'd; free it if you free this struct. */
char *name;
/* Some flag bits for this objfile. */
unsigned short flags;
/* Each objfile points to a linked list of symtabs derived from this file,
one symtab structure for each compilation unit (source file). Each link
in the symtab list contains a backpointer to this objfile. */
struct symtab *symtabs;
/* Each objfile points to a linked list of partial symtabs derived from
this file, one partial symtab structure for each compilation unit
(source file). */
struct partial_symtab *psymtabs;
/* List of freed partial symtabs, available for re-use */
struct partial_symtab *free_psymtabs;
/* The object file's BFD. Can be null, in which case bfd_open (name) and
put the result here. */
bfd *obfd;
/* The modification timestamp of the object file, as of the last time
we read its symbols. */
long mtime;
/* Obstacks to hold objects that should be freed when we load a new symbol
table from this object file. */
struct obstack psymbol_obstack; /* Partial symbols */
struct obstack symbol_obstack; /* Full symbols */
struct obstack type_obstack; /* Types */
/* Vectors of all partial symbols read in from file. The actual data
is stored in the psymbol_obstack. */
struct psymbol_allocation_list global_psymbols;
struct psymbol_allocation_list static_psymbols;
/* Each file contains a pointer to an array of minimal symbols for all
global symbols that are defined within the file. The array is terminated
by a "null symbol", one that has a NULL pointer for the name and a zero
value for the address. This makes it easy to walk through the array
when passed a pointer to somewhere in the middle of it. There is also
a count of the number of symbols, which does include the terminating
null symbol. The array itself, as well as all the data that it points
to, should be allocated on the symbol_obstack for this file. */
struct minimal_symbol *msymbols;
int minimal_symbol_count;
/* For object file formats which don't specify fundamental types, gdb
can create such types. For now, it maintains a vector of pointers
to these internally created fundamental types on a per objfile basis,
however it really should ultimately keep them on a per-compilation-unit
basis, to account for linkage-units that consist of a number of
compilation units that may have different fundamental types, such as
linking C modules with ADA modules, or linking C modules that are
compiled with 32-bit ints with C modules that are compiled with 64-bit
ints (not inherently evil with a smarter linker). */
struct type **fundamental_types;
/* The mmalloc() malloc-descriptor for this objfile if we are using
the memory mapped malloc() package to manage storage for this objfile's
data. NULL if we are not. */
PTR md;
/* Structure which keeps track of functions that manipulate objfile's
of the same type as this objfile. I.E. the function to read partial
symbols for example. Note that this structure is in statically
allocated memory, and is shared by all objfiles that use the
object module reader of this type. */
struct sym_fns *sf;
/* The per-objfile information about the entry point, the scope (file/func)
containing the entry point, and the scope of the user's main() func. */
struct entry_info ei;
/* Hook for information which is shared by sym_init and sym_read for
this objfile. It is typically a pointer to malloc'd memory. */
PTR sym_private;
};
/* Defines for the objfile flag word. */
/* Gdb can arrange to allocate storage for all objects related to a
particular objfile in a designated section of it's address space,
managed at a low level by mmap() and using a special version of
malloc that handles malloc/free/realloc on top of the mmap() interface.
This allows the "internal gdb state" for a particular objfile to be
dumped to a gdb state file and subsequently reloaded at a later time. */
#define OBJF_MAPPED (1 << 0) /* Objfile data is mmap'd */
/* The object file that the main symbol table was loaded from (e.g. the
argument to the "symbol-file" or "file" command). */
extern struct objfile *symfile_objfile;
/* When we need to allocate a new type, we need to know which type_obstack
to allocate the type on, since there is one for each objfile. The places
where types are allocated are deeply buried in function call hierarchies
which know nothing about objfiles, so rather than trying to pass a
particular objfile down to them, we just do an end run around them and
set current_objfile to be whatever objfile we expect to be using at the
time types are being allocated. For instance, when we start reading
symbols for a particular objfile, we set current_objfile to point to that
objfile, and when we are done, we set it back to NULL, to ensure that we
never put a type someplace other than where we are expecting to put it.
FIXME: Maybe we should review the entire type handling system and
see if there is a better way to avoid this problem. */
extern struct objfile *current_objfile;
/* All known objfiles are kept in a linked list. This points to the
root of this list. */
extern struct objfile *object_files;
/* Declarations for functions defined in objfiles.c */
extern struct objfile *
allocate_objfile PARAMS ((bfd *, int));
extern void
free_objfile PARAMS ((struct objfile *));
extern void
free_all_objfiles PARAMS ((void));
extern int
have_partial_symbols PARAMS ((void));
extern int
have_full_symbols PARAMS ((void));
/* Functions for dealing with the minimal symbol table, really a misc
address<->symbol mapping for things we don't have debug symbols for. */
extern int
have_minimal_symbols PARAMS ((void));
extern PTR
iterate_over_objfiles PARAMS ((PTR (*func) (struct objfile *,
PTR arg1, PTR arg2, PTR arg3),
PTR arg1, PTR arg2, PTR arg3));
extern PTR
iterate_over_symtabs PARAMS ((PTR (*func) (struct objfile *, struct symtab *,
PTR arg1, PTR arg2, PTR arg3),
PTR arg1, PTR arg2, PTR arg3));
extern PTR
iterate_over_psymtabs PARAMS ((PTR (*func) (struct objfile *,
struct partial_symtab *,
PTR arg1, PTR arg2, PTR arg3),
PTR arg1, PTR arg2, PTR arg3));
/* Traverse all object files. ALL_OBJFILES_SAFE works even if you delete
the objfile during the traversal. */
#define ALL_OBJFILES(obj) \
for ((obj)=object_files; (obj)!=NULL; (obj)=(obj)->next)
#define ALL_OBJFILES_SAFE(obj,nxt) \
for ((obj)=object_files; (obj)!=NULL?((nxt)=(obj)->next,1):0; (obj)=(nxt))
#endif /* !defined (OBJFILES_H) */

View File

@ -71,12 +71,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|| (namestring [(nsl = strlen (namestring)) - 1] == 'o'
&& namestring [nsl - 2] == '.'))
{
if (entry_point < CUR_SYMBOL_VALUE
&& entry_point >= last_o_file_start
&& addr == 0) /* FIXME nogood nomore */
if (objfile -> ei.entry_point < CUR_SYMBOL_VALUE &&
objfile -> ei.entry_point >= last_o_file_start &&
addr == 0) /* FIXME nogood nomore */
{
startup_file_start = last_o_file_start;
startup_file_end = CUR_SYMBOL_VALUE;
objfile -> ei.entry_file_lowpc = last_o_file_start;
objfile -> ei.entry_file_highpc = CUR_SYMBOL_VALUE;
}
if (past_first_source_file && pst
/* The gould NP1 uses low values for .o and -l symbols

View File

@ -459,7 +459,7 @@ void init_frame_pc ();
FIXME!!!
However, allow a pc in a call dummy. */
#define FRAME_CHAIN_VALID(chain, thisframe) \
(outside_startup_file (FRAME_SAVED_PC (thisframe)))
(!inside_entry_file (FRAME_SAVED_PC (thisframe)))
/* Define other aspects of the stack frame. */

View File

@ -288,38 +288,16 @@ extern const struct ext_format ext_format_68881;
/* Describe the pointer in each stack frame to the previous stack frame
(its caller). */
/* FRAME_CHAIN takes a frame's nominal address
and produces the frame's chain-pointer.
However, if FRAME_CHAIN_VALID returns zero,
it means the given frame is the outermost one and has no caller. */
/* In the case of the 68000, the frame's nominal address
/* FRAME_CHAIN takes a frame's nominal address and produces the frame's
chain-pointer.
In the case of the 68000, the frame's nominal address
is the address of a 4-byte word containing the calling frame's address. */
#define FRAME_CHAIN(thisframe) \
(outside_startup_file ((thisframe)->pc) ? \
(!inside_entry_file ((thisframe)->pc) ? \
read_memory_integer ((thisframe)->frame, 4) :\
0)
#if defined (FRAME_CHAIN_VALID_ALTERNATE)
/* Use the alternate method of avoiding running up off the end of
the frame chain or following frames back into the startup code.
See the comments in blockframe.c */
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 \
&& !(inside_main_scope ((thisframe)->pc)) \
&& !(inside_entry_scope ((thisframe)->pc)))
#else
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 && outside_startup_file (FRAME_SAVED_PC (thisframe)))
#endif /* FRAME_CHAIN_VALID_ALTERNATE */
/* Define other aspects of the stack frame. */
/* A macro that tells us whether the function invocation represented

View File

@ -295,18 +295,12 @@ extern struct value *value_of_trapped_internalvar ();
(its caller). */
/* FRAME_CHAIN takes a frame_info with a frame's nominal address in fi->frame,
and produces the frame's chain-pointer.
However, if FRAME_CHAIN_VALID returns zero,
it means the given frame is the outermost one and has no caller. */
and produces the frame's chain-pointer. */
/* (caller fp is saved at 8(fp)) */
#define FRAME_CHAIN(fi) (read_memory_integer ((fi)->frame + 8, 4))
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
/* Define other aspects of the stack frame. */
/* We need the boundaries of the text in the exec file, as a kludge,

View File

@ -220,18 +220,11 @@ UNSIGNED_SHORT(read_memory_integer (read_register (SP_REGNUM), 2))
/* In the case of the H8/300, the frame's nominal address
is the address of a 2-byte word containing the calling frame's address. */
/* Use the alternate method of avoiding running up off the end of
the frame chain or following frames back into the startup code.
See the comments in blockframe.c */
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 \
&& !(inside_main_scope ((thisframe)->pc)) \
&& !(inside_entry_scope ((thisframe)->pc)))
See the comments in objfile.h */
#define FRAME_CHAIN_VALID_ALTERNATE
/* Define other aspects of the stack frame. */

View File

@ -225,19 +225,13 @@ i386_skip_prologue PARAMS ((int));
(its caller). */
/* FRAME_CHAIN takes a frame's nominal address
and produces the frame's chain-pointer.
However, if FRAME_CHAIN_VALID returns zero,
it means the given frame is the outermost one and has no caller. */
and produces the frame's chain-pointer. */
#define FRAME_CHAIN(thisframe) \
(outside_startup_file ((thisframe)->pc) ? \
(!inside_entry_file ((thisframe)->pc) ? \
read_memory_integer ((thisframe)->frame, 4) :\
0)
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
/* Define other aspects of the stack frame. */
/* A macro that tells us whether the function invocation represented

View File

@ -200,16 +200,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
(its caller). */
/* FRAME_CHAIN takes a frame's nominal address
and produces the frame's chain-pointer.
However, if FRAME_CHAIN_VALID returns zero,
it means the given frame is the outermost one and has no caller. */
and produces the frame's chain-pointer. */
#define FRAME_CHAIN(thisframe) (FRAME_ADDR)mips_frame_chain(thisframe)
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
/* Define other aspects of the stack frame. */

View File

@ -204,22 +204,16 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
(its caller). */
/* FRAME_CHAIN takes a frame's nominal address
and produces the frame's chain-pointer.
However, if FRAME_CHAIN_VALID returns zero,
it means the given frame is the outermost one and has no caller. */
and produces the frame's chain-pointer. */
/* In the case of the Merlin, the frame's nominal address is the FP value,
and at that address is saved previous FP value as a 4-byte word. */
#define FRAME_CHAIN(thisframe) \
(outside_startup_file ((thisframe)->pc) ? \
(!inside_entry_file ((thisframe)->pc) ? \
read_memory_integer ((thisframe)->frame, 4) :\
0)
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
/* Define other aspects of the stack frame. */
#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))

View File

@ -224,16 +224,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
(its caller). */
/* FRAME_CHAIN takes a frame's nominal address
and produces the frame's chain-pointer.
However, if FRAME_CHAIN_VALID returns zero,
it means the given frame is the outermost one and has no caller. */
and produces the frame's chain-pointer. */
#define FRAME_CHAIN(thisframe) (FRAME_ADDR)mips_frame_chain(thisframe)
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
/* Define other aspects of the stack frame. */

View File

@ -305,10 +305,7 @@ do { \
} while (0);
/* FRAME_CHAIN takes a frame's nominal address
and produces the frame's chain-pointer.
However, if FRAME_CHAIN_VALID returns zero,
it means the given frame is the outermost one and has no caller. */
and produces the frame's chain-pointer. */
/* In the case of the pyr, the frame's nominal address is the address
of parameter register 0. The previous frame is found 32 words up. */
@ -316,9 +313,6 @@ do { \
#define FRAME_CHAIN(thisframe) \
( (thisframe) -> frame - CONTROL_STACK_FRAME_SIZE)
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
/*((thisframe) >= CONTROL_STACK_ADDR))*/
/* Define other aspects of the stack frame. */

View File

@ -405,22 +405,16 @@ extern unsigned int rs6000_struct_return_address;
(its caller). */
/* FRAME_CHAIN takes a frame's nominal address
and produces the frame's chain-pointer.
However, if FRAME_CHAIN_VALID returns zero,
it means the given frame is the outermost one and has no caller. */
and produces the frame's chain-pointer. */
/* In the case of the RS6000, the frame's nominal address
is the address of a 4-byte word containing the calling frame's address. */
#define FRAME_CHAIN(thisframe) \
(outside_startup_file ((thisframe)->pc) ? \
(!inside_entry_file ((thisframe)->pc) ? \
read_memory_integer ((thisframe)->frame, 4) :\
0)
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
/* Define other aspects of the stack frame. */
/* A macro that tells us whether the function invocation represented

View File

@ -300,10 +300,7 @@ sparc_extract_struct_value_address PARAMS ((char [REGISTER_BYTES]));
#include <sun4/reg.h>
/* FRAME_CHAIN takes a frame's nominal address
and produces the frame's chain-pointer.
However, if FRAME_CHAIN_VALID returns zero,
it means the given frame is the outermost one and has no caller. */
and produces the frame's chain-pointer. */
/* In the case of the Sun 4, the frame-chain's nominal address
is held in the frame pointer register.
@ -336,9 +333,6 @@ sparc_extract_struct_value_address PARAMS ((char [REGISTER_BYTES]));
#define FRAME_CHAIN(thisframe) (sparc_frame_chain (thisframe))
CORE_ADDR sparc_frame_chain ();
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
/* Define other aspects of the stack frame. */
/* A macro that tells us whether the function invocation represented

View File

@ -228,19 +228,13 @@ double_to_i387 PARAMS ((char *, char *));
(its caller). */
/* FRAME_CHAIN takes a frame's nominal address
and produces the frame's chain-pointer.
However, if FRAME_CHAIN_VALID returns zero,
it means the given frame is the outermost one and has no caller. */
and produces the frame's chain-pointer. */
#define FRAME_CHAIN(thisframe) \
(outside_startup_file ((thisframe)->pc) ? \
(!inside_entry_file ((thisframe)->pc) ? \
read_memory_integer ((thisframe)->frame, 4) :\
0)
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
/* Define other aspects of the stack frame. */
/* A macro that tells us whether the function invocation represented

View File

@ -257,7 +257,7 @@ double_to_i387 PARAMS ((char *, char *));
is right on top of that. */
#define FRAME_CHAIN(thisframe) \
(outside_startup_file ((thisframe)->pc) ? \
(!inside_entry_file ((thisframe)->pc) ? \
read_memory_integer((thisframe)->frame, 4) :\
0)

View File

@ -208,22 +208,16 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
(its caller).
FRAME_CHAIN takes a frame's nominal address
and produces the frame's chain-pointer.
However, if FRAME_CHAIN_VALID returns zero,
it means the given frame is the outermost one and has no caller. */
and produces the frame's chain-pointer. */
/* In the case of the Tahoe, the frame's nominal address is the FP value,
and it points to the old FP */
#define FRAME_CHAIN(thisframe) \
(outside_startup_file ((thisframe)->pc) ? \
(!inside_entry_file ((thisframe)->pc) ? \
read_memory_integer ((thisframe)->frame, 4) :\
0)
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
/* Define other aspects of the stack frame. */
/* Saved PC */

View File

@ -212,22 +212,16 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
(its caller). */
/* FRAME_CHAIN takes a frame's nominal address
and produces the frame's chain-pointer.
However, if FRAME_CHAIN_VALID returns zero,
it means the given frame is the outermost one and has no caller. */
and produces the frame's chain-pointer. */
/* In the case of the ns32000 series, the frame's nominal address is the FP
value, and at that address is saved previous FP value as a 4-byte word. */
#define FRAME_CHAIN(thisframe) \
(outside_startup_file ((thisframe)->pc) ? \
(!inside_entry_file ((thisframe)->pc) ? \
read_memory_integer ((thisframe)->frame, 4) :\
0)
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
/* Define other aspects of the stack frame. */
#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))

View File

@ -218,22 +218,16 @@ fix to bug-gdb@prep.ai.mit.edu. */
(its caller). */
/* FRAME_CHAIN takes a frame's nominal address
and produces the frame's chain-pointer.
However, if FRAME_CHAIN_VALID returns zero,
it means the given frame is the outermost one and has no caller. */
and produces the frame's chain-pointer. */
/* In the case of the Vax, the frame's nominal address is the FP value,
and 12 bytes later comes the saved previous FP value as a 4-byte word. */
#define FRAME_CHAIN(thisframe) \
(outside_startup_file ((thisframe)->pc) ? \
(!inside_entry_file ((thisframe)->pc) ? \
read_memory_integer ((thisframe)->frame + 12, 4) :\
0)
#define FRAME_CHAIN_VALID(chain, thisframe) \
(chain != 0 && (outside_startup_file (FRAME_SAVED_PC (thisframe))))
/* Define other aspects of the stack frame. */
/* A macro that tells us whether the function invocation represented

View File

@ -37,6 +37,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "gdbcmd.h"
#include "gdbcore.h"
#include "symfile.h"
#include "objfiles.h"
#include "libbfd.h" /* BFD internals (sigh!) FIXME */

View File

@ -44,6 +44,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "symtab.h"
#include "gdbtypes.h"
#include "symfile.h"
#include "objfiles.h"
#include "buildsym.h"
#include "coff/internal.h" /* FIXME, internal data from BFD */
@ -2018,19 +2019,7 @@ aixcoff_symfile_init (objfile)
/* Allocate struct to keep track of the symfile */
objfile -> sym_private = xmmalloc (objfile -> md,
sizeof (struct coff_symfile_info));
/*
* Save startup file's range of PC addresses to help
* blockframe.c decide where the bottom of the stack is.
*/
if (bfd_get_file_flags(abfd) & EXEC_P) {
entry_point = bfd_get_start_address(abfd);
} else {
entry_point = ~0;
/* set the startup file to be an empty range. */
startup_file_start = 0;
startup_file_end = 0;
}
init_entry_point_info (objfile);
}
/* Perform any local cleanups required when we are done with a particular