This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/5] AArch64 GDB and GDBSERVER Port V2
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Marcus Shawcroft <marcus dot shawcroft at arm dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Sun, 23 Dec 2012 10:50:31 +0400
- Subject: Re: [PATCH 3/5] AArch64 GDB and GDBSERVER Port V2
- References: <50AD031F.1030502@arm.com>
> 2012-11-21 Jim MacArthur <jim.macarthur@arm.com>
> Marcus Shawcroft <marcus.shawcroft@arm.com>
> Nigel Stephens <nigel.stephens@arm.com>
> Yufeng Zhang <yufeng.zhang@arm.com>
>
> * aarch64-newlib-tdep.c: New file.
> * defs.h (enum gdb_osabi): Add GDB_OSABI_NEWLIB.
> * osabi.c (gdb_osabi_names): Add "Newlib".
As mentioned in the review of patch #1, can you explain how this
code would be activated, and why you need a new osabi value?
> diff --git a/gdb/aarch64-newlib-tdep.c b/gdb/aarch64-newlib-tdep.c
> new file mode 100644
> index 0000000..5556b58
> --- /dev/null
> +++ b/gdb/aarch64-newlib-tdep.c
> @@ -0,0 +1,45 @@
> +/* Target-dependent code for Newlib AArch64.
> +
> + Copyright (C) 2011, 2012 Free Software Foundation, Inc.
> + Contributed by ARM Ltd.
> +
> + This file is part of GDB.
> +
> + This program is free software; you can redistribute it and/or modify
> + it under the terms of the GNU General Public License as published by
> + the Free Software Foundation; either version 3 of the License, or
> + (at your option) any later version.
> +
> + This program is distributed in the hope that it will be useful,
> + but WITHOUT ANY WARRANTY; without even the implied warranty of
> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + GNU General Public License for more details.
> +
> + You should have received a copy of the GNU General Public License
> + along with this program. If not, see <http://www.gnu.org/licenses/>. */
> +
> +#include "defs.h"
> +
> +#include "gdbarch.h"
> +#include "aarch64-tdep.h"
> +#include "osabi.h"
> +
> +static void
> +aarch64_newlib_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
> +{
> + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
> +
> + /* Jump buffer - support for longjmp.
> + Offset of original PC in jump buffer (in registers). */
> + tdep->jb_pc = 11;
> +}
> +
> +/* Provide a prototype to silence -Wmissing-prototypes. */
> +extern initialize_file_ftype _initialize_aarch64_newlib_tdep;
> +
> +void
> +_initialize_aarch64_newlib_tdep (void)
> +{
> + gdbarch_register_osabi (bfd_arch_aarch64, 0, GDB_OSABI_NEWLIB,
> + aarch64_newlib_init_abi);
> +}
> diff --git a/gdb/defs.h b/gdb/defs.h
> index 5e8a681..fdf84b4 100644
> --- a/gdb/defs.h
> +++ b/gdb/defs.h
> @@ -613,6 +613,7 @@ enum gdb_osabi
> GDB_OSABI_DARWIN,
> GDB_OSABI_SYMBIAN,
> GDB_OSABI_OPENVMS,
> + GDB_OSABI_NEWLIB,
>
> GDB_OSABI_INVALID /* keep this last */
> };
> diff --git a/gdb/osabi.c b/gdb/osabi.c
> index 7f60984..a6af8fc 100644
> --- a/gdb/osabi.c
> +++ b/gdb/osabi.c
> @@ -73,6 +73,7 @@ static const char * const gdb_osabi_names[] =
> "Darwin",
> "Symbian",
> "OpenVMS",
> + "Newlib",
>
> "<invalid>"
> };
> --
> 1.7.9.5
--
Joel