<div dir="ltr">Hi Jason,<div><br></div><div>This CL caused a build failure on our OSX build bot: <a href="http://lab.llvm.org:8011/builders/lldb-x86_64-darwin-13.4/builds/11405/steps/ninja%20build%20local/logs/stdio" target="_blank">http://lab.llvm.org:8011/builders/lldb-x86_64-darwin-13.4/builds/11405/steps/ninja%20build%20local/logs/stdio</a></div><div><br></div><div>I committed in a possible fix at <a href="http://reviews.llvm.org/rL274743">http://reviews.llvm.org/rL274743</a> but please take a look as I don't know too much about this code so my fix might be wrong.</div><div><br></div><div>Thanks,</div><div>Tamas</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jul 7, 2016 at 4:19 AM Jason Molenda via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: jmolenda<br>
Date: Wed Jul  6 22:12:01 2016<br>
New Revision: 274725<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=274725&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=274725&view=rev</a><br>
Log:<br>
debugserver will now report the minimum version load command<br>
os name and version # from the mach-o binary as it scans the<br>
header/load commands from memory and sends the details back<br>
in the jGetLoadedDynamicLibrariesInfos response.  lldb isn't<br>
using these fields yet but I have a suspicion I'm going to<br>
need them soon.<br>
<br>
<rdar://problem/25251243><br>
<br>
Modified:<br>
    lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.h<br>
    lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm<br>
<br>
Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.h?rev=274725&r1=274724&r2=274725&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.h?rev=274725&r1=274724&r2=274725&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.h (original)<br>
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.h Wed Jul  6 22:12:01 2016<br>
@@ -69,6 +69,8 @@ public:<br>
         struct mach_header_64 mach_header;<br>
         std::vector<struct mach_o_segment> segments;<br>
         uuid_t uuid;<br>
+        std::string min_version_os_name;<br>
+        std::string min_version_os_version;<br>
     };<br>
<br>
     struct binary_image_information<br>
<br>
Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm?rev=274725&r1=274724&r2=274725&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm?rev=274725&r1=274724&r2=274725&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm (original)<br>
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm Wed Jul  6 22:12:01 2016<br>
@@ -631,6 +631,44 @@ MachProcess::GetMachOInformationFromMemo<br>
             if (ReadMemory (load_cmds_p, sizeof (struct uuid_command), &uuidcmd) == sizeof (struct uuid_command))<br>
                 uuid_copy (inf.uuid, uuidcmd.uuid);<br>
         }<br>
+        if (lc.cmd == LC_VERSION_MIN_IPHONEOS || lc.cmd == LC_VERSION_MIN_MACOSX<br>
+            || lc.cmd == LC_VERSION_MIN_WATCHOS || lc.cmd == LC_VERSION_MIN_TVOS)<br>
+        {<br>
+            struct version_min_command vers_cmd;<br>
+            if (ReadMemory (load_cmds_p, sizeof (struct version_min_command), &vers_cmd) != sizeof (struct version_min_command))<br>
+            {<br>
+                return false;<br>
+            }<br>
+            switch (lc.cmd)<br>
+            {<br>
+                case LC_VERSION_MIN_IPHONEOS:<br>
+                    inf.min_version_os_name = "iphoneos";<br>
+                    break;<br>
+                case LC_VERSION_MIN_MACOSX:<br>
+                    inf.min_version_os_name = "macosx";<br>
+                    break;<br>
+                case LC_VERSION_MIN_TVOS:<br>
+                    inf.min_version_os_name = "tvos";<br>
+                    break;<br>
+                case LC_VERSION_MIN_WATCHOS:<br>
+                    inf.min_version_os_name = "watchos";<br>
+                    break;<br>
+                default:<br>
+                    return false;<br>
+            }<br>
+            uint32_t xxxx = vers_cmd.sdk >> 16;<br>
+            uint32_t yy = (vers_cmd.sdk >> 8) & 0xffu;<br>
+            uint32_t zz = vers_cmd.sdk & 0xffu;<br>
+            inf.min_version_os_version = "";<br>
+            inf.min_version_os_version += std::to_string(xxxx);<br>
+            inf.min_version_os_version += ".";<br>
+            inf.min_version_os_version += std::to_string(yy);<br>
+            if (zz != 0)<br>
+            {<br>
+                inf.min_version_os_version += ".";<br>
+                inf.min_version_os_version += std::to_string(zz);<br>
+            }<br>
+        }<br>
         load_cmds_p += lc.cmdsize;<br>
     }<br>
     return true;<br>
@@ -657,6 +695,13 @@ MachProcess::FormatDynamicLibrariesIntoJ<br>
         uuid_unparse_upper (image_infos[i].macho_info.uuid, uuidstr);<br>
         image_info_dict_sp->AddStringItem ("uuid", uuidstr);<br>
<br>
+        if (image_infos[i].macho_info.min_version_os_name.empty() == false<br>
+            && image_infos[i].macho_info.min_version_os_version.empty() == false)<br>
+        {<br>
+            image_info_dict_sp->AddStringItem ("min_version_os_name", image_infos[i].macho_info.min_version_os_name);<br>
+            image_info_dict_sp->AddStringItem ("min_version_os_sdk", image_infos[i].macho_info.min_version_os_version);<br>
+        }<br>
+<br>
         JSONGenerator::DictionarySP mach_header_dict_sp (new JSONGenerator::Dictionary());<br>
         mach_header_dict_sp->AddIntegerItem ("magic", image_infos[i].macho_info.mach_header.magic);<br>
         mach_header_dict_sp->AddIntegerItem ("cputype", (uint32_t) image_infos[i].macho_info.mach_header.cputype);<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div></div>