[Lldb-commits] [lldb] r217905 - Fixed an issue where the last N load commands in the mach-o core file would not be read in where N was the number of LC_THREAD load commands.

Greg Clayton gclayton at apple.com
Tue Sep 16 13:50:29 PDT 2014


Author: gclayton
Date: Tue Sep 16 15:50:29 2014
New Revision: 217905

URL: http://llvm.org/viewvc/llvm-project?rev=217905&view=rev
Log:
Fixed an issue where the last N load commands in the mach-o core file would not be read in where N was the number of LC_THREAD load commands.

I now properly increment the ncmds for each LC_THREAD and now core files are saved correctly.

<rdar://problem/18312703> 

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=217905&r1=217904&r2=217905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Sep 16 15:50:29 2014
@@ -5349,6 +5349,7 @@ ObjectFileMachO::SaveCore (const lldb::P
                     // and the size of all LC_THREAD load command
                     for (const auto &LC_THREAD_data : LC_THREAD_datas)
                     {
+                        ++mach_header.ncmds;
                         mach_header.sizeofcmds += 8 + LC_THREAD_data.GetSize();
                     }
 





More information about the lldb-commits mailing list