From: Jan Kratochvil Date: Sun, 2 May 2010 23:52:14 +0000 (+0000) Subject: gdb/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c25c4a8b0e4a21b527424fa7f0675a858bf0a9e6;p=binutils-gdb.git gdb/ * cli/cli-cmds.h (error_no_arg): Remove. Move the comment ... * command.h (error_no_arg): ... here. Remove NORETURN, change ATTR_NORETURN to ATTRIBUTE_NORETURN. * defs.h (NORETURN, ATTR_NORETURN): Remove. (perror_with_name, verror, error, error_stream, vfatal, fatal) (internal_verror, internal_error, nomem): Remove NORETURN, change ATTR_NORETURN to ATTRIBUTE_NORETURN. * exceptions.c (throw_exception, deprecated_throw_reason, throw_verror) (throw_vfatal, throw_error): Remove NORETURN. (throw_it): Remove NORETURN, change ATTR_NORETURN to ATTRIBUTE_NORETURN. * exceptions.h (throw_exception, throw_verror, throw_vfatal) (throw_error, deprecated_throw_reason): Remove NORETURN, change ATTR_NORETURN to ATTRIBUTE_NORETURN. * linespec.c (cplusplus_error): Remove NORETURN, change ATTR_NORETURN to ATTRIBUTE_NORETURN for prototype, for the definition only remove NORETURN. * remote-mips.c (mips_error): Change NORETURN to ATTRIBUTE_NORETURN. * remote-sim.c (gdb_os_error): Change ATTR_NORETURN to ATTRIBUTE_NORETURN. * target.c (tcomplain): Likewise. * target.h (noprocess): Remove NORETURN, change ATTR_NORETURN to ATTRIBUTE_NORETURN. * utils.c (verror, error, vfatal, fatal, error_stream, internal_verror) (internal_error, perror_with_name, nomem): Remove NORETURN. * xml-support.h (gdb_xml_error): Change ATTR_NORETURN to ATTRIBUTE_NORETURN. gdb/doc/ * gdbint.texinfo (Host Definition): Remove items NORETURN and ATTR_NORETURN. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 96a88e51822..206a4365b2b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,32 @@ +2010-05-02 Jan Kratochvil + + * cli/cli-cmds.h (error_no_arg): Remove. Move the comment ... + * command.h (error_no_arg): ... here. Remove NORETURN, change + ATTR_NORETURN to ATTRIBUTE_NORETURN. + * defs.h (NORETURN, ATTR_NORETURN): Remove. + (perror_with_name, verror, error, error_stream, vfatal, fatal) + (internal_verror, internal_error, nomem): Remove NORETURN, change + ATTR_NORETURN to ATTRIBUTE_NORETURN. + * exceptions.c (throw_exception, deprecated_throw_reason, throw_verror) + (throw_vfatal, throw_error): Remove NORETURN. + (throw_it): Remove NORETURN, change ATTR_NORETURN to ATTRIBUTE_NORETURN. + * exceptions.h (throw_exception, throw_verror, throw_vfatal) + (throw_error, deprecated_throw_reason): Remove NORETURN, change + ATTR_NORETURN to ATTRIBUTE_NORETURN. + * linespec.c (cplusplus_error): Remove NORETURN, change ATTR_NORETURN + to ATTRIBUTE_NORETURN for prototype, for the definition only remove + NORETURN. + * remote-mips.c (mips_error): Change NORETURN to ATTRIBUTE_NORETURN. + * remote-sim.c (gdb_os_error): Change ATTR_NORETURN to + ATTRIBUTE_NORETURN. + * target.c (tcomplain): Likewise. + * target.h (noprocess): Remove NORETURN, change ATTR_NORETURN to + ATTRIBUTE_NORETURN. + * utils.c (verror, error, vfatal, fatal, error_stream, internal_verror) + (internal_error, perror_with_name, nomem): Remove NORETURN. + * xml-support.h (gdb_xml_error): Change ATTR_NORETURN to + ATTRIBUTE_NORETURN. + 2010-05-02 Jan Kratochvil * ada-lang.c (lim_warning): Change ATTR_FORMAT to ATTRIBUTE_PRINTF. diff --git a/gdb/cli/cli-cmds.h b/gdb/cli/cli-cmds.h index 9446f93dc5b..596870e0a3e 100644 --- a/gdb/cli/cli-cmds.h +++ b/gdb/cli/cli-cmds.h @@ -128,11 +128,6 @@ extern void source_script (char *, int); extern int find_and_open_script (const char *file, int search_path, FILE **streamp, char **full_path); -/* Used everywhere whenever at least one parameter is required and - none is specified. */ - -extern NORETURN void error_no_arg (char *) ATTR_NORETURN; - /* Command tracing state. */ extern int source_verbose; diff --git a/gdb/command.h b/gdb/command.h index a746c8251c7..f53dc3e75ca 100644 --- a/gdb/command.h +++ b/gdb/command.h @@ -341,7 +341,10 @@ extern void add_setshow_zuinteger_cmd (char *name, extern void cmd_show_list (struct cmd_list_element *, int, char *); -extern NORETURN void error_no_arg (char *) ATTR_NORETURN; +/* Used everywhere whenever at least one parameter is required and + none is specified. */ + +extern void error_no_arg (char *) ATTRIBUTE_NORETURN; extern void dont_repeat (void); diff --git a/gdb/defs.h b/gdb/defs.h index c58f6987c94..b18e03fdf53 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -267,36 +267,6 @@ struct cleanup void *arg; }; - -/* The ability to declare that a function never returns is useful, but - not really required to compile GDB successfully, so the NORETURN and - ATTR_NORETURN macros normally expand into nothing. */ - -/* If compiling with older versions of GCC, a function may be declared - "volatile" to indicate that it does not return. */ - -#ifndef NORETURN -#if defined(__GNUC__) \ - && (__GNUC__ == 1 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)) -#define NORETURN volatile -#else -#define NORETURN /* nothing */ -#endif -#endif - -/* GCC 2.5 and later versions define a function attribute "noreturn", - which is the preferred way to declare that a function never returns. - However GCC 2.7 appears to be the first version in which this fully - works everywhere we use it. */ - -#ifndef ATTR_NORETURN -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) -#define ATTR_NORETURN __attribute__ ((noreturn)) -#else -#define ATTR_NORETURN /* nothing */ -#endif -#endif - /* Be conservative and use enum bitfields only with GCC. This is copied from gcc 3.3.1, system.h. */ @@ -552,7 +522,7 @@ extern char *hex_string_custom (LONGEST, int); extern void fprintf_symbol_filtered (struct ui_file *, char *, enum language, int); -extern NORETURN void perror_with_name (const char *) ATTR_NORETURN; +extern void perror_with_name (const char *) ATTRIBUTE_NORETURN; extern void print_sys_errmsg (const char *, int); @@ -921,24 +891,26 @@ extern char *quit_pre_print; extern char *warning_pre_print; -extern NORETURN void verror (const char *fmt, va_list ap) - ATTR_NORETURN ATTRIBUTE_PRINTF (1, 0); +extern void verror (const char *fmt, va_list ap) + ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 0); -extern NORETURN void error (const char *fmt, ...) ATTR_NORETURN ATTRIBUTE_PRINTF (1, 2); +extern void error (const char *fmt, ...) + ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2); -extern NORETURN void error_stream (struct ui_file *) ATTR_NORETURN; +extern void error_stream (struct ui_file *) ATTRIBUTE_NORETURN; -extern NORETURN void vfatal (const char *fmt, va_list ap) - ATTR_NORETURN ATTRIBUTE_PRINTF (1, 0); +extern void vfatal (const char *fmt, va_list ap) + ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 0); -extern NORETURN void fatal (const char *fmt, ...) ATTR_NORETURN ATTRIBUTE_PRINTF (1, 2); +extern void fatal (const char *fmt, ...) + ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2); -extern NORETURN void internal_verror (const char *file, int line, - const char *, va_list ap) - ATTR_NORETURN ATTRIBUTE_PRINTF (3, 0); +extern void internal_verror (const char *file, int line, const char *, + va_list ap) + ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (3, 0); -extern NORETURN void internal_error (const char *file, int line, - const char *, ...) ATTR_NORETURN ATTRIBUTE_PRINTF (3, 4); +extern void internal_error (const char *file, int line, const char *, ...) + ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (3, 4); extern void internal_vwarning (const char *file, int line, const char *, va_list ap) @@ -947,7 +919,7 @@ extern void internal_vwarning (const char *file, int line, extern void internal_warning (const char *file, int line, const char *, ...) ATTRIBUTE_PRINTF (3, 4); -extern NORETURN void nomem (long) ATTR_NORETURN; +extern void nomem (long) ATTRIBUTE_NORETURN; extern void warning (const char *, ...) ATTRIBUTE_PRINTF (1, 2); diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index b390c9c1ff7..eb4609815f5 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,8 +1,13 @@ +2010-05-02 Jan Kratochvil + + * gdbint.texinfo (Host Definition): Remove items NORETURN and + ATTR_NORETURN. + 2010-04-29 Phil Muldoon - Tom Tromey - Thiago Jung Bauermann + Tom Tromey + Thiago Jung Bauermann - * gdb.texinfo (Parameters In Python): New Node. + * gdb.texinfo (Parameters In Python): New Node. 2010-04-29 Mihail Zenkov diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index d9a4a9590f2..26719e6ee35 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -2784,19 +2784,6 @@ Define this if @code{lseek (n)} does not necessarily move to byte number @code{n} in the file. This is only used when reading source files. It is normally faster to define @code{CRLF_SOURCE_FILES} when possible. -@item NORETURN -If defined, this should be one or more tokens, such as @code{volatile}, -that can be used in both the declaration and definition of functions to -indicate that they never return. The default is already set correctly -if compiling with GCC. This will almost never need to be defined. - -@item ATTR_NORETURN -If defined, this should be one or more tokens, such as -@code{__attribute__ ((noreturn))}, that can be used in the declarations -of functions to indicate that they never return. The default is already -set correctly if compiling with GCC. This will almost never need to be -defined. - @item lint Define this to help placate @code{lint} in some situations. diff --git a/gdb/exceptions.c b/gdb/exceptions.c index 5f672240246..444db504b16 100644 --- a/gdb/exceptions.c +++ b/gdb/exceptions.c @@ -210,7 +210,7 @@ exceptions_state_mc_action_iter_1 (void) /* Return EXCEPTION to the nearest containing catch_errors(). */ -NORETURN void +void throw_exception (struct gdb_exception exception) { struct thread_info *tp = NULL; @@ -239,7 +239,7 @@ throw_exception (struct gdb_exception exception) static char *last_message; -NORETURN void +void deprecated_throw_reason (enum return_reason reason) { struct gdb_exception exception; @@ -374,7 +374,7 @@ print_any_exception (struct ui_file *file, const char *prefix, } } -NORETURN static void ATTR_NORETURN ATTRIBUTE_PRINTF (3, 0) +static void ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (3, 0) throw_it (enum return_reason reason, enum errors error, const char *fmt, va_list ap) { @@ -396,19 +396,19 @@ throw_it (enum return_reason reason, enum errors error, const char *fmt, throw_exception (e); } -NORETURN void +void throw_verror (enum errors error, const char *fmt, va_list ap) { throw_it (RETURN_ERROR, error, fmt, ap); } -NORETURN void +void throw_vfatal (const char *fmt, va_list ap) { throw_it (RETURN_QUIT, GDB_NO_ERROR, fmt, ap); } -NORETURN void +void throw_error (enum errors error, const char *fmt, ...) { va_list args; diff --git a/gdb/exceptions.h b/gdb/exceptions.h index e5b8adeddd8..7d68a36a219 100644 --- a/gdb/exceptions.h +++ b/gdb/exceptions.h @@ -166,17 +166,18 @@ extern void exception_fprintf (struct ui_file *file, struct gdb_exception e, be a good thing or a dangerous thing.'' -- the Existential 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 ATTRIBUTE_PRINTF (2, 0); -extern NORETURN void throw_vfatal (const char *fmt, va_list ap) - ATTR_NORETURN ATTRIBUTE_PRINTF (1, 0); -extern NORETURN void throw_error (enum errors error, const char *fmt, - ...) ATTR_NORETURN ATTRIBUTE_PRINTF (2, 3); +extern void throw_exception (struct gdb_exception exception) ATTRIBUTE_NORETURN; +extern void throw_verror (enum errors, const char *fmt, va_list ap) + ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (2, 0); +extern void throw_vfatal (const char *fmt, va_list ap) + ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 0); +extern void throw_error (enum errors error, const char *fmt, ...) + ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (2, 3); /* Instead of deprecated_throw_reason, code should use catch_exception and throw_exception. */ -extern NORETURN void deprecated_throw_reason (enum return_reason reason) ATTR_NORETURN; +extern void deprecated_throw_reason (enum return_reason reason) + ATTRIBUTE_NORETURN; /* Call FUNC(UIOUT, FUNC_ARGS) but wrapped within an exception handler. If an exception (enum return_reason) is thrown using diff --git a/gdb/linespec.c b/gdb/linespec.c index 00203a18e51..8cd480e95f9 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -78,9 +78,8 @@ static struct symtabs_and_lines find_method (int funfirstline, struct symbol *sym_class, int *not_found_ptr); -static NORETURN void cplusplus_error (const char *name, - const char *fmt, ...) - ATTR_NORETURN ATTRIBUTE_PRINTF (2, 3); +static void cplusplus_error (const char *name, const char *fmt, ...) + ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (2, 3); static int total_number_of_methods (struct type *type); @@ -146,7 +145,7 @@ symtabs_and_lines minsym_found (int funfirstline, single quoted demangled C++ symbols as part of the completion error. */ -static NORETURN void +static void cplusplus_error (const char *name, const char *fmt, ...) { struct ui_file *tmp_stream; diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index 3e123657c52..3da10423bff 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -473,7 +473,7 @@ close_ports (void) all hell to break loose--the rest of GDB will tend to get left in an inconsistent state. */ -static NORETURN void +static void ATTRIBUTE_NORETURN mips_error (char *string,...) { va_list args; diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 53f31090717..ac7b0438ff7 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -70,7 +70,8 @@ static void gdb_os_vprintf_filtered (host_callback *, const char *, va_list); static void gdb_os_evprintf_filtered (host_callback *, const char *, va_list); -static void gdb_os_error (host_callback *, const char *, ...) ATTR_NORETURN; +static void gdb_os_error (host_callback *, const char *, ...) + ATTRIBUTE_NORETURN; static void gdbsim_kill (struct target_ops *); diff --git a/gdb/target.c b/gdb/target.c index f93a706babe..fec11abb39d 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -56,7 +56,7 @@ static int default_region_ok_for_hw_watchpoint (CORE_ADDR, int); static int nosymbol (char *, CORE_ADDR *); -static void tcomplain (void) ATTR_NORETURN; +static void tcomplain (void) ATTRIBUTE_NORETURN; static int nomemory (CORE_ADDR, char *, int, int, struct target_ops *); diff --git a/gdb/target.h b/gdb/target.h index 272571b7502..d4bd00759b0 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -1485,7 +1485,7 @@ extern int default_memory_insert_breakpoint (struct gdbarch *, struct bp_target_ extern void initialize_targets (void); -extern NORETURN void noprocess (void) ATTR_NORETURN; +extern void noprocess (void) ATTRIBUTE_NORETURN; extern void target_require_runnable (void); diff --git a/gdb/utils.c b/gdb/utils.c index fcffabe836d..b4b85b1f344 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -806,13 +806,13 @@ warning (const char *string, ...) The first argument STRING is the error message, used as a fprintf string, and the remaining args are passed as arguments to it. */ -NORETURN void +void verror (const char *string, va_list args) { throw_verror (GENERIC_ERROR, string, args); } -NORETURN void +void error (const char *string, ...) { va_list args; @@ -825,13 +825,13 @@ error (const char *string, ...) The first argument STRING is the error message, used as a fprintf string, and the remaining args are passed as arguments to it. */ -NORETURN void +void vfatal (const char *string, va_list args) { throw_vfatal (string, args); } -NORETURN void +void fatal (const char *string, ...) { va_list args; @@ -840,7 +840,7 @@ fatal (const char *string, ...) va_end (args); } -NORETURN void +void error_stream (struct ui_file *stream) { char *message = ui_file_xstrdup (stream, NULL); @@ -1036,14 +1036,14 @@ static struct internal_problem internal_error_problem = { "internal-error", internal_problem_ask, internal_problem_ask }; -NORETURN void +void internal_verror (const char *file, int line, const char *fmt, va_list ap) { internal_vproblem (&internal_error_problem, file, line, fmt, ap); deprecated_throw_reason (RETURN_ERROR); } -NORETURN void +void internal_error (const char *file, int line, const char *string, ...) { va_list ap; @@ -1174,7 +1174,7 @@ Show whether GDB will create a core file of GDB when %s is detected"), as the file name for which the error was encountered. Then return to command level. */ -NORETURN void +void perror_with_name (const char *string) { char *err; @@ -1240,7 +1240,7 @@ quit (void) /* Called when a memory allocation fails, with the number of bytes of memory requested in SIZE. */ -NORETURN void +void nomem (long size) { if (size > 0) diff --git a/gdb/xml-support.h b/gdb/xml-support.h index 64672c3aecc..1f438cf5acc 100644 --- a/gdb/xml-support.h +++ b/gdb/xml-support.h @@ -205,7 +205,7 @@ void gdb_xml_debug (struct gdb_xml_parser *parser, const char *format, ...) parsing. */ void gdb_xml_error (struct gdb_xml_parser *parser, const char *format, ...) - ATTR_NORETURN ATTRIBUTE_PRINTF (2, 0); + ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (2, 0); /* Parse an integer attribute into a ULONGEST. */