* complaints.c: New file, code moved from utils.c.

* complaints.c (complain):  Made into a varargs function.
	* complaints.h:  New file, code moved from symfile.h.
	* Makefile.in (SFILES_MAINDIR):  Add complaints.c.
	* Makefile.in (HFILES):  Add complaints.h.
	* Makefile.in (OBS):  Add complaints.o.
	* symfile.c (complaint_root, stop_whining, complaint_series,
	complain, clear_complaints, add_show_from_set for stop_whining):
	Moved to complaints.c.
	* symfile.h (struct complaint, complaint_root decl, complain
	prototype, clear_complaints prototype):  Moved to complaints.h.
	* buildsym.c, coffread.c, dbxread.c, dwarfread.c, elfread.c,
	gdbtypes.c, mipsread.c, stbsread.c, symfile.c:  Include
	complaints.h.  Remove casts from arguments to complain(),
	which is now a varargs function, and remove unnecessary
	placeholder zero args.
	* defs.h (begin_line):  Add prototype.
	* defs.h (vprintf_filtered):  Add prototype.
	* dwarfread.c (varargs.h):  Remove, no longer needed.
	* dwarfread.c (dwarfwarn):  Remove prototype and function.
	* dwarfread.c (complaints):  Define a bunch of complaints.
	* dwarfread.c (SQUAWK):  Remove macro defs, convert all
	usages to standard complain() calls.
	* utils.c (begin_line):  New function that ensures that
	whatever gets filter-printed next starts on its own line.
	* utils.c (vprintf_filtered):  New func, like vfprintf_filtered,
	but to stdout (calls vfprintf_filtered internally).
This commit is contained in:
Fred Fish
1992-12-15 12:18:53 +00:00
parent 631f7a9f7c
commit 51b80b0072
19 changed files with 533 additions and 499 deletions

View File

@@ -808,11 +808,13 @@ parse_escape (string_ptr)
}
}
/* Print the character C on STREAM as part of the contents
of a literal string whose delimiter is QUOTER. */
/* Print the character C on STREAM as part of the contents of a literal
string whose delimiter is QUOTER. Note that this routine should only
be call for printing things which are independent of the language
of the program being debugged. */
void
printchar (c, stream, quoter)
gdb_printchar (c, stream, quoter)
register int c;
FILE *stream;
int quoter;
@@ -980,6 +982,20 @@ wrap_here(indent)
}
}
/* Ensure that whatever gets printed next, using the filtered output
commands, starts at the beginning of the line. I.E. if there is
any pending output for the current line, flush it and start a new
line. Otherwise do nothing. */
void
begin_line ()
{
if (chars_printed > 0)
{
puts_filtered ("\n");
}
}
/* Like fputs but pause after every screenful, and can wrap at points
other than the final character of a line.
Unlike fputs, fputs_filtered does not return a value.
@@ -1211,6 +1227,14 @@ vfprintf_filtered (stream, format, args)
fputs_filtered (linebuffer, stream);
}
void
vprintf_filtered (format, args)
char *format;
va_list args;
{
vfprintf_filtered (stdout, format, args);
}
/* VARARGS */
void
fprintf_filtered (va_alist)
@@ -1290,7 +1314,10 @@ printfi_filtered (va_alist)
va_end (args);
}
/* Easy */
/* Easy -- but watch out!
This routine is *not* a replacement for puts()! puts() appends a newline.
This one doesn't, and had better not! */
void
puts_filtered (string)
@@ -1378,7 +1405,7 @@ fprint_symbol (stream, name)
when searching for matching C++ function names (such as if the
user types 'break FOO', where FOO is a mangled C++ function). */
static int
int
strcmp_iw (string1, string2)
const char *string1;
const char *string2;