aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile.c
diff options
context:
space:
mode:
authorPeter Schauer <Peter.Schauer@mytum.de>1994-08-19 20:44:18 +0000
committerPeter Schauer <Peter.Schauer@mytum.de>1994-08-19 20:44:18 +0000
commitf3806e3b6ceead276a3acba85ff944fde6668e39 (patch)
tree72ce83c769f8c1772c6044e540e2c78567abc0e4 /gdb/symfile.c
parent8e3641719ba57f7b6e88330c12a1d59628e7efa4 (diff)
downloadfsf-binutils-gdb-f3806e3b6ceead276a3acba85ff944fde6668e39.zip
fsf-binutils-gdb-f3806e3b6ceead276a3acba85ff944fde6668e39.tar.gz
fsf-binutils-gdb-f3806e3b6ceead276a3acba85ff944fde6668e39.tar.bz2
* c-typeprint.c (c_print_type): Assume demangled arguments
if a '(' is found in varstring, Looking for ')' at the end of varstring did fail with demangled const member functions, which have a trailing `const'. * remote.c (get_offsets, putpkt): Change to `char' buffers, to avoid errors when compiling with DEC c89. (remote_wait): Cast to `char *' before passing buffer to fputs_filtered, to avoid errors when compiling with DEC c89. (remote_wait): Do not return inferior_pid by default, this statement is never reached, which causes warnings from some compilers. * stabsread.c (scan_file_globals): Ignore static minimal symbols. * symfile.c (load_command): If called with no argument, try to get the filename from the executable file. (generic_load): Remove check for NULL filename, it is done in load_command now.
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r--gdb/symfile.c71
1 files changed, 52 insertions, 19 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index f0b3983..577aaa4 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1,5 +1,5 @@
/* Generic symbol file reading for the GNU debugger, GDB.
- Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
This file is part of GDB.
@@ -74,6 +74,9 @@ static void
add_symbol_file_command PARAMS ((char *, int));
static void
+add_shared_symbol_files_command PARAMS ((char *, int));
+
+static void
cashier_psymtab PARAMS ((struct partial_symtab *));
static int
@@ -294,11 +297,9 @@ init_entry_point_info (objfile)
else
{
/* Examination of non-executable.o files. Short-circuit this stuff. */
- /* ~0 will not be in any file, we hope. */
- objfile -> ei.entry_point = ~0;
- /* set the startup file to be an empty range. */
- objfile -> ei.entry_file_lowpc = 0;
- objfile -> ei.entry_file_highpc = 0;
+ objfile -> ei.entry_point = INVALID_ENTRY_POINT;
+ objfile -> ei.entry_file_lowpc = INVALID_ENTRY_LOWPC;
+ objfile -> ei.entry_file_highpc = INVALID_ENTRY_HIGHPC;
}
}
@@ -464,6 +465,13 @@ syms_from_objfile (objfile, addr, mainline, verbo)
(*objfile -> sf -> sym_read) (objfile, section_offsets, mainline);
+ if (!have_partial_symbols () && !have_full_symbols ())
+ {
+ wrap_here ("");
+ printf_filtered ("(no debugging symbols found)...");
+ wrap_here ("");
+ }
+
/* Don't allow char * to have a typename (else would get caddr_t).
Ditto void *. FIXME: Check whether this is now done by all the
symbol readers themselves (many of them now do), and if so remove
@@ -849,6 +857,8 @@ load_command (arg, from_tty)
char *arg;
int from_tty;
{
+ if (arg == NULL)
+ arg = get_exec_file (1);
target_load (arg, from_tty);
}
@@ -869,9 +879,6 @@ generic_load (filename, from_tty)
asection *s;
bfd *loadfile_bfd;
- if (filename == NULL)
- filename = get_exec_file (1);
-
loadfile_bfd = bfd_openr (filename, gnutarget);
if (loadfile_bfd == NULL)
{
@@ -1020,6 +1027,18 @@ add_symbol_file_command (args, from_tty)
symbol_file_add (name, 0, text_addr, 0, mapped, readnow);
}
+static void
+add_shared_symbol_files_command (args, from_tty)
+ char *args;
+ int from_tty;
+{
+#ifdef ADD_SHARED_SYMBOL_FILES
+ ADD_SHARED_SYMBOL_FILES (args, from_tty);
+#else
+ error ("This command is not available in this configuration of GDB.");
+#endif
+}
+
/* Re-read symbols if a symbol-file has changed. */
void
reread_symbols ()
@@ -1168,6 +1187,12 @@ reread_symbols ()
zero is OK since dbxread.c also does what it needs to do if
objfile->global_psymbols.size is 0. */
(*objfile->sf->sym_read) (objfile, objfile->section_offsets, 0);
+ if (!have_partial_symbols () && !have_full_symbols ())
+ {
+ wrap_here ("");
+ printf_filtered ("(no debugging symbols found)\n");
+ wrap_here ("");
+ }
objfile -> flags |= OBJF_SYMS;
/* We're done reading the symbol file; finish off complaints. */
@@ -1205,17 +1230,17 @@ deduce_language_from_filename (filename)
; /* Get default */
else if (0 == (c = strrchr (filename, '.')))
; /* Get default. */
- else if (STREQ(c,".mod"))
- return language_m2;
- else if (STREQ(c,".c"))
+ else if (STREQ (c, ".c"))
return language_c;
- else if (STREQ(c,".s"))
- return language_asm;
- else if (STREQ (c,".cc") || STREQ (c,".C") || STREQ (c, ".cxx")
- || STREQ (c, ".cpp"))
+ else if (STREQ (c, ".cc") || STREQ (c, ".C") || STREQ (c, ".cxx")
+ || STREQ (c, ".cpp") || STREQ (c, ".cp"))
return language_cplus;
- else if (STREQ (c,".ch") || STREQ (c,".c186") || STREQ (c,".c286"))
+ else if (STREQ (c, ".ch") || STREQ (c, ".c186") || STREQ (c, ".c286"))
return language_chill;
+ else if (STREQ (c, ".mod"))
+ return language_m2;
+ else if (STREQ (c, ".s") || STREQ (c, ".S"))
+ return language_asm;
return language_unknown; /* default */
}
@@ -1630,11 +1655,19 @@ to execute.", &cmdlist);
c->completer = filename_completer;
c = add_cmd ("add-symbol-file", class_files, add_symbol_file_command,
- "Load the symbols from FILE, assuming FILE has been dynamically loaded.\n\
-The second argument provides the starting address of the file's text.",
+ "Usage: add-symbol-file FILE ADDR\n\
+Load the symbols from FILE, assuming FILE has been dynamically loaded.\n\
+ADDR is the starting address of the file's text.",
&cmdlist);
c->completer = filename_completer;
+ c = add_cmd ("add-shared-symbol-files", class_files,
+ add_shared_symbol_files_command,
+ "Load the symbols from shared objects in the dynamic linker's link map.",
+ &cmdlist);
+ c = add_alias_cmd ("assf", "add-shared-symbol-files", class_files, 1,
+ &cmdlist);
+
c = add_cmd ("load", class_files, load_command,
"Dynamically load FILE into the running program, and record its symbols\n\
for access from GDB.", &cmdlist);