This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[RFA] Delete duplicate declarations of info_verbose


This seems like a pretty obvious code cleanup.  The info_verbose
variable is declared in defs.h, so there is no need to redeclare it in
the C sources that use it.

While I have your attention about info_verbose, from what I can tell
it traditionally was used to allow the user to get information
messages about what gdb was doing for operations which could be
expected to take a significant amount of time, such as reading large
symbol tables.

Now it seems to be more a "tell me about various random things" flag,
making it less useful for those that just want to set info_verbose so
gdb can inform them it is doing something rather than just hung in an
infinite loop.

I would propose that maybe we want to add a new flag that has the
original purpose of info_verbose, say perhaps "progress", like:

	(gdb) set progress on
	(gdb) set progress off

and change the appropriate places in gdb that do things like:

	if (info_verbose)
        {
          printf_filtered ("Reading in symbols for %s...", pst->filename);
          gdb_flush (gdb_stdout);
        }

to be		

	if (info_progress || info_verbose)
        {
          printf_filtered ("Reading in symbols for %s...", pst->filename);
          gdb_flush (gdb_stdout);
        }

This would allow people to set "progress" instead of "verbose", and
just get the progress messages instead of the "other stuff" as well.
As an example of "other stuff", when you attach to a running process
on Solaris you get messages like:

  PR_REQUESTED : Directed to stop by debugger via P(IO)CSTOP or P(IO)CWSTOP
  Retry #1:
  PR_REQUESTED : Directed to stop by debugger via P(IO)CSTOP or P(IO)CWSTOP
  Retry #2:
  PR_REQUESTED : Directed to stop by debugger via P(IO)CSTOP or P(IO)CWSTOP
  Retry #3:
  PR_REQUESTED : Directed to stop by debugger via P(IO)CSTOP or P(IO)CWSTOP
  Retry #4:
  PR_REQUESTED : Directed to stop by debugger via P(IO)CSTOP or P(IO)CWSTOP
  etc

Anyway, here is the cleanup patch.

-Fred

============================================================================

 2001-11-01  Fred Fish  <fnf@redhat.com>
 
	* complaints.c (info_verbose): Remove unneeded decl, is in defs.h.
	* dbxread.c: Ditto
	* dwarf2read.c: Ditto.
	* dwarfread.c: Ditto.
	* exec.c: Ditto.
	* hpread.c: Ditto.
	* hpread.h: Ditto.
	* mdebugread.c: Ditto.
	* os9kread.c: Ditto.
	* stack.c: Ditto.
	* symfile.c: Ditto.
	* tracepoint.c: Ditto.

Index: complaints.c
===================================================================
RCS file: /cvs/src/src/gdb/complaints.c,v
retrieving revision 1.5
diff -u -p -r1.5 complaints.c
--- complaints.c	2001/03/06 08:21:06	1.5
+++ complaints.c	2001/11/01 17:52:05
@@ -51,9 +51,6 @@ static unsigned int stop_whining = 0;
 
 static int complaint_series = 0;
 
-/* External variables and functions referenced. */
-
-extern int info_verbose;
 
 
 /* Functions to handle complaints during symbol reading.  */
Index: dbxread.c
===================================================================
RCS file: /cvs/src/src/gdb/dbxread.c,v
retrieving revision 1.25
diff -u -p -r1.25 dbxread.c
--- dbxread.c	2001/10/24 17:10:18	1.25
+++ dbxread.c	2001/11/01 17:52:06
@@ -124,10 +124,6 @@ struct symloc
 
 static enum language psymtab_language = language_unknown;
 
-/* Nonzero means give verbose info on gdb action.  From main.c.  */
-
-extern int info_verbose;
-
 /* The BFD for this file -- implicit parameter to next_symbol_text.  */
 
 static bfd *symfile_bfd;
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.32
diff -u -p -r1.32 dwarf2read.c
--- dwarf2read.c	2001/09/20 03:03:39	1.32
+++ dwarf2read.c	2001/11/01 17:52:08
@@ -554,9 +554,6 @@ static struct complaint dwarf2_unsupport
   "unsupported const value attribute form: '%s'", 0, 0
 };
 
-/* Externals references.  */
-extern int info_verbose;	/* From main.c; nonzero => verbose */
-
 /* local function prototypes */
 
 static void dwarf2_locate_sections (bfd *, asection *, PTR);
Index: dwarfread.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarfread.c,v
retrieving revision 1.9
diff -u -p -r1.9 dwarfread.c
--- dwarfread.c	2001/09/20 03:03:40	1.9
+++ dwarfread.c	2001/11/01 17:52:10
@@ -241,7 +241,6 @@ typedef unsigned int DIE_REF;	/* Referen
 
 /* External variables referenced. */
 
-extern int info_verbose;	/* From main.c; nonzero => verbose */
 extern char *warning_pre_print;	/* From utils.c */
 
 /* The DWARF debugging information consists of two major pieces,
Index: exec.c
===================================================================
RCS file: /cvs/src/src/gdb/exec.c,v
retrieving revision 1.14
diff -u -p -r1.14 exec.c
--- exec.c	2001/10/21 17:19:36	1.14
+++ exec.c	2001/11/01 17:52:10
@@ -72,8 +72,6 @@ static void init_exec_ops (void);
 
 void _initialize_exec (void);
 
-extern int info_verbose;
-
 /* The target vector for executable files.  */
 
 struct target_ops exec_ops;
Index: hpread.c
===================================================================
RCS file: /cvs/src/src/gdb/hpread.c,v
retrieving revision 1.9
diff -u -p -r1.9 hpread.c
--- hpread.c	2001/03/06 08:21:08	1.9
+++ hpread.c	2001/11/01 17:52:10
@@ -127,9 +127,6 @@ struct symloc
 #define SYMLOC(p) ((struct symloc *)((p)->read_symtab_private))
 
 /* FIXME: Shouldn't this stuff be in a .h file somewhere?  */
-/* Nonzero means give verbose info on gdb action.  */
-extern int info_verbose;
-
 /* Complaints about the symbols we have encountered.  */
 extern struct complaint string_table_offset_complaint;
 extern struct complaint lbrac_unmatched_complaint;
Index: hpread.h
===================================================================
RCS file: /cvs/src/src/gdb/hpread.h,v
retrieving revision 1.3
diff -u -p -r1.3 hpread.h
--- hpread.h	2001/03/06 08:21:08	1.3
+++ hpread.h	2001/11/01 17:52:11
@@ -131,9 +131,6 @@ struct symloc
 #define SYMLOC(p) ((struct symloc *)((p)->read_symtab_private))
 
 /* FIXME: Shouldn't this stuff be in a .h file somewhere?  */
-/* Nonzero means give verbose info on gdb action.  */
-extern int info_verbose;
-
 /* Complaints about the symbols we have encountered.  */
 extern struct complaint string_table_offset_complaint;
 extern struct complaint lbrac_unmatched_complaint;
Index: mdebugread.c
===================================================================
RCS file: /cvs/src/src/gdb/mdebugread.c,v
retrieving revision 1.17
diff -u -p -r1.17 mdebugread.c
--- mdebugread.c	2001/10/24 17:10:18	1.17
+++ mdebugread.c	2001/11/01 17:52:12
@@ -146,11 +146,6 @@ struct symloc
 #define SC_IS_BSS(sc) ((sc) == scBss || (sc) == scSBss)
 #define SC_IS_UNDEF(sc) ((sc) == scUndefined || (sc) == scSUndefined)
 
-
-/* Things we import explicitly from other modules */
-
-extern int info_verbose;
-
 /* Various complaints about symbol reading that don't abort the process */
 
 static struct complaint bad_file_number_complaint =
Index: os9kread.c
===================================================================
RCS file: /cvs/src/src/gdb/os9kread.c,v
retrieving revision 1.10
diff -u -p -r1.10 os9kread.c
--- os9kread.c	2001/09/05 02:13:11	1.10
+++ os9kread.c	2001/11/01 17:52:13
@@ -95,9 +95,6 @@ static int psymfile_depth = 0;
 /* keep symbol table file nested depth */
 static int symfile_depth = 0;
 
-/* Nonzero means give verbose info on gdb action.  From main.c.  */
-extern int info_verbose;
-
 extern int previous_stab_code;
 
 /* Name of last function encountered.  Used in Solaris to approximate
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.24
diff -u -p -r1.24 stack.c
--- stack.c	2001/10/16 01:58:07	1.24
+++ stack.c	2001/11/01 17:52:14
@@ -108,7 +108,6 @@ struct frame_info *parse_frame_specifica
 static void frame_info (char *, int);
 
 extern int addressprint;	/* Print addresses, or stay symbolic only? */
-extern int info_verbose;	/* Verbosity of symbol reading msgs */
 extern int lines_to_list;	/* # of lines "list" command shows by default */
 
 /* The "selected" stack frame is used by default for local and arg access.
Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.41
diff -u -p -r1.41 symfile.c
--- symfile.c	2001/10/30 04:05:34	1.41
+++ symfile.c	2001/11/01 17:52:14
@@ -95,8 +95,6 @@ struct complaint unknown_option_complain
 
 /* External variables and functions referenced. */
 
-extern int info_verbose;
-
 extern void report_transfer_performance (unsigned long, time_t, time_t);
 
 /* Functions this file defines */
Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.27
diff -u -p -r1.27 tracepoint.c
--- tracepoint.c	2001/10/12 23:51:29	1.27
+++ tracepoint.c	2001/11/01 17:52:15
@@ -61,7 +61,6 @@
 #define MAX_AGENT_EXPR_LEN	184
 
 
-extern int info_verbose;
 extern void (*readline_begin_hook) (char *, ...);
 extern char *(*readline_hook) (char *);
 extern void (*readline_end_hook) (void);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]