Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Alan Hayward <Alan.Hayward@arm.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: nd <nd@arm.com>
Subject: Re: [PATCH v2 4/5] Arm: Use read_description funcs in gdbserver
Date: Thu, 11 Jul 2019 14:35:00 -0000	[thread overview]
Message-ID: <91d8f80d-a24c-4a89-fe34-babff209d807@simark.ca> (raw)
In-Reply-To: <20190711134436.47896-5-alan.hayward@arm.com>

> diff --git a/gdb/gdbserver/linux-aarch32-tdesc.c b/gdb/gdbserver/linux-aarch32-tdesc.c
> new file mode 100644
> index 0000000000..3c26df1f96
> --- /dev/null
> +++ b/gdb/gdbserver/linux-aarch32-tdesc.c
> @@ -0,0 +1,46 @@
> +/* Copyright (C) 2019 Free Software Foundation, Inc.
> +
> +   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 "server.h"
> +#include "tdesc.h"
> +#include "arch/aarch32.h"
> +#include <inttypes.h>
> +
> +static struct target_desc *tdesc_aarch32;
> +
> +/* See linux-aarch32-tdesc.h.  */
> +
> +const target_desc *
> +aarch32_linux_read_description ()
> +{
> +  if (tdesc_aarch32 == nullptr)
> +    {
> +      tdesc_aarch32 = aarch32_create_target_description ();
> +
> +      static const char *expedite_regs[] = { "r11", "sp", "pc", 0 };
> +      init_target_desc (tdesc_aarch32, expedite_regs);
> +    }
> +  return tdesc_aarch32;
> +}
> +
> +/* See linux-aarch32-tdesc.h.  */
> +
> +bool
> +is_aarch32_linux_description (const target_desc *tdesc)
> +{
> +  return tdesc != nullptr && tdesc == tdesc_aarch32;
> +}

If you don't expect tdesc to ever be nullptr, use gdb_assert.

Simon


  reply	other threads:[~2019-07-11 14:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-11 13:45 [PATCH v2 0/5] Arm: Use feature target descriptions Alan Hayward
2019-07-11 13:46 ` [PATCH v2 1/5] Arm: Add read_description read funcs and use in GDB Alan Hayward
2019-07-11 13:56   ` Simon Marchi
2019-07-11 13:58   ` Simon Marchi
2019-07-11 18:04     ` Alan Hayward
2019-07-11 14:19   ` Simon Marchi
2019-07-11 13:46 ` [PATCH v2 2/5] Arm: Use feature target descriptions Alan Hayward
2019-07-11 13:46 ` [PATCH v2 3/5] Arm: Add xml unit tests Alan Hayward
2019-07-11 13:46 ` [PATCH v2 4/5] Arm: Use read_description funcs in gdbserver Alan Hayward
2019-07-11 14:35   ` Simon Marchi [this message]
2019-07-11 13:46 ` [PATCH v2 5/5] Arm: Remove unused feature files and tests Alan Hayward
2019-07-19 15:08 ` [PATCH v2 0/5] Arm: Use feature target descriptions Alan Hayward

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91d8f80d-a24c-4a89-fe34-babff209d807@simark.ca \
    --to=simark@simark.ca \
    --cc=Alan.Hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nd@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox