Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kaushik Phatak <Kaushik.Phatak@kpitcummins.com>
To: Pedro Alves <palves@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [RFA 4/5] New port: CR16: gdbserver
Date: Fri, 28 Dec 2012 04:42:00 -0000	[thread overview]
Message-ID: <C6CA53A2A46BA7469348BDBD663AB65848564536@KCHJEXMB02.kpit.com> (raw)
In-Reply-To: <50CB742E.9090506@redhat.com>

Hi Pedro,
Thanks for the detailed review.

I will take care of all the formatting and re-base this with GDB mainline when
I resubmit the patch.

To answer some of your points,
> +cr16_supply_ptrace_register (struct regcache *regcache,
> Is the shift visible in GDB or not?  Is this a ptrace quirk,
> or an architecture quirk?  If the latter, why isn't GDB itself, and
> the cr16_set_pc cr16_get_pc routines in gdbserver handling this?

This is an architecture quirk as the PC is 24 bits wide and only top 23 bits
can be read. The last bit is always zero, so user has to left shift to get
the correct value. The 'supply_ptrace_register' seemed like the correct place
to make these manipulations similar to s390 or the ppc ports.
Manipulations in the get_pc and set_pc calls did not seem to get the 
desired effect while reading PC from the target.

> +32:r10and11
> Eh.  What's the rationale for this? Peeking at the GDB patch, I saw no
> pseudo registers support.
This is the way the kernel port defines the PT_REGS structure. This allows for
faster access as register pair move reg_names (movd rp,rp) instruction is 
supported. However, we needed individual registers to be viewed under gdb.

> +expedite:psr
> Why only psr?  That's surprising.
In case I add any other registers, then the offset of that register is 
incorrect with respect to the "reg_names", and the size does not match 
which is returned by "cr16_register_type".
For example, if I add 
expedite:psr,ra
Then 'ra' is register number 8, and has size 32 bits as per reg-cr16.dat, 
however,for number 8, I have r8 in "reg_names" (cr16-tdep.c) which has 
size 16 bits.
When gdb requests for the expedite registers, it gets data and throws error,
"Badly formatted packet" -> I guess this is expected, as it returns 32 bits
for 'ra' as per reg-cr16.dat, but it expects only 16 bits for 'r8'.
I know this is bit of a hack, however to get the gdbserver running on the
kernel and keeping it in sync with the host, this seemed my best bet.

>> +  (*the_target->read_memory) (where, (unsigned char *) &insn,
>> +			      cr16_breakpoint_len);
> Most ports fail to do this, but the above may fail.  That should be
> checked here.
I have probably borrowed this from cris port. Do I need to perform additional
here? Please let me know if there is any other port I can refer to.

Please let me know if the above justifications are ok.

Thanks & Best Regards,
Kaushik



  reply	other threads:[~2012-12-28  4:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-04 10:23 Kaushik Phatak
2012-12-14 18:47 ` Pedro Alves
2012-12-28  4:42   ` Kaushik Phatak [this message]
2013-01-18 16:39     ` Pedro Alves
2013-01-22 13:43       ` Kaushik Phatak
2013-01-22 15:05         ` Pedro Alves
2013-01-23 12:50           ` Kaushik Phatak
2013-01-23 13:29             ` Pedro Alves
2013-01-23 14:04               ` Kaushik Phatak
2013-01-23 14:44                 ` Pedro Alves
2013-06-19 14:10                   ` Kaushik Phatak
2013-06-25 19:10                     ` Pedro Alves
2013-06-26  8:03                       ` Kaushik Phatak

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=C6CA53A2A46BA7469348BDBD663AB65848564536@KCHJEXMB02.kpit.com \
    --to=kaushik.phatak@kpitcummins.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.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