aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1992-06-13 06:39:27 +0000
committerJohn Gilmore <gnu@cygnus>1992-06-13 06:39:27 +0000
commit9342ecb9445e97793a516e97eff233e991b9d84d (patch)
treea81cad811d3c4efa6a22d155fcd1be94e8f5976e /gdb/symfile.c
parent609f87d4c94e0a0f897727701ede20f46af7fa1b (diff)
downloadgdb-9342ecb9445e97793a516e97eff233e991b9d84d.zip
gdb-9342ecb9445e97793a516e97eff233e991b9d84d.tar.gz
gdb-9342ecb9445e97793a516e97eff233e991b9d84d.tar.bz2
* dbxread.c: Add symbol_size to struct dbx_symfile_info.
Add symbol_size and file offsets to struct symloc. Add static symbol_table_offset, string_table_offset, file_string_table_offset, next_file_string_table_offset, last_function_name. (add_old_header_file): Convert error() to complain()t. (dbx_symfile_read): Get symbol size via the objfile. Also get symbol_table_offset. (dbx_symfile_init): Record symbol size and count via the objfile. (dbx_next_symbol_text): Always add file_string_table_offset when accessing string table. (read_dbx_symtab): Initialize file_string_table_offset to 0. (SET_NAMESTRING): Use the offset. (end_psymtab): Large kludge to determine addresses where source files start and end (for the psymtab header). (psymtab_to_symtab_1): Set file_string_table_offset before reading. Get this, symbol size, and symbol offset, from psymtab. (read_ofile_symtab): Don't back up one symbol for Solaris2. Patch up last_source_start_addr if zero in N_SO. (process_one_symbol): Add variable function_start_offset. ( "", N_FUN, N_LBRAC, N_RBRAC, N_SLINE): Add ifdef for BLOCK_ADDRESS_FUNCTION_RELATIVE. ( "", N_OBJ, N_OPT): Ignore. (elfstab_build_psymtabs): New function to read stabs out of an ELF file. * Makefile.in: Accept $(BISON) even though we really want $(YACC). (gdb): use GLOBAL_CFLAGS when linking, too. * partial-stab.h (N_UNDF): Deal with Sol2 relative stringtab offsets. (N_OBJ, N_OPT): Ignore. ('f', 'F'): Save last function name. * symfile.h: Prototype elfstab_build_psymtabs. * symfile.c: Add almost-OK debug versions of add_psymbol_*to_list. * xm-sysv4.h: Add <limits.h> to avoid conflicting defns in defs.h.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r--gdb/symfile.c63
1 files changed, 62 insertions, 1 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 8ef5ed9..de7f3a6 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -37,6 +37,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <fcntl.h>
#include <string.h>
#include <sys/stat.h>
+#include <ctype.h>
/* Global variables owned by this file */
@@ -403,6 +404,22 @@ syms_from_objfile (objfile, addr, mainline, verbo)
TYPE_NAME (lookup_pointer_type (builtin_type_char)) = 0;
TYPE_NAME (lookup_pointer_type (builtin_type_void)) = 0;
+ /* Mark the objfile has having had initial symbol read attempted. Note
+ that this does not mean we found any symbols... */
+
+ objfile -> flags |= OBJF_SYMS;
+}
+
+/* Perform required actions immediately after either reading in the initial
+ symbols for a new objfile, or mapping in the symbols from a reusable
+ objfile. */
+
+void
+new_symfile_objfile (objfile, mainline, verbo)
+ struct objfile *objfile;
+ int mainline;
+ int verbo;
+{
if (mainline)
{
/* OK, make it the "real" symbol file. */
@@ -491,6 +508,8 @@ symbol_file_add (name, from_tty, addr, mainline, mapped, readnow)
wrap_here ("");
fflush (stdout);
}
+ init_entry_point_info (objfile);
+ find_sym_fns (objfile);
}
else
{
@@ -504,9 +523,10 @@ symbol_file_add (name, from_tty, addr, mainline, mapped, readnow)
fflush (stdout);
}
syms_from_objfile (objfile, addr, mainline, from_tty);
- objfile -> flags |= OBJF_SYMS;
}
+ new_symfile_objfile (objfile, mainline, from_tty);
+
/* We now have at least a partial symbol table. Check to see if the
user requested that all symbols be read on initial access via either
the gdb startup command line or on a per symbol file basis. Expand
@@ -563,6 +583,10 @@ symbol_file_command (args, from_tty)
error ("Not confirmed.");
free_all_objfiles ();
symfile_objfile = NULL;
+ if (from_tty)
+ {
+ printf ("No symbol file now.\n");
+ }
}
else
{
@@ -1247,7 +1271,44 @@ start_psymtab_common (objfile, addr,
psymtab -> statics_offset = static_syms - objfile -> static_psymbols.list;
return (psymtab);
}
+
+/* Debugging versions of functions that are usually inline macros
+ (see symfile.h). */
+
+#if 0 /* Don't quite work nowadays... */
+
+/* Add a symbol with a long value to a psymtab.
+ Since one arg is a struct, we pass in a ptr and deref it (sigh). */
+
+void
+add_psymbol_to_list (name, namelength, namespace, class, list, val)
+ char *name;
+ int namelength;
+ enum namespace namespace;
+ enum address_class class;
+ struct psymbol_allocation_list *list;
+ long val;
+{
+ ADD_PSYMBOL_VT_TO_LIST (name, namelength, namespace, class, (*list), val,
+ SYMBOL_VALUE);
+}
+
+/* Add a symbol with a CORE_ADDR value to a psymtab. */
+
+void
+add_psymbol_addr_to_list (name, namelength, namespace, class, list, val)
+ char *name;
+ int namelength;
+ enum namespace namespace;
+ enum address_class class;
+ struct psymbol_allocation_list *list;
+ CORE_ADDR val;
+{
+ ADD_PSYMBOL_VT_TO_LIST (name, namelength, namespace, class, (*list), val,
+ SYMBOL_VALUE_ADDRESS);
+}
+#endif /* 0 */
void
_initialize_symfile ()