public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Jon Beniston <jon@beniston.com>
Cc: <gdb@sourceware.org>
Subject: Re: Memory-mapped peripheral registers, remote protocol and memory maps
Date: Thu, 29 Nov 2012 15:51:00 -0000	[thread overview]
Message-ID: <50B78451.5000903@codesourcery.com> (raw)
In-Reply-To: <005301cdce23$e1b0f3e0$a512dba0$@beniston.com>

On 11/29/2012 07:22 PM, Jon Beniston wrote:
> In some cases, there might be a large variety of inter-mixed
> 8/16/32-bit registers, which you might not have the space to cater
> for in a small stub. Can we be sure that GDB will only generate a 'm
> 0x0x00d000 4' packet? It would be tricky for a stub to deal with a

The following command 'p' will only generate 'm' packet with the right size.

(gdb) p *(unsigned int *) 0x8048608
Sending packet: $m8048608,4#3f...Packet received: 5589e583

(gdb) p *(char *) 0x8048608
Sending packet: $m8048608,1#3c...Packet received: 55

I admit they are tricky.

> packet of a larger size (say if the register area is opened in a
> memory viewer). Also, it would be nice to prevent reads from certain
> addresses, in case they have side effects (i.e FIFOs, etc).
>

Something similar was done in codesourcery (by other people) to handle 
memory-mapped register and side effect of reading registers (we call it 
read sensitiveness, IIRC).  The target description mechanism
(http://sourceware.org/gdb/current/onlinedocs/gdb/Target-Descriptions.html) 
was enhanced, in which the name, width, mapped address and read 
sensitiveness of each register is described.  With these knowledge, GDB 
can take care of memory-mapped register.  However, these patches didn't 
go to upstream.

-- 
Yao (齐尧)

  reply	other threads:[~2012-11-29 15:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-28 19:24 Jon Beniston
2012-11-29  9:16 ` Yao Qi
2012-11-29 11:23   ` Jon Beniston
2012-11-29 15:51     ` Yao Qi [this message]
2012-11-29 16:32   ` Jon Beniston
2012-11-29 17:23     ` Paul_Koning
2012-11-29 17:57       ` Jon Beniston

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=50B78451.5000903@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb@sourceware.org \
    --cc=jon@beniston.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).