* rs6000-tdep.c Question
@ 2008-04-10 18:19 Roberts, Dennis
2008-04-11 0:07 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Roberts, Dennis @ 2008-04-10 18:19 UTC (permalink / raw)
To: 'gdb@sourceware.org'
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: rs6000-tdep.c Question
2008-04-10 18:19 rs6000-tdep.c Question Roberts, Dennis
@ 2008-04-11 0:07 ` Daniel Jacobowitz
2008-04-11 5:06 ` Roberts, Dennis
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2008-04-11 0:07 UTC (permalink / raw)
To: Roberts, Dennis; +Cc: 'gdb@sourceware.org'
On Thu, Apr 10, 2008 at 11:00:25AM -0700, Roberts, Dennis wrote:
> Does anyone see any problem with this code change?
Not I. In fact, I suspect it isn't necessary for 32-bit either;
perhaps you could test that? Are you set up to run the testsuite?
If so, be sure to do before-and-after testing; the results on AIX
are not stellar at present.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: rs6000-tdep.c Question
2008-04-11 0:07 ` Daniel Jacobowitz
@ 2008-04-11 5:06 ` Roberts, Dennis
0 siblings, 0 replies; 3+ messages in thread
From: Roberts, Dennis @ 2008-04-11 5:06 UTC (permalink / raw)
To: 'Daniel Jacobowitz'; +Cc: 'gdb@sourceware.org'
> Not I. In fact, I suspect it isn't necessary for 32-bit
> either; perhaps you could test that? Are you set up to run
> the testsuite?
Not yet. I'll try to set it up and run it.
Thanks,
Dennis
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-04-10 18:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-10 18:19 rs6000-tdep.c Question Roberts, Dennis
2008-04-11 0:07 ` Daniel Jacobowitz
2008-04-11 5:06 ` Roberts, Dennis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox