From: Andrew Cagney <ac131313@cygnus.com>
To: joern.rennecke@st.com
Cc: Ben Elliston <bje@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: SH5 simulator contribution
Date: Fri, 12 Apr 2002 09:45:00 -0000 [thread overview]
Message-ID: <3CB70F11.6010609@cygnus.com> (raw)
In-Reply-To: <3CB6AD19.CCDD835A@st.com>
> Andrew Cagney wrote:
>
>> The sim/sh simulator has a specific register name / number / size
>> mapping and sh-elf-gdb knows how to use it.
>>
>> This new sim/sh5 simulator has a different register / name / size
>> mapping and this difference is covered up by GDB. (I note the addition
>> of the sim-sh64.h file which is in itself a very good move).
>
>
> Actually, the difference is not covered up by gdb. The compiler emits
> different register numbers when compiling for sh5 or shcompact than
> when compiling for sh1..sh4.
> The sh64 simulator matches the numbering scheme for the sh5 / shcompact
> targets, while the old sh simulator matches the numbering scheme for
> sh1..sh4 targets. When you try to use gdb with the sh64 simulator
> as submitted so far on an sh4 program (i.e. set a breakpoint, display
> registers), it just falls over.
Until the sim works, GDB probably won't add the code :-) The
infrastructure is there.
> In order to have a unified interface between gdb and the simulator, you
> would have first to introduce a translation step in gdb to translate the
> old register numbers for sh1..sh4 programs to the new scheme, and in the
> old simulator translate it back (the latter is easy, since there is
> already a translation going on in sim_store_register / sim_fetch_register).
> You can't just change the numbering in the interface between gcc and gdb,
> because that would break binary compatibility. And you also can't change
> the interface between gdb and hardware monitors.
Strictly speaking GCC does re-number the interface between GCC and GDB.
.stabs and dwarf2 debug info can have different register numbering for
the same ISA/ABI. Fortunatly GDB has mechanisms for handling this.
As for hardware monitors, I'm not sure. I do know that the MIPS has
more G packet formats than I've had hot dinners. Here, unfortunatly,
the mechanisms GDB needed to handle this are still work-in-progress.
As for the SIM, there is REGISTER_SIM_REGNO. However, that may not be
sufficient.
> So I don't see that you gain anything by unifying the numbering scheme
> in the gdb <-> sim interface, as it would be at odds with the interface
> to gcc and the hardware interfaces.
Formalizing would be a better word. So that GDB and the SIM can agree
on the register numbers and their sizes without needing to know the
others internals.
Andrew
next prev parent reply other threads:[~2002-04-12 16:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-02 2:06 Ben Elliston
2002-02-04 19:48 ` Andrew Cagney
2002-02-04 20:28 ` Ben Elliston
2002-02-04 20:59 ` Andrew Cagney
2002-02-04 22:29 ` Ben Elliston
2002-02-05 8:31 ` Andrew Cagney
2002-02-05 12:21 ` Ben Elliston
2002-02-05 17:36 ` Andrew Cagney
2002-04-12 2:46 ` Joern Rennecke
2002-04-12 9:30 ` Andrew Cagney
2002-04-12 9:45 ` Andrew Cagney [this message]
2002-04-15 1:48 ` Joern Rennecke
2002-04-18 18:32 ` Andrew Cagney
2002-04-29 10:23 ` Joern Rennecke
2002-04-29 10:47 ` Andrew Cagney
2002-04-29 11:30 ` Joern Rennecke
2002-04-12 2:48 ` Joern Rennecke
2002-04-12 2:57 ` Joern Rennecke
2002-04-12 2:57 ` Joern Rennecke
2002-04-12 2:57 ` Joern Rennecke
2002-04-12 2:58 ` Joern Rennecke
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=3CB70F11.6010609@cygnus.com \
--to=ac131313@cygnus.com \
--cc=bje@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=joern.rennecke@st.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