aboutsummaryrefslogtreecommitdiff
path: root/gdb/mdebugread.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/mdebugread.c')
-rw-r--r--gdb/mdebugread.c443
1 files changed, 222 insertions, 221 deletions
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 01e68ab..0159b89 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -61,17 +61,17 @@
#include "bfd.h"
-#include "coff/ecoff.h" /* COFF-like aspects of ecoff files */
+#include "coff/ecoff.h" /* COFF-like aspects of ecoff files. */
#include "libaout.h" /* Private BFD a.out information. */
#include "aout/aout64.h"
-#include "aout/stab_gnu.h" /* STABS information */
+#include "aout/stab_gnu.h" /* STABS information. */
#include "expression.h"
extern void _initialize_mdebugread (void);
-/* Provide a way to test if we have both ECOFF and ELF symbol tables.
+/* Provide a way to test if we have both ECOFF and ELF symbol tables.
We use this define in order to know whether we should override a
symbol's ECOFF section with its ELF section. This is necessary in
case the symbol's ELF section could not be represented in ECOFF. */
@@ -119,7 +119,7 @@ struct symloc
#define SC_IS_SBSS(sc) ((sc) == scSBss)
#define SC_IS_UNDEF(sc) ((sc) == scUndefined || (sc) == scSUndefined)
-/* Various complaints about symbol reading that don't abort the process */
+/* Various complaints about symbol reading that don't abort the process. */
static void
index_complaint (const char *arg1)
{
@@ -159,18 +159,18 @@ unexpected_type_code_complaint (const char *arg1)
complaint (&symfile_complaints, _("unexpected type code for %s"), arg1);
}
-/* Macros and extra defs */
+/* Macros and extra defs. */
-/* Puns: hard to find whether -g was used and how */
+/* Puns: hard to find whether -g was used and how. */
#define MIN_GLEVEL GLEVEL_0
#define compare_glevel(a,b) \
(((a) == GLEVEL_3) ? ((b) < GLEVEL_3) : \
((b) == GLEVEL_3) ? -1 : (int)((b) - (a)))
-/* Things that really are local to this module */
+/* Things that really are local to this module. */
-/* Remember what we deduced to be the source language of this psymtab. */
+/* Remember what we deduced to be the source language of this psymtab. */
static enum language psymtab_language = language_unknown;
@@ -186,22 +186,22 @@ static const struct ecoff_debug_swap *debug_swap;
static struct ecoff_debug_info *debug_info;
-/* Pointer to current file decriptor record, and its index */
+/* Pointer to current file decriptor record, and its index. */
static FDR *cur_fdr;
static int cur_fd;
-/* Index of current symbol */
+/* Index of current symbol. */
static int cur_sdx;
/* Note how much "debuggable" this image is. We would like
- to see at least one FDR with full symbols */
+ to see at least one FDR with full symbols. */
static int max_gdbinfo;
static int max_glevel;
-/* When examining .o files, report on undefined symbols */
+/* When examining .o files, report on undefined symbols. */
static int n_undef_symbols, n_undef_labels, n_undef_vars, n_undef_procs;
@@ -213,7 +213,7 @@ static char stabs_symbol[] = STABS_SYMBOL;
static int found_ecoff_debugging_info;
-/* Forward declarations */
+/* Forward declarations. */
static int upgrade_type (int, struct type **, int, union aux_ext *,
int, char *);
@@ -267,7 +267,7 @@ static char *mdebug_next_symbol_text (struct objfile *);
/* Exported procedure: Builds a symtab from the PST partial one.
Restores the environment in effect when PST was created, delegates
most of the work to an ancillary procedure, and sorts
- and reorders the symtab list at the end */
+ and reorders the symtab list at the end. */
static void
mdebug_psymtab_to_symtab (struct partial_symtab *pst)
@@ -286,16 +286,16 @@ mdebug_psymtab_to_symtab (struct partial_symtab *pst)
psymtab_to_symtab_1 (pst, pst->filename);
/* Match with global symbols. This only needs to be done once,
- after all of the symtabs and dependencies have been read in. */
+ after all of the symtabs and dependencies have been read in. */
scan_file_globals (pst->objfile);
if (info_verbose)
printf_filtered (_("done.\n"));
}
-/* File-level interface functions */
+/* File-level interface functions. */
-/* Find a file descriptor given its index RF relative to a file CF */
+/* Find a file descriptor given its index RF relative to a file CF. */
static FDR *
get_rfd (int cf, int rf)
@@ -306,7 +306,7 @@ get_rfd (int cf, int rf)
fdrs = debug_info->fdr;
f = fdrs + cf;
- /* Object files do not have the RFD table, all refs are absolute */
+ /* Object files do not have the RFD table, all refs are absolute. */
if (f->rfdBase == 0)
return fdrs + rf;
(*debug_swap->swap_rfd_in) (cur_bfd,
@@ -317,7 +317,7 @@ get_rfd (int cf, int rf)
return fdrs + rfd;
}
-/* Return a safer print NAME for a file descriptor */
+/* Return a safer print NAME for a file descriptor. */
static char *
fdr_name (FDR *f)
@@ -385,7 +385,7 @@ mdebug_build_psymtabs (struct objfile *objfile,
/* Local utilities */
-/* Map of FDR indexes to partial symtabs */
+/* Map of FDR indexes to partial symtabs. */
struct pst_map
{
@@ -398,13 +398,13 @@ struct pst_map
/* Utility stack, used to nest procedures and blocks properly.
It is a doubly linked list, to avoid too many alloc/free.
Since we might need it quite a few times it is NOT deallocated
- after use. */
+ after use. */
static struct parse_stack
{
struct parse_stack *next, *prev;
- struct symtab *cur_st; /* Current symtab. */
- struct block *cur_block; /* Block in it. */
+ struct symtab *cur_st; /* Current symtab. */
+ struct block *cur_block; /* Block in it. */
/* What are we parsing. stFile, or stBlock are for files and
blocks. stProc or stStaticProc means we have seen the start of a
@@ -414,28 +414,28 @@ static struct parse_stack
int blocktype;
- struct type *cur_type; /* Type we parse fields for. */
- int cur_field; /* Field number in cur_type. */
- CORE_ADDR procadr; /* Start addres of this procedure */
- int numargs; /* Its argument count */
+ struct type *cur_type; /* Type we parse fields for. */
+ int cur_field; /* Field number in cur_type. */
+ CORE_ADDR procadr; /* Start addres of this procedure. */
+ int numargs; /* Its argument count. */
}
*top_stack; /* Top stack ptr */
-/* Enter a new lexical context */
+/* Enter a new lexical context. */
static void
push_parse_stack (void)
{
struct parse_stack *new;
- /* Reuse frames if possible */
+ /* Reuse frames if possible. */
if (top_stack && top_stack->prev)
new = top_stack->prev;
else
new = (struct parse_stack *) xzalloc (sizeof (struct parse_stack));
- /* Initialize new frame with previous content */
+ /* Initialize new frame with previous content. */
if (top_stack)
{
struct parse_stack *prev = new->prev;
@@ -448,7 +448,7 @@ push_parse_stack (void)
top_stack = new;
}
-/* Exit a lexical context */
+/* Exit a lexical context. */
static void
pop_parse_stack (void)
@@ -463,7 +463,7 @@ pop_parse_stack (void)
/* Cross-references might be to things we haven't looked at
yet, e.g. type references. To avoid too many type
duplications we keep a quick fixup table, an array
- of lists of references indexed by file descriptor */
+ of lists of references indexed by file descriptor. */
struct mdebug_pending
{
@@ -482,7 +482,7 @@ struct mdebug_pending
static struct mdebug_pending **pending_list;
-/* Check whether we already saw symbol SH in file FH */
+/* Check whether we already saw symbol SH in file FH. */
static struct mdebug_pending *
is_pending_symbol (FDR *fh, char *sh)
@@ -490,14 +490,14 @@ is_pending_symbol (FDR *fh, char *sh)
int f_idx = fh - debug_info->fdr;
struct mdebug_pending *p;
- /* Linear search is ok, list is typically no more than 10 deep */
+ /* Linear search is ok, list is typically no more than 10 deep. */
for (p = pending_list[f_idx]; p; p = p->next)
if (p->s == sh)
break;
return p;
}
-/* Add a new symbol SH of type T */
+/* Add a new symbol SH of type T. */
static void
add_pending (FDR *fh, char *sh, struct type *t)
@@ -505,7 +505,7 @@ add_pending (FDR *fh, char *sh, struct type *t)
int f_idx = fh - debug_info->fdr;
struct mdebug_pending *p = is_pending_symbol (fh, sh);
- /* Make sure we do not make duplicates */
+ /* Make sure we do not make duplicates. */
if (!p)
{
p = ((struct mdebug_pending *)
@@ -519,9 +519,9 @@ add_pending (FDR *fh, char *sh, struct type *t)
}
-/* Parsing Routines proper. */
+/* Parsing Routines proper. */
-/* Parse a single symbol. Mostly just make up a GDB symbol for it.
+/* Parse a single symbol. Mostly just make up a GDB symbol for it.
For blocks, procedures and types we open a new lexical context.
This is basically just a big switch on the symbol's type. Argument
AX is the base pointer of aux symbols for this file (fh->iauxBase).
@@ -594,7 +594,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
case stNil:
break;
- case stGlobal: /* external symbol, goes into global block */
+ case stGlobal: /* External symbol, goes into global block. */
class = LOC_STATIC;
b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (top_stack->cur_st),
GLOBAL_BLOCK);
@@ -602,7 +602,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
SYMBOL_VALUE_ADDRESS (s) = (CORE_ADDR) sh->value;
goto data;
- case stStatic: /* static data, goes into current block. */
+ case stStatic: /* Static data, goes into current block. */
class = LOC_STATIC;
b = top_stack->cur_block;
s = new_symbol (name);
@@ -619,7 +619,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
SYMBOL_VALUE_ADDRESS (s) = (CORE_ADDR) sh->value;
goto data;
- case stLocal: /* local variable, goes into current block */
+ case stLocal: /* Local variable, goes into current block. */
b = top_stack->cur_block;
s = new_symbol (name);
SYMBOL_VALUE (s) = svalue;
@@ -631,7 +631,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
else
class = LOC_LOCAL;
- data: /* Common code for symbols describing data */
+ data: /* Common code for symbols describing data. */
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
SYMBOL_CLASS (s) = class;
add_symbol (s, top_stack->cur_st, b);
@@ -642,17 +642,18 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
SYMBOL_TYPE (s) = objfile_type (objfile)->nodebug_data_symbol;
else
SYMBOL_TYPE (s) = parse_type (cur_fd, ax, sh->index, 0, bigend, name);
- /* Value of a data symbol is its memory address */
+ /* Value of a data symbol is its memory address. */
break;
- case stParam: /* arg to procedure, goes into current block */
+ case stParam: /* Arg to procedure, goes into current
+ block. */
max_gdbinfo++;
found_ecoff_debugging_info = 1;
top_stack->numargs++;
/* Special GNU C++ name. */
if (is_cplus_marker (name[0]) && name[1] == 't' && name[2] == 0)
- name = "this"; /* FIXME, not alloc'd in obstack */
+ name = "this"; /* FIXME, not alloc'd in obstack. */
s = new_symbol (name);
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
@@ -683,17 +684,17 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
break;
- case stLabel: /* label, goes into current block */
+ case stLabel: /* label, goes into current block. */
s = new_symbol (name);
- SYMBOL_DOMAIN (s) = VAR_DOMAIN; /* so that it can be used */
- SYMBOL_CLASS (s) = LOC_LABEL; /* but not misused */
+ SYMBOL_DOMAIN (s) = VAR_DOMAIN; /* So that it can be used */
+ SYMBOL_CLASS (s) = LOC_LABEL; /* but not misused. */
SYMBOL_VALUE_ADDRESS (s) = (CORE_ADDR) sh->value;
SYMBOL_TYPE (s) = objfile_type (objfile)->builtin_int;
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
break;
- case stProc: /* Procedure, usually goes into global block */
- case stStaticProc: /* Static procedure, goes into current block */
+ case stProc: /* Procedure, usually goes into global block. */
+ case stStaticProc: /* Static procedure, goes into current block. */
/* For stProc symbol records, we need to check the storage class
as well, as only (stProc, scText) entries represent "real"
procedures - See the Compaq document titled "Object File /
@@ -729,7 +730,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
s = new_symbol (name);
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
SYMBOL_CLASS (s) = LOC_BLOCK;
- /* Type of the return value */
+ /* Type of the return value. */
if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil)
t = objfile_type (objfile)->builtin_int;
else
@@ -746,8 +747,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
printf("howdy\n")" would fail with the error message
"program has no memory available". To avoid this, we
patch up the type and make it void*
- instead. (davidm@azstarnet.com)
- */
+ instead. (davidm@azstarnet.com). */
t = make_pointer_type (t, NULL);
}
}
@@ -769,7 +769,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
}
add_symbol (s, top_stack->cur_st, b);
- /* Make a type for the procedure itself */
+ /* Make a type for the procedure itself. */
SYMBOL_TYPE (s) = lookup_function_type (t);
/* All functions in C++ have prototypes. For C we don't have enough
@@ -777,7 +777,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
if (SYMBOL_LANGUAGE (s) == language_cplus)
TYPE_PROTOTYPED (SYMBOL_TYPE (s)) = 1;
- /* Create and enter a new lexical context */
+ /* Create and enter a new lexical context. */
b = new_block (FUNCTION_BLOCK);
SYMBOL_BLOCK_VALUE (s) = b;
BLOCK_FUNCTION (b) = s;
@@ -785,7 +785,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
BLOCK_SUPERBLOCK (b) = top_stack->cur_block;
add_block (b, top_stack->cur_st);
- /* Not if we only have partial info */
+ /* Not if we only have partial info. */
if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil)
break;
@@ -807,19 +807,19 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
long max_value;
struct field *f;
- case stStruct: /* Start a block defining a struct type */
+ case stStruct: /* Start a block defining a struct type. */
type_code = TYPE_CODE_STRUCT;
goto structured_common;
- case stUnion: /* Start a block defining a union type */
+ case stUnion: /* Start a block defining a union type. */
type_code = TYPE_CODE_UNION;
goto structured_common;
- case stEnum: /* Start a block defining an enum type */
+ case stEnum: /* Start a block defining an enum type. */
type_code = TYPE_CODE_ENUM;
goto structured_common;
- case stBlock: /* Either a lexical block, or some type */
+ case stBlock: /* Either a lexical block, or some type. */
if (sh->sc != scInfo && !SC_IS_COMMON (sh->sc))
goto case_stBlock_code; /* Lexical block */
@@ -833,7 +833,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
push_parse_stack ();
top_stack->blocktype = stBlock;
- /* First count the number of fields and the highest value. */
+ /* First count the number of fields and the highest value. */
nfields = 0;
max_value = 0;
for (ext_tsym = ext_sh + external_sym_size;
@@ -848,7 +848,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
{
case stEnd:
/* C++ encodes class types as structures where there the
- methods are encoded as stProc. The scope of stProc
+ methods are encoded as stProc. The scope of stProc
symbols also ends with stEnd, thus creating a risk of
taking the wrong stEnd symbol record as the end of
the current struct, which would cause GDB to undercount
@@ -926,14 +926,14 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
/* mips cc puts out a typedef for struct x if it is not yet
defined when it encounters
struct y { struct x *xp; };
- Just ignore it. */
+ Just ignore it. */
break;
case stIndirect:
/* Irix5 cc puts out a stIndirect for struct x if it is not
yet defined when it encounters
struct y { struct x *xp; };
- Just ignore it. */
+ Just ignore it. */
break;
default:
@@ -976,7 +976,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
differently from struct/union fields, and that is harder to
patch up, but luckily we shouldn't need to. (If there are
any enumeration members, we can tell for sure it's an enum
- here.) */
+ here.) */
if (type_code == TYPE_CODE_UNDEF)
{
@@ -1016,7 +1016,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
{
int unsigned_enum = 1;
- /* This is a non-empty enum. */
+ /* This is a non-empty enum. */
/* DEC c89 has the number of enumerators in the sh.value field,
not the type length, so we have to compensate for that
@@ -1061,14 +1061,14 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
unsigned_enum = 0;
add_symbol (enum_sym, top_stack->cur_st, top_stack->cur_block);
- /* Skip the stMembers that we've handled. */
+ /* Skip the stMembers that we've handled. */
count++;
f++;
}
if (unsigned_enum)
TYPE_UNSIGNED (t) = 1;
}
- /* make this the current type */
+ /* Make this the current type. */
top_stack->cur_type = t;
top_stack->cur_field = 0;
@@ -1098,8 +1098,8 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
case_stBlock_code:
found_ecoff_debugging_info = 1;
- /* beginnning of (code) block. Value of symbol
- is the displacement from procedure start */
+ /* Beginnning of (code) block. Value of symbol
+ is the displacement from procedure start. */
push_parse_stack ();
/* Do not start a new block if this is the outermost block of a
@@ -1139,7 +1139,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
BLOCK_END (top_stack->cur_block) += sh->value; /* size */
- /* Make up special symbol to contain procedure specific info */
+ /* Make up special symbol to contain procedure specific info. */
s = new_symbol (MDEBUG_EFI_SYMBOL_NAME);
SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
SYMBOL_CLASS (s) = LOC_CONST;
@@ -1171,7 +1171,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
if (TYPE_NFIELDS (ftype) <= 0)
{
/* No parameter type information is recorded with the function's
- type. Set that from the type of the parameter symbols. */
+ type. Set that from the type of the parameter symbols. */
int nparams = top_stack->numargs;
int iparams;
struct symbol *sym;
@@ -1202,9 +1202,9 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
}
else if (sh->sc == scText && top_stack->blocktype == stBlock)
{
- /* End of (code) block. The value of the symbol is the
+ /* End of (code) block. The value of the symbol is the
displacement from the procedure`s start address of the
- end of this block. */
+ end of this block. */
BLOCK_END (top_stack->cur_block) = sh->value + top_stack->procadr;
}
else if (sh->sc == scText && top_stack->blocktype == stNil)
@@ -1223,7 +1223,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
complaint (&symfile_complaints,
_("stEnd with storage class %d not handled"), sh->sc);
- pop_parse_stack (); /* restore previous lexical context */
+ pop_parse_stack (); /* Restore previous lexical context. */
break;
case stMember: /* member of struct or union */
@@ -1259,8 +1259,8 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
else
t = pend->t;
- /* mips cc puts out a typedef with the name of the struct for forward
- declarations. These should not go into the symbol table and
+ /* Mips cc puts out a typedef with the name of the struct for forward
+ declarations. These should not go into the symbol table and
TYPE_NAME should not be set for them.
They can't be distinguished from an intentional typedef to
the same name however:
@@ -1514,7 +1514,7 @@ basic_type (int bt, struct objfile *objfile)
}
/* Parse the type information provided in the raw AX entries for
- the symbol SH. Return the bitfield size in BS, in case.
+ the symbol SH. Return the bitfield size in BS, in case.
We must byte-swap the AX entries before we use them; BIGEND says whether
they are big-endian or little-endian (from fh->fBigendian). */
@@ -1526,7 +1526,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
struct type *tp = 0;
enum type_code type_code = TYPE_CODE_UNDEF;
- /* Handle undefined types, they have indexNil. */
+ /* Handle undefined types, they have indexNil. */
if (aux_index == indexNil)
return basic_type (btInt, current_objfile);
@@ -1543,7 +1543,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
tp = basic_type (t->bt, current_objfile);
if (tp == NULL)
{
- /* Cannot use builtin types -- build our own */
+ /* Cannot use builtin types -- build our own. */
switch (t->bt)
{
case btStruct:
@@ -1562,12 +1562,12 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
type_code = TYPE_CODE_SET;
break;
case btIndirect:
- /* alpha cc -migrate uses this for typedefs. The true type will
+ /* alpha cc -migrate uses this for typedefs. The true type will
be obtained by crossreferencing below. */
type_code = TYPE_CODE_ERROR;
break;
case btTypedef:
- /* alpha cc uses this for typedefs. The true type will be
+ /* alpha cc uses this for typedefs. The true type will be
obtained by crossreferencing below. */
type_code = TYPE_CODE_ERROR;
break;
@@ -1577,7 +1577,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
}
}
- /* Move on to next aux */
+ /* Move on to next aux. */
ax++;
if (t->fBitfield)
@@ -1639,7 +1639,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
/* All these types really point to some (common) MIPS type
definition, and only the type-qualifiers fully identify
- them. We'll make the same effort at sharing. */
+ them. We'll make the same effort at sharing. */
if (t->bt == btStruct ||
t->bt == btUnion ||
t->bt == btEnum ||
@@ -1724,7 +1724,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
else
{
/* Usually, TYPE_CODE(tp) is already type_code. The main
- exception is if we guessed wrong re struct/union/enum. */
+ exception is if we guessed wrong re struct/union/enum. */
if (TYPE_CODE (tp) != type_code)
{
bad_tag_guess_complaint (sym_name);
@@ -1750,7 +1750,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
}
}
- /* Deal with range types */
+ /* Deal with range types. */
if (t->bt == btRange)
{
TYPE_NFIELDS (tp) = 0;
@@ -1762,8 +1762,8 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
ax++;
}
- /* Parse all the type qualifiers now. If there are more
- than 6 the game will continue in the next aux */
+ /* Parse all the type qualifiers now. If there are more
+ than 6 the game will continue in the next aux. */
while (1)
{
@@ -1798,11 +1798,11 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
}
/* Make up a complex type from a basic one. Type is passed by
- reference in TPP and side-effected as necessary. The type
+ reference in TPP and side-effected as necessary. The type
qualifier TQ says how to handle the aux symbols at AX for
the symbol SX we are currently analyzing. BIGEND says whether
aux symbols are big-endian or little-endian.
- Returns the number of aux symbols we parsed. */
+ Returns the number of aux symbols we parsed. */
static int
upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
@@ -1811,7 +1811,7 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
int off;
struct type *t;
- /* Used in array processing */
+ /* Used in array processing. */
int rf, id;
FDR *fh;
struct type *range;
@@ -1834,7 +1834,7 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
case tqArray:
off = 0;
- /* Determine and record the domain type (type of index) */
+ /* Determine and record the domain type (type of index). */
(*debug_swap->swap_rndx_in) (bigend, &ax->a_rndx, &rndx);
id = rndx.index;
rf = rndx.rfd;
@@ -1930,12 +1930,12 @@ parse_procedure (PDR *pr, struct symtab *search_symtab,
struct block *b;
char *sh_name;
- /* Simple rule to find files linked "-x" */
+ /* Simple rule to find files linked "-x". */
if (cur_fdr->rss == -1)
{
if (pr->isym == -1)
{
- /* Static procedure at address pr->adr. Sigh. */
+ /* Static procedure at address pr->adr. Sigh. */
/* FIXME-32x64. assuming pr->adr fits in long. */
complaint (&symfile_complaints,
_("can't handle PDR for static proc at 0x%lx"),
@@ -2008,11 +2008,11 @@ parse_procedure (PDR *pr, struct symtab *search_symtab,
s = new_symbol (sh_name);
SYMBOL_DOMAIN (s) = VAR_DOMAIN;
SYMBOL_CLASS (s) = LOC_BLOCK;
- /* Donno its type, hope int is ok */
+ /* Donno its type, hope int is ok. */
SYMBOL_TYPE (s)
= lookup_function_type (objfile_type (pst->objfile)->builtin_int);
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
- /* Wont have symbols for this one */
+ /* Won't have symbols for this one. */
b = new_block (2);
SYMBOL_BLOCK_VALUE (s) = b;
BLOCK_FUNCTION (b) = s;
@@ -2068,11 +2068,11 @@ parse_procedure (PDR *pr, struct symtab *search_symtab,
SYMBOL_TYPE (s) = objfile_type (pst->objfile)->nodebug_text_symbol;
}
-/* Parse the external symbol ES. Just call parse_symbol() after
+/* Parse the external symbol ES. Just call parse_symbol() after
making sure we know where the aux are for it.
BIGEND says whether aux entries are big-endian or little-endian.
- This routine clobbers top_stack->cur_block and ->cur_st. */
+ This routine clobbers top_stack->cur_block and ->cur_st. */
static void parse_external (EXTR *, int, struct section_offsets *,
struct objfile *);
@@ -2123,7 +2123,7 @@ parse_external (EXTR *es, int bigend, struct section_offsets *section_offsets,
break;
}
n_undef_symbols++;
- /* FIXME: Turn this into a complaint? */
+ /* FIXME: Turn this into a complaint? */
if (info_verbose)
printf_filtered (_("Warning: %s `%s' is undefined (in %s)\n"),
what, debug_info->ssext + es->asym.iss,
@@ -2166,7 +2166,7 @@ parse_external (EXTR *es, int bigend, struct section_offsets *section_offsets,
GDB's linetable LT. MIPS' encoding requires a little bit
of magic to get things out. Note also that MIPS' line
numbers can go back and forth, apparently we can live
- with that and do not need to reorder our linetables */
+ with that and do not need to reorder our linetables. */
static void parse_lines (FDR *, PDR *, struct linetable *, int,
struct partial_symtab *, CORE_ADDR);
@@ -2182,7 +2182,7 @@ parse_lines (FDR *fh, PDR *pr, struct linetable *lt, int maxlines,
if (fh->cbLine == 0)
return;
- /* Scan by procedure descriptors */
+ /* Scan by procedure descriptors. */
k = 0;
for (j = 0; j < fh->cpd; j++, pr++)
{
@@ -2190,7 +2190,7 @@ parse_lines (FDR *fh, PDR *pr, struct linetable *lt, int maxlines,
CORE_ADDR adr;
unsigned char *halt;
- /* No code for this one */
+ /* No code for this one. */
if (pr->iline == ilineNil ||
pr->lnLow == -1 || pr->lnHigh == -1)
continue;
@@ -2222,7 +2222,7 @@ parse_lines (FDR *fh, PDR *pr, struct linetable *lt, int maxlines,
}
lineno += delta; /* first delta is 0 */
- /* Complain if the line table overflows. Could happen
+ /* Complain if the line table overflows. Could happen
with corrupt binaries. */
if (lt->nitems >= maxlines)
{
@@ -2352,13 +2352,13 @@ parse_partial_symbols (struct objfile *objfile)
int textlow_not_set = 1;
int past_first_source_file = 0;
- /* List of current psymtab's include files */
+ /* List of current psymtab's include files. */
char **psymtab_include_list;
int includes_allocated;
int includes_used;
EXTR *extern_tab;
struct pst_map *fdr_to_pst;
- /* Index within current psymtab dependency list */
+ /* Index within current psymtab dependency list. */
struct partial_symtab **dependency_list;
int dependencies_used, dependencies_allocated;
struct cleanup *old_chain;
@@ -2401,7 +2401,7 @@ parse_partial_symbols (struct objfile *objfile)
* Only parse the Local and External symbols, and the Relative FDR.
* Fixup enough of the loader symtab to be able to use it.
* Allocate space only for the file's portions we need to
- * look at. (XXX)
+ * look at. (XXX)
*/
max_gdbinfo = 0;
@@ -2409,7 +2409,7 @@ parse_partial_symbols (struct objfile *objfile)
/* Allocate the map FDR -> PST.
Minor hack: -O3 images might claim some global data belongs
- to FDR -1. We`ll go along with that */
+ to FDR -1. We`ll go along with that. */
fdr_to_pst = (struct pst_map *)
xzalloc ((hdr->ifdMax + 1) * sizeof *fdr_to_pst);
old_chain = make_cleanup (xfree, fdr_to_pst);
@@ -2439,7 +2439,7 @@ parse_partial_symbols (struct objfile *objfile)
for (; ext_out < ext_out_end; ext_out += external_ext_size, ext_in++)
(*swap_ext_in) (cur_bfd, ext_out, ext_in);
- /* Pass 1 over external syms: Presize and partition the list */
+ /* Pass 1 over external syms: Presize and partition the list. */
ext_in = ext_block;
ext_in_end = ext_in + hdr->iextMax;
for (; ext_in < ext_in_end; ext_in++)
@@ -2452,7 +2452,7 @@ parse_partial_symbols (struct objfile *objfile)
fdr_to_pst[ext_in->ifd].n_globals++;
}
- /* Pass 1.5 over files: partition out global symbol space */
+ /* Pass 1.5 over files: partition out global symbol space. */
s_idx = 0;
for (f_idx = -1; f_idx < hdr->ifdMax; f_idx++)
{
@@ -2473,7 +2473,7 @@ parse_partial_symbols (struct objfile *objfile)
Since absolute sections don't get relocated, we
end up calculating an address different from that of
the symbol's minimal symbol (created earlier from the
- Elf symtab).
+ Elf symtab).
To fix this, either :
1) don't create the duplicate symbol
@@ -2490,9 +2490,9 @@ parse_partial_symbols (struct objfile *objfile)
I've implemented #1 here...
Skip the creation of the minimal symbols based on the ECOFF
- symbol table. */
+ symbol table. */
- /* Pass 2 over external syms: fill in external symbols */
+ /* Pass 2 over external syms: fill in external symbols. */
ext_in = ext_block;
ext_in_end = ext_in + hdr->iextMax;
for (; ext_in < ext_in_end; ext_in++)
@@ -2525,10 +2525,10 @@ parse_partial_symbols (struct objfile *objfile)
continue;
- /* Pass 3 over files, over local syms: fill in static symbols */
+ /* Pass 3 over files, over local syms: fill in static symbols. */
name = debug_info->ssext + ext_in->asym.iss;
- /* Process ECOFF Symbol Types and Storage Classes */
+ /* Process ECOFF Symbol Types and Storage Classes. */
switch (ext_in->asym.st)
{
case stProc:
@@ -2575,24 +2575,23 @@ parse_partial_symbols (struct objfile *objfile)
/* Label */
/* On certain platforms, some extra label symbols can be
- generated by the linker. One possible usage for this kind
+ generated by the linker. One possible usage for this kind
of symbols is to represent the address of the begining of a
- given section. For instance, on Tru64 5.1, the address of
+ given section. For instance, on Tru64 5.1, the address of
the _ftext label is the start address of the .text section.
The storage class of these symbols is usually directly
- related to the section to which the symbol refers. For
+ related to the section to which the symbol refers. For
instance, on Tru64 5.1, the storage class for the _fdata
label is scData, refering to the .data section.
It is actually possible that the section associated to the
- storage class of the label does not exist. On True64 5.1
+ storage class of the label does not exist. On True64 5.1
for instance, the libm.so shared library does not contain
any .data section, although it contains a _fpdata label
- which storage class is scData... Since these symbols are
+ which storage class is scData... Since these symbols are
usually useless for the debugger user anyway, we just
- discard these symbols.
- */
+ discard these symbols. */
if (SC_IS_TEXT (ext_in->asym.sc))
{
@@ -2637,10 +2636,10 @@ parse_partial_symbols (struct objfile *objfile)
case stLocal:
case stNil:
/* The alpha has the section start addresses in stLocal symbols
- whose name starts with a `.'. Skip those but complain for all
+ whose name starts with a `.'. Skip those but complain for all
other stLocal symbols.
Irix6 puts the section start addresses in stNil symbols, skip
- those too. */
+ those too. */
if (name[0] == '.')
continue;
/* Fall through. */
@@ -2653,7 +2652,7 @@ parse_partial_symbols (struct objfile *objfile)
objfile);
}
- /* Pass 3 over files, over local syms: fill in static symbols */
+ /* Pass 3 over files, over local syms: fill in static symbols. */
for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++)
{
struct partial_symtab *save_pst;
@@ -2695,7 +2694,7 @@ parse_partial_symbols (struct objfile *objfile)
DEBUG_INFO (pst) = debug_info;
PENDING_LIST (pst) = pending_list;
- /* The way to turn this into a symtab is to call... */
+ /* The way to turn this into a symtab is to call... */
pst->read_symtab = mdebug_psymtab_to_symtab;
/* Set up language for the pst.
@@ -2707,7 +2706,7 @@ parse_partial_symbols (struct objfile *objfile)
a header file, which is not what we want.
But the FDRs for the header files are after the FDR for the source
file, so we can assign the language of the source file to the
- following header files. Then we save the language in the private
+ following header files. Then we save the language in the private
pst data so that we can reuse it when building symtabs. */
prev_language = psymtab_language;
@@ -2731,7 +2730,7 @@ parse_partial_symbols (struct objfile *objfile)
current object file uses encapsulated stabs instead of mips
ecoff for local symbols. (It is the second symbol because
the first symbol is the stFile used to signal the start of a
- file). */
+ file). */
processing_gcc_compilation = 0;
if (fh->csym >= 2)
{
@@ -2820,7 +2819,7 @@ parse_partial_symbols (struct objfile *objfile)
default:
/* FIXME! Shouldn't this use cases for bss,
- then have the default be abs? */
+ then have the default be abs? */
namestring = debug_info->ss + fh->issBase + sh.iss;
sh.value += ANOFFSET (objfile->section_offsets,
SECT_OFF_BSS (objfile));
@@ -2832,7 +2831,7 @@ parse_partial_symbols (struct objfile *objfile)
}
continue;
}
- /* Handle stabs continuation */
+ /* Handle stabs continuation. */
{
char *stabstring = debug_info->ss + fh->issBase + sh.iss;
int len = strlen (stabstring);
@@ -2844,10 +2843,10 @@ parse_partial_symbols (struct objfile *objfile)
char *stabstring2;
int len2;
- /* Ignore continuation char from 1st string */
+ /* Ignore continuation char from 1st string. */
len--;
- /* Read next stabstring */
+ /* Read next stabstring. */
cur_sdx++;
(*swap_sym_in) (cur_bfd,
(((char *) debug_info->external_sym)
@@ -2857,7 +2856,7 @@ parse_partial_symbols (struct objfile *objfile)
stabstring2 = debug_info->ss + fh->issBase + sh2.iss;
len2 = strlen (stabstring2);
- /* Concatinate stabstring2 with stabstring1 */
+ /* Concatinate stabstring2 with stabstring1. */
if (stabstring
&& stabstring != debug_info->ss + fh->issBase + sh.iss)
stabstring = xrealloc (stabstring, len + len2 + 1);
@@ -2891,7 +2890,7 @@ parse_partial_symbols (struct objfile *objfile)
case N_BSS:
case N_BSS | N_EXT:
case N_NBBSS | N_EXT:
- case N_SETV | N_EXT: /* FIXME, is this in BSS? */
+ case N_SETV | N_EXT: /* FIXME, is this in BSS? */
sh.value += ANOFFSET (objfile->section_offsets,
SECT_OFF_BSS (objfile));
goto record_it;
@@ -2900,7 +2899,7 @@ parse_partial_symbols (struct objfile *objfile)
record_it:
continue;
- /* Standard, local, non-debugger, symbols */
+ /* Standard, local, non-debugger, symbols. */
case N_NBTEXT:
@@ -2921,7 +2920,7 @@ parse_partial_symbols (struct objfile *objfile)
goto record_it;
case N_UNDF | N_EXT:
- continue; /* Just undefined, not COMMON */
+ continue; /* Just undefined, not COMMON. */
case N_UNDF:
continue;
@@ -2933,7 +2932,7 @@ parse_partial_symbols (struct objfile *objfile)
case N_NBBSS:
continue;
- /* Keep going . . . */
+ /* Keep going . . . */
/*
* Special symbol types for GNU
@@ -2969,7 +2968,7 @@ parse_partial_symbols (struct objfile *objfile)
prev_textlow_not_set = textlow_not_set;
/* A zero value is probably an indication for the
- SunPRO 3.0 compiler. end_psymtab explicitly tests
+ SunPRO 3.0 compiler. end_psymtab explicitly tests
for zero, so don't relocate it. */
if (sh.value == 0
@@ -2984,7 +2983,7 @@ parse_partial_symbols (struct objfile *objfile)
past_first_source_file = 1;
if (prev_so_symnum != symnum - 1)
- { /* Here if prev stab wasn't N_SO */
+ { /* Here if prev stab wasn't N_SO. */
first_so_symnum = symnum;
if (pst)
@@ -2997,13 +2996,14 @@ parse_partial_symbols (struct objfile *objfile)
prev_so_symnum = symnum;
- /* End the current partial symtab and start a new one */
+ /* End the current partial symtab and start a
+ new one. */
/* SET_NAMESTRING ();*/
namestring = stabstring;
/* Null name means end of .o file. Don't start a new
- one. */
+ one. */
if (*namestring == '\000')
continue;
@@ -3011,12 +3011,12 @@ parse_partial_symbols (struct objfile *objfile)
initial N_SOs. The first one is a directory name;
the second the file name. If pst exists, is
empty, and has a filename ending in '/', we assume
- the previous N_SO was a directory name. */
+ the previous N_SO was a directory name. */
p = strrchr (namestring, '/');
if (p && *(p + 1) == '\000')
continue; /* Simply ignore directory
- name SOs */
+ name SOs. */
/* Some other compilers (C++ ones in particular) emit
useless SOs for non-existant .c files. We ignore
@@ -3035,9 +3035,9 @@ parse_partial_symbols (struct objfile *objfile)
{
enum language tmp_language;
- /* Mark down an include file in the current psymtab */
+ /* Mark down an include file in the current psymtab. */
- /* SET_NAMESTRING ();*/
+ /* SET_NAMESTRING (); */
namestring = stabstring;
tmp_language
@@ -3056,7 +3056,7 @@ parse_partial_symbols (struct objfile *objfile)
/* In C++, one may expect the same filename to come
round many times, when code is coming alternately
from the main file and from inline functions in
- other files. So I check to see if this is a file
+ other files. So I check to see if this is a file
we've seen before -- either the main source file,
or a previously included file.
@@ -3095,7 +3095,7 @@ parse_partial_symbols (struct objfile *objfile)
}
continue;
}
- case N_LSYM: /* Typedef or automatic variable. */
+ case N_LSYM: /* Typedef or automatic variable. */
case N_STSYM: /* Data seg var -- static */
case N_LCSYM: /* BSS " */
case N_ROSYM: /* Read-only data seg var -- static. */
@@ -3111,14 +3111,14 @@ parse_partial_symbols (struct objfile *objfile)
case N_PC: /* I may or may not need this; I
suspect not. */
case N_M2C: /* I suspect that I can ignore this
- here. */
- case N_SCOPE: /* Same. */
+ here. */
+ case N_SCOPE: /* Same. */
- /* SET_NAMESTRING ();*/
+ /* SET_NAMESTRING (); */
namestring = stabstring;
p = (char *) strchr (namestring, ':');
if (!p)
- continue; /* Not a debugging symbol. */
+ continue; /* Not a debugging symbol. */
@@ -3149,8 +3149,9 @@ parse_partial_symbols (struct objfile *objfile)
case 'G':
sh.value += ANOFFSET (objfile->section_offsets,
SECT_OFF_DATA (objfile));
- /* The addresses in these entries are reported to be
- wrong. See the code that reads 'G's for symtabs. */
+ /* The addresses in these entries are reported
+ to be wrong. See the code that reads 'G's
+ for symtabs. */
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_STATIC,
&objfile->global_psymbols,
@@ -3190,7 +3191,7 @@ parse_partial_symbols (struct objfile *objfile)
goto check_enum;
case 't':
if (p != namestring) /* a name is there, not
- just :T... */
+ just :T... */
{
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_TYPEDEF,
@@ -3202,7 +3203,7 @@ parse_partial_symbols (struct objfile *objfile)
/* If this is an enumerated type, we need to add
all the enum constants to the partial symbol
table. This does not cover enums without names,
- e.g. "enum {a, b} c;" in C, but fortunately
+ e.g. "enum {a, b} c;" in C, but fortunately
those are rare. There is no way for GDB to find
those from the enum type without spending too
much time on it. Thus to solve this problem,
@@ -3403,10 +3404,10 @@ parse_partial_symbols (struct objfile *objfile)
element. Hopefully, I can
ignore this. */
case N_ENTRY: /* Alternate entry point; can
- ignore. */
+ ignore. */
case N_MAIN: /* Can definitely ignore this. */
- case N_CATCH: /* These are GNU C++ extensions */
- case N_EHDECL: /* that can safely be ignored here. */
+ case N_CATCH: /* These are GNU C++ extensions. */
+ case N_EHDECL: /* that can safely be ignored here. */
case N_LENG:
case N_BCOMM:
case N_ECOMM:
@@ -3421,10 +3422,10 @@ parse_partial_symbols (struct objfile *objfile)
case N_ALIAS: /* SunPro F77: alias name, ignore
for now. */
- case N_OBJ: /* useless types from Solaris */
+ case N_OBJ: /* Useless types from Solaris. */
case N_OPT:
/* These symbols aren't interesting; don't worry about
- them */
+ them. */
continue;
@@ -3433,7 +3434,7 @@ parse_partial_symbols (struct objfile *objfile)
probably some new type we don't know about yet. */
complaint (&symfile_complaints,
_("unknown symbol type %s"),
- hex_string (type_code)); /*CUR_SYMBOL_TYPE*/
+ hex_string (type_code)); /* CUR_SYMBOL_TYPE */
continue;
}
if (stabstring
@@ -3467,7 +3468,7 @@ parse_partial_symbols (struct objfile *objfile)
|| (sh.index == indexNil
&& (sh.st != stStatic || sh.sc == scAbs)))
{
- /* FIXME, premature? */
+ /* FIXME, premature? */
cur_sdx++;
continue;
}
@@ -3520,7 +3521,7 @@ parse_partial_symbols (struct objfile *objfile)
/* Should not happen, but does when cross-compiling
with the MIPS compiler. FIXME -- pull later. */
index_complaint (name);
- new_sdx = cur_sdx + 1; /* Don't skip at all */
+ new_sdx = cur_sdx + 1; /* Don't skip at all. */
}
else
new_sdx = AUX_GET_ISYM (fh->fBigendian,
@@ -3534,7 +3535,7 @@ parse_partial_symbols (struct objfile *objfile)
complaint (&symfile_complaints,
_("bad proc end in aux found from symbol %s"),
name);
- new_sdx = cur_sdx + 1; /* Don't skip backward */
+ new_sdx = cur_sdx + 1; /* Don't skip backward. */
}
/* For stProc symbol records, we need to check the
@@ -3548,7 +3549,7 @@ parse_partial_symbols (struct objfile *objfile)
goto skip;
/* Usually there is a local and a global stProc symbol
- for a function. This means that the function name
+ for a function. This means that the function name
has already been entered into the mimimal symbol table
while processing the global symbols in pass 2 above.
One notable exception is the PROGRAM name from
@@ -3607,7 +3608,7 @@ parse_partial_symbols (struct objfile *objfile)
break;
case stIndirect: /* Irix5 forward declaration */
- /* Skip forward declarations from Irix5 cc */
+ /* Skip forward declarations from Irix5 cc. */
goto skip;
case stTypedef: /* Typedef */
@@ -3627,7 +3628,7 @@ parse_partial_symbols (struct objfile *objfile)
case stEnum:
case stBlock: /* { }, str, un, enum */
/* Do not create a partial symbol for cc unnamed aggregates
- and gcc empty aggregates. */
+ and gcc empty aggregates. */
if ((sh.sc == scInfo
|| SC_IS_COMMON (sh.sc))
&& sh.iss != 0
@@ -3641,14 +3642,14 @@ parse_partial_symbols (struct objfile *objfile)
}
handle_psymbol_enumerators (objfile, fh, sh.st, sh.value);
- /* Skip over the block */
+ /* Skip over the block. */
new_sdx = sh.index;
if (new_sdx <= cur_sdx)
{
- /* This happens with the Ultrix kernel. */
+ /* This happens with the Ultrix kernel. */
complaint (&symfile_complaints,
_("bad aux index at block symbol %s"), name);
- new_sdx = cur_sdx + 1; /* Don't skip backward */
+ new_sdx = cur_sdx + 1; /* Don't skip backward. */
}
cur_sdx = new_sdx;
continue;
@@ -3661,7 +3662,7 @@ parse_partial_symbols (struct objfile *objfile)
case stLocal: /* Local variables */
/* Normally these are skipped because we skip over
all blocks we see. However, these can occur
- as visible symbols in a .h file that contains code. */
+ as visible symbols in a .h file that contains code. */
goto skip;
default:
@@ -3673,16 +3674,16 @@ parse_partial_symbols (struct objfile *objfile)
cur_sdx++;
continue;
}
- /* Use this gdb symbol */
+ /* Use this gdb symbol. */
add_psymbol_to_list (name, strlen (name), 1,
VAR_DOMAIN, class,
&objfile->static_psymbols,
0, sh.value, psymtab_language, objfile);
skip:
- cur_sdx++; /* Go to next file symbol */
+ cur_sdx++; /* Go to next file symbol. */
}
- /* Now do enter the external symbols. */
+ /* Now do enter the external symbols. */
ext_ptr = &extern_tab[fdr_to_pst[f_idx].globals_offset];
cur_sdx = fdr_to_pst[f_idx].n_globals;
PST_PRIVATE (save_pst)->extern_count = cur_sdx;
@@ -3762,7 +3763,7 @@ parse_partial_symbols (struct objfile *objfile)
}
}
- /* Link pst to FDR. end_psymtab returns NULL if the psymtab was
+ /* Link pst to FDR. end_psymtab returns NULL if the psymtab was
empty and put on the free list. */
fdr_to_pst[f_idx].pst = end_psymtab (save_pst,
psymtab_include_list, includes_used,
@@ -3801,7 +3802,7 @@ parse_partial_symbols (struct objfile *objfile)
}
}
- /* Now scan the FDRs for dependencies */
+ /* Now scan the FDRs for dependencies. */
for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++)
{
fh = f_idx + debug_info->fdr;
@@ -3810,7 +3811,7 @@ parse_partial_symbols (struct objfile *objfile)
if (pst == (struct partial_symtab *) NULL)
continue;
- /* This should catch stabs-in-ecoff. */
+ /* This should catch stabs-in-ecoff. */
if (fh->crfd <= 1)
continue;
@@ -3926,7 +3927,7 @@ handle_psymbol_enumerators (struct objfile *objfile, FDR *fh, int stype,
}
}
-/* Get the next symbol. OBJFILE is unused. */
+/* Get the next symbol. OBJFILE is unused. */
static char *
mdebug_next_symbol_text (struct objfile *objfile)
@@ -3989,7 +3990,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
wrap_here (""); /* Flush output */
gdb_flush (gdb_stdout);
}
- /* We only pass the filename for debug purposes */
+ /* We only pass the filename for debug purposes. */
psymtab_to_symtab_1 (pst->dependencies[i],
pst->dependencies[i]->filename);
}
@@ -4000,7 +4001,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
&& pst->textlow == 0 && pst->texthigh == 0)
return;
- /* Now read the symbols for this symtab */
+ /* Now read the symbols for this symtab. */
cur_bfd = CUR_BFD (pst);
debug_swap = DEBUG_SWAP (pst);
@@ -4017,7 +4018,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
: debug_info->fdr + cur_fd);
cur_fdr = fh;
- /* See comment in parse_partial_symbols about the @stabs sentinel. */
+ /* See comment in parse_partial_symbols about the @stabs sentinel. */
processing_gcc_compilation = 0;
if (fh != (FDR *) NULL && fh->csym >= 2)
{
@@ -4042,9 +4043,9 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
/* This symbol table contains stabs-in-ecoff entries. */
- /* Parse local symbols first */
+ /* Parse local symbols first. */
- if (fh->csym <= 2) /* FIXME, this blows psymtab->symtab ptr */
+ if (fh->csym <= 2) /* FIXME, this blows psymtab->symtab ptr. */
{
current_objfile = NULL;
return;
@@ -4075,7 +4076,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
it here instead of in process_one_symbol, so we
can keep a handle to its symtab. The symtab
would otherwise be ended twice, once in
- process_one_symbol, and once after this loop. */
+ process_one_symbol, and once after this loop. */
if (type_code == N_SO
&& last_source_file
&& previous_stab_code != (unsigned char) N_SO
@@ -4105,7 +4106,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
if (type_code == N_FUN)
{
/* Make up special symbol to contain
- procedure specific info */
+ procedure specific info. */
struct mdebug_extra_func_info *e =
((struct mdebug_extra_func_info *)
obstack_alloc (&current_objfile->objfile_obstack,
@@ -4131,7 +4132,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
}
else
{
- /* Handle encoded stab line number. */
+ /* Handle encoded stab line number. */
valu += ANOFFSET (pst->section_offsets,
SECT_OFF_TEXT (pst->objfile));
record_line (current_subfile, sh.index,
@@ -4140,7 +4141,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
}
else if (sh.st == stProc || sh.st == stStaticProc
|| sh.st == stStatic || sh.st == stEnd)
- /* These are generated by gcc-2.x, do not complain */
+ /* These are generated by gcc-2.x, do not complain. */
;
else
complaint (&symfile_complaints,
@@ -4225,7 +4226,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
lines = LINETABLE (st);
- /* Get a new lexical context */
+ /* Get a new lexical context. */
push_parse_stack ();
top_stack->cur_st = st;
@@ -4244,7 +4245,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
char *sym_ptr;
char *sym_end;
- /* Parse local symbols first */
+ /* Parse local symbols first. */
sym_ptr = ((char *) debug_info->external_sym
+ fh->isymBase * external_sym_size);
sym_end = sym_ptr + fh->csym * external_sym_size;
@@ -4313,8 +4314,8 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
LINETABLE (st) = lines;
/* .. and our share of externals.
- XXX use the global list to speed up things here. how?
- FIXME, Maybe quit once we have found the right number of ext's? */
+ XXX use the global list to speed up things here. How?
+ FIXME, Maybe quit once we have found the right number of ext's? */
top_stack->cur_st = st;
top_stack->cur_block
= BLOCKVECTOR_BLOCK (BLOCKVECTOR (top_stack->cur_st),
@@ -4352,7 +4353,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename)
current_objfile = NULL;
}
-/* Ancillary parsing procedures. */
+/* Ancillary parsing procedures. */
/* Return 1 if the symbol pointed to by SH has a cross reference
to an opaque aggregate type, else 0. */
@@ -4387,12 +4388,12 @@ has_opaque_xref (FDR *fh, SYMR *sh)
/* Lookup the type at relative index RN. Return it in TPP
if found and in any event come up with its name PNAME.
BIGEND says whether aux symbols are big-endian or not (from fh->fBigendian).
- Return value says how many aux symbols we ate. */
+ Return value says how many aux symbols we ate. */
static int
cross_ref (int fd, union aux_ext *ax, struct type **tpp,
enum type_code type_code,
- /* Use to alloc new type if none is found. */
+ /* Use to alloc new type if none is found. */
char **pname, int bigend, char *sym_name)
{
RNDXR rn[1];
@@ -4408,7 +4409,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp,
(*debug_swap->swap_rndx_in) (bigend, &ax->a_rndx, rn);
- /* Escape index means 'the next one' */
+ /* Escape index means 'the next one'. */
if (rn->rfd == 0xfff)
{
result++;
@@ -4431,7 +4432,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp,
}
/* mips cc uses an escaped rn->index of 0 for struct return types
- of procedures that were compiled without -g. These will always remain
+ of procedures that were compiled without -g. These will always remain
undefined. */
if (rn->rfd == 0xfff && rn->index == 0)
{
@@ -4492,12 +4493,12 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp,
two cases:
a) forward declarations of structs/unions/enums which are not
defined in this compilation unit.
- For these the type will be void. This is a bad design decision
+ For these the type will be void. This is a bad design decision
as cross referencing across compilation units is impossible
due to the missing name.
b) forward declarations of structs/unions/enums/typedefs which
are defined later in this file or in another file in the same
- compilation unit. Irix5 cc uses a stIndirect symbol for this.
+ compilation unit. Irix5 cc uses a stIndirect symbol for this.
Simply cross reference those again to get the true type.
The forward references are not entered in the pending list and
in the symbol table. */
@@ -4528,10 +4529,10 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp,
break;
case btTypedef:
- /* Follow a forward typedef. This might recursively
+ /* Follow a forward typedef. This might recursively
call cross_ref till we get a non typedef'ed type.
FIXME: This is not correct behaviour, but gdb currently
- cannot handle typedefs without type copying. Type
+ cannot handle typedefs without type copying. Type
copying is impossible as we might have mutual forward
references between two files and the copied type would not
get filled in when we later parse its definition. */
@@ -4556,10 +4557,10 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp,
}
else if (sh.st == stTypedef)
{
- /* Parse the type for a normal typedef. This might recursively call
+ /* Parse the type for a normal typedef. This might recursively call
cross_ref till we get a non typedef'ed type.
FIXME: This is not correct behaviour, but gdb currently
- cannot handle typedefs without type copying. But type copying is
+ cannot handle typedefs without type copying. But type copying is
impossible as we might have mutual forward references between
two files and the copied type would not get filled in when
we later parse its definition. */
@@ -4582,13 +4583,13 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp,
add_pending (fh, esh, *tpp);
}
- /* We used one auxent normally, two if we got a "next one" rf. */
+ /* We used one auxent normally, two if we got a "next one" rf. */
return result;
}
/* Quick&dirty lookup procedure, to avoid the MI ones that require
- keeping the symtab sorted */
+ keeping the symtab sorted. */
static struct symbol *
mylookup_symbol (char *name, struct block *block,
@@ -4624,7 +4625,7 @@ add_symbol (struct symbol *s, struct symtab *symtab, struct block *b)
dict_add_symbol (BLOCK_DICT (b), s);
}
-/* Add a new block B to a symtab S */
+/* Add a new block B to a symtab S. */
static void
add_block (struct block *b, struct symtab *s)
@@ -4651,7 +4652,7 @@ add_block (struct block *b, struct symtab *s)
a prologue than mips_skip_prologue).
But due to the compressed line table format there are line number entries
for the same line which are needed to bridge the gap to the next
- line number entry. These entries have a bogus address info with them
+ line number entry. These entries have a bogus address info with them
and we are unable to tell them from intended duplicate line number
entries.
This is another reason why -ggdb debugging format is preferable. */
@@ -4660,13 +4661,13 @@ static int
add_line (struct linetable *lt, int lineno, CORE_ADDR adr, int last)
{
/* DEC c89 sometimes produces zero linenos which confuse gdb.
- Change them to something sensible. */
+ Change them to something sensible. */
if (lineno == 0)
lineno = 1;
if (last == 0)
- last = -2; /* make sure we record first line */
+ last = -2; /* Make sure we record first line. */
- if (last == lineno) /* skip continuation lines */
+ if (last == lineno) /* Skip continuation lines. */
return lineno;
lt->item[lt->nitems].line = lineno;
@@ -4674,9 +4675,9 @@ add_line (struct linetable *lt, int lineno, CORE_ADDR adr, int last)
return lineno;
}
-/* Sorting and reordering procedures */
+/* Sorting and reordering procedures. */
-/* Blocks with a smaller low bound should come first */
+/* Blocks with a smaller low bound should come first. */
static int
compare_blocks (const void *arg1, const void *arg2)
@@ -4693,7 +4694,7 @@ compare_blocks (const void *arg1, const void *arg2)
/* Sort the blocks of a symtab S.
Reorder the blocks in the blockvector by code-address,
- as required by some MI search routines */
+ as required by some MI search routines. */
static void
sort_blocks (struct symtab *s)
@@ -4741,10 +4742,10 @@ sort_blocks (struct symtab *s)
}
-/* Constructor/restructor/destructor procedures */
+/* Constructor/restructor/destructor procedures. */
/* Allocate a new symtab for NAME. Needs an estimate of how many
- linenumbers MAXLINES we'll put in it */
+ linenumbers MAXLINES we'll put in it. */
static struct symtab *
new_symtab (const char *name, int maxlines, struct objfile *objfile)
@@ -4753,7 +4754,7 @@ new_symtab (const char *name, int maxlines, struct objfile *objfile)
LINETABLE (s) = new_linetable (maxlines);
- /* All symtabs must have at least two blocks */
+ /* All symtabs must have at least two blocks. */
BLOCKVECTOR (s) = new_bvect (2);
BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK)
= new_block (NON_FUNCTION_BLOCK);
@@ -4767,7 +4768,7 @@ new_symtab (const char *name, int maxlines, struct objfile *objfile)
return (s);
}
-/* Allocate a new partial_symtab NAME */
+/* Allocate a new partial_symtab NAME. */
static struct partial_symtab *
new_psymtab (char *name, struct objfile *objfile)
@@ -4777,7 +4778,7 @@ new_psymtab (char *name, struct objfile *objfile)
psymtab = allocate_psymtab (name, objfile);
psymtab->section_offsets = objfile->section_offsets;
- /* Keep a backpointer to the file's symbols */
+ /* Keep a backpointer to the file's symbols. */
psymtab->read_symtab_private = obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symloc));
@@ -4787,7 +4788,7 @@ new_psymtab (char *name, struct objfile *objfile)
DEBUG_INFO (psymtab) = debug_info;
PENDING_LIST (psymtab) = pending_list;
- /* The way to turn this into a symtab is to call... */
+ /* The way to turn this into a symtab is to call... */
psymtab->read_symtab = mdebug_psymtab_to_symtab;
return (psymtab);
}
@@ -4808,7 +4809,7 @@ new_linetable (int size)
return l;
}
-/* Oops, too big. Shrink it. This was important with the 2.4 linetables,
+/* Oops, too big. Shrink it. This was important with the 2.4 linetables,
I am not so sure about the 3.4 ones.
Since the struct linetable already includes one item, we subtract one when
@@ -4823,7 +4824,7 @@ shrink_linetable (struct linetable *lt)
* sizeof (lt->item))));
}
-/* Allocate and zero a new blockvector of NBLOCKS blocks. */
+/* Allocate and zero a new blockvector of NBLOCKS blocks. */
static struct blockvector *
new_bvect (int nblocks)
@@ -4860,7 +4861,7 @@ new_block (enum block_type type)
return retval;
}
-/* Create a new symbol with printname NAME */
+/* Create a new symbol with printname NAME. */
static struct symbol *
new_symbol (char *name)
@@ -4875,7 +4876,7 @@ new_symbol (char *name)
return s;
}
-/* Create a new type with printname NAME */
+/* Create a new type with printname NAME. */
static struct type *
new_type (char *name)