public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: John Darrington <john@darrington.wattle.id.au>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 4/4] GDB:  New target s12z
Date: Fri, 07 Sep 2018 22:03:00 -0000	[thread overview]
Message-ID: <874lf1vuca.fsf@tromey.com> (raw)
In-Reply-To: <20180829141845.26378-5-john@darrington.wattle.id.au> (John	Darrington's message of "Wed, 29 Aug 2018 16:18:45 +0200")

>>>>> "John" == John Darrington <john@darrington.wattle.id.au> writes:

Thank you for the patch.  It seems generally good.  I have a few nits,
but nothing serious.

John> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
John> index 118c3c8062..f448d1ee19 100644
John> --- a/gdb/Makefile.in
John> +++ b/gdb/Makefile.in
John> @@ -758,6 +758,7 @@ ALL_TARGET_OBS = \
John>  	rs6000-lynx178-tdep.o \
John>  	rs6000-tdep.o \
John>  	rx-tdep.o \
John> +	s12z-tdep.o \

This change should be mentioned in the ChangeLog.

John> +
John> +#define N_PHYSICAL_REGISTERS (S12Z_N_REGISTERS - 2)
John> +
John> +static const int reg_perm[N_PHYSICAL_REGISTERS] =
John> +  {

New functions, comments, and macros should have an explanatory comment.
Sometimes this can be just a reference to some generic thing, like
implementations of gdbarch methods can refer to gdbarch.h.  There are a
number of cases of this in the file.

John> +  /*  registers is declared in opcodes/s12z.h */

GNU comment style is to start with a capital letter and end with a
period and two spaces.

John> +      if (0 != prologue_end)
John> +	{
John> +	  struct symtab_and_line prologue_sal = find_pc_line (start_pc, 0);
John> +	  struct compunit_symtab *compunit
John> +	    = SYMTAB_COMPUNIT (prologue_sal.symtab);
John> +	  const char *debug_format = COMPUNIT_DEBUGFORMAT (compunit);
John> +
John> +	  if ((NULL != debug_format)
John> +	      && (strlen ("dwarf") <= strlen (debug_format))
John> +	      && (0 == strncasecmp ("dwarf", debug_format, strlen ("dwarf"))))
John> +	    return (prologue_end > pc) ? prologue_end : pc;
John> +	}

Is this stuff useful?

I would think that because s12z_frame_unwind is added after the DWARF
unwinders that this would perhaps just be dead code.  I do not know for
sure.

I see this in or1k-tdep.c. gdb is kind of lenient about some targets,
but it seems like there should be a better way.

John> +      /* JPB: 28-Apr-11.  This is a temporary patch, to get round GDB
John> +	 crashing right at the beginning.  Build the frame ID as best we
John> +	 can.  */
John> +      trad_frame_set_id (info, frame_id_build (this_sp, this_pc));

Could you explain this more?  I wonder if there is something we could
change.

John> +struct gdbarch_tdep
John> +{
John> +};

I wonder if it could simply be eliminated.  Not super important to me.

John> +  int i;
John> +  for (i = 0; i < stop_1 - len; ++i)

We've been preferring "for (int i = ...".

John> +  const int numregs = gdbarch_num_regs (gdbarch)
John> +		      + gdbarch_num_pseudo_regs (gdbarch);

Parens around the right hand side when line-breaking is the GNU style.

John> +      int reg;
John> +      for (reg = 0; reg < numregs; reg++)

for (int reg ...

Tom

  reply	other threads:[~2018-09-07 22:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-29 14:18 S12Z [new patchset] John Darrington
2018-08-29 14:18 ` [PATCH 3/4] GDB: Add support for 24 bit addresses John Darrington
2018-09-07 22:04   ` Tom Tromey
2018-08-29 14:18 ` [PATCH 1/4] gdb: Add builtin types for 24 bit integers John Darrington
2018-09-07 22:04   ` Tom Tromey
2018-09-08  4:27     ` John Darrington
2018-09-08  5:56       ` Tom Tromey
2018-08-29 14:19 ` [PATCH 4/4] GDB: New target s12z John Darrington
2018-09-07 22:03   ` Tom Tromey [this message]
2018-09-08  4:46     ` John Darrington
2018-09-08 13:16       ` Tom Tromey
2018-09-08 13:21         ` John Darrington
2018-08-29 14:19 ` [PATCH 2/4] Add a dwarf unit type to represent 24 bit values John Darrington
2018-09-07 21:50   ` Tom Tromey
2018-09-26 17:42     ` John Darrington
2018-09-27  2:53       ` Simon Marchi
2018-09-27  5:49         ` John Darrington
2018-09-27 17:53           ` Simon Marchi
2018-09-28 16:03             ` John Darrington
2018-09-07 22:46 ` S12Z [new patchset] Simon Marchi
2018-09-08  4:18   ` John Darrington
2018-09-08  6:30     ` John Darrington
2018-09-08 21:37       ` Simon Marchi

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=874lf1vuca.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=john@darrington.wattle.id.au \
    /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).