[Lldb-commits] [lldb] r189305 - When ObjectFileMachO::GetModuleSpecifications is getting the ArchSpec

Jason Molenda jmolenda at apple.com
Mon Aug 26 19:22:06 PDT 2013


Author: jmolenda
Date: Mon Aug 26 21:22:06 2013
New Revision: 189305

URL: http://llvm.org/viewvc/llvm-project?rev=189305&view=rev
Log:
When ObjectFileMachO::GetModuleSpecifications is getting the ArchSpec
out of a binary, if the Mach-O binary is MH_PRELOAD ("standalone"), don't
let the OS be set to "ios" or "macosx" - there will be no dynamic loader
used when debugging this process.
<rdar://problem/9956443> 

Modified:
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=189305&r1=189304&r2=189305&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Mon Aug 26 21:22:06 2013
@@ -523,6 +523,11 @@ ObjectFileMachO::GetModuleSpecifications
                 spec.GetArchitecture().SetArchitecture(eArchTypeMachO,
                                                        header.cputype,
                                                        header.cpusubtype);
+                if (header.filetype == HeaderFileTypePreloadedExecutable) // 0x5u MH_PRELOAD
+                {
+                    // Set OS to "unknown" - this is a standalone binary with no dyld et al
+                    spec.GetArchitecture().GetTriple().setOS (llvm::Triple::UnknownOS);
+                }
                 if (spec.GetArchitecture().IsValid())
                 {
                     GetUUID (header, data, data_offset, spec.GetUUID());





More information about the lldb-commits mailing list