From: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb@sources.redhat.com
Subject: Re: parcelling up struct gdbarch
Date: Mon, 16 Jul 2001 11:25:00 -0000 [thread overview]
Message-ID: <20010716112536.A19620@nevyn.them.org> (raw)
In-Reply-To: <3B506250.5080502@cygnus.com>
On Sat, Jul 14, 2001 at 11:16:32AM -0400, Andrew Cagney wrote:
> > undefined reference to `current_gdbarch'
> > undefined reference to `gdbarch_cannot_store_register'
> > undefined reference to `gdbarch_fp_regnum'
> > undefined reference to `gdbarch_npc_regnum'
> > undefined reference to `gdbarch_pc_regnum'
> > undefined reference to `gdbarch_register_byte'
> > undefined reference to `gdbarch_register_bytes'
> > undefined reference to `gdbarch_register_raw_size'
> > undefined reference to `gdbarch_sp_regnum'
>
>
> Live dangerously, try linking against libgdb.a :-)
Just for kicks, I tried it. One file at a time, since I couldn't get
GNU ld to tell me what it was bringing in (is there an option for that?).
The problem is that gdbarch is all one file. To resolve it, we have to
bring in gdbarch.o. That brings in things like
legacy_breakpoint_from_pc, default_memory_insert_breakpoint, etc. It
also brings in gdb_stdout, which means we need main.o. It's hopeless.
This is, of course, resolvable. We could build gdbarch.c as a large
number of separate files (or one file generating multiple objects, like
how libgcc2 is built) into an ar archive, gdbarch.a. Then this
wouldn't happen. I don't know if that's a good idea or not; what do
you think?
> > REGISTER_BYTES, KERNEL_U_ADDR, PC_REGNUM, SP_REGNUM, FP_REGNUM
>
>
> REGISTER_BYTES is hard, I'll ignore it for the moment :-)
Such a pity :) It's the one that really bugs me.
> KERNEL_U_ADDR lives in nm.h so that one is probably ok.
>
> As for PC_REGNUM, NPC_REGNUM, ... SP_REGNUM and FP_REGNUM, I think we
> need to study a little history.
> While it's taken 15 years to figure out, I think this is a register
> model that works. As far as core GDB is concerned PC_REGNUM, FP_REGNUM,
> SP_REGNUM et.al. are all cooked registers. While for many targets,
> RAW_FP_REGNUM == COOKED_FP_REGNUM, might be true, they are separate.
> The gdbserver code that refers to those macros has, has a result of the
> above revalation, become wrong. The nat code, in general, should refer
> to nat, raw or G register numbering and not cooked registers. When it
> comes to the registers to pass back with the T packet, I think it should
> be given an explicit list.
It doesn't refer to those register numbers when generating a G packet
at all. It just passes the entire buffer. The only issue in creation
of G packets is REGISTER_BYTES.
It's the T packet that uses them, currently. outreg() sends
regno:value pairs; regno is a cooked regno. This is the only use of
REGISTER_BYTE or REGISTER_RAW_SIZE outside of a low-* file.
What would you say to providing this list in the form of (cooked regno,
raw offset, raw size) in the nm.h file? It's very fragile, but without
protocol changes it's the best we can do right now.
I'm willing to do all sorts of intrusive things to gdbserver to work
around this for now; as I've said, that gdbserver built for two of the
targets I tried appears to be almost accidental. I've no qualms about
breaking it on any number of other targets, if the fixes are cleaner
than the current state.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2001-07-16 11:25 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-13 0:16 Daniel Jacobowitz
2001-07-13 12:35 ` Andrew Cagney
2001-07-13 14:53 ` Daniel Jacobowitz
2001-07-14 8:33 ` Andrew Cagney
2001-07-16 11:25 ` Daniel Jacobowitz [this message]
2001-07-16 11:27 ` H . J . Lu
2001-07-16 12:04 ` Andrew Cagney
2001-07-16 12:34 ` J.T. Conklin
2001-07-16 15:30 ` Andrew Cagney
2001-07-16 15:40 ` Daniel Jacobowitz
2001-07-16 17:24 ` gdbserver (was Re: parcelling up struct gdbarch) Fabrice Gautier
2001-07-16 21:17 ` Daniel Jacobowitz
2001-07-16 22:22 ` Fabrice Gautier
2001-07-16 22:28 ` Daniel Jacobowitz
2001-07-17 10:00 ` Andrew Cagney
2001-07-17 10:11 ` Daniel Jacobowitz
2001-07-17 11:10 ` Andrew Cagney
2001-07-17 11:21 ` Daniel Jacobowitz
2001-07-17 11:46 ` Andrew Cagney
2001-07-17 10:36 ` Quality Quorum
2001-07-16 13:05 ` parcelling up struct gdbarch Daniel Jacobowitz
2001-07-16 15:15 ` Andrew Cagney
2001-07-16 15:49 ` Daniel Jacobowitz
2001-07-17 10:46 ` Andrew Cagney
2001-07-17 11:03 ` Daniel Jacobowitz
2001-07-17 11:37 ` Andrew Cagney
2001-07-18 13:21 ` Daniel Jacobowitz
2001-07-18 22:53 ` Andrew Cagney
2001-07-18 23:22 ` Daniel Jacobowitz
2001-07-19 0:23 ` Daniel Jacobowitz
2001-07-19 7:51 ` Andrew Cagney
2001-07-19 7:44 ` Andrew Cagney
2001-07-18 8:09 ` Andrew Cagney
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=20010716112536.A19620@nevyn.them.org \
--to=dmj+@andrew.cmu.edu \
--cc=ac131313@cygnus.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