diff options
author | John Gilmore <gnu@cygnus> | 1991-12-04 08:36:17 +0000 |
---|---|---|
committer | John Gilmore <gnu@cygnus> | 1991-12-04 08:36:17 +0000 |
commit | 4369a1406f2559d0d0dcdbf3edb634cd835e6fbe (patch) | |
tree | a83aaa0c4cb2e5e1463687ffb7d86c771c33c98b | |
parent | 01a8219f154307cd1df4c4e04fb97ba52ec7924c (diff) | |
download | gdb-4369a1406f2559d0d0dcdbf3edb634cd835e6fbe.zip gdb-4369a1406f2559d0d0dcdbf3edb634cd835e6fbe.tar.gz gdb-4369a1406f2559d0d0dcdbf3edb634cd835e6fbe.tar.bz2 |
* Makefile.in: VERSION 4.2.96.
* main.c (initialize_main): Revise command descriptions.
* command.c (show_user): `info user' -> `show user'.
* symtab.c (_initialize_symtab): Typo in `info types' desc.
* coffread.c (coff_symfile_read): Avoid select_source_symtab,
since it is not needed and can cause errors when examining ".o"s.
(read_coff_symtab, decode_base_type): Use complain, not printf.
Print symbol name, not its number.
Remove "#if defined(clipper) #define BELIEVE_PCC_PROMOTION", which
someday should go in a clipper target config file.
* symfile.c (compact_misc_function_vector): Handle empty vector.
(complain, clear_complaints, syms_from_objfile): Fix complaint
formatting.
* xcoffexec.c: Change syms_from_objfile caller.
-rw-r--r-- | gdb/ChangeLog | 16 | ||||
-rw-r--r-- | gdb/command.c | 15 | ||||
-rw-r--r-- | gdb/symfile.c | 79 | ||||
-rw-r--r-- | gdb/xcoffexec.c | 2 |
4 files changed, 89 insertions, 23 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ca18753..307435c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,10 +1,22 @@ Tue Dec 3 17:24:57 1991 John Gilmore (gnu at cygnus.com) + * Makefile.in: VERSION 4.2.96. + + * main.c (initialize_main): Revise command descriptions. + * command.c (show_user): `info user' -> `show user'. + * symtab.c (_initialize_symtab): Typo in `info types' desc. + * coffread.c (coff_symfile_read): Avoid select_source_symtab, - since it is not needed and can cause errors when examining ".o" - files. + since it is not needed and can cause errors when examining ".o"s. + (read_coff_symtab, decode_base_type): Use complain, not printf. + Print symbol name, not its number. + Remove "#if defined(clipper) #define BELIEVE_PCC_PROMOTION", which + someday should go in a clipper target config file. * symfile.c (compact_misc_function_vector): Handle empty vector. + (complain, clear_complaints, syms_from_objfile): Fix complaint + formatting. + * xcoffexec.c: Change syms_from_objfile caller. * sparc-xdep.c: Force tm-file as tm-sparc.h, to make it compile when configured for cross debugging. FIXME, this needs a more diff --git a/gdb/command.c b/gdb/command.c index 1747706..2851ad9 100644 --- a/gdb/command.c +++ b/gdb/command.c @@ -17,7 +17,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <stdio.h> #include "defs.h" -#include "command.h" +#include "gdbcmd.h" #include "symtab.h" #include "value.h" #include <ctype.h> @@ -1152,7 +1152,7 @@ make_command (arg, from_tty) } static void -user_info_1 (c, stream) +show_user_1 (c, stream) struct cmd_list_element *c; FILE *stream; { @@ -1172,7 +1172,7 @@ user_info_1 (c, stream) /* ARGSUSED */ static void -user_info (args, from_tty) +show_user (args, from_tty) char *args; int from_tty; { @@ -1184,14 +1184,14 @@ user_info (args, from_tty) c = lookup_cmd (&args, cmdlist, "", 0, 1); if (c->class != class_user) error ("Not a user command."); - user_info_1 (c, stdout); + show_user_1 (c, stdout); } else { for (c = cmdlist; c; c = c->next) { if (c->class == class_user) - user_info_1 (c, stdout); + show_user_1 (c, stdout); } } } @@ -1206,7 +1206,8 @@ With no arguments, run an inferior shell."); add_com ("make", class_support, make_command, "Run the ``make'' program using the rest of the line as arguments."); - add_info ("user", user_info, "Show definitions of user defined commands.\n\ + add_cmd ("user", no_class, show_user, + "Show definitions of user defined commands.\n\ Argument is the name of the user defined command.\n\ -With no argument, show definitions of all user defined commands."); +With no argument, show definitions of all user defined commands.", &showlist); } diff --git a/gdb/symfile.c b/gdb/symfile.c index 0ab16a0..8f5b5b3 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -475,13 +475,16 @@ psymtab_to_symtab (pst) FROM_TTY says how verbose to be. MAINLINE specifies whether this is the main symbol file, or whether it's an extra symbol file such as dynamically loaded code. If !mainline, ADDR is the address - where the text segment was loaded. */ + where the text segment was loaded. If VERBO, the caller has printed + a verbose message about the symbol reading (and complaints can be + more terse about it). */ void -syms_from_objfile (objfile, addr, mainline) +syms_from_objfile (objfile, addr, mainline, verbo) struct objfile *objfile; CORE_ADDR addr; int mainline; + int verbo; { asection *text_sect; struct sym_fns *sf; @@ -531,7 +534,10 @@ syms_from_objfile (objfile, addr, mainline) addr = bfd_section_vma (sym_bfd, text_sect); } - clear_complaints(); /* Allow complaints to appear for this new file. */ + /* Allow complaints to appear for this new file, and record how + verbose to be. */ + + clear_complaints(1, verbo); (*sf->sym_read) (sf, addr, mainline); @@ -550,6 +556,9 @@ syms_from_objfile (objfile, addr, mainline) /* If we have wiped out any old symbol tables, clean up. */ clear_symtab_users_once (); + + /* We're done reading the symbol file; finish off complaints. */ + clear_complaints(0, verbo); } @@ -600,7 +609,7 @@ symbol_file_add (name, from_tty, addr, mainline) fflush (stdout); } - syms_from_objfile (objfile, addr, mainline); + syms_from_objfile (objfile, addr, mainline, from_tty); if (from_tty) { @@ -916,6 +925,15 @@ fill_in_vptr_fieldno (type) static unsigned stop_whining = 0; +/* Should each complaint be self explanatory, or should we assume that + a series of complaints is being produced? + case 0: self explanatory message. + case 1: First message of a series that must start off with explanation. + case 2: Subsequent message, when user already knows we are reading + symbols and we can just state our piece. */ + +static int complaint_series = 0; + /* Print a complaint about the input symbols, and link the complaint block into a chain for later handling. */ @@ -932,25 +950,60 @@ complain (complaint, val) if (complaint->counter > stop_whining) return; wrap_here (""); - if (!info_verbose) { + + switch (complaint_series + (info_verbose << 1)) { + + /* Isolated messages, must be self-explanatory. */ + case 0: + puts_filtered ("During symbol reading, "); + wrap_here(""); + printf_filtered (complaint->message, val); + puts_filtered (".\n"); + break; + + /* First of a series, without `set verbose'. */ + case 1: puts_filtered ("During symbol reading..."); + printf_filtered (complaint->message, val); + puts_filtered ("..."); + wrap_here(""); + complaint_series++; + break; + + /* Subsequent messages of a series, or messages under `set verbose'. + (We'll already have produced a "Reading in symbols for XXX..." message + and will clean up at the end with a newline.) */ + default: + printf_filtered (complaint->message, val); + puts_filtered ("..."); + wrap_here(""); } - printf_filtered (complaint->message, val); - puts_filtered ("..."); - wrap_here(""); - if (!info_verbose) - puts_filtered ("\n"); } -/* Clear out all complaint counters that have ever been incremented. */ +/* Clear out all complaint counters that have ever been incremented. + If sym_reading is 1, be less verbose about successive complaints, + since the messages are appearing all together during a command that + reads symbols (rather than scattered around as psymtabs get fleshed + out into symtabs at random times). If noisy is 1, we are in a + noisy symbol reading command, and our caller will print enough + context for the user to figure it out. */ void -clear_complaints () +clear_complaints (sym_reading, noisy) + int sym_reading; + int noisy; { struct complaint *p; for (p = complaint_root->next; p != complaint_root; p = p->next) p->counter = 0; + + if (!sym_reading && !noisy && complaint_series > 1) { + /* Terminate previous series, since caller won't. */ + puts_filtered ("\n"); + } + + complaint_series = sym_reading? 1 + noisy: 0; } enum language @@ -1268,7 +1321,7 @@ The second argument provides the starting address of the file's text."); for access from GDB."); add_show_from_set - (add_set_cmd ("complaints", class_support, var_uinteger, + (add_set_cmd ("complaints", class_support, var_zinteger, (char *)&stop_whining, "Set max number of complaints about incorrect symbols.", &setlist), diff --git a/gdb/xcoffexec.c b/gdb/xcoffexec.c index c6d421f..bba2c5c 100644 --- a/gdb/xcoffexec.c +++ b/gdb/xcoffexec.c @@ -299,7 +299,7 @@ map_vmap (bfd *bf, bfd *arch) if (exec_bfd && !obj) { name = savestring (bfd_get_filename (bf), strlen (bfd_get_filename (bf))); obj = allocate_objfile (bf, name); - syms_from_objfile (obj, 0, 0); + syms_from_objfile (obj, 0, 0, 0); } /* find the end of the list, and append. */ |