Remove last cleanup from gdbserver
This removes the last cleanup from gdbserver, replacing it with SCOPE_EXIT. This could perhaps be done in a different way, but this approach was direct and obviously correct. 2019-03-06 Tom Tromey <tom@tromey.com> * server.c (detach_or_kill_for_exit_cleanup): Remove parameter. (captured_main): Use SCOPE_EXIT.
This commit is contained in:
parent
32603266e5
commit
37991b4f52
@ -1,3 +1,8 @@
|
|||||||
|
2019-03-06 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* server.c (detach_or_kill_for_exit_cleanup): Remove parameter.
|
||||||
|
(captured_main): Use SCOPE_EXIT.
|
||||||
|
|
||||||
2019-03-04 Sergio Durigan Junior <sergiodj@redhat.com>
|
2019-03-04 Sergio Durigan Junior <sergiodj@redhat.com>
|
||||||
|
|
||||||
* configure.srv: Use '$enable_unittest' instead of '$development'
|
* configure.srv: Use '$enable_unittest' instead of '$development'
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include "common/pathstuff.h"
|
#include "common/pathstuff.h"
|
||||||
|
|
||||||
#include "common/selftest.h"
|
#include "common/selftest.h"
|
||||||
|
#include "common/scope-exit.h"
|
||||||
|
|
||||||
#define require_running_or_return(BUF) \
|
#define require_running_or_return(BUF) \
|
||||||
if (!target_running ()) \
|
if (!target_running ()) \
|
||||||
@ -3545,17 +3546,16 @@ detach_or_kill_for_exit (void)
|
|||||||
/* Value that will be passed to exit(3) when gdbserver exits. */
|
/* Value that will be passed to exit(3) when gdbserver exits. */
|
||||||
static int exit_code;
|
static int exit_code;
|
||||||
|
|
||||||
/* Cleanup version of detach_or_kill_for_exit. */
|
/* Wrapper for detach_or_kill_for_exit that catches and prints
|
||||||
|
errors. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
detach_or_kill_for_exit_cleanup (void *ignore)
|
detach_or_kill_for_exit_cleanup ()
|
||||||
{
|
{
|
||||||
|
|
||||||
TRY
|
TRY
|
||||||
{
|
{
|
||||||
detach_or_kill_for_exit ();
|
detach_or_kill_for_exit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
CATCH (exception, RETURN_MASK_ALL)
|
CATCH (exception, RETURN_MASK_ALL)
|
||||||
{
|
{
|
||||||
fflush (stdout);
|
fflush (stdout);
|
||||||
@ -3832,7 +3832,8 @@ captured_main (int argc, char *argv[])
|
|||||||
cs.last_status.value.integer = 0;
|
cs.last_status.value.integer = 0;
|
||||||
cs.last_ptid = minus_one_ptid;
|
cs.last_ptid = minus_one_ptid;
|
||||||
}
|
}
|
||||||
make_cleanup (detach_or_kill_for_exit_cleanup, NULL);
|
|
||||||
|
SCOPE_EXIT { detach_or_kill_for_exit_cleanup (); };
|
||||||
|
|
||||||
/* Don't report shared library events on the initial connection,
|
/* Don't report shared library events on the initial connection,
|
||||||
even if some libraries are preloaded. Avoids the "stopped by
|
even if some libraries are preloaded. Avoids the "stopped by
|
||||||
|
Loading…
x
Reference in New Issue
Block a user