From: Joel Brobecker <brobecker@adacore.com>
To: Maxim Grigoriev <maxim@tensilica.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [commit] Take into account Xtensa TX
Date: Wed, 09 Mar 2011 03:51:00 -0000 [thread overview]
Message-ID: <20110309034608.GP30306@adacore.com> (raw)
In-Reply-To: <4D76CDB9.8070902@tensilica.com>
> 2011-03-08 Maxim Grigoriev <maxim2405@gmail.com>
>
> * xtensa-tdep.c (TX_PS): New.
> (windowing_enabled): Update to count for Call0 ABI.
> (xtensa_hextochar): New.
> (xtensa_init_reggroups): Make algorithm generic.
> (xtensa_frame_cache): Use TX_PS on Tiny Xtensa.
Just a few minor comments...
> +/* On TX, hardware can be configured without Exception Option.
> + There is no PS register in this case. Inside XT-GDB, let us treat
> + it as a virtual read-only register always holding the same value. */
Not really an issue, but we don't need 2 spaces after commas, only
after periods.
> +static inline char xtensa_hextochar (int xdigit)
Formatting:
static inline char
xtensa_hextochar (int xdigit)
Also, we really would like to have every function documented.
While we can't go back and document everything that already
exists, we can try to make an effort for new functions...
> +{
> + static char hex[]="0123456789abcdef";
space around '='.
> + return hex[xdigit & 0x0f];
Why do you need the 0xf? Just a precaution? I would use a gdb_assert,
if you are about this. Note that instead of using a character array,
you can also return '0' + xdigit.
> + ps = (ps_regnum >= 0)
> + ? get_frame_register_unsigned (this_frame, ps_regnum) : TX_PS;
The GNU coding style recommends the use of parentheses in this case
(and the parens around ps_regnum >= 0 are superfluous. Thus:
ps = (ps_regnum >= 0
? get_frame_register_unsigned (this_frame, ps_regnum) : TX_PS)
> if (gdbarch_tdep (gdbarch)->call_abi != CallAbiCall0Only)
> {
> + ULONGEST val;
> ra = (bp_addr & 0x3fffffff) | 0x40000000;
> - regcache_raw_read (regcache, gdbarch_ps_regnum (gdbarch), buf);
Empty line between variable declarations and the first statement.
(this is a GDB convention)
--
Joel
prev parent reply other threads:[~2011-03-09 3:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-09 2:22 Maxim Grigoriev
2011-03-09 3:51 ` Joel Brobecker [this message]
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=20110309034608.GP30306@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=maxim@tensilica.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