diff options
author | Pedro Alves <palves@redhat.com> | 2017-09-27 23:37:48 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2017-09-27 23:37:48 +0100 |
commit | 2a015c47e1a4a9b117d54f357dc3540326811748 (patch) | |
tree | aa62d83c6770702191ff1b038f0183824bcec639 /gdb/remote-fileio.c | |
parent | bea0a5aeece991b2f4f20a746ce655283607d9a6 (diff) | |
download | binutils-users/palves/catch_exceptions.zip binutils-users/palves/catch_exceptions.tar.gz binutils-users/palves/catch_exceptions.tar.bz2 |
zap catch_exceptionsusers/palves/catch_exceptions
Diffstat (limited to 'gdb/remote-fileio.c')
-rw-r--r-- | gdb/remote-fileio.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c index f3e33ec..9d1a923 100644 --- a/gdb/remote-fileio.c +++ b/gdb/remote-fileio.c @@ -1118,10 +1118,9 @@ static struct { { NULL, NULL } }; -static int -do_remote_fileio_request (struct ui_out *uiout, void *buf_arg) +static void +do_remote_fileio_request (char *buf) { - char *buf = (char *) buf_arg; char *c; int idx; @@ -1135,10 +1134,10 @@ do_remote_fileio_request (struct ui_out *uiout, void *buf_arg) for (idx = 0; remote_fio_func_map[idx].name; ++idx) if (!strcmp (remote_fio_func_map[idx].name, buf)) break; - if (!remote_fio_func_map[idx].name) /* ERROR: No such function. */ - return RETURN_ERROR; - remote_fio_func_map[idx].func (c); - return 0; + if (!remote_fio_func_map[idx].name) + remote_fileio_reply (-1, FILEIO_ENOSYS); + else + remote_fio_func_map[idx].func (c); } /* Close any open descriptors, and reinitialize the file mapping. */ @@ -1188,22 +1187,16 @@ remote_fileio_request (char *buf, int ctrlc_pending_p) } else { - ex = catch_exceptions (current_uiout, - [&] (ui_out *uiout) - { - return do_remote_fileio_request (uiout, buf); - }, - RETURN_MASK_ALL); - switch (ex) + TRY { - case RETURN_ERROR: - remote_fileio_reply (-1, FILEIO_ENOSYS); - break; - case RETURN_QUIT: - remote_fileio_reply (-1, FILEIO_EINTR); - break; - default: - break; + do_remote_fileio_request (buf); + } + CATCH (ex, RETURN_MASK_ALL) + { + if (ex.reason == RETURN_QUIT) + remote_fileio_reply (-1, FILEIO_EINTR); + else + remote_fileio_reply (-1, FILEIO_EIO); } } |