[Lldb-commits] [lldb] r343029 - Change the unwinder to not use a hard-coded limit on the

2018-09-25 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Sep 25 14:01:54 2018
New Revision: 343029

URL: http://llvm.org/viewvc/llvm-project?rev=343029&view=rev
Log:
Change the unwinder to not use a hard-coded limit on the
max number of stack frames to backtrace, make it a setting,
target.process.thread.max-backtrace-depth.
Add a test case for the setting.

 

Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/TestBacktraceLimit.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/main.cpp
Modified:
lldb/trunk/include/lldb/Target/Thread.h
lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp
lldb/trunk/source/Target/Thread.cpp

Modified: lldb/trunk/include/lldb/Target/Thread.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=343029&r1=343028&r2=343029&view=diff
==
--- lldb/trunk/include/lldb/Target/Thread.h (original)
+++ lldb/trunk/include/lldb/Target/Thread.h Tue Sep 25 14:01:54 2018
@@ -57,6 +57,8 @@ public:
   bool GetStepInAvoidsNoDebug() const;
 
   bool GetStepOutAvoidsNoDebug() const;
+  
+  uint64_t GetMaxBacktraceDepth() const;
 };
 
 typedef std::shared_ptr ThreadPropertiesSP;

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/Makefile?rev=343029&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/Makefile
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/Makefile
 Tue Sep 25 14:01:54 2018
@@ -0,0 +1,6 @@
+LEVEL = ../../../make
+
+CXXFLAGS += -std=c++11
+CXX_SOURCES := main.cpp
+ENABLE_THREADS := YES
+include $(LEVEL)/Makefile.rules

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/TestBacktraceLimit.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/TestBacktraceLimit.py?rev=343029&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/TestBacktraceLimit.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/TestBacktraceLimit.py
 Tue Sep 25 14:01:54 2018
@@ -0,0 +1,31 @@
+"""
+Test that the target.process.thread.max-backtrace-depth setting works.
+"""
+
+import unittest2
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class BacktraceLimitSettingTest(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+NO_DEBUG_INFO_TESTCASE = True
+
+def setUp(self):
+# Call super's setUp().
+TestBase.setUp(self)
+
+def test_backtrace_depth(self):
+"""Test that the max-backtrace-depth setting limits backtraces."""
+self.build()
+self.main_source_file = lldb.SBFileSpec("main.cpp")
+(target, process, thread, bkpt) = 
lldbutil.run_to_source_breakpoint(self,
+"Set a breakpoint here", self.main_source_file)
+interp = self.dbg.GetCommandInterpreter()
+result = lldb.SBCommandReturnObject()
+interp.HandleCommand("settings set 
target.process.thread.max-backtrace-depth 30", result)
+self.assertEqual(True, result.Succeeded())
+self.assertEqual(30, thread.GetNumFrames())

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/main.cpp?rev=343029&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/main.cpp
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/main.cpp
 Tue Sep 25 14:01:54 2018
@@ -0,0 +1,13 @@
+int bottom () { 
+  return 1;  // Set a breakpoint here
+} 
+int foo(int in) { 
+  if (in > 0)
+return foo(--in) + 5; 
+  else
+return bottom();
+}
+int main()
+{
+   return foo(500);
+}

Modified: lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp?rev=343029&r1=343028&r2=343029&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/UnwindL

[Lldb-commits] [lldb] r344209 - Upstreaming the BridgeOS device support and the

2018-10-10 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Oct 10 17:28:35 2018
New Revision: 344209

URL: http://llvm.org/viewvc/llvm-project?rev=344209&view=rev
Log:
Upstreaming the BridgeOS device support and the 
LC_BUILD_VERSION load command handling - this
commit is a combination of patches by Adrian
Prantl and myself.  llvm::Triple::BridgeOS 
isn't defined yet, so all references to that
are currently commented out.  

Also update Xcode project file to build the 
NativePDB etc plugins.

 


Added:
lldb/trunk/lit/Modules/lc_build_version.yaml
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/scripts/Xcode/package-clang-headers.py
lldb/trunk/source/API/SystemInitializerFull.cpp
lldb/trunk/source/Host/macosx/objcxx/HostInfoMacOSX.mm

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h

lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp

lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/CMakeLists.txt
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
lldb/trunk/source/Utility/ArchSpec.cpp

Added: lldb/trunk/lit/Modules/lc_build_version.yaml
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Modules/lc_build_version.yaml?rev=344209&view=auto
==
--- lldb/trunk/lit/Modules/lc_build_version.yaml (added)
+++ lldb/trunk/lit/Modules/lc_build_version.yaml Wed Oct 10 17:28:35 2018
@@ -0,0 +1,210 @@
+# RUN: yaml2obj %s > %t.out
+# RUN: lldb-test symbols %t.out | FileCheck %s
+# REQUIRES: darwin
+# Test that the deployment target is parsed from the load commands.
+# CHECK: x86_64-apple-macosx10.14.0
+--- !mach-o
+FileHeader:  
+  magic:   0xFEEDFACF
+  cputype: 0x0107
+  cpusubtype:  0x8003
+  filetype:0x0002
+  ncmds:   14
+  sizeofcmds:  744
+  flags:   0x00200085
+  reserved:0x
+LoadCommands:
+  - cmd: LC_SEGMENT_64
+cmdsize: 72
+segname: __PAGEZERO
+vmaddr:  0
+vmsize:  4294967296
+fileoff: 0
+filesize:0
+maxprot: 0
+initprot:0
+nsects:  0
+flags:   0
+  - cmd: LC_SEGMENT_64
+cmdsize: 232
+segname: __TEXT
+vmaddr:  4294967296
+vmsize:  4096
+fileoff: 0
+filesize:4096
+maxprot: 7
+initprot:5
+nsects:  2
+flags:   0
+Sections:
+  - sectname:__text
+segname: __TEXT
+addr:0x00010FB0
+size:8
+offset:  0x0FB0
+align:   4
+reloff:  0x
+nreloc:  0
+flags:   0x8400
+reserved1:   0x
+reserved2:   0x
+reserved3:   0x
+  - sectname:__unwind_info
+segname: __TEXT
+addr:0x00010FB8
+size:72
+offset:  0x0FB8
+align:   2
+reloff:  0x
+nreloc:  0
+flags:   0x
+reserved1:   0x
+reserved2:   0x
+reserved3:   0x
+  - cmd: LC_SEGMENT_64
+cmdsize: 72
+segname: __LINKEDIT
+vmaddr:  4294971392
+vmsize:  4096
+fileoff: 4096
+filesize:152
+maxprot: 7
+initprot:1
+nsects:  0
+flags:   0
+  - cmd: LC_DYLD_INFO_ONLY
+cmdsize: 48
+rebase_off:  0
+rebase_size: 0
+bind_off:0
+bind_size:   0
+weak_bind_off:   0
+weak_bind_size:  0
+lazy_bind_off:   0
+lazy_bind_size:  0
+export_off:  4096
+export_size: 48
+  - cmd: LC_SYMTAB
+cmdsize: 24
+symoff:  4152
+nsyms:   3
+stroff:  4200
+strsize: 48
+  - cmd: LC_DYSYMTAB
+cmdsize: 80
+ilocalsym:   0
+nlocalsym:   0
+i

[Lldb-commits] [lldb] r344275 - Don't mark an LC_BUILD_VERSION as giving us a

2018-10-11 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Oct 11 11:37:53 2018
New Revision: 344275

URL: http://llvm.org/viewvc/llvm-project?rev=344275&view=rev
Log:
Don't mark an LC_BUILD_VERSION as giving us a 
correct version if it has a major verison 0.

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=344275&r1=344274&r2=344275&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Thu Oct 11 
11:37:53 2018
@@ -5914,8 +5914,8 @@ uint32_t ObjectFileMachO::GetSDKVersion(
 m_sdk_versions.push_back ();
 m_sdk_versions.push_back (yy);
 m_sdk_versions.push_back (zz);
+success = true;
 }
-success = true;
 }
 offset = load_cmd_offset + lc.cmdsize;
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r344277 - Fix this comment so it is consistent with all the others.

2018-10-11 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Oct 11 11:41:34 2018
New Revision: 344277

URL: http://llvm.org/viewvc/llvm-project?rev=344277&view=rev
Log:

Fix this comment so it is consistent with all the others.

Modified:
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.cpp

Modified: 
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.cpp?rev=344277&r1=344276&r2=344277&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.cpp 
(original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.cpp Thu 
Oct 11 11:41:34 2018
@@ -108,7 +108,7 @@ PlatformSP PlatformRemoteAppleBridge::Cr
   }
   if (create) {
 switch (triple.getOS()) {
-// FIXMEJSM case llvm::Triple::BridgeOS: 
+// NEED_BRIDGEOS_TRIPLE case llvm::Triple::BridgeOS: 
   break;
 
 default:


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r344323 - Remove references to source/Plugins/SymbolFile/NativePDB.

2018-10-11 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Oct 11 17:53:55 2018
New Revision: 344323

URL: http://llvm.org/viewvc/llvm-project?rev=344323&view=rev
Log:
Remove references to source/Plugins/SymbolFile/NativePDB.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=344323&r1=344322&r2=344323&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Oct 11 17:53:55 2018
@@ -210,7 +210,6 @@
2642FBAE13D003B400ED6808 /* CommunicationKDP.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 2642FBA813D003B400ED6808 /* 
CommunicationKDP.cpp */; };
964463EC1A330C0500154ED8 /* CompactUnwindInfo.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 964463EB1A330C0500154ED8 /* 
CompactUnwindInfo.cpp */; };
268900D513353E6F00698AC0 /* CompileUnit.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26BC7F1510F1B8EC00F91463 /* CompileUnit.cpp */; 
};
-   AF9BB7F8216EC7220093FA65 /* CompileUnitIndex.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = AF9BB7F5216EC7210093FA65 /* 
CompileUnitIndex.cpp */; };
265192C61BA8E905002F08F6 /* CompilerDecl.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 265192C51BA8E905002F08F6 /* CompilerDecl.cpp */; 
};
2657AFB71B86910100958979 /* CompilerDeclContext.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 2657AFB61B86910100958979 /* 
CompilerDeclContext.cpp */; };
268900D213353E6F00698AC0 /* CompilerType.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 49E45FAD11F660FE008F7B28 /* CompilerType.cpp */; 
};
@@ -587,8 +586,6 @@
4CA0C6CC20F929C700CFE6BB /* PDBLocationToDWARFExpression.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4CA0C6CA20F929C600CFE6BB /* 
PDBLocationToDWARFExpression.cpp */; };
268900EE13353E6F00698AC0 /* PathMappingList.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 495BBACB119A0DBE00418BEA /* PathMappingList.cpp 
*/; };
2668A2EE20AF417D00D94111 /* PathMappingListTest.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 2668A2ED20AF417D00D94111 /* 
PathMappingListTest.cpp */; };
-   AF9BB7F6216EC7220093FA65 /* PdbIndex.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = AF9BB7F3216EC7210093FA65 /* PdbIndex.cpp */; };
-   AF9BB7F7216EC7220093FA65 /* PdbUtil.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = AF9BB7F4216EC7210093FA65 /* PdbUtil.cpp */; };
25420ED21A649D88009ADBCB /* PipeBase.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 25420ED11A649D88009ADBCB /* PipeBase.cpp */; };
2377C2F819E613C100737875 /* PipePosix.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 2377C2F719E613C100737875 /* PipePosix.cpp */; };
268900EF13353E6F00698AC0 /* Platform.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 264A43BD1320BCEB005B4096 /* Platform.cpp */; };
@@ -915,7 +912,6 @@
4C7D48251F5099B2005314B4 /* SymbolFileDWARFDwoDwp.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4C7D481F1F509964005314B4 /* 
SymbolFileDWARFDwoDwp.cpp */; };
4C7D48241F5099A1005314B4 /* SymbolFileDWARFDwp.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 4C7D481C1F509963005314B4 /* 
SymbolFileDWARFDwp.cpp */; };
9A2057121F3B824B00F6C293 /* SymbolFileDWARFTests.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 9A20570A1F3B81F300F6C293 /* 
SymbolFileDWARFTests.cpp */; };
-   AF9BB7F2216EC6EF0093FA65 /* SymbolFileNativePDB.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AF9BB7F1216EC6EF0093FA65 /* 
SymbolFileNativePDB.cpp */; };
AF6335E21C87B21E00F7D554 /* SymbolFilePDB.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF6335E01C87B21E00F7D554 /* SymbolFilePDB.cpp 
*/; };
268900CE13353E5F00698AC0 /* SymbolFileSymtab.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 260C89DE10F57C5600BB2B04 /* 
SymbolFileSymtab.cpp */; };
268900E013353E6F00698AC0 /* SymbolVendor.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF94005711C03F6500085DB9 /* SymbolVendor.cpp */; 
};
@@ -1667,7 +1663,6 @@
964463ED1A330C1B00154ED8 /* CompactUnwindInfo.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
CompactUnwindInfo.h; path = include/lldb/Symbol/CompactUnwindInfo.h; sourceTree 
= ""; };
26BC7F1510F1B8EC00F91463 /* CompileUnit.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = CompileUnit.cpp; path = source/Symbol/CompileUnit.cpp; sourceTree = 
""; };
26BC7C5710F1B6E900F91463 /* CompileUnit.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileTy

[Lldb-commits] [lldb] r344414 - Add NativePDB subdir again.

2018-10-12 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Oct 12 13:53:21 2018
New Revision: 344414

URL: http://llvm.org/viewvc/llvm-project?rev=344414&view=rev
Log:
Add NativePDB subdir again.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=344414&r1=344413&r2=344414&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Oct 12 13:53:21 2018
@@ -210,6 +210,7 @@
2642FBAE13D003B400ED6808 /* CommunicationKDP.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 2642FBA813D003B400ED6808 /* 
CommunicationKDP.cpp */; };
964463EC1A330C0500154ED8 /* CompactUnwindInfo.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 964463EB1A330C0500154ED8 /* 
CompactUnwindInfo.cpp */; };
268900D513353E6F00698AC0 /* CompileUnit.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26BC7F1510F1B8EC00F91463 /* CompileUnit.cpp */; 
};
+   AFD966B8217140B6006714AC /* CompileUnitIndex.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = AFD966B4217140B5006714AC /* 
CompileUnitIndex.cpp */; };
265192C61BA8E905002F08F6 /* CompilerDecl.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 265192C51BA8E905002F08F6 /* CompilerDecl.cpp */; 
};
2657AFB71B86910100958979 /* CompilerDeclContext.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 2657AFB61B86910100958979 /* 
CompilerDeclContext.cpp */; };
268900D213353E6F00698AC0 /* CompilerType.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 49E45FAD11F660FE008F7B28 /* CompilerType.cpp */; 
};
@@ -586,6 +587,8 @@
4CA0C6CC20F929C700CFE6BB /* PDBLocationToDWARFExpression.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4CA0C6CA20F929C600CFE6BB /* 
PDBLocationToDWARFExpression.cpp */; };
268900EE13353E6F00698AC0 /* PathMappingList.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 495BBACB119A0DBE00418BEA /* PathMappingList.cpp 
*/; };
2668A2EE20AF417D00D94111 /* PathMappingListTest.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 2668A2ED20AF417D00D94111 /* 
PathMappingListTest.cpp */; };
+   AFD966BA217140B6006714AC /* PdbIndex.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = AFD966B6217140B6006714AC /* PdbIndex.cpp */; };
+   AFD966B9217140B6006714AC /* PdbUtil.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = AFD966B5217140B6006714AC /* PdbUtil.cpp */; };
25420ED21A649D88009ADBCB /* PipeBase.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 25420ED11A649D88009ADBCB /* PipeBase.cpp */; };
2377C2F819E613C100737875 /* PipePosix.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 2377C2F719E613C100737875 /* PipePosix.cpp */; };
268900EF13353E6F00698AC0 /* Platform.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 264A43BD1320BCEB005B4096 /* Platform.cpp */; };
@@ -912,6 +915,7 @@
4C7D48251F5099B2005314B4 /* SymbolFileDWARFDwoDwp.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4C7D481F1F509964005314B4 /* 
SymbolFileDWARFDwoDwp.cpp */; };
4C7D48241F5099A1005314B4 /* SymbolFileDWARFDwp.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 4C7D481C1F509963005314B4 /* 
SymbolFileDWARFDwp.cpp */; };
9A2057121F3B824B00F6C293 /* SymbolFileDWARFTests.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 9A20570A1F3B81F300F6C293 /* 
SymbolFileDWARFTests.cpp */; };
+   AFD966BB217140B6006714AC /* SymbolFileNativePDB.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AFD966B7217140B6006714AC /* 
SymbolFileNativePDB.cpp */; };
AF6335E21C87B21E00F7D554 /* SymbolFilePDB.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF6335E01C87B21E00F7D554 /* SymbolFilePDB.cpp 
*/; };
268900CE13353E5F00698AC0 /* SymbolFileSymtab.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 260C89DE10F57C5600BB2B04 /* 
SymbolFileSymtab.cpp */; };
268900E013353E6F00698AC0 /* SymbolVendor.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF94005711C03F6500085DB9 /* SymbolVendor.cpp */; 
};
@@ -1663,6 +1667,8 @@
964463ED1A330C1B00154ED8 /* CompactUnwindInfo.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
CompactUnwindInfo.h; path = include/lldb/Symbol/CompactUnwindInfo.h; sourceTree 
= ""; };
26BC7F1510F1B8EC00F91463 /* CompileUnit.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = CompileUnit.cpp; path = source/Symbol/CompileUnit.cpp; sourceTree = 
""; };
26BC7C5710F1B6E900F91463 /* CompileUnit.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
C

Re: [Lldb-commits] [lldb] r344409 - Resubmit "Add SymbolFileNativePDB plugin."

2018-10-12 Thread Jason Molenda via lldb-commits


> On Oct 12, 2018, at 12:47 PM, Zachary Turner via lldb-commits 
>  wrote:
> 
> Resubmit "Add SymbolFileNativePDB plugin."
> 
> This was originally reverted due to some test failures on
> Linux.  Those problems turned out to require several additional
> patches to lld and clang in order to fix, which have since been
> submitted.  This patch is resubmitted unchanged.  All tests now
> pass on both Linux and Windows.


The lit test in lit/Modules/lc_build_version.yaml fails on Darwin systems, 
crashing here -

4   lldb-test   0x0001008ebdab 
llvm::Error::fatalUncheckedError() const + 139
5   lldb-test   0x00010084b307 
llvm::Error::assertIsChecked() + 87 (Error.h:270)
6   lldb-test   0x00010084b279 
llvm::Error::~Error() + 25 (Error.h:230)
7   lldb-test   0x000100844725 
llvm::Error::~Error() + 21 (Error.h:231)
8   lldb-test   0x000101b91e49 
loadPDBFile(std::__1::basic_string, 
std::__1::allocator >, llvm::BumpPtrAllocatorImpl&) + 1193 (SymbolFileNativePDB.cpp:73)
9   lldb-test   0x000101b9024e 
lldb_private::npdb::SymbolFileNativePDB::CalculateAbilities() + 542 
(SymbolFileNativePDB.cpp:187)
10  lldb-test   0x000101060ceb 
lldb_private::SymbolFile::GetAbilities() + 43 (SymbolFile.h:87)
11  lldb-test   0x0001010607fc 
lldb_private::SymbolFile::FindPlugin(lldb_private::ObjectFile*) + 764 
(SymbolFile.cpp:58)


Where the loadPDBFile line 73 is 


59  static std::unique_ptr loadPDBFile(std::string PdbPath,
60  llvm::BumpPtrAllocator 
&Allocator) {
61llvm::ErrorOr> ErrorOrBuffer =
62llvm::MemoryBuffer::getFile(PdbPath, /*FileSize=*/-1,
63/*RequiresNullTerminator=*/false);
64if (!ErrorOrBuffer)
65  return nullptr;
66std::unique_ptr Buffer = 
std::move(*ErrorOrBuffer);
67  
68llvm::StringRef Path = Buffer->getBufferIdentifier();
69auto Stream = llvm::make_unique(
70std::move(Buffer), llvm::support::little);
71  
72auto File = llvm::make_unique(Path, std::move(Stream), 
Allocator);
73if (auto EC = File->parseFileHeaders())
74  return nullptr;
75if (auto EC = File->parseStreamData())


I'm not sure why this wouldn't fail on a linux/windows system.  The point of 
the .yaml lit tests was that it is host independent?


J
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r344409 - Resubmit "Add SymbolFileNativePDB plugin."

2018-10-12 Thread Jason Molenda via lldb-commits
Ah, mystery solved.  The lit test specifies REQUIRES Darwin.  

> On Oct 12, 2018, at 3:22 PM, Jason Molenda  wrote:
> 
> 
> 
>> On Oct 12, 2018, at 12:47 PM, Zachary Turner via lldb-commits 
>>  wrote:
>> 
>> Resubmit "Add SymbolFileNativePDB plugin."
>> 
>> This was originally reverted due to some test failures on
>> Linux.  Those problems turned out to require several additional
>> patches to lld and clang in order to fix, which have since been
>> submitted.  This patch is resubmitted unchanged.  All tests now
>> pass on both Linux and Windows.
> 
> 
> The lit test in lit/Modules/lc_build_version.yaml fails on Darwin systems, 
> crashing here -
> 
> 4   lldb-test 0x0001008ebdab 
> llvm::Error::fatalUncheckedError() const + 139
> 5   lldb-test 0x00010084b307 
> llvm::Error::assertIsChecked() + 87 (Error.h:270)
> 6   lldb-test 0x00010084b279 
> llvm::Error::~Error() + 25 (Error.h:230)
> 7   lldb-test 0x000100844725 
> llvm::Error::~Error() + 21 (Error.h:231)
> 8   lldb-test 0x000101b91e49 
> loadPDBFile(std::__1::basic_string, 
> std::__1::allocator >, 
> llvm::BumpPtrAllocatorImpl&) + 1193 
> (SymbolFileNativePDB.cpp:73)
> 9   lldb-test 0x000101b9024e 
> lldb_private::npdb::SymbolFileNativePDB::CalculateAbilities() + 542 
> (SymbolFileNativePDB.cpp:187)
> 10  lldb-test 0x000101060ceb 
> lldb_private::SymbolFile::GetAbilities() + 43 (SymbolFile.h:87)
> 11  lldb-test 0x0001010607fc 
> lldb_private::SymbolFile::FindPlugin(lldb_private::ObjectFile*) + 764 
> (SymbolFile.cpp:58)
> 
> 
> Where the loadPDBFile line 73 is 
> 
> 
>59  static std::unique_ptr loadPDBFile(std::string PdbPath,
>60  llvm::BumpPtrAllocator 
> &Allocator) {
>61llvm::ErrorOr> ErrorOrBuffer =
>62llvm::MemoryBuffer::getFile(PdbPath, /*FileSize=*/-1,
>63/*RequiresNullTerminator=*/false);
>64if (!ErrorOrBuffer)
>65  return nullptr;
>66std::unique_ptr Buffer = 
> std::move(*ErrorOrBuffer);
>67  
>68llvm::StringRef Path = Buffer->getBufferIdentifier();
>69auto Stream = llvm::make_unique(
>70std::move(Buffer), llvm::support::little);
>71  
>72auto File = llvm::make_unique(Path, std::move(Stream), 
> Allocator);
>73if (auto EC = File->parseFileHeaders())
>74  return nullptr;
>75if (auto EC = File->parseStreamData())
> 
> 
> I'm not sure why this wouldn't fail on a linux/windows system.  The point of 
> the .yaml lit tests was that it is host independent?
> 
> 
> J

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r344409 - Resubmit "Add SymbolFileNativePDB plugin."

2018-10-12 Thread Jason Molenda via lldb-commits
Adrian suggests that parseFileHeaders is returning an error and that needs to 
be cleared?


> On Oct 12, 2018, at 3:27 PM, Jason Molenda  wrote:
> 
> Ah, mystery solved.  The lit test specifies REQUIRES Darwin.  
> 
>> On Oct 12, 2018, at 3:22 PM, Jason Molenda  wrote:
>> 
>> 
>> 
>>> On Oct 12, 2018, at 12:47 PM, Zachary Turner via lldb-commits 
>>>  wrote:
>>> 
>>> Resubmit "Add SymbolFileNativePDB plugin."
>>> 
>>> This was originally reverted due to some test failures on
>>> Linux.  Those problems turned out to require several additional
>>> patches to lld and clang in order to fix, which have since been
>>> submitted.  This patch is resubmitted unchanged.  All tests now
>>> pass on both Linux and Windows.
>> 
>> 
>> The lit test in lit/Modules/lc_build_version.yaml fails on Darwin systems, 
>> crashing here -
>> 
>> 4   lldb-test0x0001008ebdab 
>> llvm::Error::fatalUncheckedError() const + 139
>> 5   lldb-test0x00010084b307 
>> llvm::Error::assertIsChecked() + 87 (Error.h:270)
>> 6   lldb-test0x00010084b279 
>> llvm::Error::~Error() + 25 (Error.h:230)
>> 7   lldb-test0x000100844725 
>> llvm::Error::~Error() + 21 (Error.h:231)
>> 8   lldb-test0x000101b91e49 
>> loadPDBFile(std::__1::basic_string, 
>> std::__1::allocator >, 
>> llvm::BumpPtrAllocatorImpl&) + 1193 
>> (SymbolFileNativePDB.cpp:73)
>> 9   lldb-test0x000101b9024e 
>> lldb_private::npdb::SymbolFileNativePDB::CalculateAbilities() + 542 
>> (SymbolFileNativePDB.cpp:187)
>> 10  lldb-test0x000101060ceb 
>> lldb_private::SymbolFile::GetAbilities() + 43 (SymbolFile.h:87)
>> 11  lldb-test0x0001010607fc 
>> lldb_private::SymbolFile::FindPlugin(lldb_private::ObjectFile*) + 764 
>> (SymbolFile.cpp:58)
>> 
>> 
>> Where the loadPDBFile line 73 is 
>> 
>> 
>>   59  static std::unique_ptr loadPDBFile(std::string PdbPath,
>>   60  llvm::BumpPtrAllocator 
>> &Allocator) {
>>   61llvm::ErrorOr> ErrorOrBuffer =
>>   62llvm::MemoryBuffer::getFile(PdbPath, /*FileSize=*/-1,
>>   63/*RequiresNullTerminator=*/false);
>>   64if (!ErrorOrBuffer)
>>   65  return nullptr;
>>   66std::unique_ptr Buffer = 
>> std::move(*ErrorOrBuffer);
>>   67  
>>   68llvm::StringRef Path = Buffer->getBufferIdentifier();
>>   69auto Stream = llvm::make_unique(
>>   70std::move(Buffer), llvm::support::little);
>>   71  
>>   72auto File = llvm::make_unique(Path, std::move(Stream), 
>> Allocator);
>>   73if (auto EC = File->parseFileHeaders())
>>   74  return nullptr;
>>   75if (auto EC = File->parseStreamData())
>> 
>> 
>> I'm not sure why this wouldn't fail on a linux/windows system.  The point of 
>> the .yaml lit tests was that it is host independent?
>> 
>> 
>> J
> 

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r344429 - Try to fix some failures on MacOSX with the NativePDB patch.

2018-10-12 Thread Jason Molenda via lldb-commits
Yep, thanks!

% bin/lldb-test symbols ../f.obj
Module: ../f.obj
Module ../f.obj
0x7fb795587320:   ObjectFileMachO64, file = '../f.obj', triple = 
x86_64-apple-macosx10.14.0
  SectID Type File Address Perm 
File Off.  File Size  Flags  Section Name
  --  ---   
-- -- -- 
  0x0100 container[0x-0x0001)  ---  
0x 0x 0x f.obj.__PAGEZERO
  0x0200 container[0x0001-0x00011000)  r-x  
0x 0x1000 0x f.obj.__TEXT
  0x0001 code [0x00010fb0-0x00010fb8)  r-x  
0x0fb0 0x0008 0x8400 f.obj.__TEXT.__text
  0x0002 compact-unwind   [0x00010fb8-0x00011000)  r-x  
0x0fb8 0x0048 0x f.obj.__TEXT.__unwind_info
  0x0300 container[0x00011000-0x00012000)  r--  
0x1000 0x0098 0x f.obj.__LINKEDIT
0x7fb7955871b0: SymbolVendor (../f.obj)


> On Oct 12, 2018, at 3:57 PM, Zachary Turner via lldb-commits 
>  wrote:
> 
> Author: zturner
> Date: Fri Oct 12 15:57:40 2018
> New Revision: 344429
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=344429&view=rev
> Log:
> Try to fix some failures on MacOSX with the NativePDB patch.
> 
> This adds -- before any filenames, so that /U doesn't get interpreted
> as a command line.
> 
> It also adds better error checking, so that we don't get assertions
> on the failure path when a file fails to parse as a PDB.
> 
> Modified:
>lldb/trunk/lit/SymbolFile/NativePDB/disassembly.cpp
>lldb/trunk/lit/SymbolFile/NativePDB/simple-breakpoints.cpp
>lldb/trunk/lit/SymbolFile/NativePDB/source-list.cpp
>lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
> 
> Modified: lldb/trunk/lit/SymbolFile/NativePDB/disassembly.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/NativePDB/disassembly.cpp?rev=344429&r1=344428&r2=344429&view=diff
> ==
> --- lldb/trunk/lit/SymbolFile/NativePDB/disassembly.cpp (original)
> +++ lldb/trunk/lit/SymbolFile/NativePDB/disassembly.cpp Fri Oct 12 15:57:40 
> 2018
> @@ -1,8 +1,8 @@
> // clang-format off
> 
> // Test that we can show disassembly and source.
> -// RUN: clang-cl /Z7 /GS- /GR- /c %s /Fo%t.obj
> -// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb 
> %t.obj
> +// RUN: clang-cl /Z7 /GS- /GR- /c /Fo%t.obj -- %s
> +// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb -- 
> %t.obj
> // RUN: env LLDB_USE_NATIVE_PDB_READER=1 lldb -f %t.exe -s \
> // RUN: %p/Inputs/disassembly.lldbinit | FileCheck %s
> 
> 
> Modified: lldb/trunk/lit/SymbolFile/NativePDB/simple-breakpoints.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/NativePDB/simple-breakpoints.cpp?rev=344429&r1=344428&r2=344429&view=diff
> ==
> --- lldb/trunk/lit/SymbolFile/NativePDB/simple-breakpoints.cpp (original)
> +++ lldb/trunk/lit/SymbolFile/NativePDB/simple-breakpoints.cpp Fri Oct 12 
> 15:57:40 2018
> @@ -1,8 +1,8 @@
> // clang-format off
> 
> // Test that we can set simple breakpoints using PDB on any platform.
> -// RUN: clang-cl /Z7 /GS- /GR- /c %s /Fo%t.obj
> -// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb 
> %t.obj
> +// RUN: clang-cl /Z7 /GS- /GR- /c /Fo%t.obj -- %s 
> +// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb -- 
> %t.obj
> // RUN: env LLDB_USE_NATIVE_PDB_READER=1 lldb -f %t.exe -s \
> // RUN: %p/Inputs/breakpoints.lldbinit | FileCheck %s
> 
> 
> Modified: lldb/trunk/lit/SymbolFile/NativePDB/source-list.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/NativePDB/source-list.cpp?rev=344429&r1=344428&r2=344429&view=diff
> ==
> --- lldb/trunk/lit/SymbolFile/NativePDB/source-list.cpp (original)
> +++ lldb/trunk/lit/SymbolFile/NativePDB/source-list.cpp Fri Oct 12 15:57:40 
> 2018
> @@ -1,8 +1,8 @@
> // clang-format off
> 
> // Test that we can set display source of functions.
> -// RUN: clang-cl /Z7 /GS- /GR- /c %s /Fo%t.obj
> -// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb 
> %t.obj
> +// RUN: clang-cl /Z7 /GS- /GR- /c /Fo%t.obj -- %s 
> +// RUN: lld-link /DEBUG /nodefaultlib /entry:main /OUT:%t.exe /PDB:%t.pdb -- 
> %t.obj
> // RUN: env LLDB_USE_NATIVE_PDB_READER=1 lldb -f %t.exe -s \
> // RUN: %p/Inputs/source-list.lldbinit | FileCheck %s
> 
> 
> Modified: 
> lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp?rev=344

[Lldb-commits] [lldb] r344626 - Simplify LocateDSYMInVincinityOfExecutable by moving

2018-10-16 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Oct 16 10:26:04 2018
New Revision: 344626

URL: http://llvm.org/viewvc/llvm-project?rev=344626&view=rev
Log:
Simplify LocateDSYMInVincinityOfExecutable by moving
some redundant code into a separate function, 
LookForDsymNextToExecutablePath, and having that function
also look for .dSYM.yaa files in addition to .dSYM
bundles.

Differential Revision: https://reviews.llvm.org/D53305

 


Modified:
lldb/trunk/source/Host/common/Symbols.cpp

Modified: lldb/trunk/source/Host/common/Symbols.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Symbols.cpp?rev=344626&r1=344625&r2=344626&view=diff
==
--- lldb/trunk/source/Host/common/Symbols.cpp (original)
+++ lldb/trunk/source/Host/common/Symbols.cpp Tue Oct 16 10:26:04 2018
@@ -65,96 +65,134 @@ static bool FileAtPathContainsArchAndUUI
   return false;
 }
 
+// Given a binary exec_fspec, and a ModuleSpec with an architecture/uuid,
+// return true if there is a matching dSYM bundle next to the exec_fspec,
+// and return that value in dsym_fspec.  
+// If there is a .dSYM.yaa compressed archive next to the exec_fspec, 
+// call through Symbols::DownloadObjectAndSymbolFile to download the
+// expanded/uncompressed dSYM and return that filepath in dsym_fspec.
+
+static bool LookForDsymNextToExecutablePath(const ModuleSpec &mod_spec,
+const FileSpec &exec_fspec,
+FileSpec &dsym_fspec) {
+  ConstString filename = exec_fspec.GetFilename();
+  FileSpec dsym_directory = exec_fspec;
+  dsym_directory.RemoveLastPathComponent();
+
+  std::string dsym_filename = filename.AsCString();
+  dsym_filename += ".dSYM";
+  dsym_directory.AppendPathComponent(dsym_filename);
+  dsym_directory.AppendPathComponent("Contents");
+  dsym_directory.AppendPathComponent("Resources");
+  dsym_directory.AppendPathComponent("DWARF");
+  
+  if (dsym_directory.Exists()) {
+
+// See if the binary name exists in the dSYM DWARF
+// subdir.
+FileSpec dsym_fspec = dsym_directory;
+dsym_fspec.AppendPathComponent(filename.AsCString());
+if (dsym_fspec.Exists()
+&& FileAtPathContainsArchAndUUID(dsym_fspec, 
+ mod_spec.GetArchitecturePtr(),
+ mod_spec.GetUUIDPtr())) {
+  return true;
+}
+
+// See if we have "../CF.framework" - so we'll look for
+// CF.framework.dSYM/Contents/Resources/DWARF/CF
+// We need to drop the last suffix after '.' to match 
+// 'CF' in the DWARF subdir.
+std::string binary_name (filename.AsCString());
+auto last_dot = binary_name.find_last_of('.');
+if (last_dot != std::string::npos) {
+  binary_name.erase(last_dot);
+  dsym_fspec = dsym_directory;
+  dsym_fspec.AppendPathComponent(binary_name);
+  if (dsym_fspec.Exists()
+  && FileAtPathContainsArchAndUUID(dsym_fspec, 
+   mod_spec.GetArchitecturePtr(),
+   mod_spec.GetUUIDPtr())) {
+return true;
+  }
+}
+  } 
+  
+  // See if we have a .dSYM.yaa next to this executable path.
+  FileSpec dsym_yaa_fspec = exec_fspec;
+  dsym_yaa_fspec.RemoveLastPathComponent();
+  std::string dsym_yaa_filename = filename.AsCString();
+  dsym_yaa_filename += ".dSYM.yaa";
+  dsym_yaa_fspec.AppendPathComponent(dsym_yaa_filename);
+
+  if (dsym_yaa_fspec.Exists()) {
+ModuleSpec mutable_mod_spec = mod_spec;
+if (Symbols::DownloadObjectAndSymbolFile (mutable_mod_spec, true)
+&& mutable_mod_spec.GetSymbolFileSpec().Exists()) {
+  dsym_fspec = mutable_mod_spec.GetSymbolFileSpec();
+  return true;
+}
+  }
+
+  return false;
+}
+
+// Given a ModuleSpec with a FileSpec and optionally uuid/architecture
+// filled in, look for a .dSYM bundle next to that binary.  Returns true
+// if a .dSYM bundle is found, and that path is returned in the dsym_fspec
+// FileSpec.
+//
+// This routine looks a few directory layers above the given exec_path -
+// exec_path might be /System/Library/Frameworks/CF.framework/CF and the
+// dSYM might be /System/Library/Frameworks/CF.framework.dSYM.
+//
+// If there is a .dSYM.yaa compressed archive found next to the binary,
+// we'll call DownloadObjectAndSymbolFile to expand it into a plain .dSYM
+
 static bool LocateDSYMInVincinityOfExecutable(const ModuleSpec &module_spec,
   FileSpec &dsym_fspec) {
   Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
-  const FileSpec *exec_fspec = module_spec.GetFileSpecPtr();
+  const FileSpec &exec_fspec = module_spec.GetFileSpec();
   if (exec_fspec) {
-char path[PATH_MAX];
-if (exec_fspec->GetPath(path, sizeof(path))) {
-  // Make sure the module isn't already just a dSYM file...
-  if (strcasestr(path, ".dSYM/Contents/Resources/DWARF") == NULL) {
+if (::LookForDsymNextToExe

[Lldb-commits] [lldb] r344628 - For a built & test bot, add an environment variable PLATFORM_SDK_DIRECTORY,

2018-10-16 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Oct 16 10:31:33 2018
New Revision: 344628

URL: http://llvm.org/viewvc/llvm-project?rev=344628&view=rev
Log:
For a built & test bot, add an environment variable PLATFORM_SDK_DIRECTORY,
which PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded
which examine for any additional SDK directories when it is
constructing its list.





Modified:
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp

Modified: 
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp?rev=344628&r1=344627&r2=344628&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp 
(original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp 
Tue Oct 16 10:31:33 2018
@@ -231,6 +231,29 @@ bool PlatformRemoteDarwinDevice::UpdateS
   }
 }
   }
+
+  const char *addtional_platform_dirs = getenv("PLATFORM_SDK_DIRECTORY");
+  if (addtional_platform_dirs) {
+SDKDirectoryInfoCollection env_var_sdk_directory_infos;
+FileSpec::EnumerateDirectory(addtional_platform_dirs, find_directories,
+ find_files, find_other,
+ 
GetContainedFilesIntoVectorOfStringsCallback,
+ &env_var_sdk_directory_infos);
+FileSpec sdk_symbols_symlink_fspec;
+for (const auto &sdk_directory_info : env_var_sdk_directory_infos) {
+  sdk_symbols_symlink_fspec = sdk_directory_info.directory;
+  sdk_symbols_symlink_fspec.AppendPathComponent("Symbols");
+  if (sdk_symbols_symlink_fspec.Exists()) {
+m_sdk_directory_infos.push_back(sdk_directory_info);
+if (log) {
+  
log->Printf("PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded "
+  "added env var SDK directory %s",
+  sdk_symbols_symlink_fspec.GetPath().c_str());
+}
+  }
+}
+  }
+
 }
   }
   return !m_sdk_directory_infos.empty();


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r344633 - Don't run TestBreakpointIt.py on arm64 devices;

2018-10-16 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Oct 16 11:11:17 2018
New Revision: 344633

URL: http://llvm.org/viewvc/llvm-project?rev=344633&view=rev
Log:
Don't run TestBreakpointIt.py on arm64 devices;
it is armv7 specific.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/arm/breakpoint-it/TestBreakpointIt.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/arm/breakpoint-it/TestBreakpointIt.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/arm/breakpoint-it/TestBreakpointIt.py?rev=344633&r1=344632&r2=344633&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/arm/breakpoint-it/TestBreakpointIt.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/arm/breakpoint-it/TestBreakpointIt.py 
Tue Oct 16 11:11:17 2018
@@ -19,6 +19,7 @@ class TestBreakpointIt(TestBase):
 NO_DEBUG_INFO_TESTCASE = True
 
 @skipIf(archs=no_match(["arm"]))
+@skipIf(archs=["arm64", "arm64e"])
 def test_false(self):
 self.build()
 exe = self.getBuildArtifact("a.out")
@@ -32,6 +33,7 @@ class TestBreakpointIt(TestBase):
 "Breakpoint does not get hit")
 
 @skipIf(archs=no_match(["arm"]))
+@skipIf(archs=["arm64", "arm64e"])
 def test_true(self):
 self.build()
 exe = self.getBuildArtifact("a.out")


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r344635 - Tiny testsuite tweaks. Don't run the apple simulator

2018-10-16 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Oct 16 11:14:30 2018
New Revision: 344635

URL: http://llvm.org/viewvc/llvm-project?rev=344635&view=rev
Log:
Tiny testsuite tweaks.  Don't run the apple simulator
tests when targetting a device.  Add an include to 
safe-to-call-func to work around a modules issue with
a certain combination of header files.  Add rules for
Darwin systems to ad-hoc codesign binaries that the
testsuite builds.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/macosx/safe-to-func-call/main.c
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestAppleSimulatorOSType.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/macosx/safe-to-func-call/main.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/safe-to-func-call/main.c?rev=344635&r1=344634&r2=344635&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/safe-to-func-call/main.c 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/safe-to-func-call/main.c 
Tue Oct 16 11:14:30 2018
@@ -1,3 +1,4 @@
+#include   // work around module map issue with iOS sdk, 
 
 #include 
 #include 
 #include 

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=344635&r1=344634&r2=344635&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Tue Oct 16 
11:14:30 2018
@@ -153,6 +153,7 @@ ifeq "$(OS)" "Darwin"
DSYM = $(EXE).dSYM
AR := $(CROSS_COMPILE)libtool
ARFLAGS := -static -o
+   CODESIGN = codesign
 else
AR := $(CROSS_COMPILE)ar
# On non-Apple platforms, -arch becomes -m
@@ -513,6 +514,9 @@ endif
 else
 $(EXE) : $(OBJECTS) $(ARCHIVE_NAME)
$(LD) $(OBJECTS) $(LDFLAGS) $(ARCHIVE_NAME) -o "$(EXE)"
+ifneq "$(CODESIGN)" ""
+   $(CODESIGN) -s - "$(EXE)"
+endif
 endif
 
 #--
@@ -557,6 +561,9 @@ endif
 $(DYLIB_FILENAME) : $(DYLIB_OBJECTS)
 ifeq "$(OS)" "Darwin"
$(LD) $(DYLIB_OBJECTS) $(LDFLAGS) -install_name 
"$(DYLIB_EXECUTABLE_PATH)/$(DYLIB_FILENAME)" -dynamiclib -o "$(DYLIB_FILENAME)"
+ifneq "$(CODESIGN)" ""
+   $(CODESIGN) -s - "$(DYLIB_FILENAME)"
+endif
 ifneq "$(MAKE_DSYM)" "NO"
 ifneq "$(DS)" ""
"$(DS)" $(DSFLAGS) "$(DYLIB_FILENAME)"

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestAppleSimulatorOSType.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestAppleSimulatorOSType.py?rev=344635&r1=344634&r2=344635&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestAppleSimulatorOSType.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestAppleSimulatorOSType.py
 Tue Oct 16 11:14:30 2018
@@ -95,18 +95,21 @@ class TestAppleSimulatorOSType(gdbremote
 
 @apple_simulator_test('iphone')
 @debugserver_test
+@skipIfDarwinEmbedded
 def test_simulator_ostype_ios(self):
 self.check_simulator_ostype(sdk='iphonesimulator',
 platform='ios')
 
 @apple_simulator_test('appletv')
 @debugserver_test
+@skipIfDarwinEmbedded
 def test_simulator_ostype_tvos(self):
 self.check_simulator_ostype(sdk='appletvsimulator',
 platform='tvos')
 
 @apple_simulator_test('watch')
 @debugserver_test
+@skipIfDarwinEmbedded
 def test_simulator_ostype_watchos(self):
 self.check_simulator_ostype(sdk='watchsimulator',
 platform='watchos', arch='i386')


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r344636 - Revert r344626 while I address a testsuite failure from a bot.

2018-10-16 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Oct 16 11:25:46 2018
New Revision: 344636

URL: http://llvm.org/viewvc/llvm-project?rev=344636&view=rev
Log:
Revert r344626 while I address a testsuite failure from a bot.


Modified:
lldb/trunk/source/Host/common/Symbols.cpp

Modified: lldb/trunk/source/Host/common/Symbols.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Symbols.cpp?rev=344636&r1=344635&r2=344636&view=diff
==
--- lldb/trunk/source/Host/common/Symbols.cpp (original)
+++ lldb/trunk/source/Host/common/Symbols.cpp Tue Oct 16 11:25:46 2018
@@ -65,134 +65,96 @@ static bool FileAtPathContainsArchAndUUI
   return false;
 }
 
-// Given a binary exec_fspec, and a ModuleSpec with an architecture/uuid,
-// return true if there is a matching dSYM bundle next to the exec_fspec,
-// and return that value in dsym_fspec.  
-// If there is a .dSYM.yaa compressed archive next to the exec_fspec, 
-// call through Symbols::DownloadObjectAndSymbolFile to download the
-// expanded/uncompressed dSYM and return that filepath in dsym_fspec.
-
-static bool LookForDsymNextToExecutablePath(const ModuleSpec &mod_spec,
-const FileSpec &exec_fspec,
-FileSpec &dsym_fspec) {
-  ConstString filename = exec_fspec.GetFilename();
-  FileSpec dsym_directory = exec_fspec;
-  dsym_directory.RemoveLastPathComponent();
-
-  std::string dsym_filename = filename.AsCString();
-  dsym_filename += ".dSYM";
-  dsym_directory.AppendPathComponent(dsym_filename);
-  dsym_directory.AppendPathComponent("Contents");
-  dsym_directory.AppendPathComponent("Resources");
-  dsym_directory.AppendPathComponent("DWARF");
-  
-  if (dsym_directory.Exists()) {
-
-// See if the binary name exists in the dSYM DWARF
-// subdir.
-FileSpec dsym_fspec = dsym_directory;
-dsym_fspec.AppendPathComponent(filename.AsCString());
-if (dsym_fspec.Exists()
-&& FileAtPathContainsArchAndUUID(dsym_fspec, 
- mod_spec.GetArchitecturePtr(),
- mod_spec.GetUUIDPtr())) {
-  return true;
-}
-
-// See if we have "../CF.framework" - so we'll look for
-// CF.framework.dSYM/Contents/Resources/DWARF/CF
-// We need to drop the last suffix after '.' to match 
-// 'CF' in the DWARF subdir.
-std::string binary_name (filename.AsCString());
-auto last_dot = binary_name.find_last_of('.');
-if (last_dot != std::string::npos) {
-  binary_name.erase(last_dot);
-  dsym_fspec = dsym_directory;
-  dsym_fspec.AppendPathComponent(binary_name);
-  if (dsym_fspec.Exists()
-  && FileAtPathContainsArchAndUUID(dsym_fspec, 
-   mod_spec.GetArchitecturePtr(),
-   mod_spec.GetUUIDPtr())) {
-return true;
-  }
-}
-  } 
-  
-  // See if we have a .dSYM.yaa next to this executable path.
-  FileSpec dsym_yaa_fspec = exec_fspec;
-  dsym_yaa_fspec.RemoveLastPathComponent();
-  std::string dsym_yaa_filename = filename.AsCString();
-  dsym_yaa_filename += ".dSYM.yaa";
-  dsym_yaa_fspec.AppendPathComponent(dsym_yaa_filename);
-
-  if (dsym_yaa_fspec.Exists()) {
-ModuleSpec mutable_mod_spec = mod_spec;
-if (Symbols::DownloadObjectAndSymbolFile (mutable_mod_spec, true)
-&& mutable_mod_spec.GetSymbolFileSpec().Exists()) {
-  dsym_fspec = mutable_mod_spec.GetSymbolFileSpec();
-  return true;
-}
-  }
-
-  return false;
-}
-
-// Given a ModuleSpec with a FileSpec and optionally uuid/architecture
-// filled in, look for a .dSYM bundle next to that binary.  Returns true
-// if a .dSYM bundle is found, and that path is returned in the dsym_fspec
-// FileSpec.
-//
-// This routine looks a few directory layers above the given exec_path -
-// exec_path might be /System/Library/Frameworks/CF.framework/CF and the
-// dSYM might be /System/Library/Frameworks/CF.framework.dSYM.
-//
-// If there is a .dSYM.yaa compressed archive found next to the binary,
-// we'll call DownloadObjectAndSymbolFile to expand it into a plain .dSYM
-
 static bool LocateDSYMInVincinityOfExecutable(const ModuleSpec &module_spec,
   FileSpec &dsym_fspec) {
   Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
-  const FileSpec &exec_fspec = module_spec.GetFileSpec();
+  const FileSpec *exec_fspec = module_spec.GetFileSpecPtr();
   if (exec_fspec) {
-if (::LookForDsymNextToExecutablePath (module_spec, exec_fspec, 
dsym_fspec)) {
+char path[PATH_MAX];
+if (exec_fspec->GetPath(path, sizeof(path))) {
+  // Make sure the module isn't already just a dSYM file...
+  if (strcasestr(path, ".dSYM/Contents/Resources/DWARF") == NULL) {
 if (log) {
-  log->Printf("dSYM with matching UUID & arch found at %s", 
dsym_fspec.GetPath().c_str());
+  if (module_spec.GetUUIDPtr()

[Lldb-commits] [lldb] r344646 - Fixed an issue that a bot found with my changes

2018-10-16 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Oct 16 14:49:31 2018
New Revision: 344646

URL: http://llvm.org/viewvc/llvm-project?rev=344646&view=rev
Log:
Fixed an issue that a bot found with my changes
in r344626 & recommitting.  Original commit msg:


Simplify LocateDSYMInVincinityOfExecutable by moving
some redundant code into a separate function, 
LookForDsymNextToExecutablePath, and having that function
also look for .dSYM.yaa files in addition to .dSYM
bundles.

Differential Revision: https://reviews.llvm.org/D53305

 

Modified:
lldb/trunk/source/Host/common/Symbols.cpp

Modified: lldb/trunk/source/Host/common/Symbols.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Symbols.cpp?rev=344646&r1=344645&r2=344646&view=diff
==
--- lldb/trunk/source/Host/common/Symbols.cpp (original)
+++ lldb/trunk/source/Host/common/Symbols.cpp Tue Oct 16 14:49:31 2018
@@ -65,96 +65,134 @@ static bool FileAtPathContainsArchAndUUI
   return false;
 }
 
+// Given a binary exec_fspec, and a ModuleSpec with an architecture/uuid,
+// return true if there is a matching dSYM bundle next to the exec_fspec,
+// and return that value in dsym_fspec.  
+// If there is a .dSYM.yaa compressed archive next to the exec_fspec, 
+// call through Symbols::DownloadObjectAndSymbolFile to download the
+// expanded/uncompressed dSYM and return that filepath in dsym_fspec.
+
+static bool LookForDsymNextToExecutablePath(const ModuleSpec &mod_spec,
+const FileSpec &exec_fspec,
+FileSpec &dsym_fspec) {
+  ConstString filename = exec_fspec.GetFilename();
+  FileSpec dsym_directory = exec_fspec;
+  dsym_directory.RemoveLastPathComponent();
+
+  std::string dsym_filename = filename.AsCString();
+  dsym_filename += ".dSYM";
+  dsym_directory.AppendPathComponent(dsym_filename);
+  dsym_directory.AppendPathComponent("Contents");
+  dsym_directory.AppendPathComponent("Resources");
+  dsym_directory.AppendPathComponent("DWARF");
+  
+  if (dsym_directory.Exists()) {
+
+// See if the binary name exists in the dSYM DWARF
+// subdir.
+dsym_fspec = dsym_directory;
+dsym_fspec.AppendPathComponent(filename.AsCString());
+if (dsym_fspec.Exists()
+&& FileAtPathContainsArchAndUUID(dsym_fspec, 
+ mod_spec.GetArchitecturePtr(),
+ mod_spec.GetUUIDPtr())) {
+  return true;
+}
+
+// See if we have "../CF.framework" - so we'll look for
+// CF.framework.dSYM/Contents/Resources/DWARF/CF
+// We need to drop the last suffix after '.' to match 
+// 'CF' in the DWARF subdir.
+std::string binary_name (filename.AsCString());
+auto last_dot = binary_name.find_last_of('.');
+if (last_dot != std::string::npos) {
+  binary_name.erase(last_dot);
+  dsym_fspec = dsym_directory;
+  dsym_fspec.AppendPathComponent(binary_name);
+  if (dsym_fspec.Exists()
+  && FileAtPathContainsArchAndUUID(dsym_fspec, 
+   mod_spec.GetArchitecturePtr(),
+   mod_spec.GetUUIDPtr())) {
+return true;
+  }
+}
+  } 
+  
+  // See if we have a .dSYM.yaa next to this executable path.
+  FileSpec dsym_yaa_fspec = exec_fspec;
+  dsym_yaa_fspec.RemoveLastPathComponent();
+  std::string dsym_yaa_filename = filename.AsCString();
+  dsym_yaa_filename += ".dSYM.yaa";
+  dsym_yaa_fspec.AppendPathComponent(dsym_yaa_filename);
+
+  if (dsym_yaa_fspec.Exists()) {
+ModuleSpec mutable_mod_spec = mod_spec;
+if (Symbols::DownloadObjectAndSymbolFile (mutable_mod_spec, true)
+&& mutable_mod_spec.GetSymbolFileSpec().Exists()) {
+  dsym_fspec = mutable_mod_spec.GetSymbolFileSpec();
+  return true;
+}
+  }
+
+  return false;
+}
+
+// Given a ModuleSpec with a FileSpec and optionally uuid/architecture
+// filled in, look for a .dSYM bundle next to that binary.  Returns true
+// if a .dSYM bundle is found, and that path is returned in the dsym_fspec
+// FileSpec.
+//
+// This routine looks a few directory layers above the given exec_path -
+// exec_path might be /System/Library/Frameworks/CF.framework/CF and the
+// dSYM might be /System/Library/Frameworks/CF.framework.dSYM.
+//
+// If there is a .dSYM.yaa compressed archive found next to the binary,
+// we'll call DownloadObjectAndSymbolFile to expand it into a plain .dSYM
+
 static bool LocateDSYMInVincinityOfExecutable(const ModuleSpec &module_spec,
   FileSpec &dsym_fspec) {
   Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
-  const FileSpec *exec_fspec = module_spec.GetFileSpecPtr();
+  const FileSpec &exec_fspec = module_spec.GetFileSpec();
   if (exec_fspec) {
-char path[PATH_MAX];
-if (exec_fspec->GetPath(path, sizeof(path))) {
-  // Make sure the module isn't already just a dSYM file...
-  if (strc

[Lldb-commits] [lldb] r345069 - Add UdtRecordCompleter.cpp.

2018-10-23 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Oct 23 12:03:52 2018
New Revision: 345069

URL: http://llvm.org/viewvc/llvm-project?rev=345069&view=rev
Log:
Add UdtRecordCompleter.cpp.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=345069&r1=345068&r2=345069&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Oct 23 12:03:52 2018
@@ -998,6 +998,7 @@
54067BF11DF2041B00749AA5 /* UBSanRuntime.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 54067BEC1DF2034B00749AA5 /* UBSanRuntime.cpp */; 
};
2579065D1BD0488100178368 /* UDPSocket.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 2579065B1BD0488100178368 /* UDPSocket.cpp */; };
49CA97001E6AACC900C03FEE /* UUID.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 49CA96EA1E6AAC6600C03FEE /* UUID.cpp */; };
+   AF0578C4217FA80700CF9D80 /* UdtRecordCompleter.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AF0578C2217FA80700CF9D80 /* 
UdtRecordCompleter.cpp */; };
268900CD13353E5F00698AC0 /* UniqueDWARFASTType.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 26B8B42312EEC52A00A831B2 /* 
UniqueDWARFASTType.cpp */; };
2689010C13353E6F00698AC0 /* UnixSignals.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 4C00987011500B4300F316B0 /* UnixSignals.cpp */; 
};
9A2057201F3B8D2500F6C293 /* UnixSignalsTest.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 9A20571E1F3B8D2100F6C293 /* UnixSignalsTest.cpp 
*/; };
@@ -3162,6 +3163,8 @@
2579065B1BD0488100178368 /* UDPSocket.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = UDPSocket.cpp; sourceTree = ""; };
49CA96EA1E6AAC6600C03FEE /* UUID.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = UUID.cpp; path = source/Utility/UUID.cpp; sourceTree = ""; };
49CA96F51E6AAC8E00C03FEE /* UUID.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
UUID.h; path = include/lldb/Utility/UUID.h; sourceTree = ""; };
+   AF0578C2217FA80700CF9D80 /* UdtRecordCompleter.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = UdtRecordCompleter.cpp; path = 
source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.cpp; sourceTree = 
SOURCE_ROOT; };
+   AF0578C1217FA80700CF9D80 /* UdtRecordCompleter.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
UdtRecordCompleter.h; path = 
source/Plugins/SymbolFile/NativePDB/UdtRecordCompleter.h; sourceTree = 
SOURCE_ROOT; };
268A813F115B19D000F645B0 /* UniqueCStringMap.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
UniqueCStringMap.h; path = include/lldb/Core/UniqueCStringMap.h; sourceTree = 
""; };
26B8B42312EEC52A00A831B2 /* UniqueDWARFASTType.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = UniqueDWARFASTType.cpp; sourceTree = ""; };
26B8B42212EEC52A00A831B2 /* UniqueDWARFASTType.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
UniqueDWARFASTType.h; sourceTree = ""; };
@@ -6925,6 +6928,8 @@
AFD966BE217140C8006714AC /* PdbUtil.h */,
AFD966B7217140B6006714AC /* 
SymbolFileNativePDB.cpp */,
AFD966C0217140C8006714AC /* 
SymbolFileNativePDB.h */,
+   AF0578C2217FA80700CF9D80 /* 
UdtRecordCompleter.cpp */,
+   AF0578C1217FA80700CF9D80 /* 
UdtRecordCompleter.h */,
);
name = NativePDB;
path = "New Group";
@@ -7865,6 +7870,7 @@
2689FFFB13353DB600698AC0 /* 
BreakpointLocationList.cpp in Sources */,
AFD966B9217140B6006714AC /* PdbUtil.cpp in 
Sources */,
2689FFFD13353DB600698AC0 /* 
BreakpointOptions.cpp in Sources */,
+   AF0578C4217FA80700CF9D80 /* 
UdtRecordCompleter.cpp in Sources */,
268913353DB600698AC0 /* 
BreakpointResolver.cpp in Sources */,
25420ECD1A6490B8009ADBCB /* OptionValueChar.cpp 
in Sources */,
2689000113353DB600698AC0 /* 
BreakpointResolverAddress.cpp in Sources */,


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm

[Lldb-commits] [lldb] r345106 - Support nwere versions of the Segger J-Link jtag board software.

2018-10-23 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Oct 23 16:45:56 2018
New Revision: 345106

URL: http://llvm.org/viewvc/llvm-project?rev=345106&view=rev
Log:
Support nwere versions of the Segger J-Link jtag board software.
Add support in ProcessGDBRemote::GetGDBServerRegisterInfo
for recognizing a generic "arm" architecture that will be used if
nothing better is available so that we don't ignore the register
definitions if we didn't already have an architecture set.
Also in ProcessGDBRemote::DoConnectRemote don't set the target
arch unless we have a valid architecture to set it to.

Platform::ConnectProcess will try to get the current target's
architecture, or the default architecture, when creating the 
target for the connection to be attempted.  If lldb was started
with a target binary, we want to create this target with that
architecture in case the remote gdb stub doesn't supply a
qHostInfo arch.

Add logging to Target::MergeArchitecture.

 


Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestArmRegisterDefinition.py
Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Target/Platform.cpp
lldb/trunk/source/Target/Target.cpp

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestArmRegisterDefinition.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestArmRegisterDefinition.py?rev=345106&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestArmRegisterDefinition.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestArmRegisterDefinition.py
 Tue Oct 23 16:45:56 2018
@@ -0,0 +1,130 @@
+from __future__ import print_function
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+from gdbclientutils import *
+
+class TestArmRegisterDefinition(GDBRemoteTestBase):
+
+@skipIfXmlSupportMissing
+@skipIfRemote
+def test(self):
+"""
+Test lldb's parsing of the  tag in the target.xml 
register
+description packet.
+"""
+class MyResponder(MockGDBServerResponder):
+
+def qXferRead(self, obj, annex, offset, length):
+if annex == "target.xml":
+return """
+
+
+arm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+""", False
+else:
+return None, False
+
+def readRegister(self, regnum):
+return "E01"
+
+def readRegisters(self):
+return 
"2000f836002000102fcb0008f8360020a0360020200c0020b87f0120b7d100082ed200080001b87f0120"
+
+def haltReason(self):
+return "S05"
+
+def qfThreadInfo(self):
+return "mdead"
+
+ 

[Lldb-commits] [lldb] r345422 - Remove an early-return from Driver::ParseArgs that

2018-10-26 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Oct 26 12:40:18 2018
New Revision: 345422

URL: http://llvm.org/viewvc/llvm-project?rev=345422&view=rev
Log:
Remove an early-return from Driver::ParseArgs that
was added as a part of D52604 / r343348.  If the
lldb driver is run without any arguments, .lldbinit 
file reading was not enabled.

 

Modified:
lldb/trunk/tools/driver/Driver.cpp

Modified: lldb/trunk/tools/driver/Driver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Driver.cpp?rev=345422&r1=345421&r2=345422&view=diff
==
--- lldb/trunk/tools/driver/Driver.cpp (original)
+++ lldb/trunk/tools/driver/Driver.cpp Fri Oct 26 12:40:18 2018
@@ -578,10 +578,6 @@ SBError Driver::ParseArgs(int argc, cons
 
   ResetOptionValues();
 
-  // No arguments or just program name, nothing to parse.
-  if (argc <= 1)
-return SBError();
-
   SBError error;
   std::vector long_options_vector;
   BuildGetOptTable(long_options_vector);


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r345912 - When no FileCheck binary is specified, look in the llvm/clang bin

2018-11-01 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Nov  1 16:41:05 2018
New Revision: 345912

URL: http://llvm.org/viewvc/llvm-project?rev=345912&view=rev
Log:
When no FileCheck binary is specified, look in the llvm/clang bin
dirs relative to the source directory (Xcode build style) to find
one, use it if found.  


Modified:
lldb/trunk/packages/Python/lldbsuite/test/dotest.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=345912&r1=345911&r2=345912&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Nov  1 16:41:05 2018
@@ -313,6 +313,13 @@ def parseOptionsAndInitTestdirs():
 # target. However, when invoking dotest.py directly, a valid 
--filecheck
 # option needs to be given.
 configuration.filecheck = os.path.abspath(args.filecheck)
+else:
+outputPaths = get_llvm_bin_dirs()
+for outputPath in outputPaths:
+candidatePath = os.path.join(outputPath, 'FileCheck')
+if is_exe(candidatePath):
+configuration.filecheck = candidatePath
+break
 
 if not configuration.get_filecheck_path():
 logging.warning('No valid FileCheck executable; some tests may 
fail...')
@@ -627,6 +634,31 @@ def getOutputPaths(lldbRootDirectory):
 
 return result
 
+def get_llvm_bin_dirs():
+"""
+Returns an array of paths that may have the llvm/clang/etc binaries
+in them, relative to this current file.  
+Returns an empty array if none are found.
+"""
+result = []
+
+lldb_root_path = os.path.join(
+os.path.dirname(__file__), "..", "..", "..", "..")
+paths_to_try = [
+"llvm-build/Release+Asserts/x86_64/bin",
+"llvm-build/Debug+Asserts/x86_64/bin",
+"llvm-build/Release/x86_64/bin",
+"llvm-build/Debug/x86_64/bin",
+"llvm-build/Ninja-DebugAssert/llvm-macosx-x86_64/bin",
+"llvm-build/Ninja-ReleaseAssert/llvm-macosx-x86_64/bin",
+"llvm-build/Ninja-RelWithDebInfoAssert/llvm-macosx-x86_64/bin",
+]
+for p in paths_to_try:
+path = os.path.join(lldb_root_path, p)
+if os.path.exists(path):
+result.append(path)
+
+return result
 
 def setupSysPath():
 """


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r346278 - Add MSVCUndecoratedNameParser.cpp.

2018-11-06 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Nov  6 15:01:42 2018
New Revision: 346278

URL: http://llvm.org/viewvc/llvm-project?rev=346278&view=rev
Log:
Add MSVCUndecoratedNameParser.cpp.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=346278&r1=346277&r2=346278&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Nov  6 15:01:42 2018
@@ -476,6 +476,7 @@
266942451A6DC2AC0063BE93 /* MIUtilString.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 266941EE1A6DC2AC0063BE93 /* MIUtilString.cpp */; 
};
2669424A1A6DC2AC0063BE93 /* MIUtilThreadBaseStd.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 266941F81A6DC2AC0063BE93 /* 
MIUtilThreadBaseStd.cpp */; };
2669424B1A6DC2AC0063BE93 /* MIUtilVariant.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 266941FA1A6DC2AC0063BE93 /* MIUtilVariant.cpp 
*/; };
+   AF395C03219254F300894EC3 /* MSVCUndecoratedNameParser.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF395C01219254F200894EC3 /* 
MSVCUndecoratedNameParser.cpp */; };
D67521381EA17C4200439694 /* MainLoop.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = D67521351EA17C3900439694 /* MainLoop.cpp */; };
9A20573A1F3B8E7E00F6C293 /* MainLoopTest.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 9A2057301F3B8E7600F6C293 /* MainLoopTest.cpp */; 
};
8C3BD9961EF45DA50016C343 /* MainThreadCheckerRuntime.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 8C3BD9951EF45D9B0016C343 /* 
MainThreadCheckerRuntime.cpp */; };
@@ -2191,6 +2192,8 @@
266941F91A6DC2AC0063BE93 /* MIUtilThreadBaseStd.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
MIUtilThreadBaseStd.h; path = "tools/lldb-mi/MIUtilThreadBaseStd.h"; sourceTree 
= SOURCE_ROOT; };
266941FA1A6DC2AC0063BE93 /* MIUtilVariant.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = MIUtilVariant.cpp; path = "tools/lldb-mi/MIUtilVariant.cpp"; sourceTree 
= SOURCE_ROOT; };
266941FB1A6DC2AC0063BE93 /* MIUtilVariant.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
MIUtilVariant.h; path = "tools/lldb-mi/MIUtilVariant.h"; sourceTree = 
SOURCE_ROOT; };
+   AF395C01219254F200894EC3 /* MSVCUndecoratedNameParser.cpp */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; name = MSVCUndecoratedNameParser.cpp; path = 
Language/CPlusPlus/MSVCUndecoratedNameParser.cpp; sourceTree = ""; };
+   AF395C00219254F200894EC3 /* MSVCUndecoratedNameParser.h */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
name = MSVCUndecoratedNameParser.h; path = 
Language/CPlusPlus/MSVCUndecoratedNameParser.h; sourceTree = ""; };
D67521351EA17C3900439694 /* MainLoop.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = MainLoop.cpp; sourceTree = ""; };
9A2057301F3B8E7600F6C293 /* MainLoopTest.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = MainLoopTest.cpp; sourceTree = ""; };
8C3BD9951EF45D9B0016C343 /* MainThreadCheckerRuntime.cpp */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = 
MainThreadCheckerRuntime.cpp; sourceTree = ""; };
@@ -6460,6 +6463,8 @@
94B6385B1B8FB174004FE1E4 /* 
CPlusPlusLanguage.cpp */,
49F811F01E931B1500F4E163 /* 
CPlusPlusNameParser.h */,
49F811EF1E931B1500F4E163 /* 
CPlusPlusNameParser.cpp */,
+   AF395C01219254F200894EC3 /* 
MSVCUndecoratedNameParser.cpp */,
+   AF395C00219254F200894EC3 /* 
MSVCUndecoratedNameParser.h */,
);
name = CPlusPlus;
sourceTree = "";
@@ -7734,6 +7739,7 @@
23F4034D1926E0F60046DC9B /* 
NativeRegisterContextRegisterInfo.cpp in Sources */,
964463EC1A330C0500154ED8 /* 
CompactUnwindInfo.cpp in Sources */,
94B638531B8F8E6C004FE1E4 /* Language.cpp in 
Sources */,
+   AF395C03219254F300894EC3 /* 
MSVCUndecoratedNameParser.cpp in Sources */,
2689001D13353DDE00698AC0 /* 
CommandObjectLog.cpp in Sources */,
262173A318395D4600C52091 /* 
SectionLoadHistory.cpp in Sources */,
2689001E13353DDE00698AC0 /* 

[Lldb-commits] [lldb] r346283 - Compiler warning pointed out a mistake - fix it.

2018-11-06 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Nov  6 16:25:02 2018
New Revision: 346283

URL: http://llvm.org/viewvc/llvm-project?rev=346283&view=rev
Log:

Compiler warning pointed out a mistake - fix it.

Modified:
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp?rev=346283&r1=346282&r2=346283&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp Tue Nov  6 
16:25:02 2018
@@ -93,7 +93,7 @@ PlatformSP PlatformMacOSX::CreateInstanc
 #if defined(__APPLE__)
 // Only accept "unknown" for vendor if the host is Apple and it "unknown"
 // wasn't specified (it was just returned because it was NOT specified)
-case llvm::Triple::UnknownArch:
+case llvm::Triple::UnknownVendor:
   create = !arch->TripleVendorWasSpecified();
   break;
 #endif


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r346285 - Standardize the OTHER_LDFLAGS for the lldb-gtest-build target.

2018-11-06 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Nov  6 17:19:52 2018
New Revision: 346285

URL: http://llvm.org/viewvc/llvm-project?rev=346285&view=rev
Log:
Standardize the OTHER_LDFLAGS for the lldb-gtest-build target.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=346285&r1=346284&r2=346285&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Nov  6 17:19:52 2018
@@ -8623,9 +8623,22 @@
"-Wimplicit-fallthrough",
);
OTHER_LDFLAGS = (
-   "$(LLDB_COMPRESSION_LDFLAGS)",
+   "$(inherited)",
+   "-filelist",
+   "$(LLVM_BUILD_DIR)/archives.txt",
+   "-framework",
+   Foundation,
+   "-framework",
+   DebugSymbols,
+   "-framework",
+   Security,
+   "-framework",
+   CoreServices,
+   "-framework",
+   ApplicationServices,
+   "$(LLDB_GTESTS_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
-   "$(LLDB_COVERAGE_LDFLAGS)",
+   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PYTHON_FRAMEWORK_PATH = 
/System/Library/Frameworks/Python.framework/;
PYTHON_VERSION_MAJOR = 2;
@@ -8713,9 +8726,22 @@
"-Wimplicit-fallthrough",
);
OTHER_LDFLAGS = (
-   "$(LLDB_COMPRESSION_LDFLAGS)",
+   "$(inherited)",
+   "-filelist",
+   "$(LLVM_BUILD_DIR)/archives.txt",
+   "-framework",
+   Foundation,
+   "-framework",
+   DebugSymbols,
+   "-framework",
+   Security,
+   "-framework",
+   CoreServices,
+   "-framework",
+   ApplicationServices,
+   "$(LLDB_GTESTS_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
-   "$(LLDB_COVERAGE_LDFLAGS)",
+   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PYTHON_FRAMEWORK_PATH = 
/System/Library/Frameworks/Python.framework/;
PYTHON_VERSION_MAJOR = 2;
@@ -9036,6 +9062,8 @@
"-framework",
ApplicationServices,
"$(LLDB_GTESTS_LDFLAGS)",
+   "$(LLDB_ZLIB_LDFLAGS)",
+   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PRODUCT_NAME = "lldb-gtest";
};
@@ -9078,6 +9106,8 @@
"-framework",
ApplicationServices,
"$(LLDB_GTESTS_LDFLAGS)",
+   "$(LLDB_ZLIB_LDFLAGS)",
+   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PRODUCT_NAME = "lldb-gtest";
};
@@ -9120,6 +9150,8 @@
"-framework",
ApplicationServices,
"$(LLDB_GTESTS_LDFLAGS)",
+   "$(LLDB_ZLIB_LDFLAGS)",
+   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PRODUCT_NAME = "lldb-gtest";
};
@@ -9162,6 +9194,8 @@
"-framework",
   

[Lldb-commits] [lldb] r346342 - Revert r346285 until I can make it work correctly

2018-11-07 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Nov  7 10:38:15 2018
New Revision: 346342

URL: http://llvm.org/viewvc/llvm-project?rev=346342&view=rev
Log:
Revert r346285 until I can make it work correctly
the way the bots build lldb.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=346342&r1=346341&r2=346342&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Nov  7 10:38:15 2018
@@ -8623,22 +8623,9 @@
"-Wimplicit-fallthrough",
);
OTHER_LDFLAGS = (
-   "$(inherited)",
-   "-filelist",
-   "$(LLVM_BUILD_DIR)/archives.txt",
-   "-framework",
-   Foundation,
-   "-framework",
-   DebugSymbols,
-   "-framework",
-   Security,
-   "-framework",
-   CoreServices,
-   "-framework",
-   ApplicationServices,
-   "$(LLDB_GTESTS_LDFLAGS)",
-   "$(LLDB_ZLIB_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
+   "$(LLDB_ZLIB_LDFLAGS)",
+   "$(LLDB_COVERAGE_LDFLAGS)",
);
PYTHON_FRAMEWORK_PATH = 
/System/Library/Frameworks/Python.framework/;
PYTHON_VERSION_MAJOR = 2;
@@ -8726,22 +8713,9 @@
"-Wimplicit-fallthrough",
);
OTHER_LDFLAGS = (
-   "$(inherited)",
-   "-filelist",
-   "$(LLVM_BUILD_DIR)/archives.txt",
-   "-framework",
-   Foundation,
-   "-framework",
-   DebugSymbols,
-   "-framework",
-   Security,
-   "-framework",
-   CoreServices,
-   "-framework",
-   ApplicationServices,
-   "$(LLDB_GTESTS_LDFLAGS)",
-   "$(LLDB_ZLIB_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
+   "$(LLDB_ZLIB_LDFLAGS)",
+   "$(LLDB_COVERAGE_LDFLAGS)",
);
PYTHON_FRAMEWORK_PATH = 
/System/Library/Frameworks/Python.framework/;
PYTHON_VERSION_MAJOR = 2;
@@ -9062,8 +9036,6 @@
"-framework",
ApplicationServices,
"$(LLDB_GTESTS_LDFLAGS)",
-   "$(LLDB_ZLIB_LDFLAGS)",
-   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PRODUCT_NAME = "lldb-gtest";
};
@@ -9106,8 +9078,6 @@
"-framework",
ApplicationServices,
"$(LLDB_GTESTS_LDFLAGS)",
-   "$(LLDB_ZLIB_LDFLAGS)",
-   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PRODUCT_NAME = "lldb-gtest";
};
@@ -9150,8 +9120,6 @@
"-framework",
ApplicationServices,
"$(LLDB_GTESTS_LDFLAGS)",
-   "$(LLDB_ZLIB_LDFLAGS)",
-   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PRODUCT_NAME = "lldb-gtest";
};
@@ -9194,8 +9162,6 @@
"-framework",
 

[Lldb-commits] [lldb] r346347 - Re-commit regularization of the lldb-gtest-build target.

2018-11-07 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Nov  7 11:28:03 2018
New Revision: 346347

URL: http://llvm.org/viewvc/llvm-project?rev=346347&view=rev
Log:
Re-commit regularization of the lldb-gtest-build target.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=346347&r1=346346&r2=346347&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Nov  7 11:28:03 2018
@@ -9036,6 +9036,8 @@
"-framework",
ApplicationServices,
"$(LLDB_GTESTS_LDFLAGS)",
+   "$(LLDB_ZLIB_LDFLAGS)",
+   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PRODUCT_NAME = "lldb-gtest";
};
@@ -9078,6 +9080,8 @@
"-framework",
ApplicationServices,
"$(LLDB_GTESTS_LDFLAGS)",
+   "$(LLDB_ZLIB_LDFLAGS)",
+   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PRODUCT_NAME = "lldb-gtest";
};
@@ -9120,6 +9124,8 @@
"-framework",
ApplicationServices,
"$(LLDB_GTESTS_LDFLAGS)",
+   "$(LLDB_ZLIB_LDFLAGS)",
+   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PRODUCT_NAME = "lldb-gtest";
};
@@ -9162,6 +9168,8 @@
"-framework",
ApplicationServices,
"$(LLDB_GTESTS_LDFLAGS)",
+   "$(LLDB_ZLIB_LDFLAGS)",
+   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PRODUCT_NAME = "lldb-gtest";
};


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r346443 - Change $CURRENT_ARCH settings in xcode project file to hardcoded

2018-11-08 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Nov  8 14:41:19 2018
New Revision: 346443

URL: http://llvm.org/viewvc/llvm-project?rev=346443&view=rev
Log:
Change $CURRENT_ARCH settings in xcode project file to hardcoded
"x86_64" - used for finding the llvm build directory.  Newer
Xcodes do not define CURRENT_ARCH.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=346443&r1=346442&r2=346443&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Nov  8 14:41:19 2018
@@ -7433,7 +7433,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
-   shellScript = "/usr/bin/python 
$SRCROOT/scripts/Xcode/package-clang-headers.py $TARGET_BUILD_DIR 
$LLVM_BUILD_DIR/$CURRENT_ARCH\n";
+   shellScript = "/usr/bin/python 
$SRCROOT/scripts/Xcode/package-clang-headers.py $TARGET_BUILD_DIR 
$LLVM_BUILD_DIR/x86_64\n";
};
4C3326CA18B2A2B800EB5DD7 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@@ -7469,7 +7469,7 @@
inputPaths = (
"$(BUILT_PRODUCTS_DIR)/lldb.py",

"$(SRCROOT)/source/Interpreter/embedded_interpreter.py",
-   
"$(OBJECT_FILE_DIR_normal)/$(CURRENT_ARCH)/LLDBWrapPython.o",
+   
"$(OBJECT_FILE_DIR_normal)/x86_64/LLDBWrapPython.o",
);
name = "Finish swig wrapper classes (lldb)";
outputPaths = (
@@ -8611,7 +8611,7 @@
LLDB_ZLIB_LDFLAGS = "-lz";
LLVM_BUILD_DIR = 
"$(SRCROOT)/llvm-build/$(LLVM_CONFIGURATION)";
LLVM_BUILD_DIRTREE = "$(SRCROOT)/llvm-build";
-   LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
+   LLVM_BUILD_DIR_ARCH = "x86_64/";
LLVM_CONFIGURATION = "Release+Asserts";
LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
ONLY_ACTIVE_ARCH = YES;
@@ -8701,7 +8701,7 @@
LLDB_ZLIB_LDFLAGS = "-lz";
LLVM_BUILD_DIR = 
"$(SRCROOT)/llvm-build/$(LLVM_CONFIGURATION)";
LLVM_BUILD_DIRTREE = "$(SRCROOT)/llvm-build";
-   LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
+   LLVM_BUILD_DIR_ARCH = "x86_64/";
LLVM_CONFIGURATION = "Release+Asserts";
LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
ONLY_ACTIVE_ARCH = YES;
@@ -9859,7 +9859,7 @@
LLDB_ZLIB_LDFLAGS = "-lz";
LLVM_BUILD_DIR = "$(OBJROOT)/llvm";
LLVM_BUILD_DIRTREE = "$(OBJROOT)/llvm-build";
-   LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
+   LLVM_BUILD_DIR_ARCH = "x86_64/";
LLVM_CONFIGURATION = Release;
LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
OTHER_CFLAGS = (
@@ -10575,7 +10575,7 @@
LLDB_ZLIB_LDFLAGS = "-lz";
LLVM_BUILD_DIR = 
"$(SRCROOT)/llvm-build/$(LLVM_CONFIGURATION)";
LLVM_BUILD_DIRTREE = "$(SRCROOT)/llvm-build";
-   LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
+   LLVM_BUILD_DIR_ARCH = "x86_64/";
LLVM_CONFIGURATION = "Debug+Asserts";
LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
ONLY_ACTIVE_ARCH = YES;


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r346553 - Remove llvm include from debugserver, change

2018-11-09 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Nov  9 12:31:41 2018
New Revision: 346553

URL: http://llvm.org/viewvc/llvm-project?rev=346553&view=rev
Log:
Remove llvm include from debugserver, change 
LLVM_FALLTHROUGH's to [[clang::fallthrough]] -
debugserver is only ever compiled on darwin
systems with clang.

Modified:
lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp
lldb/trunk/tools/debugserver/source/RNBRemote.cpp

Modified: lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp?rev=346553&r1=346552&r2=346553&view=diff
==
--- lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp (original)
+++ lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp Fri Nov  9 12:31:41 
2018
@@ -13,7 +13,6 @@
 
 #include "DNBRegisterInfo.h"
 #include "DNBLog.h"
-#include 
 #include 
 
 DNBRegisterValueClass::DNBRegisterValueClass(const DNBRegisterInfo *regInfo) {
@@ -157,7 +156,7 @@ void DNBRegisterValueClass::Dump(const c
 DNBLogError(
 "unsupported vector format %d, defaulting to hex bytes.",
 info.format);
-LLVM_FALLTHROUGH;
+[[clang::fallthrough]];
   case VectorOfUInt8:
 snprintf(str, sizeof(str), "%s", "uint8   { ");
 pos = str + strlen(str);

Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=346553&r1=346552&r2=346553&view=diff
==
--- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Fri Nov  9 12:31:41 2018
@@ -50,7 +50,6 @@
 #include 
 #endif
 
-#include 
 #include  // for endianness predefines
 #include 
 #include 
@@ -3691,7 +3690,7 @@ rnb_err_t RNBRemote::HandlePacket_v(cons
   return HandlePacket_ILLFORMED(
   __FILE__, __LINE__, p, "Could not parse signal in vCont packet");
   // Fall through to next case...
-LLVM_FALLTHROUGH;
+[[clang::fallthrough]];
   case 'c':
 // Continue
 thread_action.state = eStateRunning;
@@ -3704,7 +3703,7 @@ rnb_err_t RNBRemote::HandlePacket_v(cons
   return HandlePacket_ILLFORMED(
   __FILE__, __LINE__, p, "Could not parse signal in vCont packet");
   // Fall through to next case...
-LLVM_FALLTHROUGH;
+[[clang::fallthrough]];
   case 's':
 // Step
 thread_action.state = eStateStepping;


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r346561 - Work with a gdb-remote target that doesn't handle the

2018-11-09 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Nov  9 14:33:26 2018
New Revision: 346561

URL: http://llvm.org/viewvc/llvm-project?rev=346561&view=rev
Log:
Work with a gdb-remote target that doesn't handle the
qWatchpointSupportInfo packet correctly.  

In GDBRemoteCommunicationClient::GetWatchpointSupportInfo,
if the response to qWatchpointSupportInfo does not
include the 'num' field, then we did not get an answer
we understood, mark this target as not supporting that
packet.

In Target.cpp, rename the very confusingly named
CheckIfWatchpointsExhausted to CheckIfWatchpointsSupported,
and check the error status returned by 
Process::GetWatchpointSupportInfo.  If we cannot determine
what the number of supported watchpoints are, assume that
they will work.  We'll handle the failure
later when we try to create/enable the watchpoint if the
Z2 packet isn't supported.

Add a gdb_remote_client test case.

 




Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
Modified:

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/trunk/source/Target/Target.cpp

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py?rev=346561&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestNoWatchpointSupportInfo.py
 Fri Nov  9 14:33:26 2018
@@ -0,0 +1,64 @@
+from __future__ import print_function
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+from gdbclientutils import *
+
+class TestNoWatchpointSupportInfo(GDBRemoteTestBase):
+
+@skipIfXmlSupportMissing
+@skipIfRemote
+def test(self):
+"""
+Test lldb's parsing of the  tag in the target.xml 
register
+description packet.
+"""
+class MyResponder(MockGDBServerResponder):
+
+def haltReason(self):
+return "T02thread:1ff0d;thread-pcs:10001bc00;"
+
+def threadStopInfo(self, threadnum):
+if threadnum == 0x1ff0d:
+return "T02thread:1ff0d;thread-pcs:10001bc00;"
+
+def setBreakpoint(self, packet):
+if packet.startswith("Z2,"):
+return "OK"
+
+def qXferRead(self, obj, annex, offset, length):
+if annex == "target.xml":
+return """
+
+  i386:x86-64
+  
+
+  
+""", False
+else:
+return None, False
+
+self.server.responder = MyResponder()
+if self.TraceOn():
+interp = self.dbg.GetCommandInterpreter()
+result = lldb.SBCommandReturnObject()
+interp.HandleCommand("log enable gdb-remote packets", result)
+self.dbg.SetDefaultArchitecture("x86_64")
+target = self.dbg.CreateTargetWithFileAndArch(None, None)
+
+process = self.connect(target)
+
+if self.TraceOn():
+interp = self.dbg.GetCommandInterpreter()
+result = lldb.SBCommandReturnObject()
+interp.HandleCommand("target list", result)
+print(result.GetOutput())
+
+   
+err = lldb.SBError()
+wp = target.WatchAddress(0x100, 8, False, True, err)
+if self.TraceOn() and (err.Fail() or wp.IsValid == False):
+strm = lldb.SBStream()
+err.GetDescription(strm)
+print("watchpoint failed: %s" % strm.GetData())
+self.assertTrue(wp.IsValid())

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=346561&r1=346560&r2=346561&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp 
Fri Nov  9 14:33:26 2018
@@ -1689,12 +1689,17 @@ Status GDBRemoteCommunicationClient::Get
   m_supports_watchpoint_support_info = eLazyBoolYes;
   llvm::StringRef name;
   llvm::StringRef value;
+  bool found_num_field = false;
   while (response.GetNameColonValue(name, value)) {
 if (name.equals("num")) {
   value.getAsInteger(0, m_num_supported_hardware_watchpoints);
   num = m_num_supported_hardware_watchpoi

[Lldb-commits] [lldb] r346571 - Enable listening for EXC_RESOURCE events, and format mach

2018-11-09 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Nov  9 16:14:14 2018
New Revision: 346571

URL: http://llvm.org/viewvc/llvm-project?rev=346571&view=rev
Log:
Enable listening for EXC_RESOURCE events, and format mach
event as a thread stop reason if we receive one, using 
some macros to decode the payload.  

Patch originally written by Fred Riss, with a few small changes
by myself.

Writing a test for this is a little tricky because the 
mach exception data interpretation relies on header macros
or function calls - it may change over time and writing
a gdb_remote_client test for this would break as older 
encoding interpretation is changed.  I'll tak with Fred
about this more, but neither of us has been thrilled with
the kind of tests we could write for it.

,  

Modified:
lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp
lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp

Modified: lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp?rev=346571&r1=346570&r2=346571&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp Fri Nov 
 9 16:14:14 2018
@@ -10,6 +10,8 @@
 #include "StopInfoMachException.h"
 
 // C Includes
+#include 
+
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
@@ -41,6 +43,10 @@ const char *StopInfoMachException::GetDe
 const char *code_desc = NULL;
 const char *subcode_label = "subcode";
 const char *subcode_desc = NULL;
+
+char code_desc_buf[32];
+char subcode_desc_buf[32];
+
 switch (m_value) {
 case 1: // EXC_BAD_ACCESS
   exc_desc = "EXC_BAD_ACCESS";
@@ -275,6 +281,45 @@ const char *StopInfoMachException::GetDe
   break;
 case 11:
   exc_desc = "EXC_RESOURCE";
+  {
+int resource_type = EXC_RESOURCE_DECODE_RESOURCE_TYPE(m_exc_code);
+
+code_label = "limit";
+code_desc = code_desc_buf;
+subcode_label = "observed";
+subcode_desc = subcode_desc_buf;
+
+switch (resource_type) {
+case RESOURCE_TYPE_CPU:
+  exc_desc = "EXC_RESOURCE RESOURCE_TYPE_CPU";
+  snprintf(code_desc_buf, sizeof(code_desc_buf), "%d%%",
+(int)EXC_RESOURCE_CPUMONITOR_DECODE_PERCENTAGE(m_exc_code));
+  snprintf(subcode_desc_buf, sizeof(subcode_desc_buf), "%d%%",
+
(int)EXC_RESOURCE_CPUMONITOR_DECODE_PERCENTAGE_OBSERVED(m_exc_subcode));
+  break;
+case RESOURCE_TYPE_WAKEUPS:
+  exc_desc = "EXC_RESOURCE RESOURCE_TYPE_WAKEUPS";
+  snprintf(code_desc_buf, sizeof(code_desc_buf), "%d w/s",
+(int)EXC_RESOURCE_CPUMONITOR_DECODE_WAKEUPS_PERMITTED(m_exc_code));
+  snprintf(subcode_desc_buf, sizeof(subcode_desc_buf), "%d w/s",
+
(int)EXC_RESOURCE_CPUMONITOR_DECODE_WAKEUPS_OBSERVED(m_exc_subcode));
+  break;
+case RESOURCE_TYPE_MEMORY:
+  exc_desc = "EXC_RESOURCE RESOURCE_TYPE_MEMORY";
+  snprintf(code_desc_buf, sizeof(code_desc_buf), "%d MB",
+(int)EXC_RESOURCE_HWM_DECODE_LIMIT(m_exc_code));
+  subcode_desc = nullptr;
+  subcode_label = "unused";
+  break;
+case RESOURCE_TYPE_IO:
+  exc_desc = "EXC_RESOURCE RESOURCE_TYPE_IO";
+  snprintf(code_desc_buf, sizeof(code_desc_buf), "%d MB",
+(int)EXC_RESOURCE_IO_DECODE_LIMIT(m_exc_code));
+  snprintf(subcode_desc_buf, sizeof(subcode_desc_buf), "%d MB",
+(int)EXC_RESOURCE_IO_OBSERVED(m_exc_subcode));;
+  break;
+}
+  }
   break;
 case 12:
   exc_desc = "EXC_GUARD";

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp?rev=346571&r1=346570&r2=346571&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp Fri Nov  9 
16:14:14 2018
@@ -386,24 +386,29 @@ void MachException::Data::Dump() const {
   }
 }
 
-#define PREV_EXC_MASK_ALL  
\
-  (EXC_MASK_BAD_ACCESS | EXC_MASK_BAD_INSTRUCTION | EXC_MASK_ARITHMETIC |  
\
-   EXC_MASK_EMULATION | EXC_MASK_SOFTWARE | EXC_MASK_BREAKPOINT |  
\
-   EXC_MASK_SYSCALL | EXC_MASK_MACH_SYSCALL | EXC_MASK_RPC_ALERT | 
\
-   EXC_MASK_MACHINE)
+// The EXC_MASK_ALL value hard-coded here so that lldb can be built
+// on a new OS with an older deployment target .  The new OS may have
+// an addition to its EXC_MASK_ALL that the old OS will not recognize -
+//  doesn't vary the value 

[Lldb-commits] [lldb] r346573 - Unbreak the linux bot from the previous commit. Fred needed to use

2018-11-09 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Nov  9 16:25:45 2018
New Revision: 346573

URL: http://llvm.org/viewvc/llvm-project?rev=346573&view=rev
Log:
Unbreak the linux bot from the previous commit.  Fred needed to use
some of the macros from mach/exc_resource.h to decode EXC_RESOURCE,
but that header doesn't exist on non-apple platforms and
StopInfoMachException.cpp needs to build on those systems.
EXC_RESOURCE won't be decoded when lldb is built on non-darwin systems.


Modified:
lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp

Modified: lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp?rev=346573&r1=346572&r2=346573&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp Fri Nov 
 9 16:25:45 2018
@@ -10,7 +10,11 @@
 #include "StopInfoMachException.h"
 
 // C Includes
+
+#if defined(__APPLE__)
+// Needed for the EXC_RESOURCE interpretation macros
 #include 
+#endif
 
 // C++ Includes
 // Other libraries and framework includes
@@ -281,6 +285,7 @@ const char *StopInfoMachException::GetDe
   break;
 case 11:
   exc_desc = "EXC_RESOURCE";
+#if defined(__APPLE__)
   {
 int resource_type = EXC_RESOURCE_DECODE_RESOURCE_TYPE(m_exc_code);
 
@@ -320,6 +325,7 @@ const char *StopInfoMachException::GetDe
   break;
 }
   }
+#endif
   break;
 case 12:
   exc_desc = "EXC_GUARD";


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r346900 - update xcode project file for reproducers.

2018-11-14 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Nov 14 14:14:07 2018
New Revision: 346900

URL: http://llvm.org/viewvc/llvm-project?rev=346900&view=rev
Log:
update xcode project file for reproducers.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=346900&r1=346899&r2=346900&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Nov 14 14:14:07 2018
@@ -194,6 +194,7 @@
2689002113353DDE00698AC0 /* CommandObjectQuit.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 26BC7E3910F1B84700F91463 /* 
CommandObjectQuit.cpp */; };
2689008413353E2200698AC0 /* CommandObjectRegexCommand.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 26DFBC59113B48F300DD817F /* 
CommandObjectRegexCommand.cpp */; };
2689002213353DDE00698AC0 /* CommandObjectRegister.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3B10F1B84700F91463 /* 
CommandObjectRegister.cpp */; };
+   AFCB1D5C219CD5A800730AD5 /* CommandObjectReproducer.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AFCB1D5A219CD5A700730AD5 /* 
CommandObjectReproducer.cpp */; };
2689002313353DDE00698AC0 /* CommandObjectScript.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 26BC7E3D10F1B84700F91463 /* 
CommandObjectScript.cpp */; };
2689002413353DDE00698AC0 /* CommandObjectSettings.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E4010F1B84700F91463 /* 
CommandObjectSettings.cpp */; };
2689002513353DDE00698AC0 /* CommandObjectSource.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 26BC7E4210F1B84700F91463 /* 
CommandObjectSource.cpp */; };
@@ -321,6 +322,8 @@
2689009D13353E4200698AC0 /* GDBRemoteCommunication.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 2618EE5B1315B29C001D6D71 /* 
GDBRemoteCommunication.cpp */; };
26744EF11338317700EF765A /* GDBRemoteCommunicationClient.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 26744EED1338317700EF765A /* 
GDBRemoteCommunicationClient.cpp */; };
23CB153D1D66DA9300EDDDE1 /* 
GDBRemoteCommunicationClientTest.cpp in Sources */ = {isa = PBXBuildFile; 
fileRef = 2370A37E1D66C587000E7BE6 /* GDBRemoteCommunicationClientTest.cpp */; 
};
+   AF8AD945219CD45800614785 /* GDBRemoteCommunicationHistory.cpp 
in Sources */ = {isa = PBXBuildFile; fileRef = AF8AD943219CD45700614785 /* 
GDBRemoteCommunicationHistory.cpp */; };
+   AFCB1D59219CD4FD00730AD5 /* 
GDBRemoteCommunicationReplayServer.cpp in Sources */ = {isa = PBXBuildFile; 
fileRef = AFCB1D57219CD4FD00730AD5 /* GDBRemoteCommunicationReplayServer.cpp 
*/; };
26744EF31338317700EF765A /* GDBRemoteCommunicationServer.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 26744EEF1338317700EF765A /* 
GDBRemoteCommunicationServer.cpp */; };
6D55B2901A8A806200A70529 /* 
GDBRemoteCommunicationServerCommon.cpp in Sources */ = {isa = PBXBuildFile; 
fileRef = 6D55B28D1A8A806200A70529 /* GDBRemoteCommunicationServerCommon.cpp 
*/; };
6D55B2911A8A806200A70529 /* 
GDBRemoteCommunicationServerLLGS.cpp in Sources */ = {isa = PBXBuildFile; 
fileRef = 6D55B28E1A8A806200A70529 /* GDBRemoteCommunicationServerLLGS.cpp */; 
};
@@ -698,6 +701,7 @@
23D065901D4A7BEE0008EDE6 /* RenderScriptRuntime.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 23D065841D4A7BDA0008EDE6 /* 
RenderScriptRuntime.cpp */; };
9485545A1DCBAE3B00345FF5 /* RenderScriptScriptGroup.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 948554591DCBAE3B00345FF5 /* 
RenderScriptScriptGroup.cpp */; };
23D065911D4A7BEE0008EDE6 /* RenderScriptx86ABIFixups.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 23D065861D4A7BDA0008EDE6 /* 
RenderScriptx86ABIFixups.cpp */; };
+   AFCB1D5F219CD5EA00730AD5 /* Reproducer.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = AFCB1D5E219CD5EA00730AD5 /* Reproducer.cpp */; };
4FBC04ED211A06200015A814 /* RichManglingContext.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 4FBC04EC211A06200015A814 /* 
RichManglingContext.cpp */; };
4FBC04EF211A06820015A814 /* RichManglingContext.h in Headers */ 
= {isa = PBXBuildFile; fileRef = 4FBC04EE211A06820015A814 /* 
RichManglingContext.h */; };
4FBC04F5211A13770015A814 /* RichManglingContextTest.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4FBC04F3211A0F0F0015A814 /* 
RichManglingContextTest.cpp */; };
@@ -1616,6 +1620,8 @@
26DFBC52113B48D600DD817F /* CommandObjectRegexCommand.h */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
name = CommandObjectRegexCommand.h; path = 
include/lldb/Inte

[Lldb-commits] [lldb] r346991 - A unit test file moved.

2018-11-15 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Nov 15 12:28:55 2018
New Revision: 346991

URL: http://llvm.org/viewvc/llvm-project?rev=346991&view=rev
Log:
A unit test file moved.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=346991&r1=346990&r2=346991&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Nov 15 12:28:55 2018
@@ -254,7 +254,7 @@
49CA96FD1E6AACC900C03FEE /* DataBufferLLVM.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 49CA96E71E6AAC6600C03FEE /* DataBufferLLVM.cpp 
*/; };
49CA96FE1E6AACC900C03FEE /* DataEncoder.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 49CA96E81E6AAC6600C03FEE /* DataEncoder.cpp */; 
};
49CA96FF1E6AACC900C03FEE /* DataExtractor.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 49CA96E91E6AAC6600C03FEE /* DataExtractor.cpp 
*/; };
-   23CB15391D66DA9300EDDDE1 /* DataExtractorTest.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 23CB14E81D66CC0E00EDDDE1 /* 
DataExtractorTest.cpp */; };
+   AFA1B62C219E0ED900A8AB7E /* DataExtractorTest.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = AFA1B62B219E0ED900A8AB7E /* 
DataExtractorTest.cpp */; };
94CB255C16B069770059775D /* DataVisualization.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 94CB255816B069770059775D /* 
DataVisualization.cpp */; };
23D4007E1C210201000C3885 /* DebugMacros.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 23E77CDB1C20F2F2007192AD /* DebugMacros.cpp */; 
};
AF116BEF20CF234B0071093F /* DebugNamesDWARFIndex.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AF116BED20CF234B0071093F /* 
DebugNamesDWARFIndex.cpp */; };
@@ -1745,7 +1745,7 @@
49CA96F31E6AAC8E00C03FEE /* DataEncoder.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
DataEncoder.h; path = include/lldb/Utility/DataEncoder.h; sourceTree = 
""; };
49CA96E91E6AAC6600C03FEE /* DataExtractor.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = DataExtractor.cpp; path = source/Utility/DataExtractor.cpp; sourceTree = 
""; };
49CA96F41E6AAC8E00C03FEE /* DataExtractor.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
DataExtractor.h; path = include/lldb/Utility/DataExtractor.h; sourceTree = 
""; };
-   23CB14E81D66CC0E00EDDDE1 /* DataExtractorTest.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = DataExtractorTest.cpp; sourceTree = ""; };
+   AFA1B62B219E0ED900A8AB7E /* DataExtractorTest.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = DataExtractorTest.cpp; sourceTree = ""; };
94CB255816B069770059775D /* DataVisualization.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = DataVisualization.cpp; path = 
source/DataFormatters/DataVisualization.cpp; sourceTree = ""; };
94CB256016B069800059775D /* DataVisualization.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = 
DataVisualization.h; path = include/lldb/DataFormatters/DataVisualization.h; 
sourceTree = ""; };
3FDFED1E19BA6D55009756A7 /* Debug.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Debug.h; path = 
include/lldb/Host/Debug.h; sourceTree = ""; };
@@ -3558,6 +3558,7 @@
7F94D7172040A13A006EE3EA /* CleanUpTest.cpp */,
23E2E5161D903689006F38BB /* ArchSpecTest.cpp */,
9A3D43C81F3150D200EB767C /* ConstStringTest.cpp 
*/,
+   AFA1B62B219E0ED900A8AB7E /* 
DataExtractorTest.cpp */,
23CB14FD1D66CD2400EDDDE1 /* FileSpecTest.cpp */,
8C3BD99F1EF5D1B50016C343 /* JSONTest.cpp */,
9A3D43C71F3150D200EB767C /* LogTest.cpp */,
@@ -3721,7 +3722,6 @@
children = (
23CB14E61D66CC0E00EDDDE1 /* BroadcasterTest.cpp 
*/,
23CB14E71D66CC0E00EDDDE1 /* CMakeLists.txt */,
-   23CB14E81D66CC0E00EDDDE1 /* 
DataExtractorTest.cpp */,
58A080B12112AB2200D5580F /* HighlighterTest.cpp 
*/,
9A3D43E31F3237D500EB767C /* ListenerTest.cpp */,
4F29D3CD21010F84003B549A /* MangledTest.cpp */,
@@ -7544,6 +7544,7 @@
58A080B3

[Lldb-commits] [lldb] r347122 - add PdbSymUid.cpp

2018-11-16 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Nov 16 17:08:01 2018
New Revision: 347122

URL: http://llvm.org/viewvc/llvm-project?rev=347122&view=rev
Log:
add PdbSymUid.cpp

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=347122&r1=347121&r2=347122&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Nov 16 17:08:01 2018
@@ -571,6 +571,7 @@
268900EE13353E6F00698AC0 /* PathMappingList.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 495BBACB119A0DBE00418BEA /* PathMappingList.cpp 
*/; };
2668A2EE20AF417D00D94111 /* PathMappingListTest.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 2668A2ED20AF417D00D94111 /* 
PathMappingListTest.cpp */; };
AFD966BA217140B6006714AC /* PdbIndex.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = AFD966B6217140B6006714AC /* PdbIndex.cpp */; };
+   AF0F459E219FA1C800C1E612 /* PdbSymUid.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = AF0F459D219FA1C800C1E612 /* PdbSymUid.cpp */; };
AFD966B9217140B6006714AC /* PdbUtil.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = AFD966B5217140B6006714AC /* PdbUtil.cpp */; };
25420ED21A649D88009ADBCB /* PipeBase.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 25420ED11A649D88009ADBCB /* PipeBase.cpp */; };
2377C2F819E613C100737875 /* PipePosix.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 2377C2F719E613C100737875 /* PipePosix.cpp */; };
@@ -2383,6 +2384,7 @@
2668A2ED20AF417D00D94111 /* PathMappingListTest.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = PathMappingListTest.cpp; path = Target/PathMappingListTest.cpp; 
sourceTree = ""; };
AFD966B6217140B6006714AC /* PdbIndex.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = PdbIndex.cpp; path = source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp; 
sourceTree = SOURCE_ROOT; };
AFD966BF217140C8006714AC /* PdbIndex.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PdbIndex.h; path = 
source/Plugins/SymbolFile/NativePDB/PdbIndex.h; sourceTree = SOURCE_ROOT; };
+   AF0F459D219FA1C800C1E612 /* PdbSymUid.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = PdbSymUid.cpp; path = source/Plugins/SymbolFile/NativePDB/PdbSymUid.cpp; 
sourceTree = SOURCE_ROOT; };
AFD966BC217140C8006714AC /* PdbSymUid.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PdbSymUid.h; path 
= source/Plugins/SymbolFile/NativePDB/PdbSymUid.h; sourceTree = SOURCE_ROOT; };
AFD966B5217140B6006714AC /* PdbUtil.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = PdbUtil.cpp; path = source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp; 
sourceTree = SOURCE_ROOT; };
AFD966BE217140C8006714AC /* PdbUtil.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PdbUtil.h; path = 
source/Plugins/SymbolFile/NativePDB/PdbUtil.h; sourceTree = SOURCE_ROOT; };
@@ -6771,6 +6773,7 @@
AFD966BD217140C8006714AC /* CompileUnitIndex.h 
*/,
AFD966B6217140B6006714AC /* PdbIndex.cpp */,
AFD966BF217140C8006714AC /* PdbIndex.h */,
+   AF0F459D219FA1C800C1E612 /* PdbSymUid.cpp */,
AFD966BC217140C8006714AC /* PdbSymUid.h */,
AFD966B5217140B6006714AC /* PdbUtil.cpp */,
AFD966BE217140C8006714AC /* PdbUtil.h */,
@@ -7822,6 +7825,7 @@
266E829D1B8E542C008FCA06 /* DWARFAttribute.cpp 
in Sources */,
26764C9E1E48F51E008D3573 /* Stream.cpp in 
Sources */,
2689004613353E0400698AC0 /* ModuleList.cpp in 
Sources */,
+   AF0F459E219FA1C800C1E612 /* PdbSymUid.cpp in 
Sources */,
2689004713353E0400698AC0 /* PluginManager.cpp 
in Sources */,
AFF81FAF20D1CC400010F95E /* HostThreadMacOSX.mm 
in Sources */,
AF0C112818580CD800C4C45B /* QueueItem.cpp in 
Sources */,


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r348040 - Add a test to verify that lldb can load a kext binary.

2018-11-30 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Nov 30 13:33:00 2018
New Revision: 348040

URL: http://llvm.org/viewvc/llvm-project?rev=348040&view=rev
Log:
Add a test to verify that lldb can load a kext binary.

 

Added:
lldb/trunk/packages/Python/lldbsuite/test/macosx/load-kext/
lldb/trunk/packages/Python/lldbsuite/test/macosx/load-kext/TestLoadKext.py
lldb/trunk/packages/Python/lldbsuite/test/macosx/load-kext/mykext.yaml

Added: 
lldb/trunk/packages/Python/lldbsuite/test/macosx/load-kext/TestLoadKext.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/load-kext/TestLoadKext.py?rev=348040&view=auto
==
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/load-kext/TestLoadKext.py 
(added)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/load-kext/TestLoadKext.py 
Fri Nov 30 13:33:00 2018
@@ -0,0 +1,38 @@
+"""
+Test loading of a kext binary.
+"""
+
+from __future__ import print_function
+
+import shutil
+import struct
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class LoadKextTestCase(TestBase):
+NO_DEBUG_INFO_TESTCASE = True
+
+mydir = TestBase.compute_mydir(__file__)
+
+def setUp(self):
+TestBase.setUp(self)
+#super(LoadKextTestCase, self).setUp()
+#self._initial_platform = lldb.DBG.GetSelectedPlatform()
+
+def test_load_kext(self):
+"""Test that lldb can load a kext binary."""
+
+# Create kext from YAML.
+self.yaml2obj("mykext.yaml", self.getBuildArtifact("mykext"))
+
+target = self.dbg.CreateTarget(self.getBuildArtifact("mykext"))
+
+self.assertTrue(target.IsValid())
+
+self.assertEqual(target.GetNumModules(), 1)
+mod = target.GetModuleAtIndex(0)
+self.assertEqual(mod.GetFileSpec().GetFilename(), "mykext")

Added: lldb/trunk/packages/Python/lldbsuite/test/macosx/load-kext/mykext.yaml
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/macosx/load-kext/mykext.yaml?rev=348040&view=auto
==
--- lldb/trunk/packages/Python/lldbsuite/test/macosx/load-kext/mykext.yaml 
(added)
+++ lldb/trunk/packages/Python/lldbsuite/test/macosx/load-kext/mykext.yaml Fri 
Nov 30 13:33:00 2018
@@ -0,0 +1,222 @@
+--- !mach-o
+FileHeader:  
+  magic:   0xFEEDFACF
+  cputype: 0x0107
+  cpusubtype:  0x0003
+  filetype:0x000B
+  ncmds:   7
+  sizeofcmds:  520
+  flags:   0x0085
+  reserved:0x
+LoadCommands:
+  - cmd: LC_SEGMENT_64
+cmdsize: 152
+segname: __TEXT
+vmaddr:  0
+vmsize:  4096
+fileoff: 0
+filesize:4096
+maxprot: 7
+initprot:5
+nsects:  1
+flags:   0
+Sections:
+  - sectname:__text
+segname: __TEXT
+addr:0x0F60
+size:158
+offset:  0x0F60
+align:   4
+reloff:  0x
+nreloc:  0
+flags:   0x8400
+reserved1:   0x
+reserved2:   0x
+reserved3:   0x
+  - cmd: LC_SEGMENT_64
+cmdsize: 152
+segname: __DATA
+vmaddr:  4096
+vmsize:  4096
+fileoff: 4096
+filesize:4096
+maxprot: 7
+initprot:3
+nsects:  1
+flags:   0
+Sections:
+  - sectname:__data
+segname: __DATA
+addr:0x1000
+size:220
+offset:  0x1000
+align:   3
+reloff:  0x
+nreloc:  0
+flags:   0x
+reserved1:   0x
+reserved2:   0x
+reserved3:   0x
+  - cmd: LC_SEGMENT_64
+cmdsize: 72
+segname: __LINKEDIT
+vmaddr:  8192
+vmsize:  4096
+fileoff: 8192
+filesize:800
+maxprot: 7
+initprot:1
+nsects:  0
+flags:   0
+  - cmd: LC_SYMTAB
+cmdsize: 24
+symoff:  8224
+nsyms:   19
+stroff:  8528
+strsize: 464
+  - cmd: LC_DYSYMTAB
+cmdsize: 80
+ilocalsym:   0
+nlocalsym:   16
+iextdefsym:  16
+nextdefsym:  3
+iundefsym:   19
+nundefsym:   0
+tocoff:  0
+ntoc:0
+modtaboff:   0
+nmodtab: 0
+extrefsymoff:0
+nextrefsyms:   

[Lldb-commits] [lldb] r348300 - Add SBInitializerOptions.cpp.

2018-12-04 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Dec  4 12:34:23 2018
New Revision: 348300

URL: http://llvm.org/viewvc/llvm-project?rev=348300&view=rev
Log:
Add SBInitializerOptions.cpp.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=348300&r1=348299&r2=348300&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Dec  4 12:34:23 2018
@@ -754,6 +754,7 @@
26DE205311618FAC00A093E2 /* SBFunction.h in Headers */ = {isa = 
PBXBuildFile; fileRef = 26DE205211618FAC00A093E2 /* SBFunction.h */; settings = 
{ATTRIBUTES = (Public, ); }; };
9A3576AA116E9AC700E8ED2F /* SBHostOS.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 9A3576A9116E9AC700E8ED2F /* SBHostOS.cpp */; };
9A3576A8116E9AB700E8ED2F /* SBHostOS.h in Headers */ = {isa = 
PBXBuildFile; fileRef = 9A3576A7116E9AB700E8ED2F /* SBHostOS.h */; settings = 
{ATTRIBUTES = (Public, ); }; };
+   AFB2F2F621B71AF30078DEF1 /* SBInitializerOptions.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AFB2F2F421B71AE90078DEF1 /* 
SBInitializerOptions.cpp */; };
9AC703AF117675410086C050 /* SBInstruction.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 9AC703AE117675410086C050 /* SBInstruction.cpp 
*/; };
9AC7038E117674FB0086C050 /* SBInstruction.h in Headers */ = 
{isa = PBXBuildFile; fileRef = 9AC7038D117674EB0086C050 /* SBInstruction.h */; 
settings = {ATTRIBUTES = (Public, ); }; };
9AC703B1117675490086C050 /* SBInstructionList.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 9AC703B0117675490086C050 /* 
SBInstructionList.cpp */; };
@@ -2726,6 +2727,7 @@
9A3576A9116E9AC700E8ED2F /* SBHostOS.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = SBHostOS.cpp; path = source/API/SBHostOS.cpp; sourceTree = ""; };
9A3576A7116E9AB700E8ED2F /* SBHostOS.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
SBHostOS.h; path = include/lldb/API/SBHostOS.h; sourceTree = ""; };
2611FF00142D83060017FEA3 /* SBHostOS.i */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = 
SBHostOS.i; sourceTree = ""; };
+   AFB2F2F421B71AE90078DEF1 /* SBInitializerOptions.cpp */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = SBInitializerOptions.cpp; path = source/API/SBInitializerOptions.cpp; 
sourceTree = ""; };
9AC703AE117675410086C050 /* SBInstruction.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = SBInstruction.cpp; path = source/API/SBInstruction.cpp; sourceTree = 
""; };
9AC7038D117674EB0086C050 /* SBInstruction.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
SBInstruction.h; path = include/lldb/API/SBInstruction.h; sourceTree = 
""; };
2611FF02142D83060017FEA3 /* SBInstruction.i */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = 
SBInstruction.i; sourceTree = ""; };
@@ -4257,6 +4259,7 @@
26DE205C1161901400A093E2 /* SBFunction.cpp */,
9A3576A7116E9AB700E8ED2F /* SBHostOS.h */,
9A3576A9116E9AC700E8ED2F /* SBHostOS.cpp */,
+   AFB2F2F421B71AE90078DEF1 /* 
SBInitializerOptions.cpp */,
9AC7038D117674EB0086C050 /* SBInstruction.h */,
9AC703AE117675410086C050 /* SBInstruction.cpp 
*/,
9AC7038F117675270086C050 /* SBInstructionList.h 
*/,
@@ -7661,6 +7664,7 @@
26680336116005EF008E1FE4 /* 
SBBreakpointLocation.cpp in Sources */,
26680337116005F1008E1FE4 /* SBBreakpoint.cpp in 
Sources */,
26DE204511618ADA00A093E2 /* SBAddress.cpp in 
Sources */,
+   AFB2F2F621B71AF30078DEF1 /* 
SBInitializerOptions.cpp in Sources */,
26DE204711618AED00A093E2 /* SBSymbolContext.cpp 
in Sources */,
26DE204D11618E7A00A093E2 /* SBModule.cpp in 
Sources */,
26DE205D1161901400A093E2 /* SBFunction.cpp in 
Sources */,


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r348527 - [pecoff] Implement ObjectFilePECOFF::GetDependedModules()

2018-12-06 Thread Jason Molenda via lldb-commits
Hi Aaron, this is failing to build on macOS systems --

> On Dec 6, 2018, at 1:36 PM, Aaron Smith via lldb-commits 
>  wrote:
> 
> +// At this moment we only have the base name of the DLL. The full path 
> can
> +// only be seen after the dynamic loading.  Our best guess is Try to get 
> it
> +// with the help of the object file's directory.
> +llvm::SmallString dll_fullpath;
> +FileSpec dll_specs(dll_name);
> +dll_specs.GetDirectory().SetString(m_file.GetDirectory().GetCString());
> +



We don't have a MAX_PATH on Darwin systems, but we do have a PATH_MAX which is 
used in other parts of lldb.  Does PATH_MAX work on windows?
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r348557 - Change the amount of data that Platform::PutFile will try to transfer

2018-12-06 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Dec  6 16:35:26 2018
New Revision: 348557

URL: http://llvm.org/viewvc/llvm-project?rev=348557&view=rev
Log:
Change the amount of data that Platform::PutFile will try to transfer
in one packet from 1k bytes to 16k bytes.  Sending a large file to an
iOS device directly connected by USB cable, to lldb-server running in
platform mode, this speeds up the file xfer by 77%.  Sending the file
in 32k blocks speeds up the file xfer by 80% versus 1k blocks, starting
with 16k to make sure we don't have any problems with android testing.

We may not have the same perf characteristics over ethernet, but with
USB it's faster to send fewer larger packets than many small packets.

Modified:
lldb/trunk/source/Target/Platform.cpp

Modified: lldb/trunk/source/Target/Platform.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Platform.cpp?rev=348557&r1=348556&r2=348557&view=diff
==
--- lldb/trunk/source/Target/Platform.cpp (original)
+++ lldb/trunk/source/Target/Platform.cpp Thu Dec  6 16:35:26 2018
@@ -1296,7 +1296,7 @@ Status Platform::PutFile(const FileSpec
 return error;
   if (dest_file == UINT64_MAX)
 return Status("unable to open target file");
-  lldb::DataBufferSP buffer_sp(new DataBufferHeap(1024, 0));
+  lldb::DataBufferSP buffer_sp(new DataBufferHeap(1024 * 16, 0));
   uint64_t offset = 0;
   for (;;) {
 size_t bytes_read = buffer_sp->GetByteSize();


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r349231 - A brief outline of the packets that need to be implemented

2018-12-14 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Dec 14 18:36:39 2018
New Revision: 349231

URL: http://llvm.org/viewvc/llvm-project?rev=349231&view=rev
Log:
A brief outline of the packets that need to be implemented
to write an lldb platform server that doesn't link against
LLDB.framework to be able to fully run the lldb testsuite
on a remote system.  The platform packets weren't covered 
in the existing lldb-gdb-remote.txt doc, so I wanted to 
jot them down in one place.

Added:
lldb/trunk/docs/lldb-platform-packets.txt

Added: lldb/trunk/docs/lldb-platform-packets.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/lldb-platform-packets.txt?rev=349231&view=auto
==
--- lldb/trunk/docs/lldb-platform-packets.txt (added)
+++ lldb/trunk/docs/lldb-platform-packets.txt Fri Dec 14 18:36:39 2018
@@ -0,0 +1,375 @@
+Here is a brief overview of the packets that an lldb platform server needs to 
implement
+for the lldb testsuite to be run on a remote target device/system.
+
+//--
+// QStartNoAckMode
+//
+// BRIEF
+//   A request to stop sending ACK packets for each properly formatted packet.
+//
+// EXAMPLE 
+//   A platform session will typically start like this:
+//
+//   receive: +$QStartNoAckMode#b0
+//   send:+   <-- ACKing the properly formatted QStartNoAckMode packet
+//   send:$OK#9a
+//   receive: +   <-- Our OK packet getting ACKed
+//
+//   ACK mode is now disabled.
+
+//--
+// qHostInfo
+//
+// BRIEF
+//   Describe the hardware and OS of the target system
+//
+// EXAMPLE
+//
+//  receive: qHostInfo
+//  send:
cputype:16777228;cpusubtype:1;ostype:ios;watchpoint_exceptions_received:before;os_version:12.1;vendor:apple;default_packet_timeout:5;
+//
+//  All numbers are base 10, os_version is a string that will be parsed as 
major.minor.patch.
+
+
+//--
+// qGetWorkingDir
+//
+// BRIEF
+//   Get the current working directory of the platform stub in
+//   ASCII hex encoding.
+//
+// EXAMPLE
+// 
+//  receive: qGetWorkingDir
+//  send:
2f4170706c65496e7465726e616c2f6c6c64622f73657474696e67732f342f5465737453657474696e67732e746573745f646973617373656d626c65725f73657474696e6773
 
+
+
+
+//--
+// QSetWorkingDir:
+//
+// BRIEF
+//   Set the current working directory of the platform stub in
+//   ASCII hex encoding.
+//
+// EXAMPLE
+// 
+//  receive: 
QSetWorkingDir:2f4170706c65496e7465726e616c2f6c6c64622f73657474696e67732f342f5465737453657474696e67732e746573745f646973617373656d626c65725f73657474696e6773
 
+//  send:OK
+
+//--
+// qPlatform_mkdir:
+//
+// BRIEF
+//   Create a directory on the target system.
+//
+// EXAMPLE
+// 
+//  receive: qPlatform_mkdir:01fd,2f746d702f6131
+//  send:F0
+//
+//  request packet has the fields:
+// 1. mode bits in base 16
+// 2. file path in ascii-hex encoding
+//
+//  response is F followed by the return value of the mkdir() call,
+//  base 10 encoded.
+
+//--
+// qPlatform_shell:
+//
+// BRIEF
+//   Run a shell command on the target system, return the output.
+//
+// EXAMPLE
+// 
+//  receive: qPlatform_shell:6c73202f746d702f,000a
+//  send:F,0,0,
+//
+//  request packet has the fields:
+// 1. shell command ascii-hex encoded
+// 2. timeout 
+// 3. {optional} working directory
+//
+//  Response is F followed by the return value of the command (base 16),
+//  followed by a another number, followed by the output of the command
+/   in binary-escaped-data encoding.
+
+//--
+// qLaunchGDBServer
+//
+// BRIEF
+//   Start a gdbserver process (gdbserver, debugserver, lldb-server)
+//   on the target system.
+//
+// EXAMPLE
+// 
+//  receive: qLaunchGDBServer;host:;
+//  send:pid:1337;port:43001;
+//
+//  request packet hostname field is not ascii-hex encoded.  Hopefully
+//  hostnames don't have $ or # characters in them.
+//
+//  response to the packet is the pid of the newly launched gdbserver,
+//  and the port it is listening for a connection on.
+//
+//  When the testsuite is running, lldb may use the pid to kill off a 
+//  debugserver that doesn't seem to be responding, etc.
+
+//--
+// qKillSpawnedProcess:
+//
+// BRIEF
+//   Kill a process running on the target system.
+//
+// EXAMPLE
+// 
+//  receive: qKillSpawnedProcess:1337
+//  send:OK
+//
+//  The request packet has the process ID in base 10.
+
+//--
+// qProcessInfoPID:
+//
+// BRIEF
+/

[Lldb-commits] [lldb] r349232 - Ah, forgot qModuleInfo. Need to look that one up

2018-12-14 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Dec 14 18:51:01 2018
New Revision: 349232

URL: http://llvm.org/viewvc/llvm-project?rev=349232&view=rev
Log:
Ah, forgot qModuleInfo.  Need to look that one up
and finish filling this in.

Modified:
lldb/trunk/docs/lldb-platform-packets.txt

Modified: lldb/trunk/docs/lldb-platform-packets.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/lldb-platform-packets.txt?rev=349232&r1=349231&r2=349232&view=diff
==
--- lldb/trunk/docs/lldb-platform-packets.txt (original)
+++ lldb/trunk/docs/lldb-platform-packets.txt Fri Dec 14 18:51:01 2018
@@ -30,6 +30,17 @@ for the lldb testsuite to be run on a re
 //
 //  All numbers are base 10, os_version is a string that will be parsed as 
major.minor.patch.
 
+//--
+// qModuleInfo
+//
+// BRIEF
+//   Report information about a binary on the target system
+//
+// EXAMPLE
+//  receive: qModuleInfo:2f62696e2f6c73;
+//
+// FIXME finish this packet description, v. 
GDBRemoteCommunicationServerCommon::Handle_qModuleInfo
+
 
 //--
 // qGetWorkingDir


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r349282 - Update the vFile:open: description to note that the flags

2018-12-15 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Sat Dec 15 10:40:38 2018
New Revision: 349282

URL: http://llvm.org/viewvc/llvm-project?rev=349282&view=rev
Log:
Update the vFile:open: description to note that the flags
in the packet are lldb enum values, not the open(2) oflags -- 
forgot about that wrinkle.  Also added a comment to File.h 
noting that the existing values cannot be modified or we'll
have a compatibilty break with any alternative platform
implementations, or older versions of lldb-server.

Modified:
lldb/trunk/docs/lldb-platform-packets.txt
lldb/trunk/include/lldb/Host/File.h

Modified: lldb/trunk/docs/lldb-platform-packets.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/lldb-platform-packets.txt?rev=349282&r1=349281&r2=349282&view=diff
==
--- lldb/trunk/docs/lldb-platform-packets.txt (original)
+++ lldb/trunk/docs/lldb-platform-packets.txt Sat Dec 15 10:40:38 2018
@@ -303,7 +303,9 @@ for the lldb testsuite to be run on a re
 //
 //  request packet has the fields:
 // 1. ASCII hex encoded filename
-// 2. oflags to be passed to open(2), base 16
+// 2. flags passed to the open call, base 16.
+//Note that these are not the oflags that open(2) takes, but
+//are the constant values in enum OpenOptions from lldb's File.h
 // 3. mode bits, base 16
 //  
 //  response is F followed by the opened file descriptor in base 10.

Modified: lldb/trunk/include/lldb/Host/File.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/File.h?rev=349282&r1=349281&r2=349282&view=diff
==
--- lldb/trunk/include/lldb/Host/File.h (original)
+++ lldb/trunk/include/lldb/Host/File.h Sat Dec 15 10:40:38 2018
@@ -33,6 +33,8 @@ public:
   static int kInvalidDescriptor;
   static FILE *kInvalidStream;
 
+  // NB this enum is used in the lldb platform gdb-remote packet
+  // vFile:open: and existing values cannot be modified.
   enum OpenOptions {
 eOpenOptionRead = (1u << 0),  // Open file for reading
 eOpenOptionWrite = (1u << 1), // Open file for writing


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r349313 - Clarify a few minor details.

2018-12-16 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Sun Dec 16 10:33:58 2018
New Revision: 349313

URL: http://llvm.org/viewvc/llvm-project?rev=349313&view=rev
Log:
Clarify a few minor details.

Modified:
lldb/trunk/docs/lldb-platform-packets.txt

Modified: lldb/trunk/docs/lldb-platform-packets.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/lldb-platform-packets.txt?rev=349313&r1=349312&r2=349313&view=diff
==
--- lldb/trunk/docs/lldb-platform-packets.txt (original)
+++ lldb/trunk/docs/lldb-platform-packets.txt Sun Dec 16 10:33:58 2018
@@ -100,7 +100,7 @@ for the lldb testsuite to be run on a re
 //  request packet has the fields:
 // 1. shell command ascii-hex encoded
 // 2. timeout 
-// 3. {optional} working directory
+// 3. {optional} working directory ascii-hex encoded
 //
 //  Response is F followed by the return value of the command (base 16),
 //  followed by a another number, followed by the output of the command
@@ -118,8 +118,8 @@ for the lldb testsuite to be run on a re
 //  receive: qLaunchGDBServer;host:;
 //  send:pid:1337;port:43001;
 //
-//  request packet hostname field is not ascii-hex encoded.  Hopefully
-//  hostnames don't have $ or # characters in them.
+//  request packet hostname field is not ascii-hex encoded. Hostnames 
+//  don't have $ or # characters in them.
 //
 //  response to the packet is the pid of the newly launched gdbserver,
 //  and the port it is listening for a connection on.
@@ -272,7 +272,8 @@ for the lldb testsuite to be run on a re
 //  ascii-hex encoding.
 //  Response is "F" plus the return value of chmod(), base 10 encoding.
 //
-//  I don't know why there are two packets for the same thing.
+//  I don't know why there are two packets for the same thing, v.
+//  vFile:chmod:.
 
 //--
 // vFile:chmod:
@@ -343,8 +344,8 @@ for the lldb testsuite to be run on a re
 // 2. number of bytes to be read, base 10
 // 3. offset into file to start from, base 10
 //
-//  Response is F, followed by the numbe rof bytes read (base 10), followed
-//  by the data in the binary-escaped-data scheme.
+//  Response is F, followed by the number of bytes read (base 10), a
+//  semicolon, followed by the data in the binary-escaped-data encoding.
 
 
 //--
@@ -363,7 +364,7 @@ for the lldb testsuite to be run on a re
 // 2. offset into file to start from, base 10
 // 3. binary-escaped-data to be written
 //
-//  Response is F, followed by the numbe rof bytes written (base 10)
+//  Response is F, followed by the number of bytes written (base 10)
 
 
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r349316 - Add a description of the similar packets defined in the

2018-12-16 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Sun Dec 16 10:44:54 2018
New Revision: 349316

URL: http://llvm.org/viewvc/llvm-project?rev=349316&view=rev
Log:
Add a description of the similar packets defined in the
gdb-remote serial protocol documentation, call out the 
incompatability of lldb's vFile:open: packet as it stands
today.  Need to think about whether to change lldb's
enum values (breaking any existing lldb-server's out there)
or create a different packet and abandon vFile:open: at
least for a while.


Modified:
lldb/trunk/docs/lldb-platform-packets.txt

Modified: lldb/trunk/docs/lldb-platform-packets.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/lldb-platform-packets.txt?rev=349316&r1=349315&r2=349316&view=diff
==
--- lldb/trunk/docs/lldb-platform-packets.txt (original)
+++ lldb/trunk/docs/lldb-platform-packets.txt Sun Dec 16 10:44:54 2018
@@ -1,5 +1,15 @@
-Here is a brief overview of the packets that an lldb platform server needs to 
implement
-for the lldb testsuite to be run on a remote target device/system.
+Here is a brief overview of the packets that an lldb platform server
+needs to implement for the lldb testsuite to be run on a remote
+target device/system.
+
+These are almost all lldb extensions to the gdb-remote serial
+protocol.  Many of the vFile: packets are described to the "Host
+I/O Packets" detailed in the gdb-remote protocol documentation,
+although the lldb platform extensions include packets that are not
+defined there (vFile:size:, vFile:mode:, vFile:symlink, vFile:chmod:).
+Most importantly, the flags that lldb passes to vFile:open: are 
+incompatible with the flags that gdb specifies.
+
 
 //--
 // QStartNoAckMode
@@ -311,7 +321,12 @@ for the lldb testsuite to be run on a re
 //  
 //  response is F followed by the opened file descriptor in base 10.
 //  "F-1,errno" with the errno if an error occurs.
-
+//
+//  COMPATABILITY
+//The gdb-remote serial protocol documentatio defines a vFile:open:
+//packet which uses incompatible flag values, e.g. 1 means O_WRONLY
+//in gdb's vFile:open:, but it means eOpenOptionRead to lldb's
+//implementation.
 
 //--
 // vFile:close:


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r349406 - Add PdbAstBuilder.cpp.

2018-12-17 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Dec 17 14:07:39 2018
New Revision: 349406

URL: http://llvm.org/viewvc/llvm-project?rev=349406&view=rev
Log:
Add PdbAstBuilder.cpp.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=349406&r1=349405&r2=349406&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Dec 17 14:07:39 2018
@@ -579,6 +579,7 @@
4CA0C6CC20F929C700CFE6BB /* PDBLocationToDWARFExpression.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4CA0C6CA20F929C600CFE6BB /* 
PDBLocationToDWARFExpression.cpp */; };
268900EE13353E6F00698AC0 /* PathMappingList.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 495BBACB119A0DBE00418BEA /* PathMappingList.cpp 
*/; };
2668A2EE20AF417D00D94111 /* PathMappingListTest.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 2668A2ED20AF417D00D94111 /* 
PathMappingListTest.cpp */; };
+   AF815DF921C855B400023A34 /* PdbAstBuilder.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF815DF721C855B400023A34 /* PdbAstBuilder.cpp 
*/; };
AFD966BA217140B6006714AC /* PdbIndex.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = AFD966B6217140B6006714AC /* PdbIndex.cpp */; };
AF0F459E219FA1C800C1E612 /* PdbSymUid.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = AF0F459D219FA1C800C1E612 /* PdbSymUid.cpp */; };
AFD966B9217140B6006714AC /* PdbUtil.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = AFD966B5217140B6006714AC /* PdbUtil.cpp */; };
@@ -2403,6 +2404,8 @@
495BBACB119A0DBE00418BEA /* PathMappingList.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = PathMappingList.cpp; path = source/Target/PathMappingList.cpp; 
sourceTree = ""; };
495BBACF119A0DE700418BEA /* PathMappingList.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
PathMappingList.h; path = include/lldb/Target/PathMappingList.h; sourceTree = 
""; };
2668A2ED20AF417D00D94111 /* PathMappingListTest.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = PathMappingListTest.cpp; path = Target/PathMappingListTest.cpp; 
sourceTree = ""; };
+   AF815DF721C855B400023A34 /* PdbAstBuilder.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = PdbAstBuilder.cpp; path = 
source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp; sourceTree = 
SOURCE_ROOT; };
+   AF815DF821C855B400023A34 /* PdbAstBuilder.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
PdbAstBuilder.h; path = source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h; 
sourceTree = SOURCE_ROOT; };
AFD966B6217140B6006714AC /* PdbIndex.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = PdbIndex.cpp; path = source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp; 
sourceTree = SOURCE_ROOT; };
AFD966BF217140C8006714AC /* PdbIndex.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PdbIndex.h; path = 
source/Plugins/SymbolFile/NativePDB/PdbIndex.h; sourceTree = SOURCE_ROOT; };
AF0F459D219FA1C800C1E612 /* PdbSymUid.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = PdbSymUid.cpp; path = source/Plugins/SymbolFile/NativePDB/PdbSymUid.cpp; 
sourceTree = SOURCE_ROOT; };
@@ -6823,6 +6826,8 @@
AFD966BD217140C8006714AC /* CompileUnitIndex.h 
*/,
4C38996221B9AECC002BAEF4 /* 
DWARFLocationExpression.cpp */,
4C38996321B9AECC002BAEF4 /* 
DWARFLocationExpression.h */,
+   AF815DF721C855B400023A34 /* PdbAstBuilder.cpp 
*/,
+   AF815DF821C855B400023A34 /* PdbAstBuilder.h */,
AFD966B6217140B6006714AC /* PdbIndex.cpp */,
AFD966BF217140C8006714AC /* PdbIndex.h */,
AF0F459D219FA1C800C1E612 /* PdbSymUid.cpp */,
@@ -7842,6 +7847,7 @@
964463EC1A330C0500154ED8 /* 
CompactUnwindInfo.cpp in Sources */,
94B638531B8F8E6C004FE1E4 /* Language.cpp in 
Sources */,
AF395C03219254F300894EC3 /* 
MSVCUndecoratedNameParser.cpp in Sources */,
+   AF815DF921C855B400023A34 /* PdbAstBuilder.cpp 
in Sources */,
2689001D13353DDE00698AC0 /* 
CommandObjectLog.cpp in Sources */,

[Lldb-commits] [lldb] r349409 - Document the DBGSourcePathRemapping dictionary that may be

2018-12-17 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Dec 17 14:25:54 2018
New Revision: 349409

URL: http://llvm.org/viewvc/llvm-project?rev=349409&view=rev
Log:
Document the DBGSourcePathRemapping dictionary that may be 
present in the dSYM per-uuid plist, its precedence order with
the older DBGBuildSourcePath/DBGSourcePath, and note that
must be present and have a value of 3 or the dictionary
will be ignored.
 

Modified:
lldb/trunk/www/symbols.html

Modified: lldb/trunk/www/symbols.html
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/www/symbols.html?rev=349409&r1=349408&r2=349409&view=diff
==
--- lldb/trunk/www/symbols.html (original)
+++ lldb/trunk/www/symbols.html Mon Dec 17 14:25:54 2018
@@ -262,6 +262,17 @@ A40597AA-5529-3337-8C09-D8A014EB1578.pli
/path/to/foo.dSYM/Contents/Resources/DWARF/foo
DBGSymbolRichExecutable
/path/to/unstripped/executable
+   DBGVersion
+   3
+   DBGSourcePathRemapping
+   
+   /path/to/build/time/src/location1
+   /path/to/debug/time/src/location
+   /path/to/build/time/src/location2
+   /path/to/debug/time/src/location
+   
+   DBGSymbolRichExecutable
+   /path/to/unstripped/executable
 
 
 
@@ -271,6 +282,22 @@ so making the results of your shell scri
 combining two plists into a single one where you take the UUID and use it a
  string key, and the value is the contents of the plist.
 
+LLDB will read the following entries from the per-UUID plist file in the 
dSYM
+bundle:  DBGSymbolRichExecutable, DBGBuildSourcePath and
+DBGSourcePath, and DBGSourcePathRemapping if DBGVersion 
is 3
+or higher.  DBGBuildSourcePath and DBGSourcePath are for 
remapping
+a single file path.  For instance, the files may be in 
/BuildDir/SheetApp/SheetApp-37
+when built, but they are in /SourceDir/SheetApp/SheetApp-37 at debug time, 
those
+two paths could be listed in those keys.  If there are multiple source path
+remappings, the DBGSourcePathRemapping dictionary can be used, where an
+arbitrary number of entries may be present.  DBGVersion should be 3 or
+DBGSourcePathRemapping will not be read.  If both 
DBGSourcePathRemapping
+AND DBGBuildSourcePath/DBGSourcePath are present in the plist, 
the
+DBGSourcePathRemapping entries will be used for path remapping first.  
This
+may allow for more specific remappings in the DBGSourcePathRemapping
+dictionary and a less specific remapping in the
+DBGBuildSourcePath/DBGSourcePath pair as a last resort.
+
 




___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r349417 - A few small updates to the testsuite for running against an iOS device.

2018-12-17 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Dec 17 15:33:40 2018
New Revision: 349417

URL: http://llvm.org/viewvc/llvm-project?rev=349417&view=rev
Log:
A few small updates to the testsuite for running against an iOS device.
Remove the expected-fails for 34538611; using an alternate platform
implementation handles these correctly.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_hits/TestMultipleHits.py
lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py

lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py
lldb/trunk/source/Target/Process.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py?rev=349417&r1=349416&r2=349417&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
 Mon Dec 17 15:33:40 2018
@@ -158,6 +158,7 @@ class LoadUnloadTestCase(TestBase):
 @skipIfFreeBSD  # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase 
support
 @expectedFailureAndroid  # wrong source file shows up for hidden library
 @skipIfWindows  # Windows doesn't have dlopen and friends, dynamic 
libraries work differently
+@skipIfDarwinEmbedded
 def test_dyld_library_path(self):
 """Test (DY)LD_LIBRARY_PATH after moving libd.dylib, which defines 
d_function, somewhere else."""
 self.copy_shlibs_to_remote(hidden_dir=True)

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py?rev=349417&r1=349416&r2=349417&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py
 Mon Dec 17 15:33:40 2018
@@ -23,7 +23,6 @@ class ProcessAttachTestCase(TestBase):
 NO_DEBUG_INFO_TESTCASE = True
 
 @skipIfiOSSimulator
-@expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], 
bugnumber="") # old lldb-server has race condition, 
launching an inferior and then launching debugserver in quick succession 
sometimes fails
 def test_attach_to_process_by_id(self):
 """Test attach by process id"""
 self.build()
@@ -40,7 +39,6 @@ class ProcessAttachTestCase(TestBase):
 process = target.GetProcess()
 self.assertTrue(process, PROCESS_IS_VALID)
 
-@expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], 
bugnumber="") # old lldb-server has race condition, 
launching an inferior and then launching debugserver in quick succession 
sometimes fails
 def test_attach_to_process_from_different_dir_by_id(self):
 """Test attach by process id"""
 newdir = self.getBuildArtifact("newdir")
@@ -67,7 +65,6 @@ class ProcessAttachTestCase(TestBase):
 process = target.GetProcess()
 self.assertTrue(process, PROCESS_IS_VALID)
 
-@expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], 
bugnumber="") # old lldb-server has race condition, 
launching an inferior and then launching debugserver in quick succession 
sometimes fails
 def test_attach_to_process_by_name(self):
 """Test attach by process name"""
 self.build()

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py?rev=349417&r1=349416&r2=349417&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py
 Mon Dec 17 15:33:40 2018
@@ -24,7 +24,6 @@ class ChangeProcessGroupTestCase(TestBas
 @skipIfFreeBSD  # Times

[Lldb-commits] [lldb] r349553 - Un-conditionalize use of libcompression. debugserver only builds

2018-12-18 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Dec 18 14:21:48 2018
New Revision: 349553

URL: http://llvm.org/viewvc/llvm-project?rev=349553&view=rev
Log:
Un-conditionalize use of libcompression.  debugserver only builds
on Darwin systems and libcompression has been in the OS for over
three years. 

Remove use of / linking to zlib.  We'll always have libcompression
available now.

Create a scratch buffer via compression_encode_scratch_buffer_size()
and use it in calls to compression_encode_buffer() to avoid 
compression_encode_buffer having to malloc & free a scratch buffer
on each call.  

Tested by forcing compression to be enabled on macos native (normally
only enabled on iOS et al devices), running the testsuite.



Modified:
lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj
lldb/trunk/tools/debugserver/source/RNBRemote.cpp

Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=349553&r1=349552&r2=349553&view=diff
==
--- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj 
(original)
+++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Tue Dec 
18 14:21:48 2018
@@ -710,12 +710,9 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
-   LLDB_COMPRESSION_CFLAGS = 
"-DHAVE_LIBCOMPRESSION=1";
LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_OS_LOG_CFLAGS = 
"-DLLDB_USE_OS_LOG=$(LLDB_USE_OS_LOG)";
LLDB_USE_OS_LOG = 0;
-   LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
-   LLDB_ZLIB_LDFLAGS = "-lz";
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "";
STRIP_INSTALLED_PRODUCT = NO;
@@ -749,13 +746,10 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
-   LLDB_COMPRESSION_CFLAGS = 
"-DHAVE_LIBCOMPRESSION=1";
LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
LLDB_OS_LOG_CFLAGS = 
"-DLLDB_USE_OS_LOG=$(LLDB_USE_OS_LOG)";
LLDB_USE_OS_LOG = 0;
-   LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
-   LLDB_ZLIB_LDFLAGS = "-lz";
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "";
STRIPFLAGS = "-x";
@@ -790,12 +784,9 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
-   LLDB_COMPRESSION_CFLAGS = 
"-DHAVE_LIBCOMPRESSION=1";
LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_OS_LOG_CFLAGS = 
"-DLLDB_USE_OS_LOG=$(LLDB_USE_OS_LOG)";
LLDB_USE_OS_LOG = 1;
-   LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
-   LLDB_ZLIB_LDFLAGS = "-lz";
OTHER_CFLAGS = "";
STRIPFLAGS = "-x";
STRIP_STYLE = debugging;
@@ -828,20 +819,15 @@
HEADER_SEARCH_PATHS = 
/System/Library/Frameworks/System.framework/PrivateHeaders;
INSTALL_PATH = /usr/bin;
"INSTALL_PATH[sdk=iphoneos*]" = 
/Developer/usr/bin/;
-   LLDB_COMPRESSION_CFLAGS = 
"-DHAVE_LIBCOMPRESSION=1";
LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_DEBUGSERVER = 1;
LLDB_ENERGY_CFLAGS = "";
"LLDB_ENERGY_CFLAGS[sdk=*internal]" = 
"-DLLDB_ENERGY";
LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
-   LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
-   LLDB_ZLIB_LDFLAGS = "-lz";
OTHER_CFLAGS = (
"-Wparentheses",
"$(LLDB_ENERGY_CFLAGS)",
"-DDT_VARIANT_$(DT_VARIANT)",
-   "$(LLDB_COMPR

[Lldb-commits] [lldb] r349563 - Force libcompression calls to be enabled when building on Darwin

2018-12-18 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Dec 18 15:02:50 2018
New Revision: 349563

URL: http://llvm.org/viewvc/llvm-project?rev=349563&view=rev
Log:
Force libcompression calls to be enabled when building on Darwin
systems.  It has been available in the OS over over three years
now.  If lldb doesn't link against -lcompression, it should be an
error.

Allocate a scratch buffer for libcompression to use when decoding
packets, instead of it having to allocate & free one on every call.

Fix a typeo with the size of the buffer that compression_decode_buffer()
is expanding into.

 

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=349563&r1=349562&r2=349563&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Dec 18 15:02:50 2018
@@ -8712,8 +8712,7 @@
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VALUE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
-   LLDB_COMPRESSION_CFLAGS = 
"-DHAVE_LIBCOMPRESSION=1";
-   LLDB_COMPRESSION_LDFLAGS = "-weak-lcompression";
+   LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_COVERAGE_CFLAGS = 
"$(LLDB_COVERAGE_CFLAGS_$(LLDB_ENABLE_COVERAGE))";
LLDB_COVERAGE_CFLAGS_1 = 
"-fprofile-instr-generate -fcoverage-mapping";
LLDB_COVERAGE_LDFLAGS = 
"$(LLDB_COVERAGE_LDFLAGS_$(LLDB_ENABLE_COVERAGE))";
@@ -8734,12 +8733,11 @@
OTHER_CFLAGS = (
"-Wparentheses",
"$(LLDB_ZLIB_CFLAGS)",
-   "$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_COVERAGE_CFLAGS)",
"-Wimplicit-fallthrough",
);
OTHER_LDFLAGS = (
-   "$(LLDB_COMPRESSION_LDFLAGS)",
+   "-lcompression",
"$(LLDB_ZLIB_LDFLAGS)",
"$(LLDB_COVERAGE_LDFLAGS)",
);
@@ -8802,8 +8800,7 @@
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VALUE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
-   LLDB_COMPRESSION_CFLAGS = 
"-DHAVE_LIBCOMPRESSION=1";
-   LLDB_COMPRESSION_LDFLAGS = "-weak-lcompression";
+   LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_COVERAGE_CFLAGS = 
"$(LLDB_COVERAGE_CFLAGS_$(LLDB_ENABLE_COVERAGE))";
LLDB_COVERAGE_CFLAGS_1 = 
"-fprofile-instr-generate -fcoverage-mapping";
LLDB_COVERAGE_LDFLAGS = 
"$(LLDB_COVERAGE_LDFLAGS_$(LLDB_ENABLE_COVERAGE))";
@@ -8824,12 +8821,11 @@
OTHER_CFLAGS = (
"-Wparentheses",
"$(LLDB_ZLIB_CFLAGS)",
-   "$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_COVERAGE_CFLAGS)",
"-Wimplicit-fallthrough",
);
OTHER_LDFLAGS = (
-   "$(LLDB_COMPRESSION_LDFLAGS)",
+   "-lcompression",
"$(LLDB_ZLIB_LDFLAGS)",
"$(LLDB_COVERAGE_LDFLAGS)",
);
@@ -8965,7 +8961,6 @@
"-fno-rtti",
"-Wparentheses",
"$(LLDB_ZLIB_CFLAGS)",
-   "$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_GTESTS_CFLAGS)",
"-DGTEST_HAS_RTTI=0",
);
@@ -9007,7 +9002,6 @@
"-fno-rtti",
"-Wparentheses",
"$(LLDB_ZLIB_CFLAGS)",
-

[Lldb-commits] [lldb] r349572 - Remove the zlib CFLAGS and LDFLAGS settings from the xcode project file.

2018-12-18 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Dec 18 15:33:42 2018
New Revision: 349572

URL: http://llvm.org/viewvc/llvm-project?rev=349572&view=rev
Log:
Remove the zlib CFLAGS and LDFLAGS settings from the xcode project file.
We're linking against libcompression all the time now, we don't need to
fall back to zlib.  zlib support will still be used when lldb is built on
linux et al systems, so I'm not removing any of the source support, but
when built on darwin with xcode, we'll be using libcompression.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=349572&r1=349571&r2=349572&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Dec 18 15:33:42 2018
@@ -8722,8 +8722,6 @@
LLDB_ENABLE_COVERAGE = 0;
LLDB_FRAMEWORK_INSTALL_DIR = 
/Applications/Xcode.app/Contents/SharedFrameworks;
LLDB_TOOLS_INSTALL_DIR = /usr/bin;
-   LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
-   LLDB_ZLIB_LDFLAGS = "-lz";
LLVM_BUILD_DIR = 
"$(SRCROOT)/llvm-build/$(LLVM_CONFIGURATION)";
LLVM_BUILD_DIRTREE = "$(SRCROOT)/llvm-build";
LLVM_BUILD_DIR_ARCH = x86_64/;
@@ -8732,13 +8730,11 @@
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-Wparentheses",
-   "$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_COVERAGE_CFLAGS)",
"-Wimplicit-fallthrough",
);
OTHER_LDFLAGS = (
"-lcompression",
-   "$(LLDB_ZLIB_LDFLAGS)",
"$(LLDB_COVERAGE_LDFLAGS)",
);
PYTHON_FRAMEWORK_PATH = 
/System/Library/Frameworks/Python.framework/;
@@ -8810,8 +8806,6 @@
LLDB_ENABLE_COVERAGE = 0;
LLDB_FRAMEWORK_INSTALL_DIR = 
/Applications/Xcode.app/Contents/SharedFrameworks;
LLDB_TOOLS_INSTALL_DIR = /usr/bin;
-   LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
-   LLDB_ZLIB_LDFLAGS = "-lz";
LLVM_BUILD_DIR = 
"$(SRCROOT)/llvm-build/$(LLVM_CONFIGURATION)";
LLVM_BUILD_DIRTREE = "$(SRCROOT)/llvm-build";
LLVM_BUILD_DIR_ARCH = x86_64/;
@@ -8820,13 +8814,11 @@
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-Wparentheses",
-   "$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_COVERAGE_CFLAGS)",
"-Wimplicit-fallthrough",
);
OTHER_LDFLAGS = (
"-lcompression",
-   "$(LLDB_ZLIB_LDFLAGS)",
"$(LLDB_COVERAGE_LDFLAGS)",
);
PYTHON_FRAMEWORK_PATH = 
/System/Library/Frameworks/Python.framework/;
@@ -8960,7 +8952,6 @@
OTHER_CFLAGS = (
"-fno-rtti",
"-Wparentheses",
-   "$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_GTESTS_CFLAGS)",
"-DGTEST_HAS_RTTI=0",
);
@@ -9001,7 +8992,6 @@
OTHER_CFLAGS = (
"-fno-rtti",
"-Wparentheses",
-   "$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_GTESTS_CFLAGS)",
"-DGTEST_HAS_RTTI=0",
);
@@ -9042,7 +9032,6 @@
OTHER_CFLAGS = (
"-fno-rtti",
"-Wparentheses",
-   "$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_GTESTS_CFLAGS)",
"-DGTEST_HAS_RTTI=0",
);
@@ -9083,7

[Lldb-commits] [lldb] r349580 - Don't forget to free the libcompression scratch buffer in the dtor.

2018-12-18 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Dec 18 15:45:45 2018
New Revision: 349580

URL: http://llvm.org/viewvc/llvm-project?rev=349580&view=rev
Log:
Don't forget to free the libcompression scratch buffer in the dtor.

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=349580&r1=349579&r2=349580&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Tue 
Dec 18 15:45:45 2018
@@ -81,6 +81,9 @@ GDBRemoteCommunication::~GDBRemoteCommun
 Disconnect();
   }
 
+  if (m_decompression_scratch)
+free (m_decompression_scratch);
+
   // Stop the communications read thread which is used to parse all incoming
   // packets.  This function will block until the read thread returns.
   if (m_read_thread_enabled)


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r333690 - Set m_struct_valid to initial value in ctor.

2018-05-31 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu May 31 13:01:15 2018
New Revision: 333690

URL: http://llvm.org/viewvc/llvm-project?rev=333690&view=rev
Log:
Set m_struct_valid to initial value in ctor.  
Patch from Tom Tromey .

Differential Revision: https://reviews.llvm.org/D47481

Modified:
lldb/trunk/source/Expression/FunctionCaller.cpp

Modified: lldb/trunk/source/Expression/FunctionCaller.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/FunctionCaller.cpp?rev=333690&r1=333689&r2=333690&view=diff
==
--- lldb/trunk/source/Expression/FunctionCaller.cpp (original)
+++ lldb/trunk/source/Expression/FunctionCaller.cpp Thu May 31 13:01:15 2018
@@ -48,7 +48,8 @@ FunctionCaller::FunctionCaller(Execution
   m_function_return_type(return_type),
   m_wrapper_function_name("__lldb_caller_function"),
   m_wrapper_struct_name("__lldb_caller_struct"), m_wrapper_args_addrs(),
-  m_arg_values(arg_value_list), m_compiled(false), m_JITted(false) {
+  m_struct_valid(false), m_arg_values(arg_value_list), m_compiled(false),
+  m_JITted(false) {
   m_jit_process_wp = lldb::ProcessWP(exe_scope.CalculateProcess());
   // Can't make a FunctionCaller without a process.
   assert(m_jit_process_wp.lock());


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r334441 - Add DebugNamesDWARFIndex.cpp.

2018-06-11 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Jun 11 14:35:36 2018
New Revision: 334441

URL: http://llvm.org/viewvc/llvm-project?rev=334441&view=rev
Log:
Add DebugNamesDWARFIndex.cpp.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=334441&r1=334440&r2=334441&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Jun 11 14:35:36 2018
@@ -965,6 +965,7 @@
AF0EBBEC185941360059E52F /* SBQueue.h in Headers */ = {isa = 
PBXBuildFile; fileRef = AF0EBBEA185941360059E52F /* SBQueue.h */; settings = 
{ATTRIBUTES = (Public, ); }; };
AF0EBBED185941360059E52F /* SBQueueItem.h in Headers */ = {isa 
= PBXBuildFile; fileRef = AF0EBBEB185941360059E52F /* SBQueueItem.h */; 
settings = {ATTRIBUTES = (Public, ); }; };
AF0F6E501739A76D009180FE /* RegisterContextKDP_arm64.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF0F6E4E1739A76D009180FE /* 
RegisterContextKDP_arm64.cpp */; };
+   AF116BEF20CF234B0071093F /* DebugNamesDWARFIndex.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AF116BED20CF234B0071093F /* 
DebugNamesDWARFIndex.cpp */; };
AF1729D6182C907200E0AB97 /* HistoryThread.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF1729D4182C907200E0AB97 /* HistoryThread.cpp 
*/; };
AF1729D7182C907200E0AB97 /* HistoryUnwind.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF1729D5182C907200E0AB97 /* HistoryUnwind.cpp 
*/; };
AF1D88691B575E8D003CB899 /* ValueObjectConstResultCast.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF94726E1B575E430063D65C /* 
ValueObjectConstResultCast.cpp */; };
@@ -3076,6 +3077,8 @@
AF0EBBEF1859419F0059E52F /* SBQueueItem.i */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.c.preprocessed; path = SBQueueItem.i; sourceTree = ""; };
AF0F6E4E1739A76D009180FE /* RegisterContextKDP_arm64.cpp */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; path = RegisterContextKDP_arm64.cpp; sourceTree = 
""; };
AF0F6E4F1739A76D009180FE /* RegisterContextKDP_arm64.h */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
path = RegisterContextKDP_arm64.h; sourceTree = ""; };
+   AF116BED20CF234B0071093F /* DebugNamesDWARFIndex.cpp */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = DebugNamesDWARFIndex.cpp; sourceTree = ""; };
+   AF116BEE20CF234B0071093F /* DebugNamesDWARFIndex.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
DebugNamesDWARFIndex.h; sourceTree = ""; };
AF1729D4182C907200E0AB97 /* HistoryThread.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = HistoryThread.cpp; path = Utility/HistoryThread.cpp; sourceTree = 
""; };
AF1729D5182C907200E0AB97 /* HistoryUnwind.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = HistoryUnwind.cpp; path = Utility/HistoryUnwind.cpp; sourceTree = 
""; };
AF1F7B05189C904B0087DB9C /* AppleGetPendingItemsHandler.cpp */ 
= {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; path = AppleGetPendingItemsHandler.cpp; sourceTree = 
""; };
@@ -3939,6 +3942,8 @@
6D95DBFD1B9DC057000E318A /* DIERef.cpp */,
6D95DBFE1B9DC057000E318A /* HashedNameToDIE.cpp 
*/,
6D95DBFF1B9DC057000E318A /* 
SymbolFileDWARFDwo.cpp */,
+   AF116BED20CF234B0071093F /* 
DebugNamesDWARFIndex.cpp */,
+   AF116BEE20CF234B0071093F /* 
DebugNamesDWARFIndex.h */,
260C89B310F57C5600BB2B04 /* 
DWARFAbbreviationDeclaration.cpp */,
260C89B410F57C5600BB2B04 /* 
DWARFAbbreviationDeclaration.h */,
269DDD451B8FD01A00D0DBD8 /* DWARFASTParser.h */,
@@ -7694,6 +7699,7 @@
8C2D6A53197A1EAF006989C9 /* MemoryHistory.cpp 
in Sources */,
6D95DC021B9DC057000E318A /* 
SymbolFileDWARFDwo.cpp in Sources */,
942612F71B9500EF842E /* 
LanguageCategory.cpp in Sources */,
+   AF116BEF20CF234B0071093F /* 
DebugNamesDWARFIndex.cpp in Sources */,
2689005E13353E0E00698AC0 /* ClangASTSource.cpp 
in Sources */,
2689005F13353E0E00698AC0 /* 
ClangFunctionCaller.cpp in Sources */,
   

[Lldb-commits] [lldb] r334442 - Document how lldb uses the DBGSourcePathRemapping

2018-06-11 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Jun 11 14:36:40 2018
New Revision: 334442

URL: http://llvm.org/viewvc/llvm-project?rev=334442&view=rev
Log:
Document how lldb uses the DBGSourcePathRemapping 
source path remapping src/dest path pairs with
respect to the DBGVersion number in the plist.

Modified:
lldb/trunk/source/Host/macosx/Symbols.cpp
lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp

Modified: lldb/trunk/source/Host/macosx/Symbols.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Symbols.cpp?rev=334442&r1=334441&r2=334442&view=diff
==
--- lldb/trunk/source/Host/macosx/Symbols.cpp (original)
+++ lldb/trunk/source/Host/macosx/Symbols.cpp Mon Jun 11 14:36:40 2018
@@ -340,8 +340,13 @@ static bool GetModuleSpecInfoFromUUIDDic
 std::string DBGBuildSourcePath;
 std::string DBGSourcePath;
 
-// If DBGVersion value 2 or higher, look for DBGSourcePathRemapping
-// dictionary and append the key-value pairs to our remappings.
+// If DBGVersion 1 or DBGVersion missing, ignore DBGSourcePathRemapping.
+// If DBGVersion 2, strip last two components of path remappings from
+//  entries to fix an issue with a specific set of
+//  DBGSourcePathRemapping entries that lldb worked
+//  with.
+// If DBGVersion 3, trust & use the source path remappings as-is.
+//
 cf_dict = (CFDictionaryRef)CFDictionaryGetValue(
 (CFDictionaryRef)uuid_dict, CFSTR("DBGSourcePathRemapping"));
 if (cf_dict && CFGetTypeID(cf_dict) == CFDictionaryGetTypeID()) {

Modified: lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp?rev=334442&r1=334441&r2=334442&view=diff
==
--- lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp Mon 
Jun 11 14:36:40 2018
@@ -192,16 +192,14 @@ SymbolVendorMacOSX::CreateInstance(const
   ->GetValueForKey("DBGSourcePathRemapping")
   ->GetAsDictionary()) {
 
-// In an early version of DBGSourcePathRemapping, the
-// DBGSourcePath values were incorrect.  If we have a
-// newer style DBGSourcePathRemapping, there will be a
-// DBGVersion key in the plist with version 2 or
-// higher.
+// If DBGVersion 1 or DBGVersion missing, ignore 
DBGSourcePathRemapping.
+// If DBGVersion 2, strip last two components of path 
remappings from
+//  entries to fix an issue with a 
specific set of
+//  DBGSourcePathRemapping entries 
that lldb worked
+//  with.
+// If DBGVersion 3, trust & use the source path 
remappings as-is.
 //
-// If this is an old style DBGSourcePathRemapping,
-// ignore the value half of the key-value remappings
-// and use reuse the original gloal DBGSourcePath
-// string.
+
 bool new_style_source_remapping_dictionary = false;
 bool do_truncate_remapping_names = false;
 std::string original_DBGSourcePath_value =


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r334662 - Fix macos xcode build.

2018-06-13 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Jun 13 15:05:38 2018
New Revision: 334662

URL: http://llvm.org/viewvc/llvm-project?rev=334662&view=rev
Log:
Fix macos xcode build.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Host/macosx/objcxx/Host.mm

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=334662&r1=334661&r2=334662&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Jun 13 15:05:38 2018
@@ -604,7 +604,6 @@
26A7A035135E6E4200FB369E /* OptionValue.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26A7A034135E6E4200FB369E /* OptionValue.cpp */; 
};
26AB92121819D74600E63F3E /* DWARFDataExtractor.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 26AB92101819D74600E63F3E /* 
DWARFDataExtractor.cpp */; };
26B1EFAE154638AF00E2DAC7 /* DWARFDeclContext.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 26B1EFAC154638AF00E2DAC7 /* 
DWARFDeclContext.cpp */; };
-   26B1FCC21338115F002886E2 /* Host.mm in Sources */ = {isa = 
PBXBuildFile; fileRef = 26BC7EE810F1B88F00F91463 /* Host.mm */; };
26B42C4D1187ABA50079C8C8 /* LLDB.h in Headers */ = {isa = 
PBXBuildFile; fileRef = 26B42C4C1187ABA50079C8C8 /* LLDB.h */; settings = 
{ATTRIBUTES = (Public, ); }; };
26B7564E14F89356008D9CB3 /* PlatformiOSSimulator.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 26B7564C14F89356008D9CB3 /* 
PlatformiOSSimulator.cpp */; };
26B75B441AD6E29A001F7A57 /* MipsLinuxSignals.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 26B75B421AD6E29A001F7A57 /* 
MipsLinuxSignals.cpp */; };
@@ -686,12 +685,10 @@
3FDFDDBD199C3A06009756A7 /* FileAction.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 3FDFDDBC199C3A06009756A7 /* FileAction.cpp */; };
3FDFDDBF199D345E009756A7 /* FileCache.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 3FDFDDBE199D345E009756A7 /* FileCache.cpp */; };
3FDFDDC6199D37ED009756A7 /* FileSystem.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 3FDFDDC5199D37ED009756A7 /* FileSystem.cpp */; };
-   3FDFE52C19A2917A009756A7 /* HostInfoMacOSX.mm in Sources */ = 
{isa = PBXBuildFile; fileRef = 3FDFE52B19A2917A009756A7 /* HostInfoMacOSX.mm 
*/; };
3FDFE53119A292F0009756A7 /* HostInfoPosix.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 3FDFE53019A292F0009756A7 /* HostInfoPosix.cpp 
*/; };
3FDFE53519A29327009756A7 /* HostInfoBase.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 3FDFE53419A29327009756A7 /* HostInfoBase.cpp */; 
};
3FDFE56C19AF9C44009756A7 /* HostProcessPosix.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 3FDFE56A19AF9C44009756A7 /* 
HostProcessPosix.cpp */; };
3FDFE56D19AF9C44009756A7 /* HostThreadPosix.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 3FDFE56B19AF9C44009756A7 /* HostThreadPosix.cpp 
*/; };
-   3FDFED0B19B7C8DE009756A7 /* HostThreadMacOSX.mm in Sources */ = 
{isa = PBXBuildFile; fileRef = 3FDFED0519B7C898009756A7 /* HostThreadMacOSX.mm 
*/; };
3FDFED2719BA6D96009756A7 /* HostNativeThreadBase.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 3FDFED2419BA6D96009756A7 /* 
HostNativeThreadBase.cpp */; };
3FDFED2819BA6D96009756A7 /* HostThread.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 3FDFED2519BA6D96009756A7 /* HostThread.cpp */; };
3FDFED2919BA6D96009756A7 /* ThreadLauncher.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 3FDFED2619BA6D96009756A7 /* ThreadLauncher.cpp 
*/; };
@@ -842,7 +839,6 @@
945261C61B9A11FC00BF138D /* LibStdcpp.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 945261BC1B9A11E800BF138D /* LibStdcpp.cpp */; };
945261C81B9A14D300BF138D /* CXXFunctionPointer.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 945261C71B9A14D300BF138D /* 
CXXFunctionPointer.cpp */; };
9455630F1BEAD0600073F75F /* PlatformAppleSimulator.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 9455630A1BEAD0570073F75F /* 
PlatformAppleSimulator.cpp */; };
-   945563101BEAD0650073F75F /* 
PlatformiOSSimulatorCoreSimulatorSupport.mm in Sources */ = {isa = 
PBXBuildFile; fileRef = 9455630D1BEAD0570073F75F /* 
PlatformiOSSimulatorCoreSimulatorSupport.mm */; };
945759671534941F005A9070 /* PlatformPOSIX.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 945759651534941F005A9070 /* PlatformPOSIX.cpp 
*/; };
9461569A14E358A6003A195C /* SBTypeFilter.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 9461568A14E35621003A195C /* SBTypeFilter.cpp */; 
};
9461569B14E358A6003A195C /* SBTypeFormat.cpp in Sources */ = 
{isa = PBXBu

[Lldb-commits] [lldb] r334666 - Fix group entry.

2018-06-13 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Jun 13 15:33:27 2018
New Revision: 334666

URL: http://llvm.org/viewvc/llvm-project?rev=334666&view=rev
Log:
Fix group entry.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=334666&r1=334665&r2=334666&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Jun 13 15:33:27 2018
@@ -6791,7 +6791,6 @@
AFF81FB220D1CC910010F95E /* 
PlatformiOSSimulatorCoreSimulatorSupport.mm */,
);
name = objcxx;
-   path = "New Group";
sourceTree = "";
};
E769331B1A94D10E00C73337 /* lldb-server */ = {


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r334667 - Move the header file to be in the same new place as the .mm file.

2018-06-13 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Jun 13 15:37:01 2018
New Revision: 334667

URL: http://llvm.org/viewvc/llvm-project?rev=334667&view=rev
Log:
Move the header file to be in the same new place as the .mm file.

Added:

lldb/trunk/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h
  - copied unchanged from r334666, 
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.h
Removed:

lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.h
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=334667&r1=334666&r2=334667&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Jun 13 15:37:01 2018
@@ -2813,7 +2813,6 @@
945261C91B9A14E000BF138D /* CXXFunctionPointer.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = 
CXXFunctionPointer.h; path = include/lldb/DataFormatters/CXXFunctionPointer.h; 
sourceTree = ""; };
9455630A1BEAD0570073F75F /* PlatformAppleSimulator.cpp */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = 
PlatformAppleSimulator.cpp; sourceTree = ""; };
9455630B1BEAD0570073F75F /* PlatformAppleSimulator.h */ = {isa 
= PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
PlatformAppleSimulator.h; sourceTree = ""; };
-   9455630C1BEAD0570073F75F /* 
PlatformiOSSimulatorCoreSimulatorSupport.h */ = {isa = PBXFileReference; 
lastKnownFileType = sourcecode.c.h; path = 
PlatformiOSSimulatorCoreSimulatorSupport.h; sourceTree = ""; };
945759651534941F005A9070 /* PlatformPOSIX.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = PlatformPOSIX.cpp; path = POSIX/PlatformPOSIX.cpp; sourceTree = 
""; };
945759661534941F005A9070 /* PlatformPOSIX.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
PlatformPOSIX.h; path = POSIX/PlatformPOSIX.h; sourceTree = ""; };
9461568614E355F2003A195C /* SBTypeFilter.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeFilter.h; 
path = include/lldb/API/SBTypeFilter.h; sourceTree = ""; };
@@ -3173,6 +3172,7 @@
AF9FF1F41FAA79A400474976 /* LibCxxTuple.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = LibCxxTuple.cpp; path = Language/CPlusPlus/LibCxxTuple.cpp; sourceTree = 
""; };
AF9FF1F61FAA79FE00474976 /* LibCxxQueue.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = LibCxxQueue.cpp; path = Language/CPlusPlus/LibCxxQueue.cpp; sourceTree = 
""; };
AFAFD8091E57E1B90017A14F /* ModuleCacheTest.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = ModuleCacheTest.cpp; path = Target/ModuleCacheTest.cpp; sourceTree = 
""; };
+   AFB1682620D1D4CC00A74F25 /* 
PlatformiOSSimulatorCoreSimulatorSupport.h */ = {isa = PBXFileReference; 
lastKnownFileType = sourcecode.c.h; name = 
PlatformiOSSimulatorCoreSimulatorSupport.h; path = 
objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h; sourceTree = ""; };
AFB3D27E1AC262AB003B4B30 /* MICmdCmdGdbShow.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = MICmdCmdGdbShow.cpp; path = "tools/lldb-mi/MICmdCmdGdbShow.cpp"; 
sourceTree = SOURCE_ROOT; };
AFB3D27F1AC262AB003B4B30 /* MICmdCmdGdbShow.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
MICmdCmdGdbShow.h; path = "tools/lldb-mi/MICmdCmdGdbShow.h"; sourceTree = 
SOURCE_ROOT; };
AFC234061AF85CE000CDE8B6 /* CommandObjectLanguage.cpp */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = CommandObjectLanguage.cpp; path = 
source/Commands/CommandObjectLanguage.cpp; sourceTree = ""; };
@@ -5674,7 +5674,6 @@
2697A54C133A6305004E4240 /* PlatformDarwin.h */,
26B7564C14F89356008D9CB3 /* 
PlatformiOSSimulator.cpp */,
26B7564D14F89356008D9CB3 /* 
PlatformiOSSimulator.h */,
-   9455630C1BEAD0570073F75F /* 
PlatformiOSSimulatorCoreSimulatorSupport.h */,
26C5577B132575AD008FD8FE /* PlatformMacOSX.cpp 
*/,
26C5577C132575AD008FD8FE /* PlatformMacOSX.h */,
AF3A4AD01EA05C4700B5DEB4 /* 
PlatformRemoteDarwinDevice.cpp */,
@@ -6789,6 +6788,7 @@
isa 

[Lldb-commits] [lldb] r334680 - fix cmake include path.

2018-06-13 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Jun 13 18:29:18 2018
New Revision: 334680

URL: http://llvm.org/viewvc/llvm-project?rev=334680&view=rev
Log:
fix cmake include path.

Modified:
lldb/trunk/source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt?rev=334680&r1=334679&r2=334680&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt Wed Jun 13 
18:29:18 2018
@@ -1,5 +1,5 @@
 remove_module_flags()
-include_directories(..)
+include_directories(.)
 
 add_lldb_library(lldbPluginPlatformMacOSXObjCXX
   PlatformiOSSimulatorCoreSimulatorSupport.mm


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r334783 - Change TestExec.py from creating an i386+x86_64 fat binary

2018-06-14 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Jun 14 17:55:53 2018
New Revision: 334783

URL: http://llvm.org/viewvc/llvm-project?rev=334783&view=rev
Log:
Change TestExec.py from creating an i386+x86_64 fat binary
on darwin systems and re-execing itself, to creating two
separate test programs; lldb runs the first program and it
exec's the second.  

Support for compiling for i386 is going away.

Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/secondprog.cpp
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/secondprog.mk
Modified:
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/Makefile
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/main.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/Makefile?rev=334783&r1=334782&r2=334783&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/Makefile 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/Makefile Thu 
Jun 14 17:55:53 2018
@@ -2,4 +2,12 @@ LEVEL = ../../make
 
 CXX_SOURCES := main.cpp
 
+all: a.out secondprog
+
 include $(LEVEL)/Makefile.rules
+
+secondprog:
+   $(MAKE) VPATH=$(VPATH) -f $(SRCDIR)/secondprog.mk
+
+clean::
+   $(MAKE) -f $(SRCDIR)/secondprog.mk clean

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py?rev=334783&r1=334782&r2=334783&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py 
Thu Jun 14 17:55:53 2018
@@ -41,29 +41,20 @@ class ExecTestCase(TestBase):
 self.do_test(True)
 
 def do_test(self, skip_exec):
+self.build()
 exe = self.getBuildArtifact("a.out")
-if self.getArchitecture() == 'x86_64':
-source = self.getSourcePath("main.cpp")
-o_file = self.getBuildArtifact("main.o")
-execute_command(
-"'%s' -g -O0 -arch i386 -arch x86_64 '%s' -c -o '%s'" %
-(os.environ["CC"], source, o_file))
-execute_command(
-"'%s' -g -O0 -arch i386 -arch x86_64 '%s' -o '%s'" %
-(os.environ["CC"], o_file, exe))
-if self.getDebugInfo() != "dsym":
-dsym_path = self.getBuildArtifact("a.out.dSYM")
-execute_command("rm -rf '%s'" % (dsym_path))
-else:
-self.build()
+secondprog = self.getBuildArtifact("secondprog")
 
 # Create the target
 target = self.dbg.CreateTarget(exe)
 
 # Create any breakpoints we need
-breakpoint = target.BreakpointCreateBySourceRegex(
+breakpoint1 = target.BreakpointCreateBySourceRegex(
 'Set breakpoint 1 here', lldb.SBFileSpec("main.cpp", False))
-self.assertTrue(breakpoint, VALID_BREAKPOINT)
+self.assertTrue(breakpoint1, VALID_BREAKPOINT)
+breakpoint2 = target.BreakpointCreateBySourceRegex(
+'Set breakpoint 2 here', lldb.SBFileSpec("secondprog.cpp", False))
+self.assertTrue(breakpoint2, VALID_BREAKPOINT)
 
 # Launch the process
 process = target.LaunchSimple(
@@ -79,50 +70,48 @@ class ExecTestCase(TestBase):
 # Execute the cleanup function during test case tear down.
 self.addTearDownHook(cleanup)
 
-
-for i in range(6):
-# The stop reason of the thread should be breakpoint.
-self.assertTrue(process.GetState() == lldb.eStateStopped,
-STOPPED_DUE_TO_BREAKPOINT)
+# The stop reason of the thread should be breakpoint.
+self.assertTrue(process.GetState() == lldb.eStateStopped,
+STOPPED_DUE_TO_BREAKPOINT)
+
+threads = lldbutil.get_threads_stopped_at_breakpoint(
+process, breakpoint1)
+self.assertTrue(len(threads) == 1)
+
+# We had a deadlock tearing down the TypeSystemMap on exec, but only 
if some
+# expression had been evaluated.  So make sure we do that here so the 
teardown
+# is not trivial.
+
+thread = threads[0]
+value = thread.frames[0].EvaluateExpression("1 + 2")
+self.assertTrue(
+value.IsValid(),
+"Expression evaluated successfully")
+int_value = value.GetValueAsSigned()
+self.assertTrue(int_value == 3, "Expression got the right result.")
 
-threads = lldbutil.get_threads_stopped_at_br

[Lldb-commits] [lldb] r334872 - Sort the files in the PBXBuildFile and PBXFileReference

2018-06-15 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Jun 15 16:29:32 2018
New Revision: 334872

URL: http://llvm.org/viewvc/llvm-project?rev=334872&view=rev
Log:
Sort the files in the PBXBuildFile and PBXFileReference
sections of lldb's xcode project file to reduce automerger
issues with the github swift repository of lldb where 
the order of these entries has drifted significantly
over the years.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r334873 - Sort the files in the PBXBuildFile and PBXFileReference sections

2018-06-15 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Jun 15 16:32:37 2018
New Revision: 334873

URL: http://llvm.org/viewvc/llvm-project?rev=334873&view=rev
Log:
Sort the files in the PBXBuildFile and PBXFileReference sections
of debugserver's xcode project file to reduce automerger issues
with the github swift repository of lldb where the order of these
entries has drifted significantly over the years.


Modified:
lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj

Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=334873&r1=334872&r2=334873&view=diff
==
--- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj 
(original)
+++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Fri Jun 
15 16:32:37 2018
@@ -7,167 +7,131 @@
objects = {
 
 /* Begin PBXBuildFile section */
-   23043C9D1D35DBEC00FC25CA /* JSON.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 233B4EA51D2DB54300E98261 /* JSON.cpp */; };
-   23043C9E1D35DBFA00FC25CA /* StringConvert.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 233B4EA81D2DB96A00E98261 /* StringConvert.cpp 
*/; };
-   2307CCCB1D4A5D630016ABC0 /* LogFilterExactMatch.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 237821AE1D4917D20028B7A1 /* 
LogFilterExactMatch.cpp */; };
-   233B4EA71D2DB54300E98261 /* JSON.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 233B4EA51D2DB54300E98261 /* JSON.cpp */; };
-   233B4EA91D2DB96A00E98261 /* StringConvert.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 233B4EA81D2DB96A00E98261 /* StringConvert.cpp 
*/; };
-   23562ED21D3424DF00AB2BD4 /* LogMessageOsLog.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 23562ED01D3424DF00AB2BD4 /* LogMessageOsLog.cpp 
*/; };
-   23562ED31D3424DF00AB2BD4 /* LogMessageOsLog.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 23562ED01D3424DF00AB2BD4 /* LogMessageOsLog.cpp 
*/; };
23562ED61D342A5A00AB2BD4 /* ActivityStore.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 23562ED51D342A5A00AB2BD4 /* ActivityStore.cpp 
*/; };
23562ED71D342A5A00AB2BD4 /* ActivityStore.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 23562ED51D342A5A00AB2BD4 /* ActivityStore.cpp 
*/; };
-   23562ED91D342BAB2BD4 /* LogMessage.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 23562ED81D342BAB2BD4 /* LogMessage.cpp */; };
-   23562EDA1D342BAB2BD4 /* LogMessage.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 23562ED81D342BAB2BD4 /* LogMessage.cpp */; };
-   237821B01D4917D20028B7A1 /* LogFilterExactMatch.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 237821AE1D4917D20028B7A1 /* 
LogFilterExactMatch.cpp */; };
+   26CE05C5115C36590022F371 /* CFBundle.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 2695DD910D3EBFF6007E4CA2 /* CFBundle.cpp */; };
+   456F67641AD46CE9002850C2 /* CFBundle.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 2695DD910D3EBFF6007E4CA2 /* CFBundle.cpp */; };
+   26CE05C3115C36580022F371 /* CFString.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 2695DD9B0D3EC160007E4CA2 /* CFString.cpp */; };
+   456F67621AD46CE9002850C2 /* CFString.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 2695DD9B0D3EC160007E4CA2 /* CFString.cpp */; };
+   26CE05CF115C36F70022F371 /* CoreFoundation.framework in 
Frameworks */ = {isa = PBXBuildFile; fileRef = 26ACA3340D3E956300A2120B /* 
CoreFoundation.framework */; settings = {ATTRIBUTES = (Required, ); }; };
+   456F676B1AD46CE9002850C2 /* CoreFoundation.framework in 
Frameworks */ = {isa = PBXBuildFile; fileRef = 26ACA3340D3E956300A2120B /* 
CoreFoundation.framework */; settings = {ATTRIBUTES = (Required, ); }; };
+   26CE05B7115C363B0022F371 /* DNB.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 26C637D60C71334A0024798E /* DNB.cpp */; };
+   456F67551AD46CE9002850C2 /* DNB.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 26C637D60C71334A0024798E /* DNB.cpp */; };
+   264D5D581293835600ED4C01 /* DNBArch.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 264D5D571293835600ED4C01 /* DNBArch.cpp */; };
+   456F67671AD46CE9002850C2 /* DNBArch.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 264D5D571293835600ED4C01 /* DNBArch.cpp */; };
+   26CE05C1115C36510022F371 /* DNBArchImpl.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 2675D4220CCEB705000F49AF /* DNBArchImpl.cpp */; 
};
+   26CE05C2115C36550022F371 /* DNBArchImpl.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26C637FB0C71334A0024798E /* DNBArchImpl.cpp */; 
};
+   456F67601AD46CE9002850C2 /* DNBArchImpl.cp

[Lldb-commits] [lldb] r334995 - Some NFC changes to how we scan of kexts & kernels in memory in the

2018-06-18 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Jun 18 16:30:03 2018
New Revision: 334995

URL: http://llvm.org/viewvc/llvm-project?rev=334995&view=rev
Log:
Some NFC changes to how we scan of kexts & kernels in memory in the
DynamicLoaderDarwinKernel plugin.  Created a new function ReadMachHeader
and instead of reading through the target cached memory reader,
start by reading only a mach header sized chunk of memory, then
check it for a valid mach-o magic # and use the size of the load
commands to pre-fetch the entire load commands of the kext which
is the only thing we're going to read, instead of letting the generic
mach-o parser read it in 512 byte chunks.

Functionally this is doing exactly the same thing as before, but by
cutting down on the # of packets going back and forth, even on a 
local connection it's close to a quarter faster than it was before.

 


Modified:

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=334995&r1=334994&r2=334995&view=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 Mon Jun 18 16:30:03 2018
@@ -8,8 +8,6 @@
 //
 
//===--===//
 
-#include "lldb/Utility/SafeMachO.h"
-
 #include "Plugins/Platform/MacOSX/PlatformDarwinKernel.h"
 #include "lldb/Breakpoint/StoppointCallbackContext.h"
 #include "lldb/Core/Debugger.h"
@@ -368,46 +366,30 @@ lldb::addr_t DynamicLoaderDarwinKernel::
 }
 
 //--
-// Given an address in memory, look to see if there is a kernel image at that
-// address. Returns a UUID; if a kernel was not found at that address,
-// UUID.IsValid() will be false.
+// Read the mach_header struct out of memory and return it.
+// Returns true if the mach_header was successfully read,
+// Returns false if there was a problem reading the header, or it was not
+// a Mach-O header.
 //--
-lldb_private::UUID
-DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr,
-Process *process) {
-  Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
-  if (addr == LLDB_INVALID_ADDRESS)
-return UUID();
-
-  if (log)
-log->Printf("DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress: "
-"looking for kernel binary at 0x%" PRIx64,
-addr);
-
-  // First try a quick test -- read the first 4 bytes and see if there is a
-  // valid Mach-O magic field there (the first field of the
-  // mach_header/mach_header_64 struct).
 
+bool
+DynamicLoaderDarwinKernel::ReadMachHeader(addr_t addr, Process *process, 
llvm::MachO::mach_header &header) {
   Status read_error;
-  uint8_t magicbuf[4];
-  if (process->ReadMemoryFromInferior (addr, magicbuf, sizeof (magicbuf), 
read_error) != sizeof (magicbuf))
-  return UUID();
+
+  // Read the mach header and see whether it looks like a kernel
+  if (process->DoReadMemory (addr, &header, sizeof(header), read_error) !=
+  sizeof(header))
+return false;
 
   const uint32_t magicks[] = { llvm::MachO::MH_MAGIC_64, 
llvm::MachO::MH_MAGIC, llvm::MachO::MH_CIGAM, llvm::MachO::MH_CIGAM_64};
 
   bool found_matching_pattern = false;
   for (size_t i = 0; i < llvm::array_lengthof (magicks); i++)
-if (::memcmp (magicbuf, &magicks[i], sizeof (magicbuf)) == 0)
+if (::memcmp (&header.magic, &magicks[i], sizeof (uint32_t)) == 0)
 found_matching_pattern = true;
 
   if (found_matching_pattern == false)
-  return UUID();
-
-  // Read the mach header and see whether it looks like a kernel
-  llvm::MachO::mach_header header;
-  if (process->DoReadMemory(addr, &header, sizeof(header), read_error) !=
-  sizeof(header))
-return UUID();
+  return false;
 
   if (header.magic == llvm::MachO::MH_CIGAM ||
   header.magic == llvm::MachO::MH_CIGAM_64) {
@@ -420,6 +402,35 @@ DynamicLoaderDarwinKernel::CheckForKerne
 header.flags = llvm::ByteSwap_32(header.flags);
   }
 
+  return true;
+}
+
+//--
+// Given an address in memory, look to see if there is a kernel image at that
+// address.
+// Returns a UUID; if a kernel was not found at that address, UUID.IsValid()
+// will be false.
+//--
+lldb_private::UUID
+DynamicLoaderD

[Lldb-commits] [lldb] r335079 - Correct the pathname that PlatformDarwinKernel::ExamineKextForMatchingUUID

2018-06-19 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Jun 19 14:39:10 2018
New Revision: 335079

URL: http://llvm.org/viewvc/llvm-project?rev=335079&view=rev
Log:
Correct the pathname that PlatformDarwinKernel::ExamineKextForMatchingUUID
passes to the recursive search function so we only recursively
search the kext bundle directory, instead of its parent directory.

 

Differential Revision: https://reviews.llvm.org/D48302

Modified:
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp?rev=335079&r1=335078&r2=335079&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp 
(original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp Tue Jun 
19 14:39:10 2018
@@ -780,10 +780,10 @@ Status PlatformDarwinKernel::GetSharedMo
 }
 
 std::vector
-PlatformDarwinKernel::SearchForExecutablesRecursively(const ConstString &dir) {
+PlatformDarwinKernel::SearchForExecutablesRecursively(const std::string &dir) {
   std::vector executables;
   std::error_code EC;
-  for (llvm::sys::fs::recursive_directory_iterator it(dir.GetStringRef(), EC),
+  for (llvm::sys::fs::recursive_directory_iterator it(dir.c_str(), EC),
end;
it != end && !EC; it.increment(EC)) {
 auto status = it->status();
@@ -800,7 +800,7 @@ Status PlatformDarwinKernel::ExamineKext
 const FileSpec &kext_bundle_path, const lldb_private::UUID &uuid,
 const ArchSpec &arch, ModuleSP &exe_module_sp) {
   for (const auto &exe_file :
-   SearchForExecutablesRecursively(kext_bundle_path.GetDirectory())) {
+   SearchForExecutablesRecursively(kext_bundle_path.GetPath())) {
 if (exe_file.Exists()) {
   ModuleSpec exe_spec(exe_file);
   exe_spec.GetUUID() = uuid;

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h?rev=335079&r1=335078&r2=335079&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h Tue Jun 19 
14:39:10 2018
@@ -128,7 +128,7 @@ protected:
   bool recurse);
 
   static std::vector
-  SearchForExecutablesRecursively(const lldb_private::ConstString &dir);
+  SearchForExecutablesRecursively(const std::string &dir);
 
   static void AddKextToMap(PlatformDarwinKernel *thisp,
const lldb_private::FileSpec &file_spec);


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r335556 - A little cleanup in ObjectFileMachO::GetSDKVersion.

2018-06-25 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Jun 25 16:45:39 2018
New Revision: 335556

URL: http://llvm.org/viewvc/llvm-project?rev=335556&view=rev
Log:
A little cleanup in ObjectFileMachO::GetSDKVersion.  
This method does one of two things:

1. finds a minimum os deployment version # in a Mach-O load
command and saves the three parts in the m_sdk_version, or

2. finds no valid min os version # load command, pushes a 
sentinel value on the m_sdk_version vector so we don't search
the same load commands multiple times.

There was a little bug when we found a load command with 
a version of 0.0.0 - the method would not add anything to
the m_sdk_version vector but would declare that a success.
It would not push the sentinel value to the vector.
There was code later in the method which assumed that
the vector always had a sentinel value, at least, and that
code could crash when this method was called back when
evaluating a Swift expression.  (these version #'s are 
fetched lazily so it wouldn't happen when the object file
was parsed, only when doing an expression that needed
the version #).

 

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=335556&r1=33&r2=335556&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Mon Jun 25 
16:45:39 2018
@@ -5757,20 +5757,29 @@ uint32_t ObjectFileMachO::GetSDKVersion(
 m_sdk_versions.push_back();
 m_sdk_versions.push_back(yy);
 m_sdk_versions.push_back(zz);
+success = true;
+  } else {
+GetModule()->ReportWarning(
+"minimum OS version load command with invalid (0) version 
found.");
   }
-  success = true;
 }
   }
   offset = load_cmd_offset + lc.cmdsize;
 }
 
 if (success == false) {
-  // Push an invalid value so we don't keep trying to
+  // Push an invalid value so we don't try to find
+  // the version # again on the next call to this
+  // method.
   m_sdk_versions.push_back(UINT32_MAX);
 }
   }
 
-  if (m_sdk_versions.size() > 1 || m_sdk_versions[0] != UINT32_MAX) {
+  // Legitimate version numbers will have 3 entries pushed
+  // on to m_sdk_versions.  If we only have one value, it's
+  // the sentinel value indicating that this object file
+  // does not have a valid minimum os version #.
+  if (m_sdk_versions.size() > 1) {
 if (versions != NULL && num_versions > 0) {
   for (size_t i = 0; i < num_versions; ++i) {
 if (i < m_sdk_versions.size())


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r336158 - Re-sort the lldb.xcodeproj project file and commit the script

2018-07-02 Thread Jason Molenda via lldb-commits
Added: lldb/trunk/scripts/sort-pbxproj.rb
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/sort-pbxproj.rb?rev=336158&view=auto
==
--- lldb/trunk/scripts/sort-pbxproj.rb (added)
+++ lldb/trunk/scripts/sort-pbxproj.rb Mon Jul  2 17:43:57 2018
@@ -0,0 +1,241 @@
+#! /usr/bin/ruby
+#
+
+# A script to impose order on the Xcode project file, to make merging
+# across branches were many additional files are present, easier.
+
+
+
+
+## Sort the BuildFile and FileReference sections of an Xcode project file,
+## putting Apple/github-local files at the front to avoid merge conflicts.
+#
+## Run this in a directory with a project.pbxproj file.  The sorted version
+## is printed on standard output.
+#
+
+
+# Files with these words in the names will be sorted into a separate section;
+# they are only present in some repositories and so having them intermixed 
+# can lead to merge failures.
+segregated_filenames = ["Swift", "repl", "RPC"]
+
+if !File.exists?("project.pbxproj")
+STDERR.puts "ERROR: project.pbxproj does not exist."
+exit(1)
+end
+
+def read_pbxproj(fn)
+beginning  = Array.new   # All lines before "PBXBuildFile section"
+files  = Array.new   # PBXBuildFile section lines -- sort these
+middle = Array.new   # All lines between PBXBuildFile and 
PBXFileReference sections
+refs   = Array.new   # PBXFileReference section lines -- sort these
+ending = Array.new   # All lines after PBXFileReference section
+
+all_lines = File.readlines fn
+
+state = 1 # "begin"
+all_lines.each do |l|
+l.chomp
+if state == 1 && l =~ /Begin PBXBuildFile section/
+beginning.push(l)
+state = 2
+next
+end
+if state == 2 && l =~ /End PBXBuildFile section/
+middle.push(l)
+state = 3
+next
+end
+if state == 3 && l =~ /Begin PBXFileReference section/
+middle.push(l)
+state = 4
+next
+end
+if state == 4 && l =~ /End PBXFileReference section/
+ending.push(l)
+state = 5
+next
+end
+
+if state == 1
+beginning.push(l)
+elsif state == 2
+files.push(l)
+elsif state == 3
+middle.push(l)
+elsif state == 4
+refs.push(l)
+else
+ending.push(l)
+end
+end
+
+return beginning, files, middle, refs, ending
+end
+
+beginning, files, middle, refs, ending = read_pbxproj("project.pbxproj")
+
+
+### If we're given a "canonical" project.pbxproj file, get the uuid and 
fileref ids for
+### every source file in this project.pbxproj and the canonical one, and fix 
any of
+### the identifiers that don't match in the project file we're updating.
+### this comes up when people add the file independently on different branches 
and it
+### gets different identifiers.
+
+if ARGV.size() > 0
+canonical_pbxproj = nil
+if ARGV.size == 2 && ARGV[0] == "--canonical"
+canonical_pbxproj = ARGV[1]
+elsif ARGV.size == 1 && ARGV[0] =~ /--canonical=(.+)/
+canonical_pbxproj = $1
+end
+
+if File.exists?(canonical_pbxproj)
+ignore1, canon_files, ignore2, ignore3, ignore4 = 
read_pbxproj(canonical_pbxproj)
+canon_files_by_filename = Hash.new { |k, v| k[v] = Array.new }
+
+canon_files.each do |l|
+# 2669421A1A6DC2AC0063BE93 /* MICmdCmdTarget.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 266941941A6DC2AC0063BE93 /* MICmdCmdTarget.cpp 
*/; };
+
+if l =~ /^\s+([A-F0-9]{24})\s+\/\*\s+(.*?)\sin.*?\*\/.*?fileRef = 
([A-F0-9]{24})\s.*$/
+uuid = $1
+filename = $2
+fileref = $3
+canon_files_by_filename[filename].push({ :uuid => uuid, 
:fileref => fileref })
+end
+end
+
+this_project_files = Hash.new { |k, v| k[v] = Array.new }
+
+files.each do |l|
+# 2669421A1A6DC2AC0063BE93 /* MICmdCmdTarget.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 266941941A6DC2AC0063BE93 /* MICmdCmdTarget.cpp 
*/; };
+
+if l =~ /^\s+([A-F0-9]{24})\s+\/\*\s+(.*?)\sin.*?\*\/.*?fileRef = 
([A-F0-9]{24})\s.*$/
+uuid = $1
+filename = $2
+fileref = $3
+this_project_files[filename].push({ :uuid => uuid, :fileref => 
fileref })
+end
+end
+
+this_project_files.keys.each do |fn|
+next if !canon_files_by_filename.has_key?(fn)
+next if this_project_files[fn].size() > 1 || 
canon_files_by_filename[fn].size() > 1
+this_ent = this_project_files[fn][0]
+canon_ent = canon_files_by_filename[fn][0]
+if this_ent[:uuid] != canon_ent[:uuid]
+STDERR.puts "#{fn} has uuid #{this_ent[:uuid]} in this

[Lldb-commits] [lldb] r336158 - Re-sort the lldb.xcodeproj project file and commit the script

2018-07-02 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Jul  2 17:43:57 2018
New Revision: 336158

URL: http://llvm.org/viewvc/llvm-project?rev=336158&view=rev
Log:
Re-sort the lldb.xcodeproj project file and commit the script
that I used to sort it to scripts/sort-pbxproj.rb.  It turns
out that Xcode will perturb the order of the file lists 
every time we add a file, following its own logic, and unfortunately
we'll still end up with lots of merge conflicts when that tries
to merge to the github swift repositories.  We talked this over
and we're going to keep it in a canonical state by running this
script over it when Xcode tries to reorder it.

Added:
lldb/trunk/scripts/sort-pbxproj.rb   (with props)
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r336956 - Remove incorrect thread-pc-values clearing

2018-07-12 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Jul 12 15:45:41 2018
New Revision: 336956

URL: http://llvm.org/viewvc/llvm-project?rev=336956&view=rev
Log:
Remove incorrect thread-pc-values clearing
from ProcessGDBRemote::UpdateThreadIDsFromStopReplyThreadsValue.

Patch by Venkata Ramanaiah.

Differential Revision: https://reviews.llvm.org/D48868

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=336956&r1=336955&r2=336956&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Thu Jul 
12 15:45:41 2018
@@ -1523,7 +1523,6 @@ void ProcessGDBRemote::ClearThreadIDList
 size_t
 ProcessGDBRemote::UpdateThreadIDsFromStopReplyThreadsValue(std::string &value) 
{
   m_thread_ids.clear();
-  m_thread_pcs.clear();
   size_t comma_pos;
   lldb::tid_t tid;
   while ((comma_pos = value.find(',')) != std::string::npos) {


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D48868: [LLDB] In ProcessGDBRemote::UpdateThreadIDList(), the thread PCs should not be cleared after they are updated from the stop reply packet

2018-07-16 Thread Jason Molenda via lldb-commits
That's a good point Pavel.  I tried to write one (below) but I never saw what 
the original failure mode was.  Venkata, can you help to make a test case that 
fails before the patch and works after?  Or explain what bug was being fixed 
exactly?  I could see that the code was wrong from reading it, but I never 
understood how you got to this.


Index: 
packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestStopPCs.py
===
--- 
packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestStopPCs.py 
(nonexistent)
+++ 
packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestStopPCs.py 
(working copy)
@@ -0,0 +1,45 @@
+from __future__ import print_function
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+from gdbclientutils import *
+
+
+class TestThreadSelectionBug(GDBRemoteTestBase):
+def test(self):
+class MyResponder(MockGDBServerResponder):
+def haltReason(self):
+return 
"T02thread:1ff0d;threads:1ff0d,2ff0d;thread-pcs:10001bc00,10002bc00;"
+
+def threadStopInfo(self, threadnum):
+if threadnum == 0x1ff0d:
+return 
"T02thread:1ff0d;threads:1ff0d,2ff0d;thread-pcs:10001bc00,10002bc00;0:0,1:00bc010001;"
+if threadnum == 0x2ff0d:
+return 
"T00thread:2ff0d;threads:1ff0d,2ff0d;thread-pcs:10001bc00,10002bc00;0:0,1:00bc020001;"
+
+def qXferRead(self, obj, annex, offset, length):
+if annex == "target.xml":
+return """
+
+  i386:x86-64
+  
+
+
+  
+""", False
+else:
+return None, False
+
+self.server.responder = MyResponder()
+target = self.dbg.CreateTarget('')
+if self.TraceOn():
+  self.runCmd("log enable gdb-remote packets")
+process = self.connect(target)
+
+self.assertEqual(process.GetNumThreads(), 2)
+th0 = process.GetThreadAtIndex(0)
+th1 = process.GetThreadAtIndex(1)
+self.assertEqual(th0.GetThreadID(), 0x1ff0d)
+self.assertEqual(th1.GetThreadID(), 0x2ff0d)
+self.assertEqual(th0.GetFrameAtIndex(0).GetPC(), 0x10001bc00)
+self.assertEqual(th1.GetFrameAtIndex(0).GetPC(), 0x10002bc00)
Index: 
packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
===
--- 
packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
  (revision 337215)
+++ 
packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
  (working copy)
@@ -130,6 +130,8 @@
 return self.QEnableErrorStrings()
 if packet == "?":
 return self.haltReason()
+if packet == "s":
+return self.haltReason()
 if packet[0] == "H":
 return self.selectThread(packet[1], int(packet[2:], 16))
 if packet[0:6] == "qXfer:":
@@ -144,6 +146,9 @@
 return self.vAttach(int(pid, 16))
 if packet[0] == "Z":
 return self.setBreakpoint(packet)
+if packet.startswith("qThreadStopInfo"):
+threadnum = int (packet[15:], 16)
+return self.threadStopInfo(threadnum)
 return self.other(packet)
 
 def interrupt(self):
@@ -204,6 +209,9 @@
 def setBreakpoint(self, packet):
 raise self.UnexpectedPacketException()
 
+def threadStopInfo(self, threadnum):
+return ""
+
 def other(self, packet):
 # empty string means unsupported
 return ""


> On Jul 16, 2018, at 3:15 AM, Pavel Labath via Phabricator 
>  wrote:
> 
> labath added a comment.
> 
> Could you also add a test case for this?
> I think it should be possible to test this via the gdb-client 
> (`test/testcases/functionalities/gdb_remote_client/`) test suite. If I 
> understood the previous comments correctly, you'll need to mock a server that 
> sends a `thread-pcs` field, but does not implement a `jThreadsInfo` packet.
> 
> 
> Repository:
>  rL LLVM
> 
> https://reviews.llvm.org/D48868
> 
> 
> 

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r337335 - Link the lldb driver ("lldb") against the llvm static

2018-07-17 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Jul 17 16:44:09 2018
New Revision: 337335

URL: http://llvm.org/viewvc/llvm-project?rev=337335&view=rev
Log:
Link the lldb driver ("lldb") against the llvm static
libraries because of the new prettystackprinter dependency.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=337335&r1=337334&r2=337335&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Jul 17 16:44:09 2018
@@ -7285,7 +7285,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
-   shellScript = "cd 
\"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}\"\nfor file in 
*.h\ndo\n\t/usr/bin/sed -i '' 's/\\(#include\\)[ 
]*\"lldb\\/\\(API\\/\\)\\{0,1\\}\\(.*\\)\"/\\1 /1' 
\"$file\"\n\t/usr/bin/sed -i '' 's|/1' \"$file\"\n
/usr/bin/sed -i '' 's|http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r337774 - Change sort-pbxproj.rb to find the project.pbxproj in the

2018-07-23 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Jul 23 16:34:50 2018
New Revision: 337774

URL: http://llvm.org/viewvc/llvm-project?rev=337774&view=rev
Log:
Change sort-pbxproj.rb to find the project.pbxproj in the 
most likely locations.  And have it overwrite the original
file with the sorted output.

Modified:
lldb/trunk/scripts/sort-pbxproj.rb

Modified: lldb/trunk/scripts/sort-pbxproj.rb
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/sort-pbxproj.rb?rev=337774&r1=337773&r2=337774&view=diff
==
--- lldb/trunk/scripts/sort-pbxproj.rb (original)
+++ lldb/trunk/scripts/sort-pbxproj.rb Mon Jul 23 16:34:50 2018
@@ -20,11 +20,6 @@
 # can lead to merge failures.
 segregated_filenames = ["Swift", "repl", "RPC"]
 
-if !File.exists?("project.pbxproj")
-STDERR.puts "ERROR: project.pbxproj does not exist."
-exit(1)
-end
-
 def read_pbxproj(fn)
 beginning  = Array.new   # All lines before "PBXBuildFile section"
 files  = Array.new   # PBXBuildFile section lines -- sort these
@@ -74,7 +69,20 @@ def read_pbxproj(fn)
 return beginning, files, middle, refs, ending
 end
 
-beginning, files, middle, refs, ending = read_pbxproj("project.pbxproj")
+xcodeproj_filename = nil
+[ "../lldb.xcodeproj/project.pbxproj", "lldb.xcodeproj/project.pbxproj", 
"project.pbxproj" ].each do |ent|
+if File.exists?(ent)
+xcodeproj_filename = ent
+break
+end
+end
+
+if xcodeproj_filename.nil?
+STDERR.puts "Could not find xcode project file to sort."
+exit(1)
+end
+
+beginning, files, middle, refs, ending = read_pbxproj(xcodeproj_filename)
 
 
 ### If we're given a "canonical" project.pbxproj file, get the uuid and 
fileref ids for
@@ -236,6 +244,8 @@ end
 
 ### output the sorted pbxproj
 
-[ beginning, files, middle, refs, ending ].each do |arr|
-arr.each {|l| puts l}
+File.open(xcodeproj_filename, 'w') do |outfile|
+[ beginning, files, middle, refs, ending ].each do |arr|
+  arr.each {|l| outfile.puts l}
+end
 end


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r337865 - Add DumpRegisterValue.cpp.

2018-07-24 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Jul 24 16:19:56 2018
New Revision: 337865

URL: http://llvm.org/viewvc/llvm-project?rev=337865&view=rev
Log:
Add DumpRegisterValue.cpp.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=337865&r1=337864&r2=337865&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Jul 24 16:19:56 2018
@@ -264,6 +264,7 @@
2579065F1BD0488D00178368 /* DomainSocket.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 2579065E1BD0488D00178368 /* DomainSocket.cpp */; 
};
26F5C27710F3D9E4009D5894 /* Driver.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 26F5C27310F3D9E4009D5894 /* Driver.cpp */; };
4C4EB7811E6A4DCC002035C0 /* DumpDataExtractor.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 4C4EB77F1E6A4DB8002035C0 /* 
DumpDataExtractor.cpp */; };
+   AFA585D02107EB7400D7689A /* DumpRegisterValue.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = AFA585CF2107EB7300D7689A /* 
DumpRegisterValue.cpp */; };
9447DE431BD5963300E67212 /* DumpValueObjectOptions.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 9447DE421BD5963300E67212 /* 
DumpValueObjectOptions.cpp */; };
268900EA13353E6F00698AC0 /* DynamicLoader.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26BC7E7710F1B85900F91463 /* DynamicLoader.cpp 
*/; };
AF27AD551D3603EA00CF2833 /* DynamicLoaderDarwin.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AF27AD531D3603EA00CF2833 /* 
DynamicLoaderDarwin.cpp */; };
@@ -335,7 +336,6 @@
AE44FB301BB07EB20033EB62 /* GoUserExpression.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = AE44FB2C1BB07DD80033EB62 /* 
GoUserExpression.cpp */; };
6D95DC011B9DC057000E318A /* HashedNameToDIE.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 6D95DBFE1B9DC057000E318A /* HashedNameToDIE.cpp 
*/; };
2666ADC81B3CB675001FAFD3 /* HexagonDYLDRendezvous.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 2666ADC31B3CB675001FAFD3 /* 
HexagonDYLDRendezvous.cpp */; };
-   AFC2DCF31E6E30CF00283714 /* History.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = AFC2DCF21E6E30CF00283714 /* History.cpp */; };
AF1729D6182C907200E0AB97 /* HistoryThread.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF1729D4182C907200E0AB97 /* HistoryThread.cpp 
*/; };
AF1729D7182C907200E0AB97 /* HistoryUnwind.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF1729D5182C907200E0AB97 /* HistoryUnwind.cpp 
*/; };
2689007113353E1A00698AC0 /* Host.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 69A01E1C1236C5D400C660B5 /* Host.cpp */; };
@@ -1735,6 +1735,7 @@
26F5C27410F3D9E4009D5894 /* Driver.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
Driver.h; path = tools/driver/Driver.h; sourceTree = ""; };
4C4EB77F1E6A4DB8002035C0 /* DumpDataExtractor.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = DumpDataExtractor.cpp; path = source/Core/DumpDataExtractor.cpp; 
sourceTree = ""; };
4C4EB7821E6A4DE7002035C0 /* DumpDataExtractor.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
DumpDataExtractor.h; path = include/lldb/Core/DumpDataExtractor.h; sourceTree = 
""; };
+   AFA585CF2107EB7300D7689A /* DumpRegisterValue.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = DumpRegisterValue.cpp; path = source/Core/DumpRegisterValue.cpp; 
sourceTree = ""; };
9447DE421BD5963300E67212 /* DumpValueObjectOptions.cpp */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; name = DumpValueObjectOptions.cpp; path = 
source/DataFormatters/DumpValueObjectOptions.cpp; sourceTree = ""; };
9447DE411BD5962900E67212 /* DumpValueObjectOptions.h */ = {isa 
= PBXFileReference; lastKnownFileType = sourcecode.c.h; name = 
DumpValueObjectOptions.h; path = 
include/lldb/DataFormatters/DumpValueObjectOptions.h; sourceTree = ""; };
26BC7E7710F1B85900F91463 /* DynamicLoader.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = DynamicLoader.cpp; path = source/Core/DynamicLoader.cpp; sourceTree = 
""; };
@@ -4484,8 +4485,6 @@
AFC2DCE61E6E2ED000283714 /* FastDemangle.cpp */,
AFC2DCED1E6E2F9800283714 /* FastDemangle.h */,
4CBFF0471F579A36004AFA92 /* Flags.h */,
-   AFC2DCF21E6E30C

[Lldb-commits] [lldb] r339615 - Update TestTargetXMLArch.py test for llvm triple change with unspecified

2018-08-13 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Aug 13 14:20:29 2018
New Revision: 339615

URL: http://llvm.org/viewvc/llvm-project?rev=339615&view=rev
Log:
Update TestTargetXMLArch.py test for llvm triple change with unspecified
components in r339294.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py?rev=339615&r1=339614&r2=339615&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
 Mon Aug 13 14:20:29 2018
@@ -121,4 +121,4 @@ class TestTargetXMLArch(GDBRemoteTestBas
 if self.TraceOn():
 interp.HandleCommand("target list", result)
 print(result.GetOutput())
-self.assertTrue(target.GetTriple().startswith('x86_64--'))
+
self.assertTrue(target.GetTriple().startswith('x86_64-unknown-unknown'))


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r340877 - Remove unnecessary entitlement in debugserver for iOS.

2018-08-28 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Aug 28 15:28:34 2018
New Revision: 340877

URL: http://llvm.org/viewvc/llvm-project?rev=340877&view=rev
Log:
Remove unnecessary entitlement in debugserver for iOS.
 

Modified:
lldb/trunk/tools/debugserver/source/debugserver-entitlements.plist

Modified: lldb/trunk/tools/debugserver/source/debugserver-entitlements.plist
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/debugserver-entitlements.plist?rev=340877&r1=340876&r2=340877&view=diff
==
--- lldb/trunk/tools/debugserver/source/debugserver-entitlements.plist 
(original)
+++ lldb/trunk/tools/debugserver/source/debugserver-entitlements.plist Tue Aug 
28 15:28:34 2018
@@ -12,8 +12,6 @@
 
 com.apple.frontboard.debugapplications
 
-run-unsigned-code
-
 seatbelt-profiles
 
 debugserver


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r341511 - Re-instate a bit of code that was commented out in r188246 which

2018-09-05 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Sep  5 17:55:27 2018
New Revision: 341511

URL: http://llvm.org/viewvc/llvm-project?rev=341511&view=rev
Log:
Re-instate a bit of code that was commented out in r188246 which
reads an ObjectFileMachO's string table in one chunk.  Originally
this was commented out because binaries in the system's shared cache
all share a mega-string table and so reading the entire mega-strtab
for each binary was a performance problem.

In the reinstated code, I add a check that the binary we're reading
from memory is not in the shared cache (there isn't a constant in
 for this bit yet; we hardcode the value in one
other place in ObjectFileMachO alread).  For binaries that we're
reading out of memory that are NOT in the shared cache, reading 
the string table in one chunk is a big performance improvement.

Also have debugserver send up the flags value for binaries in its
response to the jGetLoadedDynamicLibrariesInfos request.

NFC.

 


Modified:
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm

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=341511&r1=341510&r2=341511&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Wed Sep  5 
17:55:27 2018
@@ -2331,14 +2331,6 @@ size_t ObjectFileMachO::ParseSymtab() {
 if (nlist_data_sp)
   nlist_data.SetData(nlist_data_sp, 0,
  nlist_data_sp->GetByteSize());
-// Load strings individually from memory when loading from memory
-// since shared cache string tables contain strings for all symbols
-// from all shared cached libraries DataBufferSP strtab_data_sp
-// (ReadMemory (process_sp, strtab_addr,
-// strtab_data_byte_size));
-// if (strtab_data_sp)
-//strtab_data.SetData (strtab_data_sp, 0,
-//strtab_data_sp->GetByteSize());
 if (m_dysymtab.nindirectsyms != 0) {
   const addr_t indirect_syms_addr = linkedit_load_addr +
 m_dysymtab.indirectsymoff -
@@ -2350,6 +2342,22 @@ size_t ObjectFileMachO::ParseSymtab() {
 indirect_symbol_index_data.SetData(
 indirect_syms_data_sp, 0,
 indirect_syms_data_sp->GetByteSize());
+  // If this binary is outside the shared cache, 
+  // cache the string table.
+  // Binaries in the shared cache all share a giant string table, 
and
+  // we can't share the string tables across multiple 
ObjectFileMachO's,
+  // so we'd end up re-reading this mega-strtab for every binary
+  // in the shared cache - it would be a big perf problem.
+  // For binaries outside the shared cache, it's faster to read the
+  // entire strtab at once instead of piece-by-piece as we process
+  // the nlist records.
+  if ((m_header.flags & 0x8000u) == 0) {
+DataBufferSP strtab_data_sp (ReadMemory (process_sp, 
strtab_addr, 
+  strtab_data_byte_size));
+if (strtab_data_sp) {
+  strtab_data.SetData (strtab_data_sp, 0, 
strtab_data_sp->GetByteSize());
+}
+  }
 }
   }
   if (memory_module_load_level >=

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm?rev=341511&r1=341510&r2=341511&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm Wed Sep  5 
17:55:27 2018
@@ -803,6 +803,8 @@ JSONGenerator::ObjectSP MachProcess::For
 (uint32_t)image_infos[i].macho_info.mach_header.cpusubtype);
 mach_header_dict_sp->AddIntegerItem(
 "filetype", image_infos[i].macho_info.mach_header.filetype);
+mach_header_dict_sp->AddIntegerItem ("flags", 
+ image_infos[i].macho_info.mach_header.flags);
 
 //  DynamicLoaderMacOSX doesn't currently need these fields, so
 //  don't send them.
@@ -810,8 +812,6 @@ JSONGenerator::ObjectSP MachProcess::For
 //image_infos[i].macho_info.mach_header.ncmds);
 //mach_header_dict_sp->AddIntegerItem ("sizeofcmds",
 //image_infos[i].macho_info.mach_header.sizeofcmds);
-//mach_header_dict_sp->AddIntegerItem ("flags",
- 

[Lldb-commits] [lldb] r341623 - Enable the fp-armv8 disassembler feature when disassembling Cortex-M

2018-09-06 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Sep  6 18:28:48 2018
New Revision: 341623

URL: http://llvm.org/viewvc/llvm-project?rev=341623&view=rev
Log:
Enable the fp-armv8 disassembler feature when disassembling Cortex-M
code.  This will enable disassembly of the optional subset of
neon that some Cortex cores support.  Add a unit test to check
that a few of these instructions disassemble as expected.

 


Added:
lldb/trunk/unittests/Disassembler/
lldb/trunk/unittests/Disassembler/CMakeLists.txt
lldb/trunk/unittests/Disassembler/TestArmv7Disassembly.cpp
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
lldb/trunk/source/Utility/ArchSpec.cpp

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=341623&r1=341622&r2=341623&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Sep  6 18:28:48 2018
@@ -934,6 +934,7 @@
23CB15421D66DA9300EDDDE1 /* TaskPoolTest.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 2321F9451BDD346100BA9A93 /* TaskPoolTest.cpp */; 
};
2689007413353E1A00698AC0 /* Terminal.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 268DA873130095ED00C9483A /* Terminal.cpp */; };
4CEC86A4204738C5009B37B1 /* TestArm64InstEmulation.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4CEC86A3204738C5009B37B1 /* 
TestArm64InstEmulation.cpp */; };
+   AF7F97682141FA4500795BC0 /* TestArmv7Disassembly.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AF7F97662141FA3800795BC0 /* 
TestArmv7Disassembly.cpp */; };
23CB15401D66DA9300EDDDE1 /* TestClangASTContext.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 23CB150C1D66CF5600EDDDE1 /* 
TestClangASTContext.cpp */; };
9A20572D1F3B8E6600F6C293 /* TestCompletion.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 9A20572B1F3B8E6200F6C293 /* TestCompletion.cpp 
*/; };
9A2057171F3B861400F6C293 /* TestDWARFCallFrameInfo.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 9A2057131F3B860D00F6C293 /* 
TestDWARFCallFrameInfo.cpp */; };
@@ -3032,6 +3033,7 @@
268DA873130095ED00C9483A /* Terminal.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = Terminal.cpp; sourceTree = ""; };
268DA871130095D000C9483A /* Terminal.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
Terminal.h; path = include/lldb/Host/Terminal.h; sourceTree = ""; };
4CEC86A3204738C5009B37B1 /* TestArm64InstEmulation.cpp */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; name = TestArm64InstEmulation.cpp; path = 
UnwindAssembly/ARM64/TestArm64InstEmulation.cpp; sourceTree = ""; };
+   AF7F97662141FA3800795BC0 /* TestArmv7Disassembly.cpp */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = TestArmv7Disassembly.cpp; path = 
unittests/Disassembler/TestArmv7Disassembly.cpp; sourceTree = SOURCE_ROOT; };
23CB150C1D66CF5600EDDDE1 /* TestClangASTContext.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = TestClangASTContext.cpp; sourceTree = ""; };
9A20572B1F3B8E6200F6C293 /* TestCompletion.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = TestCompletion.cpp; sourceTree = ""; };
9A2057131F3B860D00F6C293 /* TestDWARFCallFrameInfo.cpp */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; path = TestDWARFCallFrameInfo.cpp; sourceTree = ""; 
};
@@ -3516,6 +3518,7 @@
23E2E52C1D903806006F38BB /* Breakpoint */,
23CB14E51D66CBEB00EDDDE1 /* Core */,
9A2057421F3B904C00F6C293 /* debugserver */,
+   AF7F97652141FA2100795BC0 /* Disassembler */,
2326CF501BDD68CA00A5CEAC /* Editline */,
AEC6FF9D1BE97035007882C1 /* Expression */,
239504C21BDD3FD600963CEA /* gtest_common.h */,
@@ -6862,6 +6865,15 @@
name = "SysV-ppc64";
sourceTree = "";
};
+   AF7F97652141FA2100795BC0 /* Disassembler */ = {
+   isa = PBXGroup;
+   children = (
+   AF7F97662141FA3800795BC0 /* 
TestArmv7Disassembly.cpp */,
+   );
+   name = Disassembler;
+   path = ../Disassembler;
+   sourceTree = "";

[Lldb-commits] [lldb] r341696 - Add the Disassembler unit test dir.

2018-09-07 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Sep  7 11:51:10 2018
New Revision: 341696

URL: http://llvm.org/viewvc/llvm-project?rev=341696&view=rev
Log:
Add the Disassembler unit test dir.

Modified:
lldb/trunk/unittests/CMakeLists.txt

Modified: lldb/trunk/unittests/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/CMakeLists.txt?rev=341696&r1=341695&r2=341696&view=diff
==
--- lldb/trunk/unittests/CMakeLists.txt (original)
+++ lldb/trunk/unittests/CMakeLists.txt Fri Sep  7 11:51:10 2018
@@ -60,6 +60,7 @@ endfunction()
 add_subdirectory(TestingSupport)
 add_subdirectory(Breakpoint)
 add_subdirectory(Core)
+add_subdirectory(Disassembler)
 add_subdirectory(Editline)
 add_subdirectory(Expression)
 add_subdirectory(Host)


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r342072 - If we fail to get an armv7em-- disassembler from llvm, skip the

2018-09-12 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Sep 12 12:30:03 2018
New Revision: 342072

URL: http://llvm.org/viewvc/llvm-project?rev=342072&view=rev
Log:
If we fail to get an armv7em-- disassembler from llvm, skip the
tests and don't mark this as a failure.  This happens when we've
linked against an llvm without the ARM target built in.  Davide
added some cmake conditionals to avoid building this test when the
target was absent from llvm's build, but we're still finding some
bots that manage to get in this situation.

 

Modified:
lldb/trunk/unittests/Disassembler/TestArmv7Disassembly.cpp

Modified: lldb/trunk/unittests/Disassembler/TestArmv7Disassembly.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Disassembler/TestArmv7Disassembly.cpp?rev=342072&r1=342071&r2=342072&view=diff
==
--- lldb/trunk/unittests/Disassembler/TestArmv7Disassembly.cpp (original)
+++ lldb/trunk/unittests/Disassembler/TestArmv7Disassembly.cpp Wed Sep 12 
12:30:03 2018
@@ -67,7 +67,10 @@ TEST_F(TestArmv7Disassembly, TestCortexF
   disass_sp = Disassembler::DisassembleBytes(arch, nullptr, nullptr, 
start_addr,
  &data, sizeof (data), num_of_instructions, 
false);
 
-  ASSERT_NE (nullptr, disass_sp.get());
+  // If we failed to get a disassembler, we can assume it is because
+  // the llvm we linked against was not built with the ARM target,
+  // and we should skip these tests without marking anything as failing.
+
   if (disass_sp) {
 const InstructionList inst_list (disass_sp->GetInstructionList());
 EXPECT_EQ (num_of_instructions, inst_list.GetSize());


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r342085 - Commit my attempt to test the change to ProcessGDBRemote

2018-09-12 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Sep 12 14:35:02 2018
New Revision: 342085

URL: http://llvm.org/viewvc/llvm-project?rev=342085&view=rev
Log:
Commit my attempt to test the change to ProcessGDBRemote
in r336956.  This test doesn't actually test the change
that was submitted by Venkata, but it's a good one to
add.

Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestStopPCs.py
Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestStopPCs.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestStopPCs.py?rev=342085&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestStopPCs.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestStopPCs.py
 Wed Sep 12 14:35:02 2018
@@ -0,0 +1,44 @@
+from __future__ import print_function
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+from gdbclientutils import *
+
+
+class TestThreadSelectionBug(GDBRemoteTestBase):
+def test(self):
+class MyResponder(MockGDBServerResponder):
+def haltReason(self):
+return 
"T02thread:1ff0d;threads:1ff0d,2ff0d;thread-pcs:10001bc00,10002bc00;"
+
+def threadStopInfo(self, threadnum):
+if threadnum == 0x1ff0d:
+return 
"T02thread:1ff0d;threads:1ff0d,2ff0d;thread-pcs:10001bc00,10002bc00;"
+if threadnum == 0x2ff0d:
+return 
"T00thread:2ff0d;threads:1ff0d,2ff0d;thread-pcs:10001bc00,10002bc00;"
+
+def qXferRead(self, obj, annex, offset, length):
+if annex == "target.xml":
+return """
+
+  i386:x86-64
+  
+
+  
+""", False
+else:
+return None, False
+
+self.server.responder = MyResponder()
+target = self.dbg.CreateTarget('')
+if self.TraceOn():
+  self.runCmd("log enable gdb-remote packets")
+process = self.connect(target)
+
+self.assertEqual(process.GetNumThreads(), 2)
+th0 = process.GetThreadAtIndex(0)
+th1 = process.GetThreadAtIndex(1)
+self.assertEqual(th0.GetThreadID(), 0x1ff0d)
+self.assertEqual(th1.GetThreadID(), 0x2ff0d)
+self.assertEqual(th0.GetFrameAtIndex(0).GetPC(), 0x10001bc00)
+self.assertEqual(th1.GetFrameAtIndex(0).GetPC(), 0x10002bc00)

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py?rev=342085&r1=342084&r2=342085&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
 Wed Sep 12 14:35:02 2018
@@ -130,6 +130,8 @@ class MockGDBServerResponder:
 return self.QEnableErrorStrings()
 if packet == "?":
 return self.haltReason()
+if packet == "s":
+return self.haltReason()
 if packet[0] == "H":
 return self.selectThread(packet[1], int(packet[2:], 16))
 if packet[0:6] == "qXfer:":
@@ -144,6 +146,9 @@ class MockGDBServerResponder:
 return self.vAttach(int(pid, 16))
 if packet[0] == "Z":
 return self.setBreakpoint(packet)
+if packet.startswith("qThreadStopInfo"):
+threadnum = int (packet[15:], 16)
+return self.threadStopInfo(threadnum)
 return self.other(packet)
 
 def interrupt(self):
@@ -204,6 +209,9 @@ class MockGDBServerResponder:
 def setBreakpoint(self, packet):
 raise self.UnexpectedPacketException()
 
+def threadStopInfo(self, threadnum):
+return ""
+
 def other(self, packet):
 # empty string means unsupported
 return ""


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r318218 - Update xcode project file to track ArchSpec.cpp

2017-11-14 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Nov 14 15:15:35 2017
New Revision: 318218

URL: http://llvm.org/viewvc/llvm-project?rev=318218&view=rev
Log:
Update xcode project file to track ArchSpec.cpp
move and LibCxxBitset.cpp addition.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=318218&r1=318217&r2=318218&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Nov 14 15:15:35 2017
@@ -393,7 +393,6 @@
2689002C13353E0400698AC0 /* AddressResolver.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 9AC7034011752C6B0086C050 /* AddressResolver.cpp 
*/; };
2689002D13353E0400698AC0 /* AddressResolverFileLine.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 9AC7034211752C720086C050 /* 
AddressResolverFileLine.cpp */; };
2689002E13353E0400698AC0 /* AddressResolverName.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 9AC7034411752C790086C050 /* 
AddressResolverName.cpp */; };
-   2689002F13353E0400698AC0 /* ArchSpec.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 26BC7E6B10F1B85900F91463 /* ArchSpec.cpp */; };
2689003113353E0400698AC0 /* Broadcaster.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26BC7E6D10F1B85900F91463 /* Broadcaster.cpp */; 
};
2689003213353E0400698AC0 /* Communication.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26BC7E6E10F1B85900F91463 /* Communication.cpp 
*/; };
2689003313353E0400698AC0 /* Connection.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 26BC7E6F10F1B85900F91463 /* Connection.cpp */; };
@@ -974,6 +973,8 @@
AF45FDE518A1F3AC0007051C /* AppleGetThreadItemInfoHandler.cpp 
in Sources */ = {isa = PBXBuildFile; fileRef = AF45FDE318A1F3AC0007051C /* 
AppleGetThreadItemInfoHandler.cpp */; };
AF6335E21C87B21E00F7D554 /* SymbolFilePDB.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF6335E01C87B21E00F7D554 /* SymbolFilePDB.cpp 
*/; };
AF6335E31C87B21E00F7D554 /* SymbolFilePDB.h in Headers */ = 
{isa = PBXBuildFile; fileRef = AF6335E11C87B21E00F7D554 /* SymbolFilePDB.h */; 
};
+   AF6CA6661FBBAF28005A0DC3 /* ArchSpec.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = AF6CA6651FBBAF27005A0DC3 /* ArchSpec.cpp */; };
+   AF6CA6681FBBAF37005A0DC3 /* ArchSpec.h in Headers */ = {isa = 
PBXBuildFile; fileRef = AF6CA6671FBBAF37005A0DC3 /* ArchSpec.h */; };
AF77E08F1A033C700096C0EA /* ABISysV_ppc.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF77E08D1A033C700096C0EA /* ABISysV_ppc.cpp */; 
};
AF77E0931A033C7F0096C0EA /* ABISysV_ppc64.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF77E0911A033C7F0096C0EA /* ABISysV_ppc64.cpp 
*/; };
AF77E0A11A033D360096C0EA /* RegisterContextFreeBSD_powerpc.cpp 
in Sources */ = {isa = PBXBuildFile; fileRef = AF77E09A1A033D360096C0EA /* 
RegisterContextFreeBSD_powerpc.cpp */; };
@@ -1004,6 +1005,7 @@
AFC2DCF31E6E30CF00283714 /* History.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = AFC2DCF21E6E30CF00283714 /* History.cpp */; };
AFC2DCF61E6E316A00283714 /* StreamCallback.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AFC2DCF51E6E316A00283714 /* StreamCallback.cpp 
*/; };
AFC2DCF91E6E318000283714 /* StreamGDBRemote.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AFC2DCF81E6E318000283714 /* StreamGDBRemote.cpp 
*/; };
+   AFC67B151FBBB03600860ECB /* LibCxxBitset.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AFC67B141FBBB03500860ECB /* LibCxxBitset.cpp */; 
};
AFCB2BBD1BF577F40018B553 /* PythonExceptionState.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AFCB2BBB1BF577F40018B553 /* 
PythonExceptionState.cpp */; };
AFCB2BBE1BF577F40018B553 /* PythonExceptionState.h in Headers 
*/ = {isa = PBXBuildFile; fileRef = AFCB2BBC1BF577F40018B553 /* 
PythonExceptionState.h */; };
AFD65C811D9B5B2E00D93120 /* RegisterContextMinidump_x86_64.cpp 
in Sources */ = {isa = PBXBuildFile; fileRef = AFD65C7F1D9B5B2E00D93120 /* 
RegisterContextMinidump_x86_64.cpp */; };
@@ -2080,7 +2082,6 @@
26BC7D2D10F1B76300F91463 /* CommandObjectThread.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
CommandObjectThread.h; path = source/Commands/CommandObjectThread.h; sourceTree 
= ""; };
26BC7D5010F1B77400F91463 /* Address.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
Address.h; path = include/lldb/Core/Address.h; sourceTree = ""; };
26BC7D5110F1B77400F91463 /* AddressRange.h */ = {isa = 
PBXFileReferenc

[Lldb-commits] [lldb] r318260 - Two small fixes to handle arm64 fpu register contexts in

2017-11-14 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Nov 14 19:18:24 2017
New Revision: 318260

URL: http://llvm.org/viewvc/llvm-project?rev=318260&view=rev
Log:
Two small fixes to handle arm64 fpu register contexts in 
a Mach-O file load command correctly, patch by Ryan
Mansfield.

 

Modified:
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h

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=318260&r1=318259&r2=318260&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Nov 14 
19:18:24 2017
@@ -686,7 +686,7 @@ public:
   case FPURegSet: {
 uint8_t *fpu_reg_buf = (uint8_t *)&fpu.v[0];
 const int fpu_reg_buf_size = sizeof(fpu);
-if (fpu_reg_buf_size == count &&
+if (fpu_reg_buf_size == count * sizeof(uint32_t) &&
 data.ExtractBytes(offset, fpu_reg_buf_size, eByteOrderLittle,
   fpu_reg_buf) == fpu_reg_buf_size) {
   SetError(FPURegSet, Read, 0);

Modified: 
lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h?rev=318260&r1=318259&r2=318260&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h Tue 
Nov 14 19:18:24 2017
@@ -83,7 +83,7 @@ public:
 
   // mirrors  arm_neon_state64_t
   struct FPU {
-VReg v[32];
+alignas(__uint128_t) VReg v[32];
 uint32_t fpsr;
 uint32_t fpcr;
   };


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r318262 - Roll back r318260 because it is causing the windows bot to

2017-11-14 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Nov 14 19:41:47 2017
New Revision: 318262

URL: http://llvm.org/viewvc/llvm-project?rev=318262&view=rev
Log:
Roll back r318260 because it is causing the windows bot to
break.  The alignas(__uint128_t) is not recognized with MSVC
it looks like.  Zachary, is there a similar type on windows?
I suppose I can go with alignas(16) here but I'd prefer to
specify the type alignment that I want & let the ABI dictate
how much padding is required.

Modified:
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h

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=318262&r1=318261&r2=318262&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Nov 14 
19:41:47 2017
@@ -686,7 +686,7 @@ public:
   case FPURegSet: {
 uint8_t *fpu_reg_buf = (uint8_t *)&fpu.v[0];
 const int fpu_reg_buf_size = sizeof(fpu);
-if (fpu_reg_buf_size == count * sizeof(uint32_t) &&
+if (fpu_reg_buf_size == count &&
 data.ExtractBytes(offset, fpu_reg_buf_size, eByteOrderLittle,
   fpu_reg_buf) == fpu_reg_buf_size) {
   SetError(FPURegSet, Read, 0);

Modified: 
lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h?rev=318262&r1=318261&r2=318262&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h Tue 
Nov 14 19:41:47 2017
@@ -83,7 +83,7 @@ public:
 
   // mirrors  arm_neon_state64_t
   struct FPU {
-alignas(__uint128_t) VReg v[32];
+VReg v[32];
 uint32_t fpsr;
 uint32_t fpcr;
   };


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r318262 - Roll back r318260 because it is causing the windows bot to

2017-11-15 Thread Jason Molenda via lldb-commits
Hi Zachary, do you have a suggestion on how to specify this alignment in a way 
that works with MSVC?

> On Nov 14, 2017, at 7:41 PM, Jason Molenda via lldb-commits 
>  wrote:
> 
> Author: jmolenda
> Date: Tue Nov 14 19:41:47 2017
> New Revision: 318262
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=318262&view=rev
> Log:
> Roll back r318260 because it is causing the windows bot to
> break.  The alignas(__uint128_t) is not recognized with MSVC
> it looks like.  Zachary, is there a similar type on windows?
> I suppose I can go with alignas(16) here but I'd prefer to
> specify the type alignment that I want & let the ABI dictate
> how much padding is required.
> 
> Modified:
>lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
>lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h
> 
> 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=318262&r1=318261&r2=318262&view=diff
> ==
> --- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
> +++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Nov 
> 14 19:41:47 2017
> @@ -686,7 +686,7 @@ public:
>   case FPURegSet: {
> uint8_t *fpu_reg_buf = (uint8_t *)&fpu.v[0];
> const int fpu_reg_buf_size = sizeof(fpu);
> -if (fpu_reg_buf_size == count * sizeof(uint32_t) &&
> +if (fpu_reg_buf_size == count &&
> data.ExtractBytes(offset, fpu_reg_buf_size, eByteOrderLittle,
>   fpu_reg_buf) == fpu_reg_buf_size) {
>   SetError(FPURegSet, Read, 0);
> 
> Modified: 
> lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h?rev=318262&r1=318261&r2=318262&view=diff
> ==
> --- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h 
> (original)
> +++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h 
> Tue Nov 14 19:41:47 2017
> @@ -83,7 +83,7 @@ public:
> 
>   // mirrors  arm_neon_state64_t
>   struct FPU {
> -alignas(__uint128_t) VReg v[32];
> +VReg v[32];
> uint32_t fpsr;
> uint32_t fpcr;
>   };
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r318262 - Roll back r318260 because it is causing the windows bot to

2017-11-15 Thread Jason Molenda via lldb-commits


> On Nov 15, 2017, at 1:38 AM, Pavel Labath  wrote:
> 
> On 15 November 2017 at 03:41, Jason Molenda via lldb-commits
>  wrote:
>> Author: jmolenda
>> Date: Tue Nov 14 19:41:47 2017
>> New Revision: 318262
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=318262&view=rev
>> Log:
>> Roll back r318260 because it is causing the windows bot to
>> break.  The alignas(__uint128_t) is not recognized with MSVC
>> it looks like.  Zachary, is there a similar type on windows?
>> I suppose I can go with alignas(16) here but I'd prefer to
>> specify the type alignment that I want & let the ABI dictate
>> how much padding is required.
> 
> 
> Are you sure about that? If I understand correctly, this register
> context is used on the host, so, if you're cross-debugging, you'll
> have the *host* ABI dictating the layout of the mac arm64 target
> registers, which sounds like a bad idea.


Thanks for the comment.  The darwin kernel defines this structure like

struct __darwin_arm_neon_state64
{
 __uint128_t __v[32];
 __uint32_t __fpsr;
 __uint32_t __fpcr;
};

Someone was experimenting with saving the fpu register context in a corefile 
and noticed that lldb's definition of this structure,

  struct VReg {
uint8_t bytes[16];
  };

  // mirrors  arm_neon_state64_t
  struct FPU {
struct VReg v[32];
uint32_t fpsr;
uint32_t fpcr;
  };

doesn't require 16-byte alignment so it has a different size.  The kernel 
structure with __uint128_t will have 8 bytes of padding at the end (total size 
528), lldb's definition doesn't require aligning to a 16-byte boundary so it is 
only 520 bytes long.

We use this FPU definition from RegisterContextDarwin_arm64.h in 
ObjectFileMachO.cpp when we're reading saved register contexts from a core 
file.  The core file register context will have 528 bytes which won't match the 
size of FPU from RegisterContextDarwin_arm64.h so it'll error out.


I'll go with Zachary's suggestion of using the llvm idiom to force 16-byte 
alignment, I think that's a good way to solve this.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r318357 - Fix alignment of arm64 fpu register context structure

2017-11-15 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Nov 15 16:50:29 2017
New Revision: 318357

URL: http://llvm.org/viewvc/llvm-project?rev=318357&view=rev
Log:
Fix alignment of arm64 fpu register context structure
so it has the same padding as the kernel's definition
which is written in terms of uint128_t.  Original patch
by Ryan Mansfield.

 

Modified:
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h

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=318357&r1=318356&r2=318357&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Wed Nov 15 
16:50:29 2017
@@ -686,7 +686,7 @@ public:
   case FPURegSet: {
 uint8_t *fpu_reg_buf = (uint8_t *)&fpu.v[0];
 const int fpu_reg_buf_size = sizeof(fpu);
-if (fpu_reg_buf_size == count &&
+if (fpu_reg_buf_size == count * sizeof(uint32_t) &&
 data.ExtractBytes(offset, fpu_reg_buf_size, eByteOrderLittle,
   fpu_reg_buf) == fpu_reg_buf_size) {
   SetError(FPURegSet, Read, 0);

Modified: 
lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp?rev=318357&r1=318356&r2=318357&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp 
Wed Nov 15 16:50:29 2017
@@ -426,7 +426,7 @@ bool RegisterContextDarwin_arm64::ReadRe
   case fpu_v29:
   case fpu_v30:
   case fpu_v31:
-value.SetBytes(fpu.v[reg].bytes, reg_info->byte_size,
+value.SetBytes(fpu.v[reg].bytes.buffer, reg_info->byte_size,
endian::InlHostByteOrder());
 break;
 
@@ -618,7 +618,7 @@ bool RegisterContextDarwin_arm64::WriteR
   case fpu_v29:
   case fpu_v30:
   case fpu_v31:
-::memcpy(fpu.v[reg].bytes, value.GetBytes(), value.GetByteSize());
+::memcpy(fpu.v[reg].bytes.buffer, value.GetBytes(), value.GetByteSize());
 break;
 
   case fpu_fpsr:

Modified: 
lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h?rev=318357&r1=318356&r2=318357&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h Wed 
Nov 15 16:50:29 2017
@@ -78,7 +78,7 @@ public:
   };
 
   struct VReg {
-uint8_t bytes[16];
+llvm::AlignedCharArray<16, 16> bytes;
   };
 
   // mirrors  arm_neon_state64_t


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] Need to change swig typemap for reading C strings

2017-11-15 Thread Jason Molenda via lldb-commits
Hi Zachary, reviving a problem I initially found a year ago -- in r253487 where 
a swig typemap was changed for string reading methods.

The problem we're seeing with this change is that 
SBProcess::ReadCStringFromMemory() now returns a None object when you try to 
read a zero-length string, and this is breaking a couple of groups' python 
scripts here at Apple.  (it was a low priority thing for me to fix, until some 
behavior changed recently and it started biting the groups a lot more 
frequently).

SBProcess::ReadCStringFromMemory() takes an SBError object and returns a 
string.  We have three cases:


1 Non-zero length string read.  SBError says it was successful, string should 
be returned.

2 Zero-length / empty string read.  SBError says it was successful, string 
should be returned (Python None object is returned right now)

3 Memory read error.  SBError says it is an error, ideally None object should 
be returned.


For instance,

#include 
int main ()
{
const char *empty_string = "";
const char *one_letter_string = "1";
const char *invalid_memory_string = (char*)0x100; // lower 4k is always 
PAGEZERO & unreadable on darwin
return empty_string[0] + one_letter_string[0]; // breakpoint here
}

we'll see:

  (lldb) br s -p breakpoint
  (lldb) r
  (lldb) p empty_string
  (const char *) $0 = 0x00010fae ""
  (lldb) p one_letter_string
  (const char *) $1 = 0x00010faf "1"
  (lldb) p invalid_memory_string
  (const char *) $2 = 0x0100 ""
  (lldb) scri
  >>> err = lldb.SBError()

  >>> print lldb.process.ReadCStringFromMemory(0x00010fae, 2048, err)
  None
  >>> print err
  success

  >>> print lldb.process.ReadCStringFromMemory(0x00010faf, 2048, err)
  1
  >>> print err
  success

  >>> print lldb.process.ReadCStringFromMemory(0x0100, 2048, err)
  None
  >>> print err
  error: memory read failed for 0x0
  >>> print err.Success()
  False
  >>> 


Before r253487, the read of a zero-length string and the read of an invalid 
address would both return a zero length python string (and the latter would set 
the SBError).  After the change, both of these return a python None object (and 
the latter sets the SBError).


I haven't worked with the typemaps before -- I can restore the previous 
behavior where an empty Python string is returned for both the zero-length 
string and for the unreadable address.  I don't see how I can access the 
SBError object used earlier in these methods.


diff --git i/scripts/Python/python-typemaps.swig 
w/scripts/Python/python-typemaps.swig
index df16a6d27b3..29e5d9b156d 100644
--- i/scripts/Python/python-typemaps.swig
+++ w/scripts/Python/python-typemaps.swig
@@ -102,7 +102,8 @@
 %typemap(argout) (char *dst, size_t dst_len) {
Py_XDECREF($result);   /* Blow away any previous result */
if (result == 0) {
-  $result = Py_None;
+  lldb_private::PythonString string("");
+  $result = string.release();
   Py_INCREF($result);
} else {
   llvm::StringRef ref(static_cast($1), result);



This does cause one test in the testsuite to fail --

==
FAIL: test_snapshot_minidump (TestMiniDumpNew.MiniDumpNewTestCase)
   Test that if we load a snapshot minidump file (meaning the process
--
Traceback (most recent call last):
  File 
"/Volumes/newwork/github/stable/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py",
 line 88, in test_snapshot_minidump
self.assertEqual(stop_description, None)
AssertionError: '' != None
Config=x86_64-/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
--


which is doing


thread = self.process.GetThreadAtIndex(0)
self.assertEqual(thread.GetStopReason(), lldb.eStopReasonNone)
stop_description = thread.GetStopDescription(256)
self.assertEqual(stop_description, None)


SBThread::GetStopDescription doesn't have an SBError object to indicate that 
there is no stop description for eStopReasonNone.  I don't think this will be a 
problem if eStopReasonNone is returning an empty python string for the 
StopDescription.


I'm not wedded to my current patch, but we do have to come up with something 
that can return a zero length python string for a method like 
SBProcess::ReadCStringFromMemory.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] Need to change swig typemap for reading C strings

2017-11-15 Thread Jason Molenda via lldb-commits
The general point you're making is reasonable, and something like 
Thread::GetStopDescription is not clear which the correct behavior should be.

But I think we can all agree that Process::ReadCStringFromMemory() returning a 
None object when there is an empty c-string is incorrect.  People are writing 
code calling Process::ReadCStringFromMemory(), checking the SBError object if 
it was successful, and then treating the return value as if it were a string, 
which is reasonable to do.

I'll check in the fix tomorrow, and update the TestMiniDumpNew.py test, thanks.

J

> On Nov 15, 2017, at 6:56 PM, Zachary Turner  wrote:
> 
> I don't really feel strongly about how you fix it.  I'm sure there was a good 
> reason for making it do that, but at this point I don't remember what it is 
> and I don't think undoing it will cause a problem.
> 
> That said, part of the difficulty of having an API such as this is that 
> Hyrum's Law [http://www.hyrumslaw.com/] is going to continue to bite you.  
> The reason this broke is because there was no test guaranteeing that this 
> behavior that people were relying on did not change.
> 
> As a general rule, it's impossible to guarantee that no observable behavior 
> of an API will ever change, so unless there was a test for the original 
> behavior (which is documentation that this is behavior people are allowed to 
> rely on), I don't really consider it broken.
> 
> Even if we are in the business of guaranteeing that the API itself won't 
> change, we really can't be in the business of guaranteeing that no observable 
> behavior of the API will ever change.  That's going to be an endless 
> maintenance nightmare.
> 
> On Wed, Nov 15, 2017 at 6:47 PM Jason Molenda  wrote:
> Hi Zachary, reviving a problem I initially found a year ago -- in r253487 
> where a swig typemap was changed for string reading methods.
> 
> The problem we're seeing with this change is that 
> SBProcess::ReadCStringFromMemory() now returns a None object when you try to 
> read a zero-length string, and this is breaking a couple of groups' python 
> scripts here at Apple.  (it was a low priority thing for me to fix, until 
> some behavior changed recently and it started biting the groups a lot more 
> frequently).
> 
> SBProcess::ReadCStringFromMemory() takes an SBError object and returns a 
> string.  We have three cases:
> 
> 
> 1 Non-zero length string read.  SBError says it was successful, string should 
> be returned.
> 
> 2 Zero-length / empty string read.  SBError says it was successful, string 
> should be returned (Python None object is returned right now)
> 
> 3 Memory read error.  SBError says it is an error, ideally None object should 
> be returned.
> 
> 
> For instance,
> 
> #include 
> int main ()
> {
> const char *empty_string = "";
> const char *one_letter_string = "1";
> const char *invalid_memory_string = (char*)0x100; // lower 4k is always 
> PAGEZERO & unreadable on darwin
> return empty_string[0] + one_letter_string[0]; // breakpoint here
> }
> 
> we'll see:
> 
>   (lldb) br s -p breakpoint
>   (lldb) r
>   (lldb) p empty_string
>   (const char *) $0 = 0x00010fae ""
>   (lldb) p one_letter_string
>   (const char *) $1 = 0x00010faf "1"
>   (lldb) p invalid_memory_string
>   (const char *) $2 = 0x0100 ""
>   (lldb) scri
>   >>> err = lldb.SBError()
> 
>   >>> print lldb.process.ReadCStringFromMemory(0x00010fae, 2048, err)
>   None
>   >>> print err
>   success
> 
>   >>> print lldb.process.ReadCStringFromMemory(0x00010faf, 2048, err)
>   1
>   >>> print err
>   success
> 
>   >>> print lldb.process.ReadCStringFromMemory(0x0100, 2048, err)
>   None
>   >>> print err
>   error: memory read failed for 0x0
>   >>> print err.Success()
>   False
>   >>>
> 
> 
> Before r253487, the read of a zero-length string and the read of an invalid 
> address would both return a zero length python string (and the latter would 
> set the SBError).  After the change, both of these return a python None 
> object (and the latter sets the SBError).
> 
> 
> I haven't worked with the typemaps before -- I can restore the previous 
> behavior where an empty Python string is returned for both the zero-length 
> string and for the unreadable address.  I don't see how I can access the 
> SBError object used earlier in these methods.
> 
> 
> diff --git i/scripts/Python/python-typemaps.swig 
> w/scripts/Python/python-typemaps.swig
> index df16a6d27b3..29e5d9b156d 100644
> --- i/scripts/Python/python-typemaps.swig
> +++ w/scripts/Python/python-typemaps.swig
> @@ -102,7 +102,8 @@
>  %typemap(argout) (char *dst, size_t dst_len) {
> Py_XDECREF($result);   /* Blow away any previous result */
> if (result == 0) {
> -  $result = Py_None;
> +  lldb_private::PythonString string("");
> +  $result = string.release();
>Py_INCREF($result);
> } else {
>llvm::StringRef ref(static_cast($1), result);
> 
> 
> 
> This does c

Re: [Lldb-commits] Need to change swig typemap for reading C strings

2017-11-15 Thread Jason Molenda via lldb-commits
Yeah, I'm going to check in one based on my little example program.  The only 
tricky bit is 



> > const char *invalid_memory_string = (char*)0x100; // lower 4k is always 
> > PAGEZERO & unreadable on darwin


I'll need some address that is unmapped for other platforms.  Maybe address -1 
or something.




> On Nov 15, 2017, at 7:48 PM, Zachary Turner  wrote:
> 
> Probably obvious, can you add some tests to verify the new behavior?
> 
> On Wed, Nov 15, 2017 at 7:47 PM Zachary Turner  wrote:
> Yea, if there is a valid string there, it should definitely be returning "", 
> hard to argue with that.
> 
> On Wed, Nov 15, 2017 at 7:06 PM Jason Molenda  wrote:
> The general point you're making is reasonable, and something like 
> Thread::GetStopDescription is not clear which the correct behavior should be.
> 
> But I think we can all agree that Process::ReadCStringFromMemory() returning 
> a None object when there is an empty c-string is incorrect.  People are 
> writing code calling Process::ReadCStringFromMemory(), checking the SBError 
> object if it was successful, and then treating the return value as if it were 
> a string, which is reasonable to do.
> 
> I'll check in the fix tomorrow, and update the TestMiniDumpNew.py test, 
> thanks.
> 
> J
> 
> > On Nov 15, 2017, at 6:56 PM, Zachary Turner  wrote:
> >
> > I don't really feel strongly about how you fix it.  I'm sure there was a 
> > good reason for making it do that, but at this point I don't remember what 
> > it is and I don't think undoing it will cause a problem.
> >
> > That said, part of the difficulty of having an API such as this is that 
> > Hyrum's Law [http://www.hyrumslaw.com/] is going to continue to bite you.  
> > The reason this broke is because there was no test guaranteeing that this 
> > behavior that people were relying on did not change.
> >
> > As a general rule, it's impossible to guarantee that no observable behavior 
> > of an API will ever change, so unless there was a test for the original 
> > behavior (which is documentation that this is behavior people are allowed 
> > to rely on), I don't really consider it broken.
> >
> > Even if we are in the business of guaranteeing that the API itself won't 
> > change, we really can't be in the business of guaranteeing that no 
> > observable behavior of the API will ever change.  That's going to be an 
> > endless maintenance nightmare.
> >
> > On Wed, Nov 15, 2017 at 6:47 PM Jason Molenda  wrote:
> > Hi Zachary, reviving a problem I initially found a year ago -- in r253487 
> > where a swig typemap was changed for string reading methods.
> >
> > The problem we're seeing with this change is that 
> > SBProcess::ReadCStringFromMemory() now returns a None object when you try 
> > to read a zero-length string, and this is breaking a couple of groups' 
> > python scripts here at Apple.  (it was a low priority thing for me to fix, 
> > until some behavior changed recently and it started biting the groups a lot 
> > more frequently).
> >
> > SBProcess::ReadCStringFromMemory() takes an SBError object and returns a 
> > string.  We have three cases:
> >
> >
> > 1 Non-zero length string read.  SBError says it was successful, string 
> > should be returned.
> >
> > 2 Zero-length / empty string read.  SBError says it was successful, string 
> > should be returned (Python None object is returned right now)
> >
> > 3 Memory read error.  SBError says it is an error, ideally None object 
> > should be returned.
> >
> >
> > For instance,
> >
> > #include 
> > int main ()
> > {
> > const char *empty_string = "";
> > const char *one_letter_string = "1";
> > const char *invalid_memory_string = (char*)0x100; // lower 4k is always 
> > PAGEZERO & unreadable on darwin
> > return empty_string[0] + one_letter_string[0]; // breakpoint here
> > }
> >
> > we'll see:
> >
> >   (lldb) br s -p breakpoint
> >   (lldb) r
> >   (lldb) p empty_string
> >   (const char *) $0 = 0x00010fae ""
> >   (lldb) p one_letter_string
> >   (const char *) $1 = 0x00010faf "1"
> >   (lldb) p invalid_memory_string
> >   (const char *) $2 = 0x0100 ""
> >   (lldb) scri
> >   >>> err = lldb.SBError()
> >
> >   >>> print lldb.process.ReadCStringFromMemory(0x00010fae, 2048, 
> > err)
> >   None
> >   >>> print err
> >   success
> >
> >   >>> print lldb.process.ReadCStringFromMemory(0x00010faf, 2048, 
> > err)
> >   1
> >   >>> print err
> >   success
> >
> >   >>> print lldb.process.ReadCStringFromMemory(0x0100, 2048, 
> > err)
> >   None
> >   >>> print err
> >   error: memory read failed for 0x0
> >   >>> print err.Success()
> >   False
> >   >>>
> >
> >
> > Before r253487, the read of a zero-length string and the read of an invalid 
> > address would both return a zero length python string (and the latter would 
> > set the SBError).  After the change, both of these return a python None 
> > object (and the latter sets the SBError).
> >
> >
> > I haven't work

[Lldb-commits] [lldb] r318500 - Update xcode project file to build new ppc64le files.

2017-11-16 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Nov 16 17:55:50 2017
New Revision: 318500

URL: http://llvm.org/viewvc/llvm-project?rev=318500&view=rev
Log:
Update xcode project file to build new ppc64le files.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/LLDB.xcscheme
lldb/trunk/lldb.xcodeproj/xcshareddata/xcschemes/darwin-debug.xcscheme

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=318500&r1=318499&r2=318500&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Nov 16 17:55:50 2017
@@ -950,6 +950,10 @@
AF1F7B07189C904B0087DB9C /* AppleGetPendingItemsHandler.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF1F7B05189C904B0087DB9C /* 
AppleGetPendingItemsHandler.cpp */; };
AF20F7661AF18F8500751A6E /* ABISysV_arm.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF20F7641AF18F8500751A6E /* ABISysV_arm.cpp */; 
};
AF20F76A1AF18F9000751A6E /* ABISysV_arm64.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF20F7681AF18F9000751A6E /* ABISysV_arm64.cpp 
*/; };
+   AF235EB01FBE77B6009C5541 /* RegisterContextPOSIX_ppc64le.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF235EAE1FBE77B6009C5541 /* 
RegisterContextPOSIX_ppc64le.cpp */; };
+   AF235EB11FBE77B6009C5541 /* RegisterContextPOSIX_ppc64le.h in 
Headers */ = {isa = PBXBuildFile; fileRef = AF235EAF1FBE77B6009C5541 /* 
RegisterContextPOSIX_ppc64le.h */; };
+   AF235EB41FBE7858009C5541 /* RegisterInfoPOSIX_ppc64le.h in 
Headers */ = {isa = PBXBuildFile; fileRef = AF235EB21FBE7857009C5541 /* 
RegisterInfoPOSIX_ppc64le.h */; };
+   AF235EB51FBE7858009C5541 /* RegisterInfoPOSIX_ppc64le.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF235EB31FBE7858009C5541 /* 
RegisterInfoPOSIX_ppc64le.cpp */; };
AF23B4DB19009C66003E2A58 /* FreeBSDSignals.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF23B4D919009C66003E2A58 /* FreeBSDSignals.cpp 
*/; };
AF248A4D1DA71C77000B814D /* TestArm64InstEmulation.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF248A4C1DA71C77000B814D /* 
TestArm64InstEmulation.cpp */; };
AF254E31170CCC33007AE5C9 /* PlatformDarwinKernel.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AF254E2F170CCC33007AE5C9 /* 
PlatformDarwinKernel.cpp */; };
@@ -992,6 +996,8 @@
AF90106515AB7D3600FF120D /* lldb.1 in CopyFiles */ = {isa = 
PBXBuildFile; fileRef = AF90106315AB7C5700FF120D /* lldb.1 */; };
AF9107EE168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF9107EC168570D200DBCD3C /* 
RegisterContextDarwin_arm64.cpp */; };
AF9107EF168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF9107EC168570D200DBCD3C /* 
RegisterContextDarwin_arm64.cpp */; };
+   AF9113FD1FBE78EA004320CD /* 
RegisterContextPOSIXCore_ppc64le.cpp in Sources */ = {isa = PBXBuildFile; 
fileRef = AF9113FB1FBE78EA004320CD /* RegisterContextPOSIXCore_ppc64le.cpp */; 
};
+   AF9113FE1FBE78EA004320CD /* RegisterContextPOSIXCore_ppc64le.h 
in Headers */ = {isa = PBXBuildFile; fileRef = AF9113FC1FBE78EA004320CD /* 
RegisterContextPOSIXCore_ppc64le.h */; };
AF9B8F33182DB52900DA866F /* SystemRuntimeMacOSX.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AF9B8F31182DB52900DA866F /* 
SystemRuntimeMacOSX.cpp */; };
AF9FF1F51FAA79A400474976 /* LibCxxTuple.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF9FF1F41FAA79A400474976 /* LibCxxTuple.cpp */; 
};
AF9FF1F71FAA79FE00474976 /* LibCxxQueue.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = AF9FF1F61FAA79FE00474976 /* LibCxxQueue.cpp */; 
};
@@ -3021,6 +3027,10 @@
AF20F7681AF18F9000751A6E /* ABISysV_arm64.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = ABISysV_arm64.cpp; path = "SysV-arm64/ABISysV_arm64.cpp"; sourceTree = 
""; };
AF20F7691AF18F9000751A6E /* ABISysV_arm64.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
ABISysV_arm64.h; path = "SysV-arm64/ABISysV_arm64.h"; sourceTree = ""; };
AF20F76C1AF18FC700751A6E /* SBLanguageRuntime.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = SBLanguageRuntime.cpp; path = source/API/SBLanguageRuntime.cpp; 
sourceTree = ""; };
+   AF235EAE1FBE77B6009C5541 /* RegisterContextPOSIX_ppc64le.cpp */ 
= {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; name = RegisterContextPOSIX_ppc64le.cpp; path = 
Utility/Re

Re: [Lldb-commits] [PATCH] D40616: ObjectFileELF: Add support for compressed sections

2017-11-29 Thread Jason Molenda via lldb-commits
The last time this discussion came up (Sep 2016), I pointed out that a great 
approach here would be to use the lldb-mi driver.  The MI (Machine Interface) 
is a JSON-like debugger UI which closely models how people use the lldb command 
line driver.  It was written at Cygnus (long before JSON, hence the "-like") to 
allow for the separation of an IDE and a debugger.  All of the responses from 
lldb-mi are structured output; they can be ingested and queried 
programmatically so tests are stable.

This topic has come up many times, and I know there's a real desire to say "I 
did these five commands & saw a problem; I just want to write a test case that 
does those five commands and checks for the expected output."  Going from lldb 
command interpreter to lldb-mi command interpreter is not a big leap once 
you've seen how MI is structured; this may be easier for casual contributors to 
write.  I think it would be interesting to write a test harness (based on lit?) 
to write tests using lldb-mi as the driver.

Once people spend more time working on lldb, the SB API quickly becomes second 
nature so writing tests in that form is even easier.

As Jim notes, we learned a very painful lesson with gdb which was based on 
output matching; it was fine for a while but after a couple of decades, it made 
it extremely difficult to change the command line tool's behavior in any way 
because you knew you'd be fixing ornate regular expressions that had 
accumulated over the years for 4x as long as it took to write the original 
change.  It was miserable.

J

> On Nov 29, 2017, at 1:59 PM, Jim Ingham via lldb-commits 
>  wrote:
> 
> I'm mostly basing this concern on the bad effect this had on gdb all of whose 
> testing was expect based command scraping.  gdb is a tool that's much closer 
> to lldb than any of the compiler tools so that experience seems relevant.  
> It's been a decade or so since I worked on gdb, but back when I was working 
> on it, you really had to tread very carefully if you wanted to change the 
> output of, say, the break command, or to thread listings, etc, and a bunch of 
> times I just had to bag some cleanup of output I wanted to do because fixing 
> up all the tests was too time consuming.  Because Jason and I had both had 
> this experience when we started working on lldb, we promised ourselves we 
> wouldn't go down this path again...
> 
> Jim
> 
> 
>> On Nov 29, 2017, at 1:43 PM, Davide Italiano  wrote:
>> 
>> On Wed, Nov 29, 2017 at 1:38 PM, Jim Ingham  wrote:
>>> I'm a little confused by your response.
>>> 
>>> My stated objection to command output dependent tests is and has always 
>>> been that they make the test dependent on the details of command output.  
>>> Over time doing so makes it hard to modify command output.  This is sort of 
>>> related to interactivity, in the sense that since lldb is an interactive 
>>> tool with lots of different commands producing different reports of 
>>> information we can gather, the desire to improve and modify that output is 
>>> more present than in tools that are less output dependent or whose output 
>>> is meant to be processed, in which case it really is API.  Command output 
>>> for lldb is explicitly NOT API, that's why we have a real API for people 
>>> who want to program lldb...  So the bad effect of the tests in calcifying 
>>> this output is an issue for lldb where it may not be for other tools.
>>> 
>> 
>> Hi Jim,
>> in my experience command output changes can be automated via `sed/grep/awk`.
>> I'm responsible (and many others are) for fundamental changes in LLVM
>> tools output (i.e. typeless pointers changed pretty much every
>> load/store/memory_op* in tree) and I found out changing the output of
>> tests isn't that troublesome. I'm not yet very familiar with LLDB, so
>> the story might be different here.
>> I'm personally in favour of this approach because it scaled very well
>> in llvm (and lld, FWIW), with many more tests than lldb has.
>> 
>> --
>> Davide
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D40616: ObjectFileELF: Add support for compressed sections

2017-11-29 Thread Jason Molenda via lldb-commits


> On Nov 29, 2017, at 2:13 PM, Greg Clayton  wrote:
> 
> 
>> On Nov 29, 2017, at 2:10 PM, Jason Molenda via lldb-commits 
>>  wrote:
>> 
>> The last time this discussion came up (Sep 2016), I pointed out that a great 
>> approach here would be to use the lldb-mi driver.  The MI (Machine 
>> Interface) is a JSON-like debugger UI which closely models how people use 
>> the lldb command line driver.  It was written at Cygnus (long before JSON, 
>> hence the "-like") to allow for the separation of an IDE and a debugger.  
>> All of the responses from lldb-mi are structured output; they can be 
>> ingested and queried programmatically so tests are stable.
> 
> The MI driver is currently a text scraper itself... Many commands are not 
> using the SB APIs like they should and are scraping text output for the 
> response, or just making commands that will be passed down via 
> "HandleCommand()" so I can't recommend using lldb-mi...
> 


That's unfortunate; but it would be easy to switch over lldb-mi to use proper 
SB API as the command behavior changes over time and breaks their pattern 
matching.  

Writing the tests in terms of the MI (or rather, an abstraction that represents 
the k-v/arrays in the MI) isolates the tests from those details. 




>> 
>> This topic has come up many times, and I know there's a real desire to say 
>> "I did these five commands & saw a problem; I just want to write a test case 
>> that does those five commands and checks for the expected output."  Going 
>> from lldb command interpreter to lldb-mi command interpreter is not a big 
>> leap once you've seen how MI is structured; this may be easier for casual 
>> contributors to write.  I think it would be interesting to write a test 
>> harness (based on lit?) to write tests using lldb-mi as the driver.
>> 
>> Once people spend more time working on lldb, the SB API quickly becomes 
>> second nature so writing tests in that form is even easier.
>> 
>> As Jim notes, we learned a very painful lesson with gdb which was based on 
>> output matching; it was fine for a while but after a couple of decades, it 
>> made it extremely difficult to change the command line tool's behavior in 
>> any way because you knew you'd be fixing ornate regular expressions that had 
>> accumulated over the years for 4x as long as it took to write the original 
>> change.  It was miserable.
>> 
>> J
>> 
>>> On Nov 29, 2017, at 1:59 PM, Jim Ingham via lldb-commits 
>>>  wrote:
>>> 
>>> I'm mostly basing this concern on the bad effect this had on gdb all of 
>>> whose testing was expect based command scraping.  gdb is a tool that's much 
>>> closer to lldb than any of the compiler tools so that experience seems 
>>> relevant.  It's been a decade or so since I worked on gdb, but back when I 
>>> was working on it, you really had to tread very carefully if you wanted to 
>>> change the output of, say, the break command, or to thread listings, etc, 
>>> and a bunch of times I just had to bag some cleanup of output I wanted to 
>>> do because fixing up all the tests was too time consuming.  Because Jason 
>>> and I had both had this experience when we started working on lldb, we 
>>> promised ourselves we wouldn't go down this path again...
>>> 
>>> Jim
>>> 
>>> 
>>>> On Nov 29, 2017, at 1:43 PM, Davide Italiano  wrote:
>>>> 
>>>> On Wed, Nov 29, 2017 at 1:38 PM, Jim Ingham  wrote:
>>>>> I'm a little confused by your response.
>>>>> 
>>>>> My stated objection to command output dependent tests is and has always 
>>>>> been that they make the test dependent on the details of command output.  
>>>>> Over time doing so makes it hard to modify command output.  This is sort 
>>>>> of related to interactivity, in the sense that since lldb is an 
>>>>> interactive tool with lots of different commands producing different 
>>>>> reports of information we can gather, the desire to improve and modify 
>>>>> that output is more present than in tools that are less output dependent 
>>>>> or whose output is meant to be processed, in which case it really is API. 
>>>>>  Command output for lldb is explicitly NOT API, that's why we have a real 
>>>>> API for people who want to program lldb...  So the bad effect of the 
>>>>> tests in calcifying

Re: [Lldb-commits] [PATCH] D40616: ObjectFileELF: Add support for compressed sections

2017-11-29 Thread Jason Molenda via lldb-commits


> On Nov 29, 2017, at 2:51 PM, Zachary Turner via lldb-commits 
>  wrote:
> 
> 
> 
> On Wed, Nov 29, 2017 at 1:59 PM Jim Ingham  wrote:
> I'm mostly basing this concern on the bad effect this had on gdb all of whose 
> testing was expect based command scraping.  gdb is a tool that's much closer 
> to lldb than any of the compiler tools so that experience seems relevant.  
> It's been a decade or so since I worked on gdb, but back when I was working 
> on it, you really had to tread very carefully if you wanted to change the 
> output of, say, the break command, or to thread listings, etc, and a bunch of 
> times I just had to bag some cleanup of output I wanted to do because fixing 
> up all the tests was too time consuming.  Because Jason and I had both had 
> this experience when we started working on lldb, we promised ourselves we 
> wouldn't go down this path again...
> 
> 
> Couple of things:
> 
> 1) I wouldn't dare to use this approach for anything that required 
> interactivity.  If you need to run one command, extract a value from the 
> output, and use that value as input to another command, I think that would be 
> a big mistake.  I have no intention of ever proposing something like that.
> 
> 2) FileCheck is very flexible in the way it matches output and tests can be 
> written so that they are resilient to minor format tweaks.  I have no doubt 
> that with pure regex matching, or with pretty much any other tool, you would 
> have a really bad time.  Of course, that doesn't mean it would be hard to 
> construct an example of a format change that would break a FileCheck test.  
> But I think it would happen *far* less frequently than it did on GDB.  That 
> said, I still understand your concerns that it's fragile, so...
> 
> 3) I would not be opposed to a tool called lldb-test, which was basically 
> just LLDB with a different, and much more limited set of commands, and was 
> completely non-interactive and would produce output in a format designed for 
> being scraped, and which never had to be changed since it was never presented 
> to the user.


100% agree with #3.  We could go back and forth about using lldb-mi, but I 
think a specialized driver using SB API, designed for testing, would be a great 
approach.


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r319500 - We had a situation where a kext was inlined into the kernel,

2017-11-30 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Nov 30 15:31:18 2017
New Revision: 319500

URL: http://llvm.org/viewvc/llvm-project?rev=319500&view=rev
Log:
We had a situation where a kext was inlined into the kernel,
but still listed in the kernel's kext table with the kernel
binary UUID.  This resulted in the kernel text section being
loaded at the kext address and problems ensuing.  Instead,
if there is a kext with the same UUID as the kernel, lldb
should skip over it.

 

Modified:

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=319500&r1=319499&r2=319500&view=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
 Thu Nov 30 15:31:18 2017
@@ -1229,6 +1229,16 @@ bool DynamicLoaderDarwinKernel::ParseKex
 break;
   }
 }
+// If this "kext" entry is actually an alias for the kernel --
+// the kext was compiled into the kernel or something -- then
+// we don't want to load the kernel's text section at a different
+// address.  Ignore this kext entry.
+if (kext_summaries[new_kext].GetUUID().IsValid() 
+&& m_kernel.GetUUID().IsValid() 
+&& kext_summaries[new_kext].GetUUID() == m_kernel.GetUUID()) {
+  to_be_added[new_kext] = false;
+  break;
+}
 if (add_this_one) {
   number_of_new_kexts_being_added++;
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r319653 - Makefile.rules: compile all tests with -fno-limit-debug-info

2017-12-05 Thread Jason Molenda via lldb-commits
It looks like the macos testsuite on the bot is broken with this -

http://lab.llvm.org:8080/green/view/LLDB/job/lldb/3086/

On my desktop with a recent clang, it works fine.  But it seems like every 
test? most tests? are failing with 

error: parsing line table prologue at 0x (parsing ended around 
0x

messages now.  

When I run one test by hand on my system, I have the -fno-limit-debug-info flag:

./dotest.py -t -v -v  
../packages//Python/lldbsuite/test/functionalities/breakpoint/auto_continue/



stdout: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 -g -O0 -fno-builtin -arch x86_64  
-I/Volumes/newwork/svn/lldb/packages/Python/lldbsuite/test/make/../../../../../include
 -include 
/Volumes/newwork/svn/lldb/packages/Python/lldbsuite/test/make/test_common.h 
-I/Volumes/newwork/svn/lldb/packages/Python/lldbsuite/test/make/  
-fno-limit-debug-info  -std=c99   -c -o main.o main.c



I'm not sure if the bots are building against too new or too new a compiler - 
if we're looking at a bug or it just does something weird when given 
-fno-limit-debug-info?


> On Dec 4, 2017, at 5:31 AM, Pavel Labath via lldb-commits 
>  wrote:
> 
> Author: labath
> Date: Mon Dec  4 05:31:56 2017
> New Revision: 319653
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=319653&view=rev
> Log:
> Makefile.rules: compile all tests with -fno-limit-debug-info
> 
> Summary:
> This flag is on by default for darwin and freebsd, but off for linux.
> Without it, clang will sometimes not emit debug info for types like
> std::string. Whether it does this, and which tests will fail because of
> that depends on the linux distro and c++ library version.
> 
> A bunch of tests were already setting these flags manually, but here
> instead I take a whole sale approach and enable this flag for all tests.
> Any test which does not want to have this flag (right now we have one
> such test) can turn it off explicitly via
> CFLAGS_EXTRAS+=$(LIMIT_DEBUG_INFO_FLAGS)
> 
> This fixes a bunch of data formatter tests on red-hat.
> 
> Reviewers: davide, jankratochvil
> 
> Subscribers: emaste, aprantl, krytarowski, JDevlieghere, lldb-commits
> 
> Differential Revision: https://reviews.llvm.org/D40717
> 
> Modified:
>
> lldb/trunk/packages/Python/lldbsuite/test/expression_command/anonymous-struct/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/expression_command/fixits/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/Makefile
>
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_completion/Makefile
>lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/auto/Makefile
>lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/stl/Makefile
>lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/Makefile
>lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
>
> lldb/trunk/packages/Python/lldbsuite/test/python_api/sbvalue_persist/Makefile
> 
> Modified: 
> lldb/trunk/packages/Python/lldbsuite/test/expression_command/anonymous-struct/Makefile
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/anonymous-struct/Makefile?rev=319653&r1=319652&r2=319653&view=diff
> 

[Lldb-commits] [lldb] r320240 - Update PlatformDarwin::GetDeveloperDir to handle the two

2017-12-08 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Dec  8 19:06:19 2017
New Revision: 320240

URL: http://llvm.org/viewvc/llvm-project?rev=320240&view=rev
Log:
Update PlatformDarwin::GetDeveloperDir to handle the two
most common cases where the Xcode.app bundle puts lldb -
either as a default part of the bundle, or in a toolchain
subdirectory, so the platform subclasses can find files
relative to this directory.

Dropped support for handling the case where the lldb
framework was in /Library/PrivateFrameworks.  I think
this was intended to handle the case where lldb is installed
in / (outside the Xcode.app bundle) - but in that case, we
can look in the raw directory file paths to find anything.

 

Modified:
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=320240&r1=320239&r2=320240&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Fri Dec  8 
19:06:19 2017
@@ -1132,28 +1132,33 @@ bool PlatformDarwin::ARMGetSupportedArch
   return false;
 }
 
+// Return a directory path like /Applications/Xcode.app/Contents/Developer
 const char *PlatformDarwin::GetDeveloperDirectory() {
   std::lock_guard guard(m_mutex);
   if (m_developer_directory.empty()) {
 bool developer_dir_path_valid = false;
 char developer_dir_path[PATH_MAX];
 FileSpec temp_file_spec;
+
+// Get the lldb framework's file path, and if it exists, truncate some
+// components to only the developer directory path.
 if (HostInfo::GetLLDBPath(ePathTypeLLDBShlibDir, temp_file_spec)) {
   if (temp_file_spec.GetPath(developer_dir_path,
  sizeof(developer_dir_path))) {
+// e.g. 
/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework
 char *shared_frameworks =
 strstr(developer_dir_path, "/SharedFrameworks/LLDB.framework");
 if (shared_frameworks) {
-  ::snprintf(shared_frameworks,
- sizeof(developer_dir_path) -
- (shared_frameworks - developer_dir_path),
- "/Developer");
+  shared_frameworks[0] = '\0';  // truncate developer_dir_path at this 
point
+  strncat (developer_dir_path, "/Developer", sizeof 
(developer_dir_path) - 1); // add /Developer on
   developer_dir_path_valid = true;
 } else {
-  char *lib_priv_frameworks = strstr(
-  developer_dir_path, "/Library/PrivateFrameworks/LLDB.framework");
-  if (lib_priv_frameworks) {
-*lib_priv_frameworks = '\0';
+  // e.g. 
/Applications/Xcode.app/Contents/Developer/Toolchains/iOS11.2.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework
+  char *developer_toolchains =
+strstr(developer_dir_path, "/Contents/Developer/Toolchains/");
+  if (developer_toolchains) {
+developer_toolchains += sizeof ("/Contents/Developer") - 1;
+developer_toolchains[0] = '\0'; // truncate developer_dir_path at 
this point
 developer_dir_path_valid = true;
   }
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r320241 - Change the ordering that we search for kexts and kernels on the local

2017-12-08 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Dec  8 19:28:15 2017
New Revision: 320241

URL: http://llvm.org/viewvc/llvm-project?rev=320241&view=rev
Log:
Change the ordering that we search for kexts and kernels on the local
computer.  When doing kernel debugging, lldb scrapes around a few 
well-known locations to find kexts and kernels.  It builds up two
lists - kexts and kernels with dSYM, and kexts and kernels without dSYMs.
After both lists have failed to provide a file, then we'll call out
to things like the DebugSymbols framework to find a kext/kernel.

This meant that when you had a kext/kernel on the local computer that
did not have debug information, lldb wouldn't consult DebugSymbols etc
once it'd locked on to one of these no-debug-info binaries on the local
computer.

Reorder this so we give DebugSymbols etc a shot at finding a debug-info
file before we use any of the no-debug-info binaries that were found on
the system.

 

Modified:
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp?rev=320241&r1=320240&r2=320241&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp 
(original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp Fri Dec  
8 19:28:15 2017
@@ -694,7 +694,16 @@ Status PlatformDarwinKernel::GetSharedMo
   }
 }
 
-// Second look through the kext binarys without dSYMs
+// Give the generic methods, including possibly calling into 
+// DebugSymbols framework on macOS systems, a chance.
+error = PlatformDarwin::GetSharedModule(module_spec, process, module_sp,
+   module_search_paths_ptr,
+   old_module_sp_ptr, did_create_ptr);
+if (error.Success() && module_sp.get()) {
+  return error;
+}
+
+// Lastly, look through the kext binarys without dSYMs
 if (m_name_to_kext_path_map_without_dsyms.count(kext_bundle_cs) > 0) {
   for (BundleIDToKextIterator it =
m_name_to_kext_path_map_without_dsyms.begin();
@@ -739,7 +748,17 @@ Status PlatformDarwinKernel::GetSharedMo
 }
   }
 }
-// Second try all kernel binaries that don't have a dSYM
+
+// Give the generic methods, including possibly calling into 
+// DebugSymbols framework on macOS systems, a chance.
+error = PlatformDarwin::GetSharedModule(module_spec, process, module_sp,
+module_search_paths_ptr,
+old_module_sp_ptr, did_create_ptr);
+if (error.Success() && module_sp.get()) {
+  return error;
+}
+
+// Next try all kernel binaries that don't have a dSYM
 for (auto possible_kernel : m_kernel_binaries_without_dsyms) {
   if (possible_kernel.Exists()) {
 ModuleSpec kern_spec(possible_kernel);
@@ -767,11 +786,7 @@ Status PlatformDarwinKernel::GetSharedMo
 }
   }
 
-  // Else fall back to treating the file's path as an actual file path - defer
-  // to PlatformDarwin's GetSharedModule.
-  return PlatformDarwin::GetSharedModule(module_spec, process, module_sp,
- module_search_paths_ptr,
- old_module_sp_ptr, did_create_ptr);
+  return error;
 }
 
 Status PlatformDarwinKernel::ExamineKextForMatchingUUID(


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r320242 - Change uses of strncpy in debugserver to strlcpy

2017-12-08 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Fri Dec  8 19:37:09 2017
New Revision: 320242

URL: http://llvm.org/viewvc/llvm-project?rev=320242&view=rev
Log:
Change uses of strncpy in debugserver to strlcpy
for better safety.

 

Modified:
lldb/trunk/tools/debugserver/source/DNB.cpp
lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp
lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp
lldb/trunk/tools/debugserver/source/RNBRemote.cpp
lldb/trunk/tools/debugserver/source/debugserver.cpp

Modified: lldb/trunk/tools/debugserver/source/DNB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNB.cpp?rev=320242&r1=320241&r2=320242&view=diff
==
--- lldb/trunk/tools/debugserver/source/DNB.cpp (original)
+++ lldb/trunk/tools/debugserver/source/DNB.cpp Fri Dec  8 19:37:09 2017
@@ -368,7 +368,7 @@ nub_process_t DNBProcessLaunch(
   if (launch_err.Fail()) {
 const char *launch_err_str = launch_err.AsString();
 if (launch_err_str) {
-  strncpy(err_str, launch_err_str, err_len - 1);
+  strlcpy(err_str, launch_err_str, err_len - 1);
   err_str[err_len - 1] =
   '\0'; // Make sure the error string is terminated
 }
@@ -1698,7 +1698,7 @@ nub_bool_t DNBResolveExecutablePath(cons
 
   if (realpath(path, max_path)) {
 // Found the path relatively...
-::strncpy(resolved_path, max_path, resolved_path_size);
+::strlcpy(resolved_path, max_path, resolved_path_size);
 return strlen(resolved_path) + 1 < resolved_path_size;
   } else {
 // Not a relative path, check the PATH environment variable if the
@@ -1722,7 +1722,7 @@ nub_bool_t DNBResolveExecutablePath(cons
 result += path;
 struct stat s;
 if (stat(result.c_str(), &s) == 0) {
-  ::strncpy(resolved_path, result.c_str(), resolved_path_size);
+  ::strlcpy(resolved_path, result.c_str(), resolved_path_size);
   return result.size() + 1 < resolved_path_size;
 }
   }

Modified: lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp?rev=320242&r1=320241&r2=320242&view=diff
==
--- lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp (original)
+++ lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp Fri Dec  8 19:37:09 
2017
@@ -35,7 +35,7 @@ bool DNBRegisterValueClass::IsValid() co
   do { 
\
 if (pos < end) {   
\
   if (i > 0) { 
\
-strncpy(pos, ", ", end - pos); 
\
+strlcpy(pos, ", ", end - pos); 
\
 pos += 2;  
\
   }
\
 }  
\
@@ -69,7 +69,7 @@ void DNBRegisterValueClass::Dump(const c
  value.v_uint64[1]);
 break;
   default:
-strncpy(str, "0x", 3);
+strlcpy(str, "0x", 3);
 pos = str + 2;
 for (uint32_t i = 0; i < info.size; ++i) {
   if (pos < end)

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp?rev=320242&r1=320241&r2=320242&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp Fri Dec  8 
19:37:09 2017
@@ -164,15 +164,15 @@ const char *MachThread::GetBasicInfoAsSt
 //size_t run_state_str_size = sizeof(run_state_str);
 //switch (basicInfo.run_state)
 //{
-//case TH_STATE_RUNNING:  strncpy(run_state_str, "running",
+//case TH_STATE_RUNNING:  strlcpy(run_state_str, "running",
 //run_state_str_size); break;
-//case TH_STATE_STOPPED:  strncpy(run_state_str, "stopped",
+//case TH_STATE_STOPPED:  strlcpy(run_state_str, "stopped",
 //run_state_str_size); break;
-//case TH_STATE_WAITING:  strncpy(run_state_str, "waiting",
+//case TH_STATE_WAITING:  strlcpy(run_state_str, "waiting",
 //run_state_str_size); break;
-//case TH_STATE_UNINTERRUPTIBLE:  strncpy(run_state_str,
+//case TH_STATE_UNINTERRUPTIBLE:  strlcpy(run_state_str,
 //"uninterruptible", run_state_str_size); break;
-   

Re: [Lldb-commits] [lldb] r320242 - Change uses of strncpy in debugserver to strlcpy

2017-12-11 Thread Jason Molenda via lldb-commits
Hi Adrian, 

These are good points, thanks for the feedback.  debugserver is unique in the 
code base in that it only builds on darwin targets.  Originally it was intended 
to be a generic standalone gdb-remote protocol stub implementation, but it was 
only ever implemented for macos and for that matter, we have several 
Objective-C++ source files in the MacOSX subdir -- I don't think it'll build 
anywhere but on a mac already.

We have some strncpy's in the main lldb source, I remember going to change some 
of those to strlcpy's years ago & found that it was not as portable as I'd 
assumed.

Agreed, using std::string's would be better for most of these.  This was a 
quick fix to get off of the strncpy's.

Long term I know we're hoping to add our darwin-specific changes to lldb-server 
and move to that.  But that may not happen for a while.

J

> On Dec 11, 2017, at 8:26 AM, Adrian McCarthy  wrote:
> 
> I have some concerns about this change.
> 
> 1.  strlcpy is not a C++ standard function, so it's not available for 
> non-POSIX targets.  As far as I can tell, this is the first use of strlcpy in 
> LLVM.
> 
> 2.  In some of the changed calls, the buffer size argument still has a -1, 
> which is redundant with what strlcpy is going to do, so this could cause 
> strings to be truncated a char too soon.
> 
> 3.  At some of the call sites, there remains now-redundant code to guarantee 
> termination.. Since that's the point of changing these calls, we should 
> probably eliminate that.
> 
> 4.  I'm not familiar with this part of the code base.  Is it necessary for 
> the APIs to work with pointer+length rather than a std::string (or other 
> class) that would give us safety and portability?
> 
> On Sun, Dec 10, 2017 at 3:52 PM, Davide Italiano via lldb-commits 
>  wrote:
> On Fri, Dec 8, 2017 at 7:37 PM, Jason Molenda via lldb-commits
>  wrote:
> > Author: jmolenda
> > Date: Fri Dec  8 19:37:09 2017
> > New Revision: 320242
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=320242&view=rev
> > Log:
> > Change uses of strncpy in debugserver to strlcpy
> > for better safety.
> >
> > 
> >
> 
> Thanks!
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
> 

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r321051 - Tweak to the debugserver entitlements setup in the xcode project

2017-12-18 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Dec 18 17:41:47 2017
New Revision: 321051

URL: http://llvm.org/viewvc/llvm-project?rev=321051&view=rev
Log:
Tweak to the debugserver entitlements setup in the xcode project
file.  For macos builds specifically, use the macosx entitlements
files; for all other builds, use the ios etc entitlements.

Modified:
lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj

Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=321051&r1=321050&r2=321051&view=diff
==
--- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj 
(original)
+++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Mon Dec 
18 17:41:47 2017
@@ -820,7 +820,7 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
-   "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = 
"source/debugserver-entitlements.plist";
+   "CODE_SIGN_ENTITLEMENTS[sdk=*]" = 
"source/debugserver-entitlements.plist";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = 
"source/debugserver-macosx-entitlements.plist";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
@@ -920,8 +920,7 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
-   "CODE_SIGN_ENTITLEMENTS[sdk=*]" = 
"source/debugserver-macosx-entitlements.plist";
-   "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = 
"source/debugserver-entitlements.plist";
+   "CODE_SIGN_ENTITLEMENTS[sdk=*]" = 
"source/debugserver-entitlements.plist";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = 
"source/debugserver-macosx-entitlements.plist";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "";
@@ -1020,8 +1019,7 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
-   "CODE_SIGN_ENTITLEMENTS[sdk=*]" = 
"source/debugserver-macosx-entitlements.plist";
-   "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = 
"source/debugserver-entitlements.plist";
+   "CODE_SIGN_ENTITLEMENTS[sdk=*]" = 
"source/debugserver-entitlements.plist";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = 
"source/debugserver-macosx-entitlements.plist";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "";
@@ -1127,8 +1125,7 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-   "CODE_SIGN_ENTITLEMENTS[sdk=*]" = 
"source/debugserver-macosx-entitlements.plist";
-   "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = 
"source/debugserver-entitlements.plist";
+   "CODE_SIGN_ENTITLEMENTS[sdk=*]" = 
"source/debugserver-entitlements.plist";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = 
"source/debugserver-macosx-entitlements.plist";
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
@@ -1209,8 +1206,7 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
-   "CODE_SIGN_ENTITLEMENTS[sdk=*]" = 
"source/debugserver-macosx-entitlements.plist";
-   "CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = 
"source/debugserver-entitlements.plist";
+   "CODE_SIGN_ENTITLEMENTS[sdk=*]" = 
"source/debugserver-entitlements.plist";
"CODE_SIGN_ENTITLEMENTS[sdk=macosx*]" = 
"source/debugserver-macosx-entitlements.plist";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "";
@@ -1279,8 +1275,7 @@
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "li

Re: [Lldb-commits] [lldb] r320240 - Update PlatformDarwin::GetDeveloperDir to handle the two

2017-12-21 Thread Jason Molenda via lldb-commits
Yeah I need to see if I can write a unit test instantiating the platform and 
changing the values that HostInfo::GetLLDBPath returns to synthetic values, but 
I haven’t had time to look at that yet. 

> On Dec 21, 2017, at 7:01 AM, Davide Italiano via lldb-commits 
>  wrote:
> 
> Jason, any chance we can write a test case for this?
> 
> --
> Davide
> 
>> On Mon, Dec 11, 2017 at 12:52 AM, Davide Italiano  
>> wrote:
>> Testcase?
>> 
>> On Fri, Dec 8, 2017 at 7:06 PM, Jason Molenda via lldb-commits
>>  wrote:
>>> Author: jmolenda
>>> Date: Fri Dec  8 19:06:19 2017
>>> New Revision: 320240
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=320240&view=rev
>>> Log:
>>> Update PlatformDarwin::GetDeveloperDir to handle the two
>>> most common cases where the Xcode.app bundle puts lldb -
>>> either as a default part of the bundle, or in a toolchain
>>> subdirectory, so the platform subclasses can find files
>>> relative to this directory.
>>> 
>>> Dropped support for handling the case where the lldb
>>> framework was in /Library/PrivateFrameworks.  I think
>>> this was intended to handle the case where lldb is installed
>>> in / (outside the Xcode.app bundle) - but in that case, we
>>> can look in the raw directory file paths to find anything.
>>> 
>>> 
>>> 
>>> Modified:
>>>lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
>>> 
>>> Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
>>> URL: 
>>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=320240&r1=320239&r2=320240&view=diff
>>> ==
>>> --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
>>> +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Fri Dec  8 
>>> 19:06:19 2017
>>> @@ -1132,28 +1132,33 @@ bool PlatformDarwin::ARMGetSupportedArch
>>>   return false;
>>> }
>>> 
>>> +// Return a directory path like /Applications/Xcode.app/Contents/Developer
>>> const char *PlatformDarwin::GetDeveloperDirectory() {
>>>   std::lock_guard guard(m_mutex);
>>>   if (m_developer_directory.empty()) {
>>> bool developer_dir_path_valid = false;
>>> char developer_dir_path[PATH_MAX];
>>> FileSpec temp_file_spec;
>>> +
>>> +// Get the lldb framework's file path, and if it exists, truncate some
>>> +// components to only the developer directory path.
>>> if (HostInfo::GetLLDBPath(ePathTypeLLDBShlibDir, temp_file_spec)) {
>>>   if (temp_file_spec.GetPath(developer_dir_path,
>>>  sizeof(developer_dir_path))) {
>>> +// e.g. 
>>> /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework
>>> char *shared_frameworks =
>>> strstr(developer_dir_path, "/SharedFrameworks/LLDB.framework");
>>> if (shared_frameworks) {
>>> -  ::snprintf(shared_frameworks,
>>> - sizeof(developer_dir_path) -
>>> - (shared_frameworks - developer_dir_path),
>>> - "/Developer");
>>> +  shared_frameworks[0] = '\0';  // truncate developer_dir_path at 
>>> this point
>>> +  strncat (developer_dir_path, "/Developer", sizeof 
>>> (developer_dir_path) - 1); // add /Developer on
>>>   developer_dir_path_valid = true;
>>> } else {
>>> -  char *lib_priv_frameworks = strstr(
>>> -  developer_dir_path, 
>>> "/Library/PrivateFrameworks/LLDB.framework");
>>> -  if (lib_priv_frameworks) {
>>> -*lib_priv_frameworks = '\0';
>>> +  // e.g. 
>>> /Applications/Xcode.app/Contents/Developer/Toolchains/iOS11.2.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework
>>> +  char *developer_toolchains =
>>> +strstr(developer_dir_path, "/Contents/Developer/Toolchains/");
>>> +  if (developer_toolchains) {
>>> +developer_toolchains += sizeof ("/Contents/Developer") - 1;
>>> +developer_toolchains[0] = '\0'; // truncate developer_dir_path 
>>> at this point
>>> developer_dir_path_valid = true;
>>>   }
>>> }
>>> 
>>> 
>>> ___
>>> lldb-commits mailing list
>>> lldb-commits@lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r321328 - Change the default Aarch64 ISA to be v8.2 to correctly decode newer

2017-12-21 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Dec 21 16:16:04 2017
New Revision: 321328

URL: http://llvm.org/viewvc/llvm-project?rev=321328&view=rev
Log:
Change the default Aarch64 ISA to be v8.2 to correctly decode newer
instructions (e.g. on the new iphones).
 

Modified:
lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp

Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=321328&r1=321327&r2=321328&view=diff
==
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Thu Dec 
21 16:16:04 2017
@@ -1127,6 +1127,11 @@ DisassemblerLLVMC::DisassemblerLLVMC(con
   features_str += "+dspr2,";
   }
 
+  // If any AArch64 variant, enable the ARMv8.2 ISA
+  // extensions so we can disassemble newer instructions.
+  if (triple.getArch() == llvm::Triple::aarch64)
+features_str += "+v8.2a";
+
   m_disasm_ap.reset(new LLVMCDisassembler(triple_str, cpu, 
features_str.c_str(),
   flavor, *this));
   if (!m_disasm_ap->IsValid()) {


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r321338 - Change SBProcess::ReadCStringFromMemory() back to returning

2017-12-21 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Dec 21 19:27:02 2017
New Revision: 321338

URL: http://llvm.org/viewvc/llvm-project?rev=321338&view=rev
Log:
Change SBProcess::ReadCStringFromMemory() back to returning
an empty Python string object when it reads a 0-length 
string out of memory (and a successful SBError object).

 

Added:

lldb/trunk/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/

lldb/trunk/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/Makefile

lldb/trunk/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py

lldb/trunk/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/main.c
Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
lldb/trunk/scripts/Python/python-typemaps.swig

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py?rev=321338&r1=321337&r2=321338&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
 Thu Dec 21 19:27:02 2017
@@ -117,7 +117,7 @@ class MiniDumpNewTestCase(TestBase):
 thread = self.process.GetThreadAtIndex(0)
 self.assertEqual(thread.GetStopReason(), lldb.eStopReasonNone)
 stop_description = thread.GetStopDescription(256)
-self.assertEqual(stop_description, None)
+self.assertEqual(stop_description, "")
 
 def do_test_deeper_stack(self, binary, core, pid):
 target = self.dbg.CreateTarget(binary)

Added: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/Makefile?rev=321338&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/Makefile
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/Makefile
 Thu Dec 21 19:27:02 2017
@@ -0,0 +1,6 @@
+LEVEL = ../../../make
+
+C_SOURCES := main.c
+EXE := read-mem-cstring
+
+include $(LEVEL)/Makefile.rules

Added: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py?rev=321338&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py
 Thu Dec 21 19:27:02 2017
@@ -0,0 +1,62 @@
+"""Test reading c-strings from memory via SB API."""
+
+from __future__ import print_function
+
+import os
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestReadMemCString(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+def setUp(self):
+TestBase.setUp(self)
+
+# Need to have a char* pointer that points to unmapped memory to run
+# this test on other platforms -- Darwin only for now.
+@skipUnlessDarwin
+def test_read_memory_c_string(self):
+"""Test corner case behavior of SBProcess::ReadCStringFromMemory"""
+self.build()
+   self.dbg.SetAsync(False)
+
+self.main_source = "main.c"
+   self.main_source_spec = lldb.SBFileSpec(self.main_source)
+   self.exe = os.path.join(os.getcwd(), "read-mem-cstring")
+
+(target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
+self, 'breakpoint here', self.main_source_spec, None, self.exe)
+
+   frame = thread.GetFrameAtIndex(0)
+
+err = lldb.SBError()
+
+empty_str_addr = 
frame.FindVariable("empty_string").GetValueAsUnsigned(err)
+self.assertTrue(err.Success())
+self.assertTrue(empty_str_addr != lldb.LLDB_INVALID_ADDRESS)
+
+one_letter_str_addr = 
frame.FindVariable("one_letter_string").GetValueAsUnsigned(err)
+self.assertTrue(err.Success())
+self.assertTrue(one_letter_str_addr != lldb.LLDB_INVALID_ADDRESS)
+
+invalid_memory_str_addr = 
frame.FindVariable("invalid_memory_string").GetValueAsUnsigned(err)
+self.assertTrue(err.Success())
+self.assertTrue(invalid_memory_str_addr != lldb.LLDB_INVALID_ADDRESS)
+
+# Important:  An empty

Re: [Lldb-commits] [PATCH] D41725: [lldb] [test] Fix tests to use more portable LLVM_ENABLE_ZLIB

2018-01-09 Thread Jason Molenda via lldb-commits


> On Jan 9, 2018, at 6:51 AM, Michał Górny via Phabricator via lldb-commits 
>  wrote:
> 
> mgorny added a comment.
> 
> In https://reviews.llvm.org/D41725#970926, @labath wrote:
> 
>> In https://reviews.llvm.org/D41725#969388, @mgorny wrote:
>> 
>>> I was talking of:
>>> 
>>>  source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
>>>  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
>> 
>> 
>> Ah, right. These uses were introduced before we developed a preference for 
>> llvm primitives. That said, I see a lot of compression stuff there, but I 
>> don't see mention of zlib directly.
> 
> 
> In the first of those files there are two `HAVE_LIBZ` conditionals that use 
> zlib. There's also `HAVE_LIBCOMPRESSION` for the other library, I suppose 
> it's relevant to Darwin.
> 
> Therefore, I have three questions:
> 
> 1. Should we add a separate check/switch for zlib here, or just use 
> `LLVM_ENABLE_ZLIB`?
> 2. Should I post a patch rewriting this little zlib bit to reuse 
> libLLVMSupport?
> 3. Should I look into merging libcompression support into libLLVMSupport?



For lldb main sources, it's fine to use llvm's zlib impl instead of libz.  In 
the debugserver project under tools/, we still link to libz because debugserver 
does not have any dependencies on llvm.

I haven't looked at the llvm compression API so I don't know how easy it would 
be to add libcompression support.  libcompression is only available on macOS 
10.11 ("El Capitan", released late 2015) and newer.  The API is documented here:

https://developer.apple.com/documentation/compression/data_compression?language=objc

on Darwin systems, lldb will prefer the lzfse compression algorithm when both 
sides are using libcompression.  It will fall back to zlib-deflate as its next 
choice.



J

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


  1   2   3   4   5   6   7   8   9   10   >