svn commit: r320967 - in vendor/lldb/dist: docs include/lldb/Host include/lldb/Host/common lit lldb.xcodeproj packages/Python/lldbsuite/test packages/Python/lldbsuite/test/expression_command/call-r...
Dimitry Andric
dim at FreeBSD.org
Thu Jul 13 19:26:21 UTC 2017
Author: dim
Date: Thu Jul 13 19:26:17 2017
New Revision: 320967
URL: https://svnweb.freebsd.org/changeset/base/320967
Log:
Vendor import of lldb trunk r307894:
https://llvm.org/svn/llvm-project/lldb/trunk@307894
Added:
vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/
vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/
vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/Makefile (contents, props changed)
vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py (contents, props changed)
vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/main.m
vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/
vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/Makefile (contents, props changed)
vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/TestUbsanUserExpression.py (contents, props changed)
vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/main.c (contents, props changed)
Deleted:
vendor/lldb/dist/www/architecture.html
Modified:
vendor/lldb/dist/docs/lldb-gdb-remote.txt
vendor/lldb/dist/include/lldb/Host/Host.h
vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h
vendor/lldb/dist/lit/lit.cfg
vendor/lldb/dist/lldb.xcodeproj/project.pbxproj
vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py
vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/fixits/TestFixIts.py
vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py
vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py
vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py
vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/save_jit_objects/TestSaveJITObjects.py
vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py
vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/signal/raise/main.c
vendor/lldb/dist/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py
vendor/lldb/dist/packages/Python/lldbsuite/test/lldbplatformutil.py
vendor/lldb/dist/packages/Python/lldbsuite/test/lldbutil.py
vendor/lldb/dist/packages/Python/lldbsuite/test/make/Android.rules
vendor/lldb/dist/packages/Python/lldbsuite/test/sample_test/TestSampleTest.py
vendor/lldb/dist/source/Commands/CommandObjectThread.cpp
vendor/lldb/dist/source/Core/DumpDataExtractor.cpp
vendor/lldb/dist/source/Host/common/File.cpp
vendor/lldb/dist/source/Host/common/MainLoop.cpp
vendor/lldb/dist/source/Host/common/NativeProcessProtocol.cpp
vendor/lldb/dist/source/Host/common/SocketAddress.cpp
vendor/lldb/dist/source/Host/macosx/Host.mm
vendor/lldb/dist/source/Host/posix/ConnectionFileDescriptorPosix.cpp
vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp
vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h
vendor/lldb/dist/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
vendor/lldb/dist/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp
vendor/lldb/dist/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp
vendor/lldb/dist/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
vendor/lldb/dist/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp
vendor/lldb/dist/source/Plugins/Language/ObjC/Cocoa.cpp
vendor/lldb/dist/source/Plugins/Platform/Android/PlatformAndroid.cpp
vendor/lldb/dist/source/Plugins/Platform/Android/PlatformAndroid.h
vendor/lldb/dist/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
vendor/lldb/dist/source/Plugins/Platform/POSIX/PlatformPOSIX.h
vendor/lldb/dist/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.cpp
vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.h
vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
vendor/lldb/dist/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
vendor/lldb/dist/source/Plugins/Process/Linux/ProcessorTrace.cpp
vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
vendor/lldb/dist/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
vendor/lldb/dist/source/Plugins/Process/gdb-remote/CMakeLists.txt
vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
vendor/lldb/dist/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
vendor/lldb/dist/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
vendor/lldb/dist/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
vendor/lldb/dist/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h
vendor/lldb/dist/source/Utility/StringExtractorGDBRemote.cpp
vendor/lldb/dist/source/Utility/StringExtractorGDBRemote.h
vendor/lldb/dist/tools/lldb-server/CMakeLists.txt
vendor/lldb/dist/tools/lldb-server/lldb-gdbserver.cpp
vendor/lldb/dist/tools/lldb-server/lldb-platform.cpp
vendor/lldb/dist/unittests/Process/Linux/ProcessorTraceTest.cpp
vendor/lldb/dist/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp
vendor/lldb/dist/www/architecture/index.html
vendor/lldb/dist/www/sidebar.incl
Modified: vendor/lldb/dist/docs/lldb-gdb-remote.txt
==============================================================================
--- vendor/lldb/dist/docs/lldb-gdb-remote.txt Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/docs/lldb-gdb-remote.txt Thu Jul 13 19:26:17 2017 (r320967)
@@ -126,6 +126,32 @@ read packet: $OK#00
This packet can be sent one or more times _prior_ to sending a "A" packet.
//----------------------------------------------------------------------
+// "QEnableErrorStrings"
+//
+// BRIEF
+// This packet enables reporting of Error strings in remote packet
+// replies from the server to client. If the server supports this
+// feature, it should send an OK response. The client can expect the
+// following error replies if this feature is enabled in the server ->
+//
+// EXX;AAAAAAAAA
+//
+// where AAAAAAAAA will be a hex encoded ASCII string.
+// XX is hex encoded byte number.
+//
+// It must be noted that even if the client has enabled reporting
+// strings in error replies, it must not expect error strings to all
+// error replies.
+//
+// PRIORITY TO IMPLEMENT
+// Low. Only needed if the remote target wants to provide strings that
+// are human readable along with an error code.
+//----------------------------------------------------------------------
+
+send packet: $QErrorStringInPacketSupported
+read packet: $OK#00
+
+//----------------------------------------------------------------------
// "QSetSTDIN:<ascii-hex-path>"
// "QSetSTDOUT:<ascii-hex-path>"
// "QSetSTDERR:<ascii-hex-path>"
@@ -250,11 +276,12 @@ read packet: OK
//
// Each tracing instance is identified by a trace id which is returned
// as the reply to this packet. In case the tracing failed to begin an
-// error code is returned instead.
+// error code along with a hex encoded ASCII message is returned
+// instead.
//----------------------------------------------------------------------
send packet: jTraceStart:{"type":<type>,"buffersize":<buffersize>}]
-read packet: <trace id>/E<error code>
+read packet: <trace id>/E<error code>;AAAAAAAAA
//----------------------------------------------------------------------
// jTraceStop:
@@ -283,12 +310,12 @@ read packet: <trace id>/E<error code>
// to stop tracing on that thread.
// ========== ====================================================
//
-// An OK response is sent in case of success else an error code is
-// returned.
+// An OK response is sent in case of success else an error code along
+// with a hex encoded ASCII message is returned.
//----------------------------------------------------------------------
send packet: jTraceStop:{"traceid":<trace id>}]
-read packet: <OK response>/E<error code>
+read packet: <OK response>/E<error code>;AAAAAAAAA
//----------------------------------------------------------------------
// jTraceBufferRead:
@@ -317,11 +344,11 @@ read packet: <OK response>/E<error code>
// ========== ====================================================
//
// The trace data is sent as raw binary data if the read was successful
-// else an error code is sent.
+// else an error code along with a hex encoded ASCII message is sent.
//----------------------------------------------------------------------
send packet: jTraceBufferRead:{"traceid":<trace id>,"offset":<byteoffset>,"buffersize":<byte_count>}]
-read packet: <binary trace data>/E<error code>
+read packet: <binary trace data>/E<error code>;AAAAAAAAA
//----------------------------------------------------------------------
// jTraceMetaRead:
@@ -359,11 +386,11 @@ read packet: <binary trace data>/E<error code>
// gdb-remote protocol has certain limitations, binary escaping
// convention is used.
// In case the trace instance with the <trace id> was not found, an
-// error code is returned.
+// error code along with a hex encoded ASCII message is returned.
//----------------------------------------------------------------------
send packet: jTraceConfigRead:{"traceid":<trace id>}
-read packet: {"conf1":<conf1>,"conf2":<conf2>,"params":{"paramName":paramValue}]}];/E<error code>
+read packet: {"conf1":<conf1>,"conf2":<conf2>,"params":{"paramName":paramValue}]}];/E<error code>;AAAAAAAAA
//----------------------------------------------------------------------
// "qRegisterInfo<hex-reg-id>"
Modified: vendor/lldb/dist/include/lldb/Host/Host.h
==============================================================================
--- vendor/lldb/dist/include/lldb/Host/Host.h Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/include/lldb/Host/Host.h Thu Jul 13 19:26:17 2017 (r320967)
@@ -7,21 +7,20 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_Host_h_
-#define liblldb_Host_h_
-#if defined(__cplusplus)
+#ifndef LLDB_HOST_HOST_H
+#define LLDB_HOST_HOST_H
-#include <stdarg.h>
-
-#include <map>
-#include <string>
-
#include "lldb/Host/File.h"
#include "lldb/Host/HostThread.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/StringList.h"
#include "lldb/lldb-private-forward.h"
#include "lldb/lldb-private.h"
+#include <cerrno>
+#include <map>
+#include <stdarg.h>
+#include <string>
+#include <type_traits>
namespace lldb_private {
@@ -254,5 +253,4 @@ template <> struct format_provider<lldb_private::WaitS
};
} // namespace llvm
-#endif // #if defined(__cplusplus)
-#endif // liblldb_Host_h_
+#endif // LLDB_HOST_HOST_H
Modified: vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h
==============================================================================
--- vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/include/lldb/Host/common/NativeProcessProtocol.h Thu Jul 13 19:26:17 2017 (r320967)
@@ -19,6 +19,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Error.h"
#include "llvm/Support/MemoryBuffer.h"
#include <vector>
@@ -244,68 +245,57 @@ class NativeProcessProtocol (public)
virtual Status GetFileLoadAddress(const llvm::StringRef &file_name,
lldb::addr_t &load_addr) = 0;
- //------------------------------------------------------------------
- /// Launch a process for debugging. This method will create an concrete
- /// instance of NativeProcessProtocol, based on the host platform.
- /// (e.g. NativeProcessLinux on linux, etc.)
- ///
- /// @param[in] launch_info
- /// Information required to launch the process.
- ///
- /// @param[in] native_delegate
- /// The delegate that will receive messages regarding the
- /// inferior. Must outlive the NativeProcessProtocol
- /// instance.
- ///
- /// @param[in] mainloop
- /// The mainloop instance with which the process can register
- /// callbacks. Must outlive the NativeProcessProtocol
- /// instance.
- ///
- /// @param[out] process_sp
- /// On successful return from the method, this parameter
- /// contains the shared pointer to the
- /// NativeProcessProtocol that can be used to manipulate
- /// the native process.
- ///
- /// @return
- /// An error object indicating if the operation succeeded,
- /// and if not, what error occurred.
- //------------------------------------------------------------------
- static Status Launch(ProcessLaunchInfo &launch_info,
- NativeDelegate &native_delegate, MainLoop &mainloop,
- NativeProcessProtocolSP &process_sp);
+ class Factory {
+ public:
+ virtual ~Factory();
+ //------------------------------------------------------------------
+ /// Launch a process for debugging.
+ ///
+ /// @param[in] launch_info
+ /// Information required to launch the process.
+ ///
+ /// @param[in] native_delegate
+ /// The delegate that will receive messages regarding the
+ /// inferior. Must outlive the NativeProcessProtocol
+ /// instance.
+ ///
+ /// @param[in] mainloop
+ /// The mainloop instance with which the process can register
+ /// callbacks. Must outlive the NativeProcessProtocol
+ /// instance.
+ ///
+ /// @return
+ /// A NativeProcessProtocol shared pointer if the operation succeeded or
+ /// an error object if it failed.
+ //------------------------------------------------------------------
+ virtual llvm::Expected<NativeProcessProtocolSP>
+ Launch(ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate,
+ MainLoop &mainloop) const = 0;
- //------------------------------------------------------------------
- /// Attach to an existing process. This method will create an concrete
- /// instance of NativeProcessProtocol, based on the host platform.
- /// (e.g. NativeProcessLinux on linux, etc.)
- ///
- /// @param[in] pid
- /// pid of the process locatable
- ///
- /// @param[in] native_delegate
- /// The delegate that will receive messages regarding the
- /// inferior. Must outlive the NativeProcessProtocol
- /// instance.
- ///
- /// @param[in] mainloop
- /// The mainloop instance with which the process can register
- /// callbacks. Must outlive the NativeProcessProtocol
- /// instance.
- ///
- /// @param[out] process_sp
- /// On successful return from the method, this parameter
- /// contains the shared pointer to the
- /// NativeProcessProtocol that can be used to manipulate
- /// the native process.
- ///
- /// @return
- /// An error object indicating if the operation succeeded,
- /// and if not, what error occurred.
- //------------------------------------------------------------------
- static Status Attach(lldb::pid_t pid, NativeDelegate &native_delegate,
- MainLoop &mainloop, NativeProcessProtocolSP &process_sp);
+ //------------------------------------------------------------------
+ /// Attach to an existing process.
+ ///
+ /// @param[in] pid
+ /// pid of the process locatable
+ ///
+ /// @param[in] native_delegate
+ /// The delegate that will receive messages regarding the
+ /// inferior. Must outlive the NativeProcessProtocol
+ /// instance.
+ ///
+ /// @param[in] mainloop
+ /// The mainloop instance with which the process can register
+ /// callbacks. Must outlive the NativeProcessProtocol
+ /// instance.
+ ///
+ /// @return
+ /// A NativeProcessProtocol shared pointer if the operation succeeded or
+ /// an error object if it failed.
+ //------------------------------------------------------------------
+ virtual llvm::Expected<NativeProcessProtocolSP>
+ Attach(lldb::pid_t pid, NativeDelegate &native_delegate,
+ MainLoop &mainloop) const = 0;
+ };
//------------------------------------------------------------------
/// StartTracing API for starting a tracing instance with the
@@ -413,10 +403,10 @@ class NativeProcessProtocol (public)
lldb::pid_t m_pid;
std::vector<NativeThreadProtocolSP> m_threads;
- lldb::tid_t m_current_thread_id;
+ lldb::tid_t m_current_thread_id = LLDB_INVALID_THREAD_ID;
mutable std::recursive_mutex m_threads_mutex;
- lldb::StateType m_state;
+ lldb::StateType m_state = lldb::eStateInvalid;
mutable std::recursive_mutex m_state_mutex;
llvm::Optional<WaitStatus> m_exit_status;
@@ -427,7 +417,7 @@ class NativeProcessProtocol (public)
NativeWatchpointList m_watchpoint_list;
HardwareBreakpointMap m_hw_breakpoints_map;
int m_terminal_fd;
- uint32_t m_stop_id;
+ uint32_t m_stop_id = 0;
// Set of signal numbers that LLDB directly injects back to inferior
// without stopping it.
@@ -438,7 +428,8 @@ class NativeProcessProtocol (public)
// then the process should be attached to. When attaching to a process
// lldb_private::Host calls should be used to locate the process to attach to,
// and then this function should be called.
- NativeProcessProtocol(lldb::pid_t pid);
+ NativeProcessProtocol(lldb::pid_t pid, int terminal_fd,
+ NativeDelegate &delegate);
// -----------------------------------------------------------
// Internal interface for state handling
Modified: vendor/lldb/dist/lit/lit.cfg
==============================================================================
--- vendor/lldb/dist/lit/lit.cfg Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/lit/lit.cfg Thu Jul 13 19:26:17 2017 (r320967)
@@ -95,8 +95,8 @@ if config.test_exec_root is None:
lit_config.fatal('No site specific configuration available!')
# Get the source and object roots.
- llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip()
- llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip()
+ llvm_src_root = subprocess.check_output(['llvm-config', '--src-root']).strip()
+ llvm_obj_root = subprocess.check_output(['llvm-config', '--obj-root']).strip()
lldb_src_root = os.path.join(llvm_src_root, "tools", "lldb")
lldb_obj_root = os.path.join(llvm_obj_root, "tools", "lldb")
@@ -132,7 +132,7 @@ if not os.path.exists(config.cxx):
if platform.system() in ['Darwin']:
try:
- out = lit.util.capture(['xcrun', '--show-sdk-path']).strip()
+ out = subprocess.check_output(['xcrun', '--show-sdk-path']).strip()
res = 0
except OSError:
res = -1
Modified: vendor/lldb/dist/lldb.xcodeproj/project.pbxproj
==============================================================================
--- vendor/lldb/dist/lldb.xcodeproj/project.pbxproj Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/lldb.xcodeproj/project.pbxproj Thu Jul 13 19:26:17 2017 (r320967)
@@ -868,6 +868,8 @@
966C6B7C18E6A56A0093F5EC /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 966C6B7818E6A56A0093F5EC /* libz.dylib */; };
9694FA711B32AA64005EBB16 /* ABISysV_mips.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9694FA6F1B32AA64005EBB16 /* ABISysV_mips.cpp */; };
9A0FDEA71E8EF5110086B2F5 /* RegisterContextLinux_mips.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A0FDE971E8EF5010086B2F5 /* RegisterContextLinux_mips.cpp */; };
+ 9A1542F91F0EE48600DEA1D8 /* MockTildeExpressionResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1542F51F0EE44000DEA1D8 /* MockTildeExpressionResolver.cpp */; };
+ 9A1542FA1F0EE48600DEA1D8 /* TestUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1542F71F0EE44000DEA1D8 /* TestUtilities.cpp */; };
9A19A6AF1163BBB200E0D453 /* SBValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A19A6A51163BB7E00E0D453 /* SBValue.h */; settings = {ATTRIBUTES = (Public, ); }; };
9A19A6B01163BBB300E0D453 /* SBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A19A6AD1163BB9800E0D453 /* SBValue.cpp */; };
9A1E595C1EB2B141002206A5 /* SBTrace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1E59521EB2B0B9002206A5 /* SBTrace.cpp */; };
@@ -2815,6 +2817,11 @@
9A0FDE991E8EF5010086B2F5 /* RegisterInfos_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_arm.h; path = Utility/RegisterInfos_arm.h; sourceTree = "<group>"; };
9A0FDE9A1E8EF5010086B2F5 /* RegisterInfos_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_arm64.h; path = Utility/RegisterInfos_arm64.h; sourceTree = "<group>"; };
9A0FDE9B1E8EF5010086B2F5 /* RegisterInfos_mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_mips.h; path = Utility/RegisterInfos_mips.h; sourceTree = "<group>"; };
+ 9A1542F41F0EE44000DEA1D8 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
+ 9A1542F51F0EE44000DEA1D8 /* MockTildeExpressionResolver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MockTildeExpressionResolver.cpp; sourceTree = "<group>"; };
+ 9A1542F61F0EE44000DEA1D8 /* MockTildeExpressionResolver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MockTildeExpressionResolver.h; sourceTree = "<group>"; };
+ 9A1542F71F0EE44000DEA1D8 /* TestUtilities.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TestUtilities.cpp; sourceTree = "<group>"; };
+ 9A1542F81F0EE44000DEA1D8 /* TestUtilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestUtilities.h; sourceTree = "<group>"; };
9A19A6A51163BB7E00E0D453 /* SBValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBValue.h; path = include/lldb/API/SBValue.h; sourceTree = "<group>"; };
9A19A6AD1163BB9800E0D453 /* SBValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBValue.cpp; path = source/API/SBValue.cpp; sourceTree = "<group>"; };
9A1E59521EB2B0B9002206A5 /* SBTrace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTrace.cpp; path = source/API/SBTrace.cpp; sourceTree = "<group>"; };
@@ -3305,6 +3312,7 @@
2321F9421BDD343A00BA9A93 /* Utility */ = {
isa = PBXGroup;
children = (
+ 9A1542F31F0EE44000DEA1D8 /* Helpers */,
2321F9431BDD346100BA9A93 /* CMakeLists.txt */,
23CB15041D66CD9200EDDDE1 /* Inputs */,
2321F9441BDD346100BA9A93 /* StringExtractorTest.cpp */,
@@ -6216,6 +6224,18 @@
name = "SysV-mips";
sourceTree = "<group>";
};
+ 9A1542F31F0EE44000DEA1D8 /* Helpers */ = {
+ isa = PBXGroup;
+ children = (
+ 9A1542F41F0EE44000DEA1D8 /* CMakeLists.txt */,
+ 9A1542F51F0EE44000DEA1D8 /* MockTildeExpressionResolver.cpp */,
+ 9A1542F61F0EE44000DEA1D8 /* MockTildeExpressionResolver.h */,
+ 9A1542F71F0EE44000DEA1D8 /* TestUtilities.cpp */,
+ 9A1542F81F0EE44000DEA1D8 /* TestUtilities.h */,
+ );
+ path = Helpers;
+ sourceTree = "<group>";
+ };
AE44FB371BB35A2E0033EB62 /* Go */ = {
isa = PBXGroup;
children = (
@@ -7003,12 +7023,14 @@
23CB15371D66DA9300EDDDE1 /* PythonTestSuite.cpp in Sources */,
23E2E5321D903832006F38BB /* BreakpointIDTest.cpp in Sources */,
23CB15381D66DA9300EDDDE1 /* PythonExceptionStateTests.cpp in Sources */,
+ 9A1542F91F0EE48600DEA1D8 /* MockTildeExpressionResolver.cpp in Sources */,
23CB15391D66DA9300EDDDE1 /* DataExtractorTest.cpp in Sources */,
23CB153A1D66DA9300EDDDE1 /* GDBRemoteClientBaseTest.cpp in Sources */,
23CB153B1D66DA9300EDDDE1 /* SocketTest.cpp in Sources */,
23CB153C1D66DA9300EDDDE1 /* TestArgs.cpp in Sources */,
23CB153D1D66DA9300EDDDE1 /* GDBRemoteCommunicationClientTest.cpp in Sources */,
23CB153E1D66DA9300EDDDE1 /* PythonDataObjectsTests.cpp in Sources */,
+ 9A1542FA1F0EE48600DEA1D8 /* TestUtilities.cpp in Sources */,
23CB153F1D66DA9300EDDDE1 /* SymbolsTest.cpp in Sources */,
AFEC5FD81D94F9380076A480 /* Testx86AssemblyInspectionEngine.cpp in Sources */,
23CB15401D66DA9300EDDDE1 /* TestClangASTContext.cpp in Sources */,
@@ -8256,7 +8278,7 @@
"$(LLVM_SOURCE_DIR)/tools/clang/include",
"$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include",
);
- LLDB_GTESTS_CFLAGS = "-I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
+ LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)";
OTHER_CFLAGS = (
"-fno-rtti",
@@ -8298,7 +8320,7 @@
"$(LLVM_SOURCE_DIR)/tools/clang/include",
"$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include",
);
- LLDB_GTESTS_CFLAGS = "-I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
+ LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)";
OTHER_CFLAGS = (
"-fno-rtti",
@@ -8340,7 +8362,7 @@
"$(LLVM_SOURCE_DIR)/tools/clang/include",
"$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include",
);
- LLDB_GTESTS_CFLAGS = "-I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
+ LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)";
OTHER_CFLAGS = (
"-fno-rtti",
@@ -8382,7 +8404,7 @@
"$(LLVM_SOURCE_DIR)/tools/clang/include",
"$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include",
);
- LLDB_GTESTS_CFLAGS = "-I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
+ LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)";
OTHER_CFLAGS = (
"-fno-rtti",
@@ -8424,7 +8446,7 @@
"$(LLVM_SOURCE_DIR)/tools/clang/include",
"$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include",
);
- LLDB_GTESTS_CFLAGS = "-I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
+ LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)";
OTHER_CFLAGS = (
"-fno-rtti",
@@ -8466,7 +8488,7 @@
"$(LLVM_SOURCE_DIR)/tools/clang/include",
"$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include",
);
- LLDB_GTESTS_CFLAGS = "-I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
+ LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)";
OTHER_CFLAGS = (
"-fno-rtti",
@@ -8508,7 +8530,7 @@
"$(LLVM_SOURCE_DIR)/tools/clang/include",
"$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include",
);
- LLDB_GTESTS_CFLAGS = "-I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
+ LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)";
OTHER_CFLAGS = (
"-fno-rtti",
@@ -8550,7 +8572,7 @@
"$(LLVM_SOURCE_DIR)/tools/clang/include",
"$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include",
);
- LLDB_GTESTS_CFLAGS = "-I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
+ LLDB_GTESTS_CFLAGS = "-I ${SOURCE_ROOT} -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)";
OTHER_CFLAGS = (
"-fno-rtti",
Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py Thu Jul 13 19:26:17 2017 (r320967)
@@ -48,28 +48,8 @@ class ExprCommandThatRestartsTestCase(TestBase):
"Restored the zeroth frame correctly")
def call_function(self):
- exe_name = "a.out"
- exe = os.path.join(os.getcwd(), exe_name)
-
- target = self.dbg.CreateTarget(exe)
- self.assertTrue(target, VALID_TARGET)
- empty = lldb.SBFileSpec()
- breakpoint = target.BreakpointCreateBySourceRegex(
- 'Stop here in main.', self.main_source_spec)
- self.assertTrue(breakpoint.GetNumLocations() > 0, VALID_BREAKPOINT)
-
- # Launch the process, and do not stop at the entry point.
- process = target.LaunchSimple(
- None, None, self.get_process_working_directory())
-
- self.assertTrue(process, PROCESS_IS_VALID)
-
- # Frame #0 should be at our breakpoint.
- threads = lldbutil.get_threads_stopped_at_breakpoint(
- process, breakpoint)
-
- self.assertTrue(len(threads) == 1)
- self.thread = threads[0]
+ (target, process, self.thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
+ 'Stop here in main.', self.main_source_spec)
# Make sure the SIGCHLD behavior is pass/no-stop/no-notify:
return_obj = lldb.SBCommandReturnObject()
Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py Thu Jul 13 19:26:17 2017 (r320967)
@@ -37,28 +37,8 @@ class ExprCommandWithThrowTestCase(TestBase):
def call_function(self):
"""Test calling function that throws."""
- exe_name = "a.out"
- exe = os.path.join(os.getcwd(), exe_name)
-
- target = self.dbg.CreateTarget(exe)
- self.assertTrue(target, VALID_TARGET)
-
- breakpoint = target.BreakpointCreateBySourceRegex(
- 'I am about to throw.', self.main_source_spec)
- self.assertTrue(breakpoint.GetNumLocations() > 0, VALID_BREAKPOINT)
-
- # Launch the process, and do not stop at the entry point.
- process = target.LaunchSimple(
- None, None, self.get_process_working_directory())
-
- self.assertTrue(process, PROCESS_IS_VALID)
-
- # Frame #0 should be at our breakpoint.
- threads = lldbutil.get_threads_stopped_at_breakpoint(
- process, breakpoint)
-
- self.assertTrue(len(threads) == 1)
- self.thread = threads[0]
+ (target, process, self.thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
+ 'I am about to throw.', self.main_source_spec)
options = lldb.SBExpressionOptions()
options.SetUnwindOnError(True)
Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py Thu Jul 13 19:26:17 2017 (r320967)
@@ -17,29 +17,14 @@ class ExprCharTestCase(TestBase):
self.main_source = "main.cpp"
self.main_source_spec = lldb.SBFileSpec(self.main_source)
- self.exe = os.path.join(os.getcwd(), "a.out")
def do_test(self, dictionary=None):
"""These basic expression commands should work as expected."""
self.build(dictionary=dictionary)
- target = self.dbg.CreateTarget(self.exe)
- self.assertTrue(target)
-
- breakpoint = target.BreakpointCreateBySourceRegex(
- '// Break here', self.main_source_spec)
- self.assertTrue(breakpoint)
-
- # Launch the process, and do not stop at the entry point.
- process = target.LaunchSimple(
- None, None, self.get_process_working_directory())
- self.assertTrue(process)
-
- threads = lldbutil.get_threads_stopped_at_breakpoint(
- process, breakpoint)
- self.assertEqual(len(threads), 1)
-
- frame = threads[0].GetFrameAtIndex(0)
+ (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
+ '// Break here', self.main_source_spec)
+ frame = thread.GetFrameAtIndex(0)
value = frame.EvaluateExpression("foo(c)")
self.assertTrue(value.IsValid())
Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/fixits/TestFixIts.py
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/fixits/TestFixIts.py Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/fixits/TestFixIts.py Thu Jul 13 19:26:17 2017 (r320967)
@@ -37,28 +37,8 @@ class ExprCommandWithFixits(TestBase):
def try_expressions(self):
"""Test calling expressions with errors that can be fixed by the FixIts."""
- exe_name = "a.out"
- exe = os.path.join(os.getcwd(), exe_name)
-
- target = self.dbg.CreateTarget(exe)
- self.assertTrue(target, VALID_TARGET)
-
- breakpoint = target.BreakpointCreateBySourceRegex(
- 'Stop here to evaluate expressions', self.main_source_spec)
- self.assertTrue(breakpoint.GetNumLocations() > 0, VALID_BREAKPOINT)
-
- # Launch the process, and do not stop at the entry point.
- process = target.LaunchSimple(
- None, None, self.get_process_working_directory())
-
- self.assertTrue(process, PROCESS_IS_VALID)
-
- # Frame #0 should be at our breakpoint.
- threads = lldbutil.get_threads_stopped_at_breakpoint(
- process, breakpoint)
-
- self.assertTrue(len(threads) == 1)
- self.thread = threads[0]
+ (target, process, self.thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
+ 'Stop here to evaluate expressions', self.main_source_spec)
options = lldb.SBExpressionOptions()
options.SetAutoApplyFixIts(True)
Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py Thu Jul 13 19:26:17 2017 (r320967)
@@ -32,26 +32,9 @@ class Issue11581TestCase(TestBase):
"""valobj.AddressOf() should return correct values."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
-
- target = self.dbg.CreateTarget(exe)
- self.assertTrue(target, VALID_TARGET)
-
- breakpoint = target.BreakpointCreateBySourceRegex(
- 'Set breakpoint here.', lldb.SBFileSpec("main.cpp", False))
-
- process = target.LaunchSimple(
- None, None, self.get_process_working_directory())
- self.assertTrue(process, "Created a process.")
- self.assertTrue(
- process.GetState() == lldb.eStateStopped,
- "Stopped it too.")
-
- thread_list = lldbutil.get_threads_stopped_at_breakpoint(
- process, breakpoint)
- self.assertTrue(len(thread_list) == 1)
- thread = thread_list[0]
-
+ (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
+ 'Set breakpoint here.',
+ lldb.SBFileSpec("main.cpp", False))
self.runCmd("command script import --allow-reload s11588.py")
self.runCmd(
"type synthetic add --python-class s11588.Issue11581SyntheticProvider StgClosure")
Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py Thu Jul 13 19:26:17 2017 (r320967)
@@ -30,32 +30,8 @@ class TestMacros(TestBase):
src_file_spec = lldb.SBFileSpec(src_file)
self.assertTrue(src_file_spec.IsValid(), "Main source file")
- # Get the path of the executable
- cwd = os.getcwd()
- exe_file = "a.out"
- exe_path = os.path.join(cwd, exe_file)
-
- # Load the executable
- target = self.dbg.CreateTarget(exe_path)
- self.assertTrue(target.IsValid(), VALID_TARGET)
-
- # Set breakpoints
- bp1 = target.BreakpointCreateBySourceRegex("Break here", src_file_spec)
- self.assertTrue(
- bp1.IsValid() and bp1.GetNumLocations() >= 1,
- VALID_BREAKPOINT)
-
- # Launch the process
- process = target.LaunchSimple(
- None, None, self.get_process_working_directory())
- self.assertTrue(process.IsValid(), PROCESS_IS_VALID)
-
- # Get the thread of the process
- self.assertTrue(
- process.GetState() == lldb.eStateStopped,
- PROCESS_STOPPED)
- thread = lldbutil.get_stopped_thread(
- process, lldb.eStopReasonBreakpoint)
+ (target, process, thread, bp1) = lldbutil.run_to_source_breakpoint(
+ self, "Break here", src_file_spec)
# Get frame for current thread
frame = thread.GetSelectedFrame()
Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py Thu Jul 13 19:26:17 2017 (r320967)
@@ -37,25 +37,10 @@ class ExprOptionsTestCase(TestBase):
# Set debugger into synchronous mode
self.dbg.SetAsync(False)
- # Create a target by the debugger.
- target = self.dbg.CreateTarget(self.exe)
- self.assertTrue(target, VALID_TARGET)
+ (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
+ self, '// breakpoint_in_main', self.main_source_spec)
- # Set breakpoints inside main.
- breakpoint = target.BreakpointCreateBySourceRegex(
- '// breakpoint_in_main', self.main_source_spec)
- self.assertTrue(breakpoint)
-
- # Now launch the process, and do not stop at entry point.
- process = target.LaunchSimple(
- None, None, self.get_process_working_directory())
- self.assertTrue(process, PROCESS_IS_VALID)
-
- threads = lldbutil.get_threads_stopped_at_breakpoint(
- process, breakpoint)
- self.assertEqual(len(threads), 1)
-
- frame = threads[0].GetFrameAtIndex(0)
+ frame = thread.GetFrameAtIndex(0)
options = lldb.SBExpressionOptions()
# test --language on C++ expression using the SB API's
Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/save_jit_objects/TestSaveJITObjects.py
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/save_jit_objects/TestSaveJITObjects.py Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/save_jit_objects/TestSaveJITObjects.py Thu Jul 13 19:26:17 2017 (r320967)
@@ -31,17 +31,10 @@ class SaveJITObjectsTestCase(TestBase):
src_file = "main.c"
src_file_spec = lldb.SBFileSpec(src_file)
- exe_path = os.path.join(os.getcwd(), "a.out")
- target = self.dbg.CreateTarget(exe_path)
+ (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
+ self, "break", src_file_spec)
- breakpoint = target.BreakpointCreateBySourceRegex(
- "break", src_file_spec)
-
- process = target.LaunchSimple(None, None,
- self.get_process_working_directory())
-
- thread = process.GetSelectedThread()
- frame = thread.GetSelectedFrame()
+ frame = thread.frames[0]
cleanJITFiles()
frame.EvaluateExpression("(void*)malloc(0x1)")
Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py Thu Jul 13 19:26:17 2017 (r320967)
@@ -25,36 +25,14 @@ class ExprCommandWithTimeoutsTestCase(TestBase):
@expectedFlakeyFreeBSD("llvm.org/pr19605")
@expectedFailureAll(
oslist=[
- "windows",
- "macosx"],
+ "windows"],
bugnumber="llvm.org/pr21765")
def test(self):
"""Test calling std::String member function."""
self.build()
- exe_name = "a.out"
- exe = os.path.join(os.getcwd(), exe_name)
-
- target = self.dbg.CreateTarget(exe)
- self.assertTrue(target, VALID_TARGET)
-
- breakpoint = target.BreakpointCreateBySourceRegex(
- 'stop here in main.', self.main_source_spec)
- self.assertTrue(breakpoint, VALID_BREAKPOINT)
- self.runCmd("breakpoint list")
-
- # Launch the process, and do not stop at the entry point.
- process = target.LaunchSimple(
- None, None, self.get_process_working_directory())
-
- self.assertTrue(process, PROCESS_IS_VALID)
-
- # Frame #0 should be on self.step_out_of_malloc.
- threads = lldbutil.get_threads_stopped_at_breakpoint(
- process, breakpoint)
-
- self.assertTrue(len(threads) == 1)
- thread = threads[0]
+ (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
+ self, 'stop here in main.', self.main_source_spec)
# First set the timeout too short, and make sure we fail.
options = lldb.SBExpressionOptions()
Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/Makefile Thu Jul 13 19:26:17 2017 (r320967)
@@ -0,0 +1,6 @@
+LEVEL = ../../../make
+
+OBJC_SOURCES := main.m
+LDFLAGS = $(CFLAGS) -lobjc -framework Foundation -framework AppKit
+
+include $(LEVEL)/Makefile.rules
Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py Thu Jul 13 19:26:17 2017 (r320967)
@@ -0,0 +1,57 @@
+"""
+Tests basic Main Thread Checker support (detecting a main-thread-only violation).
+"""
+
+import os
+import time
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbplatformutil import *
+import json
+
+
+class MTCSimpleTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ @skipUnlessDarwin
+ def test(self):
+ self.mtc_dylib_path = findMainThreadCheckerDylib()
+ if self.mtc_dylib_path == "":
+ self.skipTest("This test requires libMainThreadChecker.dylib.")
+
+ self.build()
+ self.mtc_tests()
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+
+ def mtc_tests(self):
+ # Load the test
+ exe = os.path.join(os.getcwd(), "a.out")
+ self.expect("file " + exe, patterns=["Current executable set to .*a.out"])
+
+ self.runCmd("env DYLD_INSERT_LIBRARIES=%s" % self.mtc_dylib_path)
+ self.runCmd("run")
+
+ process = self.dbg.GetSelectedTarget().process
+ thread = process.GetSelectedThread()
+ frame = thread.GetSelectedFrame()
+
+ self.expect("thread info", substrs=['stop reason = -[NSView superview] must be used from main thread only'])
+
+ self.expect(
+ "thread info -s",
+ substrs=["instrumentation_class", "api_name", "class_name", "selector", "description"])
+ self.assertEqual(thread.GetStopReason(), lldb.eStopReasonInstrumentation)
+ output_lines = self.res.GetOutput().split('\n')
+ json_line = '\n'.join(output_lines[2:])
+ data = json.loads(json_line)
+ self.assertEqual(data["instrumentation_class"], "MainThreadChecker")
+ self.assertEqual(data["api_name"], "-[NSView superview]")
+ self.assertEqual(data["class_name"], "NSView")
+ self.assertEqual(data["selector"], "superview")
+ self.assertEqual(data["description"], "-[NSView superview] must be used from main thread only")
Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/main.m
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/mtc/simple/main.m Thu Jul 13 19:26:17 2017 (r320967)
@@ -0,0 +1,15 @@
+#import <Foundation/Foundation.h>
+#import <AppKit/AppKit.h>
+
+int main() {
+ NSView *view = [[NSView alloc] init];
+ dispatch_group_t g = dispatch_group_create();
+ dispatch_group_enter(g);
+ [NSThread detachNewThreadWithBlock:^{
+ @autoreleasepool {
+ [view superview];
+ }
+ dispatch_group_leave(g);
+ }];
+ dispatch_group_wait(g, DISPATCH_TIME_FOREVER);
+}
Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py Thu Jul 13 19:26:17 2017 (r320967)
@@ -31,8 +31,6 @@ class ReturnValueTestCase(TestBase):
"<=",
"3.6"],
archs=["i386"])
- @expectedFailureAll(compiler="clang", compiler_version=["<=", "5.0.300080"],
- triple='.*-android', archs=["i386"])
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
@add_test_categories(['pyapi'])
def test_with_python(self):
Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py Thu Jul 13 19:26:17 2017 (r320967)
@@ -16,6 +16,7 @@ from lldbsuite.test import lldbutil
class RaiseTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
def test_sigstop(self):
self.build()
@@ -28,6 +29,10 @@ class RaiseTestCase(TestBase):
def test_sigsigrtmin(self):
self.build()
self.signal_test('SIGRTMIN', True)
+
+ def test_sigtrap(self):
+ self.build()
+ self.signal_test('SIGTRAP', True)
def launch(self, target, signal):
# launch the process, do not stop at entry point.
Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/signal/raise/main.c
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/signal/raise/main.c Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/signal/raise/main.c Thu Jul 13 19:26:17 2017 (r320967)
@@ -10,6 +10,11 @@ void handler(int signo)
int main (int argc, char *argv[])
{
+ if (signal(SIGTRAP, handler) == SIG_ERR)
+ {
+ perror("signal(SIGTRAP)");
+ return 1;
+ }
#ifndef __APPLE__
// Real time signals not supported on apple platforms.
if (signal(SIGRTMIN, handler) == SIG_ERR)
@@ -27,6 +32,8 @@ int main (int argc, char *argv[])
if (strcmp(argv[1], "SIGSTOP") == 0)
raise(SIGSTOP);
+ else if (strcmp(argv[1], "SIGTRAP") == 0)
+ raise(SIGTRAP);
#ifndef __APPLE__
else if (strcmp(argv[1], "SIGRTMIN") == 0)
raise(SIGRTMIN);
Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/Makefile Thu Jul 13 19:26:17 2017 (r320967)
@@ -0,0 +1,6 @@
+LEVEL = ../../../make
+
+C_SOURCES := main.c
+CFLAGS_EXTRAS := -fsanitize=undefined -g
+
+include $(LEVEL)/Makefile.rules
Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/TestUbsanUserExpression.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/TestUbsanUserExpression.py Thu Jul 13 19:26:17 2017 (r320967)
@@ -0,0 +1,49 @@
+"""
+Test that hitting a UBSan issue while running user expression doesn't break the evaluation.
+"""
+
+import os
+import time
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+import lldbsuite.test.lldbutil as lldbutil
+import json
+
+
+class UbsanUserExpressionTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ @skipUnlessUndefinedBehaviorSanitizer
+ def test(self):
+ self.build()
+ self.ubsan_tests()
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ self.line_breakpoint = line_number('main.c', '// breakpoint line')
+
+ def ubsan_tests(self):
+ # Load the test
+ exe = os.path.join(os.getcwd(), "a.out")
+ self.expect(
+ "file " + exe,
+ patterns=["Current executable set to .*a.out"])
+
+ self.runCmd("breakpoint set -f main.c -l %d" % self.line_breakpoint)
+
+ self.runCmd("run")
+
+ process = self.dbg.GetSelectedTarget().process
+ thread = process.GetSelectedThread()
+ frame = thread.GetSelectedFrame()
+
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs=['stopped', 'stop reason = breakpoint'])
+
+ self.expect("p foo()", substrs=["(int) $0 = 42"])
+
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs=['stopped', 'stop reason = breakpoint'])
Added: vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/main.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/main.c Thu Jul 13 19:26:17 2017 (r320967)
@@ -0,0 +1,9 @@
+int foo() {
+ int data[4];
+ int x = *(int *)(((char *)&data[0]) + 2);
+ return 42;
+}
+
+int main() {
+ return 0; // breakpoint line
+}
Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py Thu Jul 13 19:26:17 2017 (r320967)
@@ -20,6 +20,7 @@ class TestGoASTContext(TestBase):
@skipIfRemote # Not remote test suit ready
@no_debug_info_test
@skipUnlessGoInstalled
+ @expectedFailureAll(bugnumber="llvm.org/pr33643")
def test_with_dsym_and_python_api(self):
"""Test GoASTContext dwarf parsing."""
self.buildGo()
Modified: vendor/lldb/dist/packages/Python/lldbsuite/test/lldbplatformutil.py
==============================================================================
--- vendor/lldb/dist/packages/Python/lldbsuite/test/lldbplatformutil.py Thu Jul 13 19:26:13 2017 (r320966)
+++ vendor/lldb/dist/packages/Python/lldbsuite/test/lldbplatformutil.py Thu Jul 13 19:26:17 2017 (r320967)
@@ -8,6 +8,7 @@ import itertools
import re
import subprocess
import sys
+import os
# Third-party modules
import six
@@ -138,6 +139,19 @@ def getPlatform():
def platformIsDarwin():
"""Returns true if the OS triple for the selected platform is any valid apple OS"""
return getPlatform() in getDarwinOSTriples()
+
+
+def findMainThreadCheckerDylib():
+ if not platformIsDarwin():
+ return ""
+
+ with os.popen('xcode-select -p') as output:
+ xcode_developer_path = output.read().strip()
+ mtc_dylib_path = '%s/usr/lib/libMainThreadChecker.dylib' % xcode_developer_path
+ if os.path.isfile(mtc_dylib_path):
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-all
mailing list