I think unknown-unknown is only useful for Hexagon, but in this case the target
arch is hexagon-unknown-unknown, so not setting it would be OK.
ProcessElfCore also has this:
ArchSpec
ProcessElfCore::GetArchitecture()
{
ObjectFileELF *core_file = (ObjectFileELF
*)(m_core_module_sp->GetObjectFile());
ArchSpec arch;
core_file->GetArchitecture(arch);
return arch;
}
I think it should be changed to return the target's arch if the OS is unknown.
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux
Foundation Collaborative Project
-----Original Message-----
From: Jim Ingham [mailto:[email protected]]
Sent: Monday, July 13, 2015 6:39 PM
To: Ted Woodward
Cc: [email protected]
Subject: Re: [lldb-dev] Loading Linux core files
Instead of triggering off Linux, can we trigger off the fact that the core
module really didn't figure out what the architecture actually is? Would
unknown-unknown ever be a correct/useful response for a modules's architecture?
Jim
> On Jul 13, 2015, at 4:22 PM, Ted Woodward <[email protected]> wrote:
>
> I’m trying to load a core file on Ubuntu 12, but I’m getting an assert in
> ThreadElfCore::CreateRegisterContextForFrame() because the
> arch.GetTriple().getOS() returns UnknownOS instead of Linux.
>
> I’ve stepped through loading my binary, and the target’s OS Is correctly set
> to Linux. But ProcessElfCore::DoLoadCore() has this code:
> // Even if the architecture is set in the target, we need to override
> // it to match the core file which is always single arch.
> ArchSpec arch (m_core_module_sp->GetArchitecture());
> if (arch.IsValid())
> m_target.SetArchitecture(arch);
>
> The problem is Linux core files don’t have anything in them to indicate that
> they are Linux. Linux is identified through a note that is added by
> gcc/clang, but isn’t in the core file. So x86-64-unknown-Linux gets replaced
> by x86-64-unknown-unknown.
>
> I’m thinking of changing this to not override the architecture if the
> target’s OS is Linux. Any thoughts?
>
> --
> Qualcomm Innovation Center, Inc.
> The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a
> Linux Foundation Collaborative Project
>
> _______________________________________________
> lldb-dev mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev