Use exceptions and cleanups in gdbserver
authorGary Benson <gbenson@redhat.com>
Fri, 8 Aug 2014 14:37:41 +0000 (15:37 +0100)
committerGary Benson <gbenson@redhat.com>
Fri, 29 Aug 2014 09:53:56 +0000 (10:53 +0100)
commit860789c7d5d6ef2f60e757feb21845bb230582a8
tree88d7addfc8242d4c8377d4afcefec92ee71ce34c
parentff55e1b54898ca4e2a90c005749505e33e32215c
Use exceptions and cleanups in gdbserver

This commit replaces the hacky "exception" system in gdbserver with
the exceptions and cleanups subsystem from GDB.

Only the catch/cleanup code in what was "main" has been updated to
use the new system.  Other parts of gdbserver can now be converted
to use TRY_CATCH and cleanups on an as-needed basis.

A side-effect of this commit is that some error messages will change
slightly, and in cases with multiple errors the error messages will
be printed in a different order.

gdb/gdbserver/ChangeLog:

* server.h (setjmp.h): Do not include.
(toplevel): Do not declare.
(common-exceptions.h): Include.
(cleanups.h): Likewise.
* server.c (toplevel): Do not define.
(exit_code): New static global.
(detach_or_kill_for_exit_cleanup): New function.
(main): New function.  Original main renamed to...
(captured_main): New function.
* utils.c (verror) [!IN_PROCESS_AGENT]: Use throw_verror.
gdb/gdbserver/ChangeLog
gdb/gdbserver/server.c
gdb/gdbserver/server.h
gdb/gdbserver/utils.c
This page took 0.039121 seconds and 4 git commands to generate.