From: Andrew Cagney <ac131313@ges.redhat.com>
To: Joern Rennecke <joern.rennecke@superh.com>
Cc: Elena Zannoni <ezannoni@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: Unreviewed patches
Date: Wed, 17 Jul 2002 13:04:00 -0000 [thread overview]
Message-ID: <3D35CA64.7040502@ges.redhat.com> (raw)
In-Reply-To: <3D35A89B.EE1EABC3@superh.com>
> Andrew Cagney wrote:
>
>>
>
>> >
>> > I think the stashing of constants into the tdep structure is basically
>> > wrong. You separate the register names arrays from the literals
>> > that describe their positions, and you replicate the literals
>> > up to four times. The tdep structure and the sh_gdbarch_init
>> > function are so large that you have lost track of the things that
>> > really belong in tdep, like sh_show_regs, skip_prologue_hard_way,
>> > and do_pseudo_register. If you look at other gdb ports, you'll
>> > see that they put only variable stuff in tdep, and use enums
>> > for constants. The sh gdb register naming scheme also doesn't
>> > scale well, the names are again duplicated multiple times.
>
>>
>> Can i suggest comparing the SH with the MIPS or RS6000.
> MIPS and RS6000 use varying register numbers for hardware registers
> with identical name and function. I suppose that is due to historical
> accident?
If it happened once it would be an accident.
In the good old days, GDB was built for a specific CPU. The register
layout (along with the G packet) was hard wired using constants from the
tm*.h files. Each CPU variant had a different register layout (for
efficiency reasons).
Targets like the SH would then add a limited form of CPU variant support
using patches like:
Mon May 15 21:27:27 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
* sh-tdep.c (sh_dsp_reg_names, sh3_dsp_reg_names): New arrays.
(sh_processor_type_table): Add entries for bfd_mach_sh_dsp and
bfd_mach_sh3_dsp.
It was implemented by modifying the register name tables (along with a
few other structures) directly.
In the mean time, people have been replacing that code with code using
the multi-arch framework. In doing this conversion, the technique of
replacing hardwired constants with variables has proven most effective.
This is because it lets the developer complete their multi-arch task
independant of any other longer term changes that GDB may require.
enjoy,
Andrew
next prev parent reply other threads:[~2002-07-17 19:50 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-01 6:55 Joern Rennecke
2002-07-01 8:47 ` Elena Zannoni
2002-07-01 10:10 ` Joern Rennecke
2002-07-01 14:24 ` Elena Zannoni
2002-07-01 15:01 ` Joern Rennecke
2002-07-02 12:32 ` Elena Zannoni
2002-07-03 13:49 ` Joern Rennecke
2002-07-12 4:59 ` Elena Zannoni
2002-07-12 5:47 ` Joern Rennecke
2002-07-12 8:23 ` Andrew Cagney
2002-07-17 11:30 ` Joern Rennecke
2002-07-17 13:04 ` Andrew Cagney [this message]
2002-08-05 6:47 ` Elena Zannoni
2002-07-12 11:36 ` Elena Zannoni
-- strict thread matches above, loose matches on Subject: below --
2007-10-11 14:51 Kazu Hirata
2007-10-04 12:04 Kazu Hirata
2003-01-30 6:03 Kazu Hirata
2003-01-31 2:36 ` Michael Snyder
2003-01-31 4:54 ` Kazu Hirata
2003-02-01 1:27 ` Michael Snyder
2003-02-01 3:23 ` Kazu Hirata
2003-02-03 20:30 ` Michael Snyder
2003-02-03 23:30 ` Kazu Hirata
2003-02-05 22:41 ` Michael Snyder
2003-01-17 4:33 Kazu Hirata
2002-06-19 14:29 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=3D35CA64.7040502@ges.redhat.com \
--to=ac131313@ges.redhat.com \
--cc=ezannoni@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=joern.rennecke@superh.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