From: Andrew Cagney <ac131313@cygnus.com>
To: thorpej@wasabisystems.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH/RFA] Don't gdbarch_init for core files
Date: Thu, 09 May 2002 20:04:00 -0000 [thread overview]
Message-ID: <3CDB38BB.4030807@cygnus.com> (raw)
In-Reply-To: <20020509185824.U3435@dr-evil.shagadelic.org>
> As discussed on gdb@, there is a problem involving gdbarch and core
> files.
>
> At least GNU/Linux and NetBSD identify executables using note sections.
> Many targets use this to select the OS/ABI variant for the target.
>
> The problem is that if you are debugging a core file, the core file is
> loaded after the executable, and the current code re-initializes the
> current gdbarch based on the core file.
>
> Since the core file lacks the same markings as the executable, the
> gdbarch that results is unable to debug the executable+core.
>
> There are other problems, as well. The core file often doesn't have
> the same flags as an executable -- consider the flags the MIPS target
> uses to decide between o32, o64, n32, etc. These flags may not be
> present in the core file (indeed -- the core file is just a memory image,
> and doens't really have an "ABI", per se). The ABI, again, really comes
> from the executable.
>
> At the very least, it has befuddled Daniel and me :-)
>
> The following patch fixes this problem (which can be easily demonstrated
> by simply doing "gdb a.out a.out.core" on any target that supports OS/ABI
> variants).
>
> * corelow.c (core_open): Don't reinitialize the current
> gdbarch.
Given this original patch:
http://sources.redhat.com/ml/gdb-patches/2000-04/msg00483.html
is the exact reverse, something else must be needed.
Instead of removing the call, is it possible to reasonably detect if the
core file belongs to the current architecture (either in corefile.c) or
in gdbarch_FOO_init().
Andrew
next prev parent reply other threads:[~2002-05-10 3:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-09 18:58 Jason R Thorpe
2002-05-09 20:04 ` Andrew Cagney [this message]
2002-05-09 21:21 ` Jason R Thorpe
2002-05-11 19:48 ` Andrew Cagney
2002-05-11 20:30 ` Jason R Thorpe
2002-05-11 20:46 ` Daniel Jacobowitz
2002-05-16 16:24 ` Michael Snyder
2002-05-16 16:24 ` Michael Snyder
2002-05-16 17:33 ` Andrew Cagney
2002-05-17 6:58 m.m.kettenis
2002-05-17 10:47 ` Jason R Thorpe
2002-05-17 10:59 ` Michael Snyder
2002-05-17 16:06 ` Mark Kettenis
2002-05-17 10:54 ` Michael Snyder
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=3CDB38BB.4030807@cygnus.com \
--to=ac131313@cygnus.com \
--cc=gdb-patches@sources.redhat.com \
--cc=thorpej@wasabisystems.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