mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-21 01:12:32 +08:00
Move exception_none to common code, and use it
gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * common/common-exceptions.h (exception_none): Declare. * common/common-exceptions.c (exception_none): Moved from exceptions.c. (exceptions_state_mc_init): Use exception_none. * exceptions.c (exception_none): Move to common/common-exceptions.c. * exceptions.h (exception_none): Move to common/common-exceptions.h.
This commit is contained in:
parent
97c185659a
commit
ad6aff7dea
@ -1,3 +1,14 @@
|
||||
2015-02-27 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* common/common-exceptions.h (exception_none): Declare.
|
||||
* common/common-exceptions.c (exception_none): Moved from
|
||||
exceptions.c.
|
||||
(exceptions_state_mc_init): Use exception_none.
|
||||
* exceptions.c (exception_none): Move to
|
||||
common/common-exceptions.c.
|
||||
* exceptions.h (exception_none): Move to
|
||||
common/common-exceptions.h.
|
||||
|
||||
2015-02-27 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* main.c (catch_command_errors, catch_command_errors_const):
|
||||
|
@ -20,6 +20,8 @@
|
||||
#include "common-defs.h"
|
||||
#include "common-exceptions.h"
|
||||
|
||||
const struct gdb_exception exception_none = { 0, GDB_NO_ERROR, NULL };
|
||||
|
||||
/* Possible catcher states. */
|
||||
enum catcher_state {
|
||||
/* Initial state, a new catcher has just been created. */
|
||||
@ -78,9 +80,7 @@ exceptions_state_mc_init (volatile struct gdb_exception *exception,
|
||||
struct catcher *new_catcher = XCNEW (struct catcher);
|
||||
|
||||
/* Start with no exception, save it's address. */
|
||||
exception->reason = 0;
|
||||
exception->error = GDB_NO_ERROR;
|
||||
exception->message = NULL;
|
||||
*exception = exception_none;
|
||||
new_catcher->exception = exception;
|
||||
|
||||
new_catcher->mask = mask;
|
||||
|
@ -188,4 +188,7 @@ extern void throw_error (enum errors error, const char *fmt, ...)
|
||||
extern void throw_quit (const char *fmt, ...)
|
||||
ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
|
||||
|
||||
/* A pre-defined non-exception. */
|
||||
extern const struct gdb_exception exception_none;
|
||||
|
||||
#endif /* COMMON_EXCEPTIONS_H */
|
||||
|
@ -27,8 +27,6 @@
|
||||
#include "serial.h"
|
||||
#include "gdbthread.h"
|
||||
|
||||
const struct gdb_exception exception_none = { 0, GDB_NO_ERROR, NULL };
|
||||
|
||||
void
|
||||
prepare_to_throw_exception (void)
|
||||
{
|
||||
|
@ -22,9 +22,6 @@
|
||||
|
||||
#include "ui-out.h"
|
||||
|
||||
/* A pre-defined non-exception. */
|
||||
extern const struct gdb_exception exception_none;
|
||||
|
||||
/* If E is an exception, print it's error message on the specified
|
||||
stream. For _fprintf, prefix the message with PREFIX... */
|
||||
extern void exception_print (struct ui_file *file, struct gdb_exception e);
|
||||
|
Loading…
Reference in New Issue
Block a user