aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.h
diff options
context:
space:
mode:
authorgdb-2.5.1 <gdb@fsf.org>1988-05-02 01:00:00 +0100
committerPedro Alves <palves@redhat.com>2012-06-03 15:36:30 +0100
commit632ea0ccc5c4c3f9fc06881bfedfc4b075873941 (patch)
tree96f152433c41c5f51fe57307b287eb85865a43e2 /gdb/symtab.h
parent7b4ac7e1ed2c4616bce56d1760807798be87ac9e (diff)
downloadgdb-632ea0ccc5c4c3f9fc06881bfedfc4b075873941.zip
gdb-632ea0ccc5c4c3f9fc06881bfedfc4b075873941.tar.gz
gdb-632ea0ccc5c4c3f9fc06881bfedfc4b075873941.tar.bz2
gdb-2.5.1
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r--gdb/symtab.h99
1 files changed, 74 insertions, 25 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 4d93355..d184766 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -53,8 +53,8 @@ int misc_function_count;
#include "symseg.h"
-/* Each source file is represented by a struct symtab.
- These objects are chained through the `next' field. */
+/* Each source file is represented by a struct symtab. */
+/* These objects are chained through the `next' field. */
struct symtab
{
@@ -70,13 +70,12 @@ struct symtab
char *filename;
/* This component says how to free the data we point to:
free_contents => do a tree walk and free each object.
- free_explicit => free what free_ptr points at, and the linetable.
free_nothing => do nothing; some other symtab will free
the data this one uses.
free_linetable => free just the linetable. */
- enum free_code {free_nothing, free_contents, free_explicit, free_linetable}
+ enum free_code {free_nothing, free_contents, free_linetable}
free_code;
- /* Pointer to one block storage to be freed, if nonzero. */
+ /* Pointer to one block of storage to be freed, if nonzero. */
char *free_ptr;
/* Total number of lines found in source file. */
int nlines;
@@ -91,6 +90,9 @@ struct symtab
/* Offset within loader symbol table
of first local symbol for this file. */
int ldsymoff;
+ /* Full name of file as found by searching the source path.
+ 0 if not yet known. */
+ char *fullname;
};
/* This is the list of struct symtab's that gdb considers current. */
@@ -113,24 +115,6 @@ int current_source_line;
#define LINELIST(symtab) (symtab)->linetable
#define LINETABLE(symtab) (symtab)->linetable
-/* Recording the code addresses of source lines. */
-
-struct linetable
- {
- int nitems;
- int item[1];
- };
-
-/* Each item is either minus a line number, or a program counter.
- If it represents a line number, that is the line described by the next
- program counter value. If it is positive, it is the program
- counter at which the code for the next line starts.
-
- Consecutive lines can be recorded by program counter entries
- with no line number entries between them. Line number entries
- are used when there are lines to skip with no code on them.
- This is to make the table shorter. */
-
/* Macros normally used to access components of symbol table structures. */
#define BLOCKLIST_NBLOCKS(blocklist) (blocklist)->nblocks
@@ -161,16 +145,34 @@ struct linetable
These types are never freed. */
#define TYPE_FLAG_PERM 4
+/* Some macros for bitfields. */
+#define B_SET(a,x) (a[x>>5] |= (1 << (x&31)))
+#define B_CLR(a,x) (a[x>>5] &= ~(1 << (x&31)))
+#define B_TST(a,x) (a[x>>5] & (1 << (x&31)))
+
#define TYPE_NAME(thistype) (thistype)->name
#define TYPE_TARGET_TYPE(thistype) (thistype)->target_type
#define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type
+#define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type
#define TYPE_FUNCTION_TYPE(thistype) (thistype)->function_type
+#define TYPE_MAIN_VARIANT(thistype) (thistype)->main_variant
#define TYPE_LENGTH(thistype) (thistype)->length
#define TYPE_FLAGS(thistype) (thistype)->flags
#define TYPE_UNSIGNED(thistype) ((thistype)->flags & TYPE_FLAG_UNSIGNED)
#define TYPE_CODE(thistype) (thistype)->code
#define TYPE_NFIELDS(thistype) (thistype)->nfields
#define TYPE_FIELDS(thistype) (thistype)->fields
+/* C++ */
+#define TYPE_VPTR_BASETYPE(thistype) (thistype)->vptr_basetype
+#define TYPE_DOMAIN_TYPE(thistype) (thistype)->vptr_basetype
+#define TYPE_VPTR_FIELDNO(thistype) (thistype)->vptr_fieldno
+#define TYPE_FN_FIELDS(thistype) (thistype)->fn_fields
+#define TYPE_NFN_FIELDS(thistype) (thistype)->nfn_fields
+#define TYPE_NFN_FIELDS_TOTAL(thistype) (thistype)->nfn_fields_total
+#define TYPE_BASECLASS(thistype) (thistype)->baseclass
+#define TYPE_VIA_PUBLIC(thistype) (thistype)->via_public
+#define TYPE_VIA_PROTECTED(thistype) (thistype)->via_protected
+#define TYPE_CHAIN(thistype) (thistype)->baseclass
#define TYPE_FIELD(thistype, n) (thistype)->fields[n]
#define TYPE_FIELD_TYPE(thistype, n) (thistype)->fields[n].type
@@ -179,11 +181,46 @@ struct linetable
#define TYPE_FIELD_BITPOS(thistype, n) (thistype)->fields[n].bitpos
#define TYPE_FIELD_BITSIZE(thistype, n) (thistype)->fields[n].bitsize
#define TYPE_FIELD_PACKED(thistype, n) (thistype)->fields[n].bitsize
+
+#define TYPE_FIELD_PRIVATE_BITS(thistype) (thistype)->private_field_bits
+#define TYPE_FIELD_PROTECTED_BITS(thistype) (thistype)->protected_field_bits
+#define SET_TYPE_FIELD_PRIVATE(thistype, n) B_SET ((thistype)->private_field_bits, (n))
+#define SET_TYPE_FIELD_PROTECTED(thistype, n) B_SET ((thistype)->protected_field_bits, (n))
+#define TYPE_FIELD_PRIVATE(thistype, n) B_TST((thistype)->private_field_bits, (n))
+#define TYPE_FIELD_PROTECTED(thistype, n) B_TST((thistype)->protected_field_bits, (n))
+
+#define TYPE_HAS_DESTRUCTOR(thistype) ((thistype)->has_destructor)
+#define TYPE_HAS_CONSTRUCTOR(thistype) ((thistype)->has_constructor)
+
+#define TYPE_FIELD_STATIC(thistype, n) ((thistype)->fields[n].bitpos == -1)
+#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) ((char *)(thistype)->fields[n].bitsize)
+
+#define TYPE_FN_FIELDLISTS(thistype) (thistype)->fn_fieldlists
+#define TYPE_FN_FIELDLIST(thistype, n) (thistype)->fn_fieldlists[n]
+#define TYPE_FN_FIELDLIST1(thistype, n) (thistype)->fn_fieldlists[n].fn_fields
+#define TYPE_FN_FIELDLIST_NAME(thistype, n) (thistype)->fn_fieldlists[n].name
+#define TYPE_FN_FIELDLIST_LENGTH(thistype, n) (thistype)->fn_fieldlists[n].length
+
+#define TYPE_FN_FIELD(thistype) (thistype)[n]
+#define TYPE_FN_FIELD_NAME(thistype, n) (thistype)[n].name
+#define TYPE_FN_FIELD_TYPE(thistype, n) (thistype)[n].type
+#define TYPE_FN_FIELD_ARGS(thistype, n) (thistype)[n].args
+#define TYPE_FN_FIELD_PHYSNAME(thistype, n) (thistype)[n].physname
+#define TYPE_FN_FIELD_VIRTUAL_P(thistype, n) (thistype)[n].voffset
+#define TYPE_FN_FIELD_VOFFSET(thistype, n) ((thistype)[n].voffset-1)
+
+#define TYPE_FN_PRIVATE_BITS(thistype) (thistype).private_fn_field_bits
+#define TYPE_FN_PROTECTED_BITS(thistype) (thistype).protected_fn_field_bits
+#define SET_TYPE_FN_PRIVATE(thistype, n) B_SET ((thistype).private_fn_field_bits, n)
+#define SET_TYPE_FN_PROTECTED(thistype, n) B_SET ((thistype).protected_fn_field_bits, n)
+#define TYPE_FN_PRIVATE(thistype, n) B_TST ((thistype).private_fn_field_bits, n)
+#define TYPE_FN_PROTECTED(thistype, n) B_TST ((thistype).protected_fn_field_bits, n)
/* Functions that work on the objects described above */
extern struct symtab *lookup_symtab ();
extern struct symbol *lookup_symbol ();
+extern struct symbol *lookup_symbol_1 (), *lookup_symbol_2 ();
extern struct type *lookup_typename ();
extern struct type *lookup_unsigned_typename ();
extern struct type *lookup_struct ();
@@ -195,6 +232,12 @@ extern struct symbol *block_function ();
extern struct symbol *find_pc_function ();
extern int find_pc_misc_function ();
+/* C++ stuff. */
+extern struct type *lookup_reference_type ();
+extern struct type *lookup_member_pointer_type ();
+extern struct type *lookup_class ();
+/* end of C++ stuff. */
+
extern struct type *builtin_type_void;
extern struct type *builtin_type_char;
extern struct type *builtin_type_short;
@@ -215,6 +258,12 @@ struct symtab_and_line
CORE_ADDR end;
};
+struct symtabs_and_lines
+{
+ struct symtab_and_line *sals;
+ int nelts;
+};
+
/* Given a pc value, return line number it is in.
Second arg nonzero means if pc is on the boundary
use the previous statement's line number. */
@@ -224,5 +273,5 @@ struct symtab_and_line find_pc_line ();
/* Given a string, return the line specified by it.
For commands like "list" and "breakpoint". */
-struct symtab_and_line decode_line_spec ();
-struct symtab_and_line decode_line_1 ();
+struct symtabs_and_lines decode_line_spec ();
+struct symtabs_and_lines decode_line_1 ();