public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] AndesTech NDS32 port
Date: Thu, 05 May 2016 23:46:00 -0000	[thread overview]
Message-ID: <20160505164641.3cac5f17@pinnacle.lan> (raw)
In-Reply-To: <3561f390-ea41-2ee3-a5a9-d870429497c3@gmail.com>

Hi Yan-Ting Lin,

Please submit a separate patch in which you add yourself to the "Write
After Approval" section in gdb/MAINTAINERS.

See my comments below regarding some things that I noticed while
looking over your patch.  Anything that I didn't quote looks okay
to me.

Kevin

On Thu, 5 May 2016 15:16:30 +0800
Yan-Ting Lin <currygt52@gmail.com> wrote:

> diff --git a/gdb/features/nds32-core.xml b/gdb/features/nds32-core.xml
> new file mode 100644
> index 0000000..c98d91e
> --- /dev/null
> +++ b/gdb/features/nds32-core.xml
> @@ -0,0 +1,44 @@
> +<?xml version="1.0"?>
> +<!-- Copyright (C) 2012-2016 Free Software Foundation, Inc.

Given that this is a new file, I suspect that the starting copyright
year should not be 2012.  Should it be 2016 only?

> diff --git a/gdb/features/nds32-fpu.xml b/gdb/features/nds32-fpu.xml
> new file mode 100644
> index 0000000..0c60ca3
> --- /dev/null
> +++ b/gdb/features/nds32-fpu.xml
> @@ -0,0 +1,42 @@
> +<?xml version="1.0"?>
> +<!-- Copyright (C) 2012-2016 Free Software Foundation, Inc.

Ditto.

> diff --git a/gdb/features/nds32-system.xml b/gdb/features/nds32-system.xml
> new file mode 100644
> index 0000000..b772dac
> --- /dev/null
> +++ b/gdb/features/nds32-system.xml
> @@ -0,0 +1,14 @@
> +<?xml version="1.0"?>
> +<!-- Copyright (C) 2012-2016 Free Software Foundation, Inc.

Ditto.

> diff --git a/gdb/features/nds32.xml b/gdb/features/nds32.xml
> new file mode 100644
> index 0000000..a728c3e
> --- /dev/null
> +++ b/gdb/features/nds32.xml
> @@ -0,0 +1,14 @@
> +<?xml version="1.0"?>
> +<!-- Copyright (C) 2012-2016 Free Software Foundation, Inc.

Ditto.

> diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c
> new file mode 100644
> index 0000000..a8add5e
> --- /dev/null
> +++ b/gdb/nds32-tdep.c
> @@ -0,0 +1,2191 @@
> +/* Target-dependent code for the NDS32 architecture, for GDB.
> +
> +   Copyright (C) 2012-2016 Free Software Foundation, Inc.
> +   Contributed by Andes Technology Corporation.

Ditto for this copyright too.  (On the other hand, if it was actually
published in some form back in any form in 2012, disregard my comments
regarding copyright.)

> +struct nds32_frame_cache
> +{
> +  /* The previous frame's inner most stack address.  Used as this
> +     frame ID's stack_addr.  */
> +  CORE_ADDR prev_sp;
> +
> +  /* The frame's base, optionally used by the high-level debug info.  */
> +  CORE_ADDR base;
> +
> +  /* During prologue analysis, keep how far the SP and FP have been offset
> +     from the start of the stack frame (as defined by the previous frame's
> +     stack pointer).
> +     During epilogue analysis, keep how far the SP has been offset from the
> +     current stack pointer.  */
> +  CORE_ADDR sp_offset;
> +  CORE_ADDR fp_offset;
> +  int use_frame;

Perhaps add a comment for use_frame?

> +
> +  /* The address of the first instruction in this function.  */
> +  CORE_ADDR pc;
> +
> +  /* Saved registers.  */
> +  CORE_ADDR saved_regs[NDS32_NUM_SAVED_REGS];
> +};
> +

Please add a comment for nds32_alloc_frame_cache(), below.

> +static struct nds32_frame_cache *
> +nds32_alloc_frame_cache (void)
> +{
> +  struct nds32_frame_cache *cache;
> +  int i;
...

Please add comment for nds32_analyze_epilogue_isns16, below.

> +static inline int
> +nds32_analyze_epilogue_insn16 (uint32_t insn, struct nds32_frame_cache *cache)
> +{
> +  if (insn == N16_TYPE5 (RET5, REG_LP))
> +    /* ret5 $lp */
> +    return INSN_RETURN;
> +  else if (CHOP_BITS (insn, 10) == N16_TYPE10 (ADDI10S, 0))

I'll take this opportunity to compliment you on your instruction
decoding.  It's very clean.

All in all, this port looks really good to me, aside from the nits noted
earlier.

Kevin

  reply	other threads:[~2016-05-05 23:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05  7:16 Yan-Ting Lin
2016-05-05 23:46 ` Kevin Buettner [this message]
2016-05-06 11:00   ` Yao Qi
2016-05-06 16:09     ` Kevin Buettner
2016-05-09  8:15 ` Yao Qi
2016-05-10  8:45   ` Yan-Ting Lin
2016-05-09 18:33 ` Pedro Alves
2016-05-10  9:31   ` Yan-Ting Lin
2016-05-15  9:39   ` Yan-Ting Lin
2016-06-01 11:28     ` Yao Qi
2016-06-06 15:13       ` Yan-Ting Lin
2016-06-07 15:34         ` Yao Qi
2016-06-07 16:30           ` Eli Zaretskii
2016-06-08  8:17             ` Yao Qi
2016-06-17  8:08           ` Yan-Ting Lin
2016-06-13 14:12         ` Pedro Alves
2016-06-15  8:44           ` Yan-Ting Lin
2016-06-15 10:07             ` Pedro Alves
2016-06-01 10:52 ` Yao Qi
2016-06-01 11:00   ` Yao Qi

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=20160505164641.3cac5f17@pinnacle.lan \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).