Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Kevin Buettner <kevinb@redhat.com>
Subject: Re: [RFC] New targets remote-rx and extended-remote-rx
Date: Fri, 30 Apr 2010 22:35:00 -0000	[thread overview]
Message-ID: <201004302335.44097.pedro@codesourcery.com> (raw)
In-Reply-To: <20100430144218.182aa18b@redhat.com>

On Friday 30 April 2010 22:42:18, Kevin Buettner wrote:
> The patch below adds two new targets, remote-rx and
> extended-remote-rx, which provide a serial debug interface to
> platforms using the Renesas RX architecture.  The interface is
> identical to that defined by remote.c except that memory transfer
> operations are redefined to do byte swapping under certain conditions.
> 
> The new file, remote-rx.c, inherits operations defined in remote.c. 
> It overrides several of those operations in order to provide support
> for some of the idiosyncracies of the RX architecture.  The long comment
> near the beginning of remote-rx.c explains the motivation for this
> patch and these new targets.

I'm not convinced this inheritance is a good idea.  Why not
handle this in the regular remote target instead?  Adding new
targets is evil.  :-)  That is, say, with a gdbarch flag telling
the remote.c target to handle this when needed.  (or a
qSupported feature, or  a new feature in the xml target
description if it is expected that stubs might handle this
themselves somehow)

This would remove the burden from the user/frontend, of
knowing upfront the idiosyncracies of this architecture,
and having to remember to connect with a special target.

Or, even, imagine that at some point you will have a native
gdb running on such architecture.  This raises the question of
whether it would make more sense to make the common memory reading
code handle this independent of target_ops instead.  On first
sight, it seems to.  I'm not sure I grasped it enough to understand
if this could benefit from a TARGET_OBJECT_MEMORY_CODE vs
TARGET_OBJECT_MEMORY_DATA request distinction, instead of just
calling everything TARGET_OBJECT_MEMORY_CODE?  That is switch
the swapping decision to the transfer intent, not to where
the code is in memory.  For example, what should happen
if I build a buffer of executable code in memory at runtime,
and I want to disassemble it with GDB?  I'll build the memory
buffer, with a layout as the compiler puts things in .text,
but the code will not be in .text, yet, don't I want for
GDB to read it in execute order, not memory order?

Lastly, is there any relation between the new address_range
structure, and struct addrmap?

-- 
Pedro Alves


  reply	other threads:[~2010-04-30 22:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-30 21:42 Kevin Buettner
2010-04-30 22:35 ` Pedro Alves [this message]
2010-05-03 22:30   ` Kevin Buettner
2010-05-04  0:32     ` Pedro Alves
2010-04-30 23:23 ` Joseph S. Myers
2010-05-03 23:18   ` Kevin Buettner

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=201004302335.44097.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@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