From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Jeff Kenton <jkenton@tilera.com>
Cc: gdb@sourceware.org
Subject: Re: GDB: problem debugging 32 bit binary on 64 bit machine
Date: Tue, 29 Nov 2011 21:11:00 -0000 [thread overview]
Message-ID: <20111129211102.GA15255@host2.jankratochvil.net> (raw)
In-Reply-To: <4ED54766.2020601@tilera.com>
On Tue, 29 Nov 2011 21:58:14 +0100, Jeff Kenton wrote:
> 0x400000008" (address is above the 32 bit limit). This is caused by
> a call to extract_typed_address() from scan_dyntag() reading an 8
> byte type when it should only be reading 4 bytes.
ARCH_SIZE there should be 32 and TARGET_GDBARCH should be 32-bit.
I guess for some reasons your GDB found wrong (64-bit) library for your 32-bit
program. See the settings like `set solib-search-path', `set sysroot' etc.
> I have two questions:
> 1. is tweaking extract_typed_address() the right way to handle 32
> bit addresses on a 64 bit machine?
No. If ARCH_SIZE and TARGET_GDBARCH are set right it will work.
> 2. what's going wrong with dl_main()?
There is called a notification new library has been loaded in the inferior,
therefore GDB tries to load a matching symbol file (=the library itself) on
the GDB side.
> 3. meta-question: is this a generic bug in gdb's handling of 32 bit
> binaries, or is there likely something I missed while porting?
It 32-on-64 normally works, at least in Fedora, no custom patches for it
there.
Regards,
Jan
next prev parent reply other threads:[~2011-11-29 21:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-29 20:58 Jeff Kenton
2011-11-29 21:11 ` Jan Kratochvil [this message]
2011-11-30 13:35 ` Jeff Kenton
2011-11-30 22:00 ` Jan Kratochvil
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=20111129211102.GA15255@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb@sourceware.org \
--cc=jkenton@tilera.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