summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Carlton <carlton@bactrian.org>2003-08-04 17:08:24 +0000
committerDavid Carlton <carlton@bactrian.org>2003-08-04 17:08:24 +0000
commit8d892e78e9190391c1efe4e3fde641a38e348801 (patch)
treebd8cd3ebd6ade720072a6e6721450b7b4c8e8c62
parentdca30a857a42ed6ca92765f61d47f02934fec2dc (diff)
downloadgdb-8d892e78e9190391c1efe4e3fde641a38e348801.tar.gz
2003-08-04 David Carlton <carlton@kealia.com>
* charset.c (cached_iconv_convert): Add __FILE__ and __LINE__ args to internal_error call. * source.c (forward_search_command): Add "%s" format argument. (reverse_search_command): Ditto. * top.c (quit_confirm): Ditto. * cli/cli-setshow.c (do_setshow_command): Ditto. * cp-valprint.c (cp_print_class_method): Replace {f,}printf_{un,}filtered by {f,}puts_{un,}filtered. (cp_print_class_member): Ditto. * event-top.c (command_line_handler): Ditto. * linux-proc.c (linux_info_proc_cmd): Ditto. * p-typeprint.c (pascal_type_print_base): Ditto. * p-valprint.c (pascal_object_print_class_method): Ditto. (pascal_object_print_class_member): Ditto. * printcmd.c (print_scalar_formatted,printf_command): Ditto. * remote.c (remote_cisco_section_offsets): Ditto. * top.c (command_line_input): Ditto. * utils.c (vwarning,error_stream,quit): Ditto. * valprint.c (print_floating,print_binary_chars) (print_octal_chars,print_decimal_chars,print_hex_chars): Ditto. 2003-08-04 David Carlton <carlton@kealia.com> * mi-main.c (mi_error_last_message): Add "%s" second argument to xasprintf call. 2003-08-04 David Carlton <carlton@kealia.com> * generic/gdbtk.c (gdbtk_source_start_file): Add "%s" first argument to error call. (tk_command): Ditto. (view_command): Ditto.
-rw-r--r--gdb/ChangeLog23
-rw-r--r--gdb/charset.c3
-rw-r--r--gdb/cli/cli-setshow.c2
-rw-r--r--gdb/cp-valprint.c4
-rw-r--r--gdb/event-top.c2
-rw-r--r--gdb/gdbtk/ChangeLog7
-rw-r--r--gdb/gdbtk/generic/gdbtk.c6
-rw-r--r--gdb/linux-proc.c2
-rw-r--r--gdb/mi/ChangeLog5
-rw-r--r--gdb/mi/mi-main.c2
-rw-r--r--gdb/p-typeprint.c4
-rw-r--r--gdb/p-valprint.c4
-rw-r--r--gdb/printcmd.c4
-rw-r--r--gdb/remote.c2
-rw-r--r--gdb/source.c4
-rw-r--r--gdb/top.c14
-rw-r--r--gdb/utils.c6
-rw-r--r--gdb/valprint.c22
18 files changed, 76 insertions, 40 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index de60e7daba9..8b7f2eaf854 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,26 @@
+2003-08-04 David Carlton <carlton@kealia.com>
+
+ * charset.c (cached_iconv_convert): Add __FILE__ and __LINE__ args
+ to internal_error call.
+ * source.c (forward_search_command): Add "%s" format argument.
+ (reverse_search_command): Ditto.
+ * top.c (quit_confirm): Ditto.
+ * cli/cli-setshow.c (do_setshow_command): Ditto.
+ * cp-valprint.c (cp_print_class_method): Replace
+ {f,}printf_{un,}filtered by {f,}puts_{un,}filtered.
+ (cp_print_class_member): Ditto.
+ * event-top.c (command_line_handler): Ditto.
+ * linux-proc.c (linux_info_proc_cmd): Ditto.
+ * p-typeprint.c (pascal_type_print_base): Ditto.
+ * p-valprint.c (pascal_object_print_class_method): Ditto.
+ (pascal_object_print_class_member): Ditto.
+ * printcmd.c (print_scalar_formatted,printf_command): Ditto.
+ * remote.c (remote_cisco_section_offsets): Ditto.
+ * top.c (command_line_input): Ditto.
+ * utils.c (vwarning,error_stream,quit): Ditto.
+ * valprint.c (print_floating,print_binary_chars)
+ (print_octal_chars,print_decimal_chars,print_hex_chars): Ditto.
+
2003-08-04 Andrew Cagney <cagney@redhat.com>
* frame.c (frame_func_unwind): Use frame_unwind_address_in_block.
diff --git a/gdb/charset.c b/gdb/charset.c
index c311447ea44..fa683743cb7 100644
--- a/gdb/charset.c
+++ b/gdb/charset.c
@@ -443,7 +443,8 @@ cached_iconv_convert (struct cached_iconv *ci, int from_char, int *to_char)
return 0;
/* Anything else is mysterious. */
- internal_error ("Error converting character `%d' from `%s' to `%s' "
+ internal_error (__FILE__, __LINE__,
+ "Error converting character `%d' from `%s' to `%s' "
"character set: %s",
from_char, ci->from->name, ci->to->name,
safe_strerror (errno));
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index 1d68ae4aa1a..64a0d7353a2 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -213,7 +213,7 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
strcat (msg, c->enums[i]);
}
strcat (msg, ".");
- error (msg);
+ error ("%s", msg);
}
p = strchr (arg, ' ');
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index a591d1859a5..27d8ec327ce 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -143,7 +143,7 @@ cp_print_class_method (char *valaddr,
char *demangled_name;
fprintf_filtered (stream, "&");
- fprintf_filtered (stream, kind);
+ fputs_filtered (kind, stream);
demangled_name = cplus_demangle (TYPE_FN_FIELD_PHYSNAME (f, j),
DMGL_ANSI | DMGL_PARAMS);
if (demangled_name == NULL)
@@ -720,7 +720,7 @@ cp_print_class_member (char *valaddr, struct type *domain,
if (i < len)
{
char *name;
- fprintf_filtered (stream, prefix);
+ fputs_filtered (prefix, stream);
name = type_name_no_tag (domain);
if (name)
fputs_filtered (name, stream);
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 5ab324df758..9db28fb38be 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -612,7 +612,7 @@ command_line_handler (char *rl)
if (annotation_level > 1 && instream == stdin)
{
printf_unfiltered ("\n\032\032post-");
- printf_unfiltered (async_annotation_suffix);
+ puts_unfiltered (async_annotation_suffix);
printf_unfiltered ("\n");
}
diff --git a/gdb/gdbtk/ChangeLog b/gdb/gdbtk/ChangeLog
index 460948ee29e..5f62cc4f0c2 100644
--- a/gdb/gdbtk/ChangeLog
+++ b/gdb/gdbtk/ChangeLog
@@ -1,3 +1,10 @@
+2003-08-04 David Carlton <carlton@kealia.com>
+
+ * generic/gdbtk.c (gdbtk_source_start_file): Add "%s" first
+ argument to error call.
+ (tk_command): Ditto.
+ (view_command): Ditto.
+
2003-07-29 Martin Hunt <hunt@redhat.com>
* library/prefs.tcl (pref_set_option_db): On Windows, fix
diff --git a/gdb/gdbtk/generic/gdbtk.c b/gdb/gdbtk/generic/gdbtk.c
index 1f4d1bbf227..c4bbf3fe105 100644
--- a/gdb/gdbtk/generic/gdbtk.c
+++ b/gdb/gdbtk/generic/gdbtk.c
@@ -636,7 +636,7 @@ gdbtk_find_main";
#else
/* FIXME: cagney/2002-04-17: Wonder what the lifetime of
``msg'' is - does it need a cleanup? */
- error (msg);
+ error ("%s", msg);
#endif
}
@@ -731,7 +731,7 @@ tk_command (char *cmd, int from_tty)
old_chain = make_cleanup (free, result);
if (retval != TCL_OK)
- error (result);
+ error ("%s", result);
printf_unfiltered ("%s\n", result);
@@ -753,7 +753,7 @@ view_command (char *args, int from_tty)
if (Tcl_Eval (gdbtk_interp, script) != TCL_OK)
{
Tcl_Obj *obj = Tcl_GetObjResult (gdbtk_interp);
- error (Tcl_GetStringFromObj (obj, NULL));
+ error ("%s", Tcl_GetStringFromObj (obj, NULL));
}
do_cleanups (old_chain);
diff --git a/gdb/linux-proc.c b/gdb/linux-proc.c
index e4ea747008b..282a3ec33fb 100644
--- a/gdb/linux-proc.c
+++ b/gdb/linux-proc.c
@@ -446,7 +446,7 @@ linux_info_proc_cmd (char *args, int from_tty)
if ((procfile = fopen (fname1, "r")) > 0)
{
while (fgets (buffer, sizeof (buffer), procfile) != NULL)
- printf_filtered (buffer);
+ puts_filtered (buffer);
fclose (procfile);
}
else
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index f4a4ad810dc..5af17c3fc51 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -1,3 +1,8 @@
+2003-08-04 David Carlton <carlton@kealia.com>
+
+ * mi-main.c (mi_error_last_message): Add "%s" second argument to
+ xasprintf call.
+
2003-06-28 Daniel Jacobowitz <drow@mvista.com>
* mi-out.c (mi_ui_out_impl): Add NULL for redirect member.
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 5e55913fb94..64a28fd7f69 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -101,7 +101,7 @@ void
mi_error_last_message (void)
{
char *s = error_last_message ();
- xasprintf (&mi_error_message, s);
+ xasprintf (&mi_error_message, "%s", s);
xfree (s);
}
diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c
index 293de70b575..286f22d95a5 100644
--- a/gdb/p-typeprint.c
+++ b/gdb/p-typeprint.c
@@ -460,8 +460,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
/* void pointer */
if ((TYPE_CODE (type) == TYPE_CODE_PTR) && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_VOID))
{
- fprintf_filtered (stream,
- TYPE_NAME (type) ? TYPE_NAME (type) : "pointer");
+ fputs_filtered (TYPE_NAME (type) ? TYPE_NAME (type) : "pointer",
+ stream);
return;
}
/* When SHOW is zero or less, and there is a valid type name, then always
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index 4867dcb47b6..718d28731d3 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -661,7 +661,7 @@ common:
char *demangled_name;
fprintf_filtered (stream, "&");
- fprintf_filtered (stream, kind);
+ fputs_filtered (kind, stream);
demangled_name = cplus_demangle (TYPE_FN_FIELD_PHYSNAME (f, j),
DMGL_ANSI | DMGL_PARAMS);
if (demangled_name == NULL)
@@ -1080,7 +1080,7 @@ pascal_object_print_class_member (char *valaddr, struct type *domain,
if (i < len)
{
char *name;
- fprintf_filtered (stream, prefix);
+ fputs_filtered (prefix, stream);
name = type_name_no_tag (domain);
if (name)
fputs_filtered (name, stream);
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 3f0bc3c21a8..dd7f6366210 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -507,7 +507,7 @@ print_scalar_formatted (void *valaddr, struct type *type, int format, int size,
strcpy (buf, local_binary_format_prefix ());
strcat (buf, cp);
strcat (buf, local_binary_format_suffix ());
- fprintf_filtered (stream, buf);
+ fputs_filtered (buf, stream);
}
break;
@@ -2003,7 +2003,7 @@ printf_command (char *arg, int from_tty)
current_substring += strlen (current_substring) + 1;
}
/* Print the portion of the format string after the last argument. */
- printf_filtered (last_arg);
+ puts_filtered (last_arg);
}
do_cleanups (old_cleanups);
}
diff --git a/gdb/remote.c b/gdb/remote.c
index 75e1e08ea37..e6c4fbc4490 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -2071,7 +2071,7 @@ remote_cisco_section_offsets (bfd_vma text_addr,
sprintf_vma (tmp + strlen (tmp), data_addr);
sprintf (tmp + strlen (tmp), " bss = 0x");
sprintf_vma (tmp + strlen (tmp), bss_addr);
- fprintf_filtered (gdb_stdlog, tmp);
+ fputs_filtered (tmp, gdb_stdlog);
fprintf_filtered (gdb_stdlog,
"Reloc offset: text = 0x%s data = 0x%s bss = 0x%s\n",
paddr_nz (*text_offs),
diff --git a/gdb/source.c b/gdb/source.c
index ae94addb613..749617bb578 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1361,7 +1361,7 @@ forward_search_command (char *regex, int from_tty)
msg = (char *) re_comp (regex);
if (msg)
- error (msg);
+ error ("%s", msg);
if (current_source_symtab == 0)
select_source_symtab (0);
@@ -1457,7 +1457,7 @@ reverse_search_command (char *regex, int from_tty)
msg = (char *) re_comp (regex);
if (msg)
- error (msg);
+ error ("%s", msg);
if (current_source_symtab == 0)
select_source_symtab (0);
diff --git a/gdb/top.c b/gdb/top.c
index 3efebecb3ec..e4f9642fcf4 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1201,9 +1201,9 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
if (annotation_level > 1 && instream == stdin)
{
- printf_unfiltered ("\n\032\032pre-");
- printf_unfiltered (annotation_suffix);
- printf_unfiltered ("\n");
+ puts_unfiltered ("\n\032\032pre-");
+ puts_unfiltered (annotation_suffix);
+ puts_unfiltered ("\n");
}
/* Don't use fancy stuff if not talking to stdin. */
@@ -1222,9 +1222,9 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
if (annotation_level > 1 && instream == stdin)
{
- printf_unfiltered ("\n\032\032post-");
- printf_unfiltered (annotation_suffix);
- printf_unfiltered ("\n");
+ puts_unfiltered ("\n\032\032post-");
+ puts_unfiltered (annotation_suffix);
+ puts_unfiltered ("\n");
}
if (!rl || rl == (char *) EOF)
@@ -1686,7 +1686,7 @@ quit_confirm (void)
else
s = "The program is running. Exit anyway? ";
- if (!query (s))
+ if (!query ("%s", s))
return 0;
}
diff --git a/gdb/utils.c b/gdb/utils.c
index 4dfe89b6428..a7c22eecc6f 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -578,7 +578,7 @@ vwarning (const char *string, va_list args)
wrap_here (""); /* Force out any buffered output */
gdb_flush (gdb_stdout);
if (warning_pre_print)
- fprintf_unfiltered (gdb_stderr, warning_pre_print);
+ fputs_unfiltered (warning_pre_print, gdb_stderr);
vfprintf_unfiltered (gdb_stderr, string, args);
fprintf_unfiltered (gdb_stderr, "\n");
va_end (args);
@@ -644,7 +644,7 @@ error_stream (struct ui_file *stream)
gdb_flush (gdb_stdout);
annotate_error_begin ();
if (error_pre_print)
- fprintf_filtered (gdb_stderr, error_pre_print);
+ fputs_filtered (error_pre_print, gdb_stderr);
ui_file_put (stream, do_write, gdb_stderr);
fprintf_filtered (gdb_stderr, "\n");
@@ -922,7 +922,7 @@ quit (void)
/* Don't use *_filtered; we don't want to prompt the user to continue. */
if (quit_pre_print)
- fprintf_unfiltered (gdb_stderr, quit_pre_print);
+ fputs_unfiltered (quit_pre_print, gdb_stderr);
#ifdef __MSDOS__
/* No steenking SIGINT will ever be coming our way when the
diff --git a/gdb/valprint.c b/gdb/valprint.c
index d4b8bf5faf7..71e391a0908 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -452,9 +452,9 @@ print_floating (char *valaddr, struct type *type, struct ui_file *stream)
if (floatformat_is_negative (fmt, valaddr))
fprintf_filtered (stream, "-");
fprintf_filtered (stream, "nan(");
- fprintf_filtered (stream, local_hex_format_prefix ());
- fprintf_filtered (stream, floatformat_mantissa (fmt, valaddr));
- fprintf_filtered (stream, local_hex_format_suffix ());
+ fputs_filtered (local_hex_format_prefix (), stream);
+ fputs_filtered (floatformat_mantissa (fmt, valaddr), stream);
+ fputs_filtered (local_hex_format_suffix (), stream);
fprintf_filtered (stream, ")");
return;
}
@@ -515,7 +515,7 @@ print_binary_chars (struct ui_file *stream, unsigned char *valaddr,
/* FIXME: We should be not printing leading zeroes in most cases. */
- fprintf_filtered (stream, local_binary_format_prefix ());
+ fputs_filtered (local_binary_format_prefix (), stream);
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = valaddr;
@@ -553,7 +553,7 @@ print_binary_chars (struct ui_file *stream, unsigned char *valaddr,
}
}
}
- fprintf_filtered (stream, local_binary_format_suffix ());
+ fputs_filtered (local_binary_format_suffix (), stream);
}
/* VALADDR points to an integer of LEN bytes.
@@ -602,7 +602,7 @@ print_octal_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len)
cycle = (len * BITS_IN_BYTES) % BITS_IN_OCTAL;
carry = 0;
- fprintf_filtered (stream, local_octal_format_prefix ());
+ fputs_filtered (local_octal_format_prefix (), stream);
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = valaddr;
@@ -701,7 +701,7 @@ print_octal_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len)
}
}
- fprintf_filtered (stream, local_octal_format_suffix ());
+ fputs_filtered (local_octal_format_suffix (), stream);
}
/* VALADDR points to an integer of LEN bytes.
@@ -744,7 +744,7 @@ print_decimal_chars (struct ui_file *stream, unsigned char *valaddr,
digits[i] = 0;
}
- fprintf_filtered (stream, local_decimal_format_prefix ());
+ fputs_filtered (local_decimal_format_prefix (), stream);
/* Ok, we have an unknown number of bytes of data to be printed in
* decimal.
@@ -841,7 +841,7 @@ print_decimal_chars (struct ui_file *stream, unsigned char *valaddr,
}
xfree (digits);
- fprintf_filtered (stream, local_decimal_format_suffix ());
+ fputs_filtered (local_decimal_format_suffix (), stream);
}
/* VALADDR points to an integer of LEN bytes. Print it in hex on stream. */
@@ -853,7 +853,7 @@ print_hex_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len)
/* FIXME: We should be not printing leading zeroes in most cases. */
- fprintf_filtered (stream, local_hex_format_prefix ());
+ fputs_filtered (local_hex_format_prefix (), stream);
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
for (p = valaddr;
@@ -872,7 +872,7 @@ print_hex_chars (struct ui_file *stream, unsigned char *valaddr, unsigned len)
fprintf_filtered (stream, "%02x", *p);
}
}
- fprintf_filtered (stream, local_hex_format_suffix ());
+ fputs_filtered (local_hex_format_suffix (), stream);
}
/* Called by various <lang>_val_print routines to print elements of an