From: Jim Blandy <jimb@red-bean.com>
To: Jie Zhang <jzhang918@gmail.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Add support for Analog Devices Blackfin processor (part 1/6: gdb)
Date: Thu, 05 Jan 2006 18:51:00 -0000 [thread overview]
Message-ID: <8f2776cb0601051050o7b1bbe09xa346220e0b526cbe@mail.gmail.com> (raw)
In-Reply-To: <43BD4C00.70608@gmail.com>
On 1/5/06, Jie Zhang <jzhang918@gmail.com> wrote:
> Here the a new patch with the following changes according to your
> suggestions.
Wonderful!
> > Am I reading bfin_frame_prev_register correctly when I conclude that
> > the only saved registers it can find are the PC and the FP? How are
>
> It can also find other registers besides the PC and the FP. It looks like:
>
> if(regnum == BFIN_PC_REGNUM)
> {
> ...
> }
> else if (regnum == BFIN_FP_REGNUM)
> {
> ...
> }
> else
> read_memory (...);
Right, but that's all under the control of:
if (regnum < BFIN_NUM_REGS && cache->saved_regs[regnum] != -1)
and if I'm reading the rest of the code right, cache->saved_regs[R]
can only be != -1 when R is BFIN_PC_REGNUM or BFIN_FP_REGNUM. But
those test suite results look pretty good. Does the Blackfin GCC port
produce Dwarf CFI? If so, then you're probably not exercising the
tdep unwinding code much.
Either way, this is a quality of implementation issue, not a coding
convention or interface usage issue, so if it's not a problem for you
(or someone willing to pay you), I don't think it needs to be
addressed for the port to go in.
So, now we can get to picky stuff:
/* ??? */
#define UPPER_LIMIT (40)
#define RETS_OFFSET 4
That comment should probably be filled in.
/* This would come after the LINK instruction in the ret_from_signal ()
function, hence the frame id would be SP + 8. */
this_id = frame_id_build (sp + 8, frame_pc_unwind(next_frame));
GNU coding standards call for a space before the opening parenthesis
of a function call argument list.
/* Read the value in from memory. */
if(regnum == BFIN_PC_REGNUM)
Similarly for 'if', 'while', and 'for' conditions. I just searched in
Emacs for the regexp '[a-z]('.
static int
bfin_sim_regno (int regno)
{
switch (regno)
{
case SIM_BFIN_ASTAT_REGNUM :
case SIM_BFIN_CYCLES_REGNUM :
case SIM_BFIN_CYCLES2_REGNUM :
case SIM_BFIN_USP_REGNUM :
The GNU coding standards have 'case' labels un-indented two spaces
relative to the code they label, like this.
static int
bfin_sim_regno (int regno)
{
switch (regno)
{
case SIM_BFIN_ASTAT_REGNUM :
case SIM_BFIN_CYCLES_REGNUM :
case SIM_BFIN_CYCLES2_REGNUM :
case SIM_BFIN_USP_REGNUM :
case SIM_BFIN_SEQSTAT_REGNUM :
Looking at:
static void
bfin_linux_sigtramp_frame_prev_register (struct frame_info *next_frame,
void **this_cache,
int regnum, int *optimizedp,
enum lval_type *lvalp,
CORE_ADDR *addrp,
int *realnump, gdb_byte *valuep)
When we have a long argument list like this, I think it's more legible
to have each argument on its own line, or at least have line groupings
reflect some sort of semantic grouping (an array and its length, for
example). The bfin_frame_prev_register case is similar. This is up
to you, though.
/* Integral values greater than one word are stored in consecutive
registers starting with R0. This will always be a multiple of
the regiser size. */
Typo.
Overall, though, it looks pretty clean to me.
next prev parent reply other threads:[~2006-01-05 18:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-29 13:41 Jie Zhang
2006-01-04 5:28 ` Jim Blandy
2006-01-05 16:48 ` Jie Zhang
2006-01-05 18:51 ` Jim Blandy [this message]
2006-01-09 4:34 ` Jie Zhang
2006-01-09 5:35 ` Jim Blandy
2006-01-05 18:55 ` Jim Blandy
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=8f2776cb0601051050o7b1bbe09xa346220e0b526cbe@mail.gmail.com \
--to=jimb@red-bean.com \
--cc=gdb-patches@sources.redhat.com \
--cc=jzhang918@gmail.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