[Lldb-commits] [PATCH] linux: Set ArchSpec m_type correctly from object file.

Stephen Wilson wilsons at start.ca
Tue Feb 15 20:10:42 PST 2011


An ArchSpec's type defaults to MachO.  Ensure the type is properly set
on ELF systems.


diff --git a/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index a16e486..0739b97 100644
--- a/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1065,6 +1065,8 @@ ObjectFileELF::GetArchitecture (ArchSpec &arch)
     arch.GetTriple().setOSName ("linux");
     // TODO: determine if there is an OS in the ELF? Default to "gnu" for now
     arch.GetTriple().setVendorName("gnu");
+
+    arch.SetElfArch(m_header.e_machine, m_header.e_flags);
     return true;
 }




More information about the lldb-commits mailing list