This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: gdbarch_init called for core files, too?
- From: Michael Snyder <msnyder at redhat dot com>
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Cc: thorpej at wasabisystems dot com, gdb at sources dot redhat dot com
- Date: Thu, 25 Apr 2002 10:59:21 -0700
- Subject: Re: gdbarch_init called for core files, too?
- Organization: Red Hat, Inc.
- References: <20020425002919.H26223@dr-evil.shagadelic.org> <3CC837CE.2030609@cygnus.com>
Andrew Cagney wrote:
>
> > So, I'm seeing alpha_gdbarch_init() called twice if I do:
> >
> > gdb foo foo.core
> >
> > ...the first time, alpha_abi is correctly set to ALPHA_ABI_NETBSD, but
> > the second time it gets ALPHA_ABI_UNKNOWN. This means that the wrong
> > target-dependent info is being used while debugging the core file.
> >
> > This behavior is ... counter-intuitive. Why is gdbarch_init being called
> > for the core file? Should't it be sufficient to initialize it based on
> > the program corresponding to the core file?
>
> There may not necessarily be a program corresponding to the core file:
> gdb --core core.
>
> > ...or should I make the code that looks for ABI tags in note sections to
> > also look for "NetBSD-CORE" notes, too?
>
> Sounds right. I'd check with michael snyder though.
Yeah, bfd has a few holes when it comes to recognizing core files.
If you find one, fill it. ;-)