From: "Roberts, Dennis" <Dennis.Roberts@sunquestinfo.com>
To: "'gdb@sourceware.org'" <gdb@sourceware.org>
Subject: rs6000-tdep.c Question
Date: Thu, 10 Apr 2008 18:19:00 -0000 [thread overview]
Message-ID: <4813EA4A50D35A44906A74A5E341D0B61A03388614@SQMAILBOX1.sunquestinfo.com> (raw)
I'm trying to teach gdb to interpret 64-bit executables and core files on AIX 5.3.0.0. I think I've got it working (I haven't found a way to break it yet although I haven't tested it on any other versions of AIX), but I'm a little uncomfortable with one of the code changes. Here's the original code:
if (!from_xcoff_exec)
{
arch = info.bfd_arch_info->arch;
mach = info.bfd_arch_info->mach;
}
else
{
arch = bfd_arch_powerpc;
bfd_default_set_arch_mach (&abfd, arch, 0);
info.bfd_arch_info = bfd_get_arch_info (&abfd);
mach = info.bfd_arch_info->mach;
}
Here's the new code:
if (!from_xcoff_exec || wordsize == 8)
{
arch = info.bfd_arch_info->arch;
mach = info.bfd_arch_info->mach;
}
else
{
arch = bfd_arch_powerpc;
bfd_default_set_arch_mach (&abfd, arch, 0);
info.bfd_arch_info = bfd_get_arch_info (&abfd);
mach = info.bfd_arch_info->mach;
}
This code change was necessary because the BFD architecture that was being selected was 32-bit, which caused a wordsize mismatch and prevented GDB from loading 64-bit executable files.
The reason that I'm uncomfortable with the code change is that someone specifically hard-coded the architecture and machine for xcoff executable files, and I don't know why. I assume that there are at least some cases where the BFD library doesn't set the architecture correctly for xcoff executables, but I'm not certain about that. It seems that the BFD library always sets the BFD architecture correctly for 64-bit executable files, though, so it seemed reasonable to have the code use the BFD architecture whenever the wordsize is 8.
Note: this is the only code change to gdb itself; the rest of the changes were in the BFD library.
Does anyone see any problem with this code change?
Thanks,
Dennis
next reply other threads:[~2008-04-10 18:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-10 18:19 Roberts, Dennis [this message]
2008-04-11 0:07 ` Daniel Jacobowitz
2008-04-11 5:06 ` Roberts, Dennis
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=4813EA4A50D35A44906A74A5E341D0B61A03388614@SQMAILBOX1.sunquestinfo.com \
--to=dennis.roberts@sunquestinfo.com \
--cc=gdb@sourceware.org \
/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