This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 5/5] Use exceptions and cleanups in gdbserver
- From: Pedro Alves <palves at redhat dot com>
- To: Gary Benson <gbenson at redhat dot com>, gdb-patches at sourceware dot org
- Date: Thu, 28 Aug 2014 16:35:46 +0100
- Subject: Re: [PATCH 5/5] Use exceptions and cleanups in gdbserver
- Authentication-results: sourceware.org; auth=none
- References: <1408351618-21013-1-git-send-email-gbenson at redhat dot com> <1408351618-21013-6-git-send-email-gbenson at redhat dot com>
On 08/18/2014 09:46 AM, Gary Benson wrote:
> diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
> index 97498a6..cac73e9 100644
> diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c
> index 6283877..e2eb4f4 100644
> --- a/gdb/gdbserver/utils.c
> +++ b/gdb/gdbserver/utils.c
> @@ -17,6 +17,7 @@
> along with this program. If not, see <http://www.gnu.org/licenses/>. */
>
> #include "server.h"
> +#include "common-exceptions.h"
>
...
> diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
> index 500260c..aec70f0 100644
> --- a/gdb/gdbserver/server.c
> +++ b/gdb/gdbserver/server.c
> @@ -35,6 +35,8 @@
> #include "tracepoint.h"
> #include "dll.h"
> #include "hostio.h"
> +#include "common-exceptions.h"
> +#include "cleanups.h"
We'll want to start using exceptions/cleanups everywhere.
We'll no doubt end up including them from a central place, either
server.h or somewhere in common/. I think we should just put
them in server.h already ...
> --- a/gdb/gdbserver/server.h
> +++ b/gdb/gdbserver/server.h
> @@ -29,8 +29,6 @@ gdb_static_assert (sizeof (CORE_ADDR) >= sizeof (void *));
>
> #include "version.h"
>
> -#include <setjmp.h>
> -
> #ifdef HAVE_ALLOCA_H
> #include <alloca.h>
> #endif
> @@ -88,8 +86,6 @@ extern int pass_signals[];
> extern int program_signals[];
> extern int program_signals_p;
>
> -extern jmp_buf toplevel;
> -
> extern int disable_packet_vCont;
> extern int disable_packet_Tthread;
> extern int disable_packet_qC;
... which is the same place we had the bare bones setjmp stuff,
avoiding the sprinkling-includes-around-only-to-inevitably-remove-them-later.
This way, even if we move them somewhere in common/ at some point, we'll
still have only a single place to touch.
Other than that, looks good.
Thanks,
Pedro Alves