From: Andrew Cagney <ac131313@cygnus.com>
To: Orjan Friberg <orjan.friberg@axis.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfc] Swap out current when creating a new architecture
Date: Mon, 15 Oct 2001 18:41:00 -0000 [thread overview]
Message-ID: <3BCB902A.8090003@cygnus.com> (raw)
In-Reply-To: <3BCA28A3.6010607@cygnus.com>
> Just a quick recap: what the old code was doing by referring to
> current_gdbarch was to avoid changing the ABI (which I infer from the
> bfd) if one of the other target specific commands were being used. The
> patch below sets the abfd field in the info struct to exec_bfd before
> calling gdbarch_update_p, so that information on the current bfd is
> passed along, just as it is when gdbarch_update_p is called from
> set_gdbarch_from_file.
>
> Is this an acceptable way of doing it? I know I'm in the risky business
> of dealing with global pointers. (I'm assuming a commit could go on
> both trunk and branch.)
>
> Nice bug! I need to think about this some more though.
Really nice bug!
The proposed change unfortunatly isn't right for reasons similar to the
original current_gdbarch problem. The exec file might belong to a
completely different architecture. Consider a sequence like:
(gdb) file hello.d10v
(gdb) info architecture
The current architecture is d10v
(gdb) set cris-mode CRIS_MODE_USER
For MIPS, the problem has so far been avoided by coding functions as:
if (set by user)
return user value;
else
return value from architecture;
I should note though, that even this will eventually have problems - it
affects all MIPS architectures - but at least it gets over the immediate
hurdle.
enjoy,
Andrew
next prev parent reply other threads:[~2001-10-15 18:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3BB16441.30805@cygnus.com>
2001-09-26 22:56 ` Kevin Buettner
2001-09-26 23:06 ` Andrew Cagney
2001-09-30 12:25 ` Andrew Cagney
2001-10-01 4:34 ` Orjan Friberg
2001-10-14 17:07 ` Andrew Cagney
2001-10-15 18:41 ` Andrew Cagney [this message]
2001-10-16 1:59 ` Orjan Friberg
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=3BCB902A.8090003@cygnus.com \
--to=ac131313@cygnus.com \
--cc=gdb-patches@sources.redhat.com \
--cc=orjan.friberg@axis.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