+2005-07-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * cli-out.c (cli_field_fmt, cli_message, out_field_fmt): Add
+ ATTR_FORMAT or ATTRIBUTE_FPTR_PRINTF.
+ * complaints.c (vcomplaint): Likewise.
+ * defs.h (xvasprintf, xstrvprintf, verror, vfatal)
+ (internal_verror, internal_vwarning, vwarning)
+ (deprecated_query_hook, deprecated_warning_hook)
+ (deprecated_readline_begin_hook): Likewise.
+ * disasm.c (fprintf_disasm): Likewise.
+ * exceptions.c (throw_it): Likewise.
+ * exceptions.h (throw_verror, throw_vfatal): Likewise.
+ * mi/mi-interp.c (mi_interp_query_hook): Likewise.
+ * mi/mi-out.c (mi_field_fmt, mi_message): Likewise.
+ * tui/tui-hooks.c (tui_query_hook): Likewise.
+ * tui/tui-out.c (tui_field_fmt, tui_message, out_field_fmt):
+ Likewise.
+ * ui-out.c (default_field_fmt, default_message, uo_field_fmt)
+ (uo_message): Likewise.
+ * ui-out.h (ui_out_field_fmt, ui_out_message, field_fmt_ftype)
+ (message_ftype): Likewise.
+ * utils.c (vfprintf_maybe_filtered, internal_vproblem)
+ (defaulted_query, printchar): Likewise.
+
2005-07-26 Mark Kettenis <kettenis@gnu.org>
* i386obsd-tdep.c (i386obsd_sigreturn_offset): New variable.
/* Output generating routines for GDB CLI.
- Copyright 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2002, 2003, 2005
+ Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
Written by Fernando Nasser for Cygnus.
static void cli_field_fmt (struct ui_out *uiout, int fldno,
int width, enum ui_align align,
const char *fldname, const char *format,
- va_list args);
+ va_list args) ATTR_FORMAT (printf, 6, 0);
static void cli_spaces (struct ui_out *uiout, int numspaces);
static void cli_text (struct ui_out *uiout, const char *string);
static void cli_message (struct ui_out *uiout, int verbosity,
- const char *format, va_list args);
+ const char *format, va_list args)
+ ATTR_FORMAT (printf, 3, 0);
static void cli_wrap_hint (struct ui_out *uiout, char *identstring);
static void cli_flush (struct ui_out *uiout);
static int cli_redirect (struct ui_out *uiout, struct ui_file *outstream);
static void out_field_fmt (struct ui_out *uiout, int fldno,
const char *fldname,
- const char *format,...);
+ const char *format,...) ATTR_FORMAT (printf, 4, 5);
/* local variables */
/* Support for complaint handling during symbol reading in GDB.
Copyright 1990, 1991, 1992, 1993, 1995, 1998, 1999, 2000, 2002,
- 2004 Free Software Foundation, Inc.
+ 2004, 2005 Free Software Foundation, Inc.
This file is part of GDB.
/* Print a complaint, and link the complaint block into a chain for
later handling. */
-static void
+static void ATTR_FORMAT (printf, 4, 0)
vcomplaint (struct complaints **c, const char *file, int line, const char *fmt,
va_list args)
{
/* Like asprintf/vasprintf but get an internal_error if the call
fails. */
extern void xasprintf (char **ret, const char *format, ...) ATTR_FORMAT (printf, 2, 3);
-extern void xvasprintf (char **ret, const char *format, va_list ap);
+extern void xvasprintf (char **ret, const char *format, va_list ap)
+ ATTR_FORMAT (printf, 2, 0);
/* Like asprintf and vasprintf, but return the string, throw an error
if no memory. */
extern char *xstrprintf (const char *format, ...) ATTR_FORMAT (printf, 1, 2);
-extern char *xstrvprintf (const char *format, va_list ap);
+extern char *xstrvprintf (const char *format, va_list ap)
+ ATTR_FORMAT (printf, 1, 0);
/* Like snprintf, but throw an error if the output buffer is too small. */
extern int xsnprintf (char *str, size_t size, const char *format, ...)
extern char *warning_pre_print;
-extern NORETURN void verror (const char *fmt, va_list ap) ATTR_NORETURN;
+extern NORETURN void verror (const char *fmt, va_list ap)
+ ATTR_NORETURN ATTR_FORMAT (printf, 1, 0);
extern NORETURN void error (const char *fmt, ...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
extern NORETURN void error_stream (struct ui_file *) ATTR_NORETURN;
-extern NORETURN void vfatal (const char *fmt, va_list ap) ATTR_NORETURN;
+extern NORETURN void vfatal (const char *fmt, va_list ap)
+ ATTR_NORETURN ATTR_FORMAT (printf, 1, 0);
extern NORETURN void fatal (const char *fmt, ...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
extern NORETURN void internal_verror (const char *file, int line,
- const char *, va_list ap) ATTR_NORETURN;
+ const char *, va_list ap)
+ ATTR_NORETURN ATTR_FORMAT (printf, 3, 0);
extern NORETURN void internal_error (const char *file, int line,
const char *, ...) ATTR_NORETURN ATTR_FORMAT (printf, 3, 4);
extern void internal_vwarning (const char *file, int line,
- const char *, va_list ap);
+ const char *, va_list ap)
+ ATTR_FORMAT (printf, 3, 0);
extern void internal_warning (const char *file, int line,
const char *, ...) ATTR_FORMAT (printf, 3, 4);
extern void warning (const char *, ...) ATTR_FORMAT (printf, 1, 2);
-extern void vwarning (const char *, va_list args);
+extern void vwarning (const char *, va_list args) ATTR_FORMAT (printf, 1, 0);
/* List of known OS ABIs. If you change this, make sure to update the
table in osabi.c. */
int line, int stopline,
int noerror);
extern struct frame_info *parse_frame_specification (char *frame_exp);
-extern int (*deprecated_query_hook) (const char *, va_list);
-extern void (*deprecated_warning_hook) (const char *, va_list);
+extern int (*deprecated_query_hook) (const char *, va_list)
+ ATTRIBUTE_FPTR_PRINTF(1,0);
+extern void (*deprecated_warning_hook) (const char *, va_list)
+ ATTRIBUTE_FPTR_PRINTF(1,0);
extern void (*deprecated_flush_hook) (struct ui_file * stream);
extern void (*deprecated_create_breakpoint_hook) (struct breakpoint * b);
extern void (*deprecated_delete_breakpoint_hook) (struct breakpoint * bpt);
extern void (*deprecated_modify_breakpoint_hook) (struct breakpoint * bpt);
extern void (*deprecated_interactive_hook) (void);
extern void (*deprecated_registers_changed_hook) (void);
-extern void (*deprecated_readline_begin_hook) (char *,...);
+extern void (*deprecated_readline_begin_hook) (char *, ...)
+ ATTRIBUTE_FPTR_PRINTF_1;
extern char *(*deprecated_readline_hook) (char *);
extern void (*deprecated_readline_end_hook) (void);
extern void (*deprecated_register_changed_hook) (int regno);
/* Disassemble support for GDB.
- Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
This file is part of GDB.
/* Initialize the disassemble info struct ready for the specified
stream. */
-static int
+static int ATTR_FORMAT (printf, 2, 3)
fprintf_disasm (void *stream, const char *format, ...)
{
va_list args;
}
}
-NORETURN static void
-throw_it (enum return_reason reason, enum errors error, const char *fmt,
- va_list ap) ATTR_NORETURN;
-NORETURN static void
+NORETURN static void ATTR_NORETURN ATTR_FORMAT (printf, 3, 0)
throw_it (enum return_reason reason, enum errors error, const char *fmt,
va_list ap)
{
Wombat. */
extern NORETURN void throw_exception (struct gdb_exception exception) ATTR_NORETURN;
-extern NORETURN void throw_verror (enum errors, const char *fmt,
- va_list ap) ATTR_NORETURN;
-extern NORETURN void throw_vfatal (const char *fmt, va_list ap) ATTR_NORETURN;
+extern NORETURN void throw_verror (enum errors, const char *fmt, va_list ap)
+ ATTR_NORETURN ATTR_FORMAT (printf, 2, 0);
+extern NORETURN void throw_vfatal (const char *fmt, va_list ap)
+ ATTR_NORETURN ATTR_FORMAT (printf, 1, 0);
extern NORETURN void throw_error (enum errors error, const char *fmt,
...) ATTR_NORETURN ATTR_FORMAT (printf, 2, 3);
+2005-07-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * server.h (error, fatal, warning): Add ATTR_FORMAT.
+
2005-07-13 Daniel Jacobowitz <dan@codesourcery.com>
* configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS
/* Functions from utils.c */
void perror_with_name (char *string);
-void error (const char *string,...) ATTR_NORETURN;
-void fatal (const char *string,...) ATTR_NORETURN;
-void warning (const char *string,...);
+void error (const char *string,...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
+void fatal (const char *string,...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
+void warning (const char *string,...) ATTR_FORMAT (printf, 1, 2);
/* Functions from the register cache definition. */
/* MI Interpreter Definitions and Commands for GDB, the GNU debugger.
- Copyright 2002, 2003, 2003 Free Software Foundation, Inc.
+ Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GDB.
/* These are hooks that we put in place while doing interpreter_exec
so we can report interesting things that happened "behind the mi's
back" in this command */
-static int mi_interp_query_hook (const char *ctlstr, va_list ap);
+static int mi_interp_query_hook (const char *ctlstr, va_list ap)
+ ATTR_FORMAT (printf, 1, 0);
static void mi3_command_loop (void);
static void mi2_command_loop (void);
/* MI Command Set - output generating routines.
- Copyright 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Cygnus Solutions (a Red Hat company).
static void mi_field_fmt (struct ui_out *uiout, int fldno,
int width, enum ui_align align,
const char *fldname, const char *format,
- va_list args);
+ va_list args) ATTR_FORMAT (printf, 6, 0);
static void mi_spaces (struct ui_out *uiout, int numspaces);
static void mi_text (struct ui_out *uiout, const char *string);
static void mi_message (struct ui_out *uiout, int verbosity,
- const char *format, va_list args);
+ const char *format, va_list args)
+ ATTR_FORMAT (printf, 3, 0);
static void mi_wrap_hint (struct ui_out *uiout, char *identstring);
static void mi_flush (struct ui_out *uiout);
/* GDB hooks for TUI.
- Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GDB.
tui_target_new_objfile_chain (objfile);
}
-static int
+static int ATTR_FORMAT (printf, 1, 0)
tui_query_hook (const char * msg, va_list argp)
{
int retval;
/* Output generating routines for GDB CLI.
- Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
- Inc.
+ Copyright 1999, 2000, 2001, 2002, 2003, 2005
+ Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
Written by Fernando Nasser for Cygnus.
static void tui_field_fmt (struct ui_out *uiout, int fldno,
int width, enum ui_align align,
const char *fldname, const char *format,
- va_list args);
+ va_list args) ATTR_FORMAT (printf, 6, 0);
static void tui_spaces (struct ui_out *uiout, int numspaces);
static void tui_text (struct ui_out *uiout, const char *string);
static void tui_message (struct ui_out *uiout, int verbosity,
- const char *format, va_list args);
+ const char *format, va_list args)
+ ATTR_FORMAT (printf, 3, 0);
static void tui_wrap_hint (struct ui_out *uiout, char *identstring);
static void tui_flush (struct ui_out *uiout);
static void out_field_fmt (struct ui_out *uiout, int fldno,
const char *fldname,
- const char *format,...);
+ const char *format,...) ATTR_FORMAT (printf, 4, 5);
/* local variables */
/* Output generating routines for GDB.
- Copyright 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002, 2004, 2005
+ Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
Written by Fernando Nasser for Cygnus.
int width, enum ui_align align,
const char *fldname,
const char *format,
- va_list args);
+ va_list args) ATTR_FORMAT (printf, 6, 0);
static void default_spaces (struct ui_out *uiout, int numspaces);
static void default_text (struct ui_out *uiout, const char *string);
static void default_message (struct ui_out *uiout, int verbosity,
const char *format,
- va_list args);
+ va_list args) ATTR_FORMAT (printf, 3, 0);
static void default_wrap_hint (struct ui_out *uiout, char *identstring);
static void default_flush (struct ui_out *uiout);
const char *string);
static void uo_field_fmt (struct ui_out *uiout, int fldno, int width,
enum ui_align align, const char *fldname,
- const char *format, va_list args);
+ const char *format, va_list args)
+ ATTR_FORMAT (printf, 6, 0);
static void uo_spaces (struct ui_out *uiout, int numspaces);
static void uo_text (struct ui_out *uiout, const char *string);
static void uo_message (struct ui_out *uiout, int verbosity,
- const char *format, va_list args);
+ const char *format, va_list args)
+ ATTR_FORMAT (printf, 3, 0);
static void uo_wrap_hint (struct ui_out *uiout, char *identstring);
static void uo_flush (struct ui_out *uiout);
static int uo_redirect (struct ui_out *uiout, struct ui_file *outstream);
/* Output generating routines for GDB.
- Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright 1999, 2000, 2001, 2002, 2003, 2005
+ Free Software Foundation, Inc.
+
Contributed by Cygnus Solutions.
Written by Fernando Nasser for Cygnus.
struct ui_stream *buf);
extern void ui_out_field_fmt (struct ui_out *uiout, const char *fldname,
- const char *format, ...);
+ const char *format, ...)
+ ATTR_FORMAT (printf, 3, 4);
extern void ui_out_field_skip (struct ui_out *uiout, const char *fldname);
extern void ui_out_text (struct ui_out *uiout, const char *string);
extern void ui_out_message (struct ui_out *uiout, int verbosity,
- const char *format, ...);
+ const char *format, ...)
+ ATTR_FORMAT (printf, 3, 4);
extern struct ui_stream *ui_out_stream_new (struct ui_out *uiout);
enum ui_align align,
const char *fldname,
const char *format,
- va_list args);
+ va_list args) ATTRIBUTE_FPTR_PRINTF(6,0);
typedef void (spaces_ftype) (struct ui_out * uiout, int numspaces);
typedef void (text_ftype) (struct ui_out * uiout,
const char *string);
typedef void (message_ftype) (struct ui_out * uiout, int verbosity,
- const char *format, va_list args);
+ const char *format, va_list args)
+ ATTRIBUTE_FPTR_PRINTF(3,0);
typedef void (wrap_hint_ftype) (struct ui_out * uiout, char *identstring);
typedef void (flush_ftype) (struct ui_out * uiout);
typedef int (redirect_ftype) (struct ui_out * uiout,
/* Prototypes for local functions */
static void vfprintf_maybe_filtered (struct ui_file *, const char *,
- va_list, int);
+ va_list, int) ATTR_FORMAT (printf, 2, 0);
static void fputs_maybe_filtered (const char *, struct ui_file *, int);
has been reported, and assuming GDB didn't quit, the caller can
either allow execution to resume or throw an error. */
-static void
+static void ATTR_FORMAT (printf, 4, 0)
internal_vproblem (struct internal_problem *problem,
const char *file, int line, const char *fmt, va_list ap)
{
ARGS are the arguments passed along with the CTLSTR argument to
printf. */
-static int
+static int ATTR_FORMAT (printf, 1, 0)
defaulted_query (const char *ctlstr, const char defchar, va_list args)
{
int answer;
static void
printchar (int c, void (*do_fputs) (const char *, struct ui_file *),
- void (*do_fprintf) (struct ui_file *, const char *, ...),
- struct ui_file *stream, int quoter)
+ void (*do_fprintf) (struct ui_file *, const char *, ...)
+ ATTRIBUTE_FPTR_PRINTF_2, struct ui_file *stream, int quoter)
{
c &= 0xFF; /* Avoid sign bit follies */