Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Paul Bartlett" <paul.bartlett@st.com>
To: <gdb@sources.redhat.com>
Subject: gdbserver, remote serial protocol and endian issues
Date: Mon, 08 Apr 2002 03:48:00 -0000	[thread overview]
Message-ID: <005701c1deea$d9cd52b0$300e81a4@bri.st.com> (raw)

Hi Folks,

We've developed an implementation of gdbserver that
runs in a box interfacing the debug ports of SuperH
SH4/SH5 targets to ethernet.

When connecting to a target cpu, various memory mapped
registers must be initialised in order to configure 
the external bus interfaces, clock generators and 
so forth.

This achieved by doing pokes from script files.

The target may be jumper configured to be either big 
or little endian.

Unfortunately, the remote serial protocol makes no
distinction between writes to memory and writes to
memory mapped registers - you just get a byte stream
in target endian order.

In our case, the registers are not byte addressable
and need to be written variously as 8, 16 and 32 bit
quantities. Again, remote serial protocol does not
provide for access size definition.

In order to get things to work at all, we've had to
embed knowledge of specific CPU variants in the
gdbserver code together with an indication of the
target endianness - messy to say the least, and a
pain to maintain.

On an aesthetic note, when reading and writing CPU
registers, the transfer really ought to be endian
neutral - i.e. in a consistent format that does
not change with the endianness of the target. Network
byte order perhaps? This would also remove the need
for gdbserver to be aware of target endianness.

I noticed a brief flurry of posts on the subject about
a year ago but nothing since.

Does anyone have an opinion on this?

Cheers,

Paul



             reply	other threads:[~2002-04-08 10:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-08  3:48 Paul Bartlett [this message]
2002-04-08  7:45 ` Daniel Jacobowitz
     [not found]   ` <00d501c1df12$ab1bdd60$300e81a4@bri.st.com>
2002-04-08  8:44     ` Daniel Jacobowitz
2002-04-08  9:01       ` Paul Bartlett
2002-04-08 11:14       ` Andrew Cagney
2002-04-08 19:48 ` Andrew Cagney
2002-04-10  2:50 FW: " Paul Bartlett
2002-04-10  3:05 ` Paul Bartlett

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='005701c1deea$d9cd52b0$300e81a4@bri.st.com' \
    --to=paul.bartlett@st.com \
    --cc=gdb@sources.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