This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] re-indent symtab.h (2/2)
- From: David Carlton <carlton at math dot stanford dot edu>
- To: gdb-patches at sources dot redhat dot com
- Date: 12 Sep 2002 12:25:48 -0700
- Subject: [PATCH] re-indent symtab.h (2/2)
- the linetable. Probably always SECT_OFF_TEXT. */
+ /* Section in objfile->section_offsets for the blockvector and
+ the linetable. Probably always SECT_OFF_TEXT. */
- int block_line_section;
+ int block_line_section;
- /* If several symtabs share a blockvector, exactly one of them
- should be designated the primary, so that the blockvector
- is relocated exactly once by objfile_relocate. */
+ /* If several symtabs share a blockvector, exactly one of them
+ should be designated the primary, so that the blockvector
+ is relocated exactly once by objfile_relocate. */
- int primary;
+ int primary;
- /* The macro table for this symtab. Like the blockvector, this
- may be shared between different symtabs --- and normally is for
- all the symtabs in a given compilation unit. */
- struct macro_table *macro_table;
+ /* The macro table for this symtab. Like the blockvector, this
+ may be shared between different symtabs --- and normally is for
+ all the symtabs in a given compilation unit. */
+ struct macro_table *macro_table;
- /* Name of this source file. */
+ /* Name of this source file. */
- char *filename;
+ char *filename;
- /* Directory in which it was compiled, or NULL if we don't know. */
+ /* Directory in which it was compiled, or NULL if we don't know. */
- char *dirname;
+ char *dirname;
- /* This component says how to free the data we point to:
- free_contents => do a tree walk and free each object.
- free_nothing => do nothing; some other symtab will free
- the data this one uses.
- free_linetable => free just the linetable. FIXME: Is this redundant
- with the primary field? */
+ /* This component says how to free the data we point to:
+ free_contents => do a tree walk and free each object.
+ free_nothing => do nothing; some other symtab will free
+ the data this one uses.
+ free_linetable => free just the linetable. FIXME: Is this redundant
+ with the primary field? */
- enum free_code
- {
- free_nothing, free_contents, free_linetable
- }
- free_code;
+ enum free_code
+ {
+ free_nothing, free_contents, free_linetable
+ }
+ free_code;
- /* Pointer to one block of storage to be freed, if nonzero. */
- /* This is IN ADDITION to the action indicated by free_code. */
+ /* Pointer to one block of storage to be freed, if nonzero. */
+ /* This is IN ADDITION to the action indicated by free_code. */
- char *free_ptr;
+ char *free_ptr;
- /* Total number of lines found in source file. */
+ /* Total number of lines found in source file. */
- int nlines;
+ int nlines;
- /* line_charpos[N] is the position of the (N-1)th line of the
- source file. "position" means something we can lseek() to; it
- is not guaranteed to be useful any other way. */
+ /* line_charpos[N] is the position of the (N-1)th line of the
+ source file. "position" means something we can lseek() to; it
+ is not guaranteed to be useful any other way. */
- int *line_charpos;
+ int *line_charpos;
- /* Language of this source file. */
+ /* Language of this source file. */
- enum language language;
+ enum language language;
- /* String that identifies the format of the debugging information, such
- as "stabs", "dwarf 1", "dwarf 2", "coff", etc. This is mostly useful
- for automated testing of gdb but may also be information that is
- useful to the user. */
+ /* String that identifies the format of the debugging information, such
+ as "stabs", "dwarf 1", "dwarf 2", "coff", etc. This is mostly useful
+ for automated testing of gdb but may also be information that is
+ useful to the user. */
- char *debugformat;
+ char *debugformat;
- /* String of version information. May be zero. */
+ /* String of version information. May be zero. */
- char *version;
+ char *version;
- /* Full name of file as found by searching the source path.
- NULL if not yet known. */
+ /* Full name of file as found by searching the source path.
+ NULL if not yet known. */
- char *fullname;
+ char *fullname;
- /* Object file from which this symbol information was read. */
+ /* Object file from which this symbol information was read. */
- struct objfile *objfile;
+ struct objfile *objfile;
- };
+};
#define BLOCKVECTOR(symtab) (symtab)->blockvector
#define LINETABLE(symtab) (symtab)->linetable
@@ -934,88 +932,88 @@ struct symtab
style execution of a bunch of .o's. */
struct partial_symtab
- {
+{
- /* Chain of all existing partial symtabs. */
+ /* Chain of all existing partial symtabs. */
- struct partial_symtab *next;
+ struct partial_symtab *next;
- /* Name of the source file which this partial_symtab defines */
+ /* Name of the source file which this partial_symtab defines */
- char *filename;
+ char *filename;
- /* Full path of the source file. NULL if not known. */
+ /* Full path of the source file. NULL if not known. */
- char *fullname;
+ char *fullname;
- /* Information about the object file from which symbols should be read. */
+ /* Information about the object file from which symbols should be read. */
- struct objfile *objfile;
+ struct objfile *objfile;
- /* Set of relocation offsets to apply to each section. */
+ /* Set of relocation offsets to apply to each section. */
- struct section_offsets *section_offsets;
+ struct section_offsets *section_offsets;
- /* Range of text addresses covered by this file; texthigh is the
- beginning of the next section. */
+ /* Range of text addresses covered by this file; texthigh is the
+ beginning of the next section. */
- CORE_ADDR textlow;
- CORE_ADDR texthigh;
+ CORE_ADDR textlow;
+ CORE_ADDR texthigh;
- /* Array of pointers to all of the partial_symtab's which this one
- depends on. Since this array can only be set to previous or
- the current (?) psymtab, this dependency tree is guaranteed not
- to have any loops. "depends on" means that symbols must be read
- for the dependencies before being read for this psymtab; this is
- for type references in stabs, where if foo.c includes foo.h, declarations
- in foo.h may use type numbers defined in foo.c. For other debugging
- formats there may be no need to use dependencies. */
+ /* Array of pointers to all of the partial_symtab's which this one
+ depends on. Since this array can only be set to previous or
+ the current (?) psymtab, this dependency tree is guaranteed not
+ to have any loops. "depends on" means that symbols must be read
+ for the dependencies before being read for this psymtab; this is
+ for type references in stabs, where if foo.c includes foo.h, declarations
+ in foo.h may use type numbers defined in foo.c. For other debugging
+ formats there may be no need to use dependencies. */
- struct partial_symtab **dependencies;
+ struct partial_symtab **dependencies;
- int number_of_dependencies;
+ int number_of_dependencies;
- /* Global symbol list. This list will be sorted after readin to
- improve access. Binary search will be the usual method of
- finding a symbol within it. globals_offset is an integer offset
- within global_psymbols[]. */
+ /* Global symbol list. This list will be sorted after readin to
+ improve access. Binary search will be the usual method of
+ finding a symbol within it. globals_offset is an integer offset
+ within global_psymbols[]. */
- int globals_offset;
- int n_global_syms;
+ int globals_offset;
+ int n_global_syms;
- /* Static symbol list. This list will *not* be sorted after readin;
- to find a symbol in it, exhaustive search must be used. This is
- reasonable because searches through this list will eventually
- lead to either the read in of a files symbols for real (assumed
- to take a *lot* of time; check) or an error (and we don't care
- how long errors take). This is an offset and size within
- static_psymbols[]. */
+ /* Static symbol list. This list will *not* be sorted after readin;
+ to find a symbol in it, exhaustive search must be used. This is
+ reasonable because searches through this list will eventually
+ lead to either the read in of a files symbols for real (assumed
+ to take a *lot* of time; check) or an error (and we don't care
+ how long errors take). This is an offset and size within
+ static_psymbols[]. */
- int statics_offset;
- int n_static_syms;
+ int statics_offset;
+ int n_static_syms;
- /* Pointer to symtab eventually allocated for this source file, 0 if
- !readin or if we haven't looked for the symtab after it was readin. */
+ /* Pointer to symtab eventually allocated for this source file, 0 if
+ !readin or if we haven't looked for the symtab after it was readin. */
- struct symtab *symtab;
+ struct symtab *symtab;
- /* Pointer to function which will read in the symtab corresponding to
- this psymtab. */
+ /* Pointer to function which will read in the symtab corresponding to
+ this psymtab. */
- void (*read_symtab) (struct partial_symtab *);
+ void (*read_symtab) (struct partial_symtab *);
- /* Information that lets read_symtab() locate the part of the symbol table
- that this psymtab corresponds to. This information is private to the
- format-dependent symbol reading routines. For further detail examine
- the various symbol reading modules. Should really be (void *) but is
- (char *) as with other such gdb variables. (FIXME) */
+ /* Information that lets read_symtab() locate the part of the symbol table
+ that this psymtab corresponds to. This information is private to the
+ format-dependent symbol reading routines. For further detail examine
+ the various symbol reading modules. Should really be (void *) but is
+ (char *) as with other such gdb variables. (FIXME) */
- char *read_symtab_private;
+ char *read_symtab_private;
- /* Non-zero if the symtab corresponding to this psymtab has been readin */
+ /* Non-zero if the symtab corresponding to this psymtab has been readin */
- unsigned char readin;
- };
+ unsigned char readin;
+};
/* A fast way to get from a psymtab to its symtab (after the first time). */
#define PSYMTAB_TO_SYMTAB(pst) \
@@ -1213,17 +1211,17 @@ extern void install_minimal_symbols (str
extern void msymbols_sort (struct objfile *objfile);
struct symtab_and_line
- {
- struct symtab *symtab;
- asection *section;
- /* Line number. Line numbers start at 1 and proceed through symtab->nlines.
- 0 is never a valid line number; it is used to indicate that line number
- information is not available. */
- int line;
-
- CORE_ADDR pc;
- CORE_ADDR end;
- };
+{
+ struct symtab *symtab;
+ asection *section;
+ /* Line number. Line numbers start at 1 and proceed through symtab->nlines.
+ 0 is never a valid line number; it is used to indicate that line number
+ information is not available. */
+ int line;
+
+ CORE_ADDR pc;
+ CORE_ADDR end;
+};
#define INIT_SAL(sal) { \
(sal)->symtab = 0; \
@@ -1234,10 +1232,10 @@ struct symtab_and_line
}
struct symtabs_and_lines
- {
- struct symtab_and_line *sals;
- int nelts;
- };
+{
+ struct symtab_and_line *sals;
+ int nelts;
+};
@@ -1248,22 +1246,22 @@ struct symtabs_and_lines
/* Enums for exception-handling support */
enum exception_event_kind
- {
- EX_EVENT_THROW,
- EX_EVENT_CATCH
- };
+{
+ EX_EVENT_THROW,
+ EX_EVENT_CATCH
+};
/* Type for returning info about an exception */
struct exception_event_record
- {
- enum exception_event_kind kind;
- struct symtab_and_line throw_sal;
- struct symtab_and_line catch_sal;
- /* This may need to be extended in the future, if
- some platforms allow reporting more information,
- such as point of rethrow, type of exception object,
- type expected by catch clause, etc. */
- };
+{
+ enum exception_event_kind kind;
+ struct symtab_and_line throw_sal;
+ struct symtab_and_line catch_sal;
+ /* This may need to be extended in the future, if
+ some platforms allow reporting more information,
+ such as point of rethrow, type of exception object,
+ type expected by catch clause, etc. */
+};
#define CURRENT_EXCEPTION_KIND (current_exception_event->kind)
#define CURRENT_EXCEPTION_CATCH_SAL (current_exception_event->catch_sal)
@@ -1356,7 +1354,8 @@ extern struct partial_symtab *find_main_
extern struct symtab *find_line_symtab (struct symtab *, int, int *, int *);
-extern struct symtab_and_line find_function_start_sal (struct symbol *sym, int);
+extern struct symtab_and_line find_function_start_sal (struct symbol *sym,
+ int);
/* blockframe.c */
@@ -1387,36 +1386,37 @@ extern struct partial_symbol *fixup_psym
/* When using search_symbols, a list of the following structs is returned.
Callers must free the search list using free_search_symbols! */
struct symbol_search
- {
- /* The block in which the match was found. Could be, for example,
- STATIC_BLOCK or GLOBAL_BLOCK. */
- int block;
-
- /* Information describing what was found.
-
- If symtab abd symbol are NOT NULL, then information was found
- for this match. */
- struct symtab *symtab;
- struct symbol *symbol;
-
- /* If msymbol is non-null, then a match was made on something for
- which only minimal_symbols exist. */
- struct minimal_symbol *msymbol;
-
- /* A link to the next match, or NULL for the end. */
- struct symbol_search *next;
- };
+{
+ /* The block in which the match was found. Could be, for example,
+ STATIC_BLOCK or GLOBAL_BLOCK. */
+ int block;
+
+ /* Information describing what was found.
+
+ If symtab abd symbol are NOT NULL, then information was found
+ for this match. */
+ struct symtab *symtab;
+ struct symbol *symbol;
+
+ /* If msymbol is non-null, then a match was made on something for
+ which only minimal_symbols exist. */
+ struct minimal_symbol *msymbol;
+
+ /* A link to the next match, or NULL for the end. */
+ struct symbol_search *next;
+};
extern void search_symbols (char *, namespace_enum, int, char **,
struct symbol_search **);
extern void free_search_symbols (struct symbol_search *);
-extern struct cleanup *make_cleanup_free_search_symbols (struct symbol_search *);
+extern struct cleanup *make_cleanup_free_search_symbols (struct symbol_search
+ *);
/* The name of the ``main'' function.
FIXME: cagney/2001-03-20: Can't make main_name() const since some
of the calling code currently assumes that the string isn't
const. */
extern void set_main_name (const char *name);
-extern /*const*/ char *main_name (void);
+extern /*const */ char *main_name (void);
#endif /* !defined(SYMTAB_H) */