Browse Source

2012-01-23 Pedro Alves <palves@redhat.com>

* server.c (main): Avoid yet another case of infinite loop while
	detaching/killing after a longjmp.
cygwin-64bit-branch
Pedro Alves 15 years ago
parent
commit
01b1789443
  1. 5
      gdb/gdbserver/ChangeLog
  2. 27
      gdb/gdbserver/server.c

5
gdb/gdbserver/ChangeLog

@ -1,3 +1,8 @@
2012-01-23 Pedro Alves <palves@redhat.com>
* server.c (main): Avoid yet another case of infinite loop while
detaching/killing after a longjmp.
2012-01-20 Jan Kratochvil <jan.kratochvil@redhat.com> 2012-01-20 Jan Kratochvil <jan.kratochvil@redhat.com>
Code cleanup. Code cleanup.

27
gdb/gdbserver/server.c

@ -2727,13 +2727,10 @@ main (int argc, char *argv[])
inferiors, we'd end up here again, stuck in an infinite loop inferiors, we'd end up here again, stuck in an infinite loop
trap. Be sure that if that happens, we exit immediately trap. Be sure that if that happens, we exit immediately
instead. */ instead. */
if (setjmp (toplevel)) if (setjmp (toplevel) == 0)
{ detach_or_kill_for_exit ();
fprintf (stderr, "Detach or kill failed. Exiting\n"); else
exit (1); fprintf (stderr, "Detach or kill failed. Exiting\n");
}
detach_or_kill_for_exit ();
exit (1); exit (1);
} }
@ -2779,8 +2776,20 @@ main (int argc, char *argv[])
if (exit_requested || run_once) if (exit_requested || run_once)
{ {
detach_or_kill_for_exit (); /* If something fails and longjmps while detaching or
exit (0); killing inferiors, we'd end up here again, stuck in an
infinite loop trap. Be sure that if that happens, we
exit immediately instead. */
if (setjmp (toplevel) == 0)
{
detach_or_kill_for_exit ();
exit (0);
}
else
{
fprintf (stderr, "Detach or kill failed. Exiting\n");
exit (1);
}
} }
fprintf (stderr, fprintf (stderr,

Loading…
Cancel
Save