From: Andrew Cagney <ac131313@redhat.com>
To: Mark Kettenis <kettenis@chello.nl>
Cc: gdb@sources.redhat.com
Subject: Re: [RFC] Core files and the architecture vector
Date: Sat, 11 Oct 2003 23:07:00 -0000 [thread overview]
Message-ID: <3F888D0E.4010001@redhat.com> (raw)
In-Reply-To: <200310112207.h9BM7WW0010332@elgar.kettenis.dyndns.org>
> When a 32-bit executable
> running on FreeBSD/amd64 or GNU/Linux x86-64 dumps, it produces an
> 64-bit ELF core file.
I think that's a kernel bug. A 32 bit emulation environment should
emulate things right down to the binary format of a core dump :-)
However ...
> The problem I'm having, is that we have no clean seperation between
> initalizing and activating an architecture vector; it's all done from
> gdbarch.c:gdbarch_update_p(). Looking at the function, it seems as if
> it's not quite so easy to seperate the two because of the
> per-architecture swapped data. I've hacked around this by
> unconditionally setting the architecture from CORE_BFD, fetching the
> core architecture vector from CURRENT_GDBARCH, and reset the
> architecture from EXEC_BFD if we have one; refer to the attached code
> to see what I mean.
>
> Is this kosher? Do folks agree with this approach?
Is this kosher? No. Is there a better way? No.
GDBARCH methods that give the appearance of returning an architecture
(without affecting global state) vis:
struct gdbarch *gdbarch_from_file ();
are going to be needed (however, right now they would only allow us to
fool ourselves into thinking we're safe :-). A method like:
struct gdbarch *deprecated_select_gdbarch_hack (struct gdbarch *);
method might also be useful?
Andrew
PS: This is only going to get worse - target <>- thread <>- frame will
have an equally messy transition.
PPS: Suggest more "rude" comments about how dangerous this is.
prev parent reply other threads:[~2003-10-11 23:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-11 22:07 Mark Kettenis
2003-10-11 22:26 ` Daniel Jacobowitz
2003-10-11 22:43 ` Mark Kettenis
2003-10-11 23:57 ` Andrew Cagney
2003-10-13 13:44 ` Paul Koning
2003-10-11 23:07 ` Andrew Cagney [this message]
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=3F888D0E.4010001@redhat.com \
--to=ac131313@redhat.com \
--cc=gdb@sources.redhat.com \
--cc=kettenis@chello.nl \
/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