char *name;
- /* Constant value, or address if static, or register number,
- or offset in arguments, or offset in stack frame. All of
- these are in host byte order (though what they point to might
- be in target byte order, e.g. LOC_CONST_BYTES).
-
- Note that the address of a function is SYMBOL_VALUE_ADDRESS (pst)
- in a partial symbol table, but BLOCK_START (SYMBOL_BLOCK_VALUE (st))
- in a symbol table. */
+ /* Value of the symbol. Which member of this union to use, and what
+ it means, depends on what kind of symbol this is and its
+ SYMBOL_CLASS. See comments there for more details. All of these
+ are in host byte order (though what they point to might be in
+ target byte order, e.g. LOC_CONST_BYTES). */
union
{
- /* for LOC_CONST, LOC_REGISTER, LOC_ARG, LOC_REF_ARG, LOC_REGPARM,
- LOC_LOCAL */
-
long value;
- /* for LOC_BLOCK */
-
struct block *block;
- /* for LOC_CONST_BYTES */
-
char *bytes;
- /* for LOC_STATIC, LOC_LABEL */
-
CORE_ADDR address;
/* for opaque typedef struct chain */
struct minimal_symbol
{
- /* The general symbol info required for all types of symbols. */
+ /* The general symbol info required for all types of symbols.
+
+ The SYMBOL_VALUE_ADDRESS contains the address that this symbol
+ corresponds to. */
struct general_symbol_info ginfo;
LOC_STATIC,
- /* Value is in register */
+ /* Value is in register. SYMBOL_VALUE is the register number. */
LOC_REGISTER,
- /* Value is at spec'd offset in arglist */
+ /* It's an argument; the value is at SYMBOL_VALUE offset in arglist. */
LOC_ARG,
- /* Value address is at spec'd offset in arglist. Currently this is used
- for C++ references (and presumably will be used for Pascal VAR
- parameters), and is only dereferenced in certain contexts. */
+ /* Value address is at SYMBOL_VALUE offset in arglist. */
LOC_REF_ARG,
- /* Value is in specified register. Just like LOC_REGISTER except this is
- an argument. Probably the cleaner way to handle this would be to
- separate address_class (which would include separate ARG and LOCAL
- to deal with FRAME_ARGS_ADDRESS versus FRAME_LOCALS_ADDRESS), and
- an is_argument flag.
+ /* Value is in register number SYMBOL_VALUE. Just like LOC_REGISTER
+ except this is an argument. Probably the cleaner way to handle
+ this would be to separate address_class (which would include
+ separate ARG and LOCAL to deal with FRAME_ARGS_ADDRESS versus
+ FRAME_LOCALS_ADDRESS), and an is_argument flag.
For some symbol formats (stabs, for some compilers at least),
- gdb generates a LOC_ARG and a LOC_REGISTER rather than a LOC_REGPARM.
- This is because that's what the compiler does, but perhaps it would
- be better if the symbol-reading code detected this (is it possible?)
- and generated a LOC_REGPARM. */
+ the compiler generates two symbols, an argument and a register.
+ In some cases we combine them to a single LOC_REGPARM in symbol
+ reading, but currently not for all cases (e.g. it's passed on the
+ stack and then loaded into a register). */
LOC_REGPARM,
- /* Value is at spec'd offset in stack frame */
+ /* Value is in specified register. Just like LOC_REGPARM except the
+ register holds the address of the argument instead of the argument
+ itself. This is currently used for the passing of structs and unions
+ on sparc and hppa. It is also used for call by reference where the
+ address is in a register, at least by mipsread.c. */
+
+ LOC_REGPARM_ADDR,
+
+ /* Value is a local variable at SYMBOL_VALUE offset in stack frame. */
LOC_LOCAL,
LOC_LABEL,
- /* Value is address SYMBOL_VALUE_BLOCK of a `struct block'. Function names
- have this class. */
+ /* In a symbol table, value is SYMBOL_BLOCK_VALUE of a `struct block'.
+ In a partial symbol table, SYMBOL_VALUE_ADDRESS is the start address
+ of the block. Function names have this class. */
LOC_BLOCK,
LOC_CONST_BYTES,
- /* Value is arg at spec'd offset in stack frame. Differs from LOC_LOCAL in
- that symbol is an argument; differs from LOC_ARG in that we find it
- in the frame (FRAME_LOCALS_ADDRESS), not in the arglist
- (FRAME_ARGS_ADDRESS). Added for i960, which passes args in regs then
- copies to frame. */
+ /* Value is arg at SYMBOL_VALUE offset in stack frame. Differs from
+ LOC_LOCAL in that symbol is an argument; differs from LOC_ARG in
+ that we find it in the frame (FRAME_LOCALS_ADDRESS), not in the
+ arglist (FRAME_ARGS_ADDRESS). Added for i960, which passes args
+ in regs then copies to frame. */
LOC_LOCAL_ARG,
/* The variable does not actually exist in the program.
- The SYMBOL_VALUE is ignored. */
+ The value is ignored. */
LOC_OPTIMIZED_OUT
};
CORE_ADDR pc;
};
+/* The order of entries in the linetable is significant.
+
+ It should generally be in ascending line number order. Line table
+ entries for a function at lines 10-40 should come before entries
+ for a function at lines 50-70.
+
+ A for statement looks like this
+
+ 10 0x100 - for the init/test part of a for stmt.
+ 20 0x200
+ 30 0x300
+ 10 0x400 - for the increment part of a for stmt.
+
+ FIXME: this description is incomplete. coffread.c is said to get
+ the linetable order wrong (would arrange_linenos from xcoffread.c
+ work for normal COFF too?). */
+
struct linetable
{
int nitems;
/* source.c */
+extern int frame_file_full_name; /* in stack.c */
+
extern int
-identify_source_line PARAMS ((struct symtab *, int, int));
+identify_source_line PARAMS ((struct symtab *, int, int, CORE_ADDR));
extern void
print_source_lines PARAMS ((struct symtab *, int, int, int));