aboutsummaryrefslogtreecommitdiff
path: root/gdb/stabsread.h
diff options
context:
space:
mode:
authorGuinevere Larsen <guinevere@redhat.com>2024-09-09 15:06:29 -0300
committerGuinevere Larsen <guinevere@redhat.com>2024-09-20 17:02:09 -0300
commit64a1f185b376c83278d1fe2ef0ad8a79aeffcb24 (patch)
tree48d97e9d16b4f89210bbf25f9652437ee2516fc3 /gdb/stabsread.h
parent5b64a6127f9898e45374de4fe76e3538b3ada532 (diff)
downloadgdb-64a1f185b376c83278d1fe2ef0ad8a79aeffcb24.zip
gdb-64a1f185b376c83278d1fe2ef0ad8a79aeffcb24.tar.gz
gdb-64a1f185b376c83278d1fe2ef0ad8a79aeffcb24.tar.bz2
gdb: Move dbx_end_psymtab to stabsread, and rename to stabs_end_psymtab
This function is used by multiple stabs readers (even if not all), and the comment in stabsread.h even acknowledges it. I believe that the comment is incorrect in saying that the function should be in dbxread because not everyone uses it. If any one reader other than dbx uses it, the function should be in stabsread, in my opinion. This commit makes also renames the function to stabs_end_psymtab since, again, this is not specific to dbx/aout format. struct symloc had to be moved because stabs_end_psymtab dereferences symloc objects, so stabsread.c must be aware of the full struct. Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/stabsread.h')
-rw-r--r--gdb/stabsread.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/gdb/stabsread.h b/gdb/stabsread.h
index 33c57d9..b8e0338 100644
--- a/gdb/stabsread.h
+++ b/gdb/stabsread.h
@@ -173,7 +173,7 @@ class psymtab_storage;
/* Functions exported by dbxread.c. These are not in stabsread.c because
they are only used by some stabs readers. */
-extern legacy_psymtab *dbx_end_psymtab
+extern legacy_psymtab *stabs_end_psymtab
(struct objfile *objfile, psymtab_storage *partial_symtabs,
legacy_psymtab *pst,
const char **include_list, int num_includes,
@@ -251,4 +251,37 @@ process_one_symbol (int, int, CORE_ADDR, const char *,
const section_offsets &,
struct objfile *, enum language);
+#define LDSYMOFF(p) (((struct symloc *)((p)->read_symtab_private))->ldsymoff)
+#define LDSYMLEN(p) (((struct symloc *)((p)->read_symtab_private))->ldsymlen)
+
+/* We put a pointer to this structure in the read_symtab_private field
+ of the psymtab. */
+
+struct symloc
+ {
+ /* Offset within the file symbol table of first local symbol for this
+ file. */
+
+ int ldsymoff;
+
+ /* Length (in bytes) of the section of the symbol table devoted to
+ this file's symbols (actually, the section bracketed may contain
+ more than just this file's symbols). If ldsymlen is 0, the only
+ reason for this thing's existence is the dependency list. Nothing
+ else will happen when it is read in. */
+
+ int ldsymlen;
+
+ /* The size of each symbol in the symbol file (in external form). */
+
+ int symbol_size;
+
+ /* Further information needed to locate the symbols if they are in
+ an ELF file. */
+
+ int symbol_offset;
+ int string_offset;
+ int file_string_offset;
+ enum language pst_language;
+ };
#endif /* STABSREAD_H */