From 14f1b3e8826ce43b978db93a62d1166055db5394 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 2 Jan 2017 19:26:05 +0000 Subject: Vendor import of lldb trunk r290819: https://llvm.org/svn/llvm-project/lldb/trunk@290819 --- .../test/api/multithreaded/driver.cpp.template | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template (limited to 'packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template') diff --git a/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template b/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template new file mode 100644 index 0000000000000..f4bd021632cec --- /dev/null +++ b/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template @@ -0,0 +1,48 @@ + +/// LLDB C API Test Driver + +#include +#include +#include +#include +#include +#if !defined(_MSC_VER) + #include +#endif + +%include_SB_APIs% + +#include "common.h" + +using namespace std; +using namespace lldb; + +void test(SBDebugger &dbg, std::vector args); + +int main(int argc, char** argv) { + +// Ignore SIGPIPE. The lldb driver does this as well, +// because we seem to get spurious SIGPIPES on some +// Unixen that take the driver down. +#if !defined(_MSC_VER) + signal(SIGPIPE, SIG_IGN); +#endif + int code = 0; + + SBDebugger::Initialize(); + SBDebugger dbg = SBDebugger::Create(); + + try { + if (!dbg.IsValid()) + throw Exception("invalid debugger"); + vector args(argv + 1, argv + argc); + + test(dbg, args); + } catch (Exception &e) { + cout << "ERROR: " << e.what() << endl; + code = 1; + } + + SBDebugger::Destroy(dbg); + return code; +} -- cgit v1.2.3