* 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.
This commit is contained in:
Peter Schauer 1994-08-19 20:44:18 +00:00
parent 8e3641719b
commit f3806e3b6c
4 changed files with 81 additions and 20 deletions

View File

@ -1,3 +1,22 @@
Fri Aug 19 13:35:01 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* 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.
Fri Aug 19 00:40:55 1994 Jeff Law (law@snake.cs.utah.edu)
* hppa-tdep.c (skip_trampoline_code): Revert incorrect change

View File

@ -130,7 +130,7 @@ c_print_type (type, varstring, stream, show, level)
/* For demangled function names, we have the arglist as part of the name,
so don't print an additional pair of ()'s */
demangled_args = varstring[strlen(varstring) - 1] == ')';
demangled_args = strchr(varstring, '(') != NULL;
c_type_print_varspec_suffix (type, stream, show, 0, demangled_args);
}

View File

@ -3818,6 +3818,15 @@ scan_file_globals (objfile)
{
QUIT;
/* Skip static symbols. */
switch (MSYMBOL_TYPE (msymbol))
{
case mst_file_text:
case mst_file_data:
case mst_file_bss:
continue;
}
prev = NULL;
/* Get the hash index and check all the symbols

View File

@ -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.
@ -73,6 +73,9 @@ load_command PARAMS ((char *, int));
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 *));
@ -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);