summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-03-23 17:38:13 +0000
committerAndrew Cagney <cagney@redhat.com>2002-03-23 17:38:13 +0000
commit7193a8458a0b0d4ba2034c4925e807d0254e2e38 (patch)
tree086aec1b0e50fd5479c0983b8a3ae42faf6df850 /gdb
parent93144de68489a99918afdb395606d0a033662fbd (diff)
downloadgdb-7193a8458a0b0d4ba2034c4925e807d0254e2e38.tar.gz
* defs.h (error): Add printf format attribute.
* thread-db.c (thread_from_lwp): Fix error format string. * stack.c (parse_frame_specification): Ditto. * cli/cli-decode.c (undef_cmd_error): Ditto. * scm-lang.c (scm_lookup_name): Ditto. * tracepoint.c (trace_error): Ditto. * remote-utils.c (usage): Ditto. * remote.c (compare_sections_command): Ditto. Fix PR gdb/328.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog12
-rw-r--r--gdb/cli/cli-decode.c2
-rw-r--r--gdb/defs.h2
-rw-r--r--gdb/remote-utils.c2
-rw-r--r--gdb/remote.c4
-rw-r--r--gdb/scm-lang.c2
-rw-r--r--gdb/stack.c2
-rw-r--r--gdb/thread-db.c2
-rw-r--r--gdb/tracepoint.c2
9 files changed, 21 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3940517aaf0..ae8c7e04fe9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,15 @@
+2002-03-23 Andrew Cagney <cagney@redhat.com>
+
+ * defs.h (error): Add printf format attribute.
+ * thread-db.c (thread_from_lwp): Fix error format string.
+ * stack.c (parse_frame_specification): Ditto.
+ * cli/cli-decode.c (undef_cmd_error): Ditto.
+ * scm-lang.c (scm_lookup_name): Ditto.
+ * tracepoint.c (trace_error): Ditto.
+ * remote-utils.c (usage): Ditto.
+ * remote.c (compare_sections_command): Ditto.
+ Fix PR gdb/328.
+
2002-03-22 Andrew Cagney <ac131313@redhat.com>
* gdbtypes.c (append_composite_type_field): New function.
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 28db5f99005..d96a4d17c77 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -975,7 +975,7 @@ undef_cmd_error (char *cmdtype, char *q)
cmdtype,
q,
*cmdtype ? " " : "",
- strlen (cmdtype) - 1,
+ (int) strlen (cmdtype) - 1,
cmdtype);
}
diff --git a/gdb/defs.h b/gdb/defs.h
index a3ee3348ab9..996c8fcbcb2 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -866,7 +866,7 @@ extern char *warning_pre_print;
extern NORETURN void verror (const char *fmt, va_list ap) ATTR_NORETURN;
-extern NORETURN void error (const char *fmt, ...) ATTR_NORETURN;
+extern NORETURN void error (const char *fmt, ...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
extern NORETURN void error_stream (struct ui_file *) ATTR_NORETURN;
diff --git a/gdb/remote-utils.c b/gdb/remote-utils.c
index e703f3dee35..ba150e34d5d 100644
--- a/gdb/remote-utils.c
+++ b/gdb/remote-utils.c
@@ -86,7 +86,7 @@ usage (char *proto, char *junk)
fprintf_unfiltered (gdb_stderr, "Unrecognized arguments: `%s'.\n", junk);
error ("Usage: target %s [DEVICE [SPEED [DEBUG]]]\n\
-where DEVICE is the name of a device or HOST:PORT", proto, proto);
+where DEVICE is the name of a device or HOST:PORT", proto);
return;
}
diff --git a/gdb/remote.c b/gdb/remote.c
index 2d70baf9b78..89bed2c3b18 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -5013,8 +5013,8 @@ compare_sections_command (char *args, int from_tty)
getpkt (buf, (rs->remote_packet_size), 0);
if (buf[0] == 'E')
- error ("target memory fault, section %s, range 0x%08x -- 0x%08x",
- sectname, lma, lma + size);
+ error ("target memory fault, section %s, range 0x%s -- 0x%s",
+ sectname, paddr (lma), paddr (lma + size));
if (buf[0] != 'C')
error ("remote target does not support this operation");
diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c
index 30ca763c1da..00d679730cd 100644
--- a/gdb/scm-lang.c
+++ b/gdb/scm-lang.c
@@ -180,7 +180,7 @@ scm_lookup_name (char *str)
(struct symtab **) NULL);
if (sym)
return value_of_variable (sym, NULL);
- error ("No symbol \"%s\" in current context.");
+ error ("No symbol \"%s\" in current context.", str);
}
struct value *
diff --git a/gdb/stack.c b/gdb/stack.c
index 68f16b653c3..2fe6e420b0b 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -704,7 +704,7 @@ parse_frame_specification (char *frame_exp)
really should be used instead of spaces to delimit; using spaces
normally works in an expression). */
#ifdef SETUP_ARBITRARY_FRAME
- error ("No frame %d", args[0]);
+ error ("No frame %s", paddr_d (args[0]));
#endif
/* If (s)he specifies the frame with an address, he deserves what
diff --git a/gdb/thread-db.c b/gdb/thread-db.c
index 2e7620ec48d..d38db74b4b1 100644
--- a/gdb/thread-db.c
+++ b/gdb/thread-db.c
@@ -239,7 +239,7 @@ thread_from_lwp (ptid_t ptid)
err = td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), &th);
if (err != TD_OK)
- error ("Cannot find user-level thread for LWP %d: %s",
+ error ("Cannot find user-level thread for LWP %ld: %s",
GET_LWP (ptid), thread_db_err_str (err));
err = td_thr_get_info_p (&th, &ti);
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 5809accdcd9..41c52d33d98 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -190,7 +190,7 @@ trace_error (char *buf)
if (*++buf == '0') /* general case: */
error ("tracepoint.c: error in outgoing packet.");
else
- error ("tracepoint.c: error in outgoing packet at field #%d.",
+ error ("tracepoint.c: error in outgoing packet at field #%ld.",
strtol (buf, NULL, 16));
case '2':
error ("trace API error 0x%s.", ++buf);