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: Wed, 30 Nov 2011 22:00:00 -0000 [thread overview]
Message-ID: <20111130220001.GA17137@host2.jankratochvil.net> (raw)
In-Reply-To: <4ED63112.5080504@tilera.com>
On Wed, 30 Nov 2011 14:35:14 +0100, Jeff Kenton wrote:
> This sounds like the basic problem. Building the 32 bit
> target_gdbarch is easy. What's the best way (place in the code) to
> detect 32 bit vs. 64 bit binaries and switch between different
> gdbarch's?
I do not understand the context. The current GDB switches target_gdbarch
right during execution of "./gdb ./gdb", at:
#0 deprecated_target_gdbarch_select_hack (new_gdbarch=0x2071110) at gdbarch.c:4294
#1 in set_gdbarch_from_file (abfd=0x206c990) at arch-utils.c:559
#2 in exec_file_attach (filename=0x7fffffffde00 "./gdb", from_tty=1) at exec.c:294
#3 in catch_command_errors (command=0x488ab7 <exec_file_attach>, arg=0x7fffffffde00 "./gdb", from_tty=1, mask=6) at exceptions.c:531
#4 in captured_main (data=0x7fffffffd9e0) at ./main.c:850
#5 in catch_errors (func=0x4873f6 <captured_main>, func_args=0x7fffffffd9e0, errstring=0xe6ede7 "", mask=6) at exceptions.c:504
#6 in gdb_main (args=0x7fffffffd9e0) at ./main.c:953
#7 in main (argc=2, argv=0x7fffffffdae8) at gdb.c:35
Regards,
Jan
prev parent reply other threads:[~2011-11-30 22:00 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
2011-11-30 13:35 ` Jeff Kenton
2011-11-30 22:00 ` Jan Kratochvil [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=20111130220001.GA17137@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