<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Looks like this broke the Darwin bots again:</div><div class=""><br class=""></div><a href="http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/40578/" class="">http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/40578/</a><div class=""><br class=""></div><div class="">-- adrian<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 16, 2017, at 10:26 AM, Zachary Turner via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Author: zturner<br class="">Date: Thu Nov 16 10:26:20 2017<br class="">New Revision: 318435<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=318435&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=318435&view=rev</a><br class="">Log:<br class="">Resubmit "Refactor debuginfo-tests"<br class=""><br class="">This was reverted due to some failures on specific darwin buildbots,<br class="">the issue being that the new lit configuration was not setting the<br class="">SDKROOT environment variable. We've tested a fix locally and confirmed<br class="">that it works, so this patch resubmits everything with the fix<br class="">applied.<br class=""><br class="">Added:<br class=""> debuginfo-tests/trunk/CMakeLists.txt<br class=""> debuginfo-tests/trunk/lit.cfg.py<br class=""> debuginfo-tests/trunk/lit.site.cfg.py.in<br class=""> debuginfo-tests/trunk/tests/<br class=""> debuginfo-tests/trunk/tests/aggregate-indirect-arg.cpp<br class=""> debuginfo-tests/trunk/tests/asan-blocks.c<br class=""> debuginfo-tests/trunk/tests/asan.c<br class=""> debuginfo-tests/trunk/tests/block_var.m<br class=""> debuginfo-tests/trunk/tests/blocks.m<br class=""> debuginfo-tests/trunk/tests/ctor.cpp<br class=""> debuginfo-tests/trunk/tests/dbg-arg.c<br class=""> debuginfo-tests/trunk/tests/foreach.m<br class=""> debuginfo-tests/trunk/tests/forward-declare-class.cpp<br class=""> debuginfo-tests/trunk/tests/lit.local.cfg<br class=""> debuginfo-tests/trunk/tests/llgdb.py<br class=""> debuginfo-tests/trunk/tests/nested-struct.cpp<br class=""> debuginfo-tests/trunk/tests/nrvo-string.cpp<br class=""> debuginfo-tests/trunk/tests/safestack.c<br class=""> debuginfo-tests/trunk/tests/sret.cpp<br class=""> debuginfo-tests/trunk/tests/stack-var.c<br class=""> debuginfo-tests/trunk/tests/static-member-2.cpp<br class=""> debuginfo-tests/trunk/tests/static-member.cpp<br class=""> debuginfo-tests/trunk/tests/vla.c<br class="">Removed:<br class=""> debuginfo-tests/trunk/aggregate-indirect-arg.cpp<br class=""> debuginfo-tests/trunk/asan-blocks.c<br class=""> debuginfo-tests/trunk/asan.c<br class=""> debuginfo-tests/trunk/block_var.m<br class=""> debuginfo-tests/trunk/blocks.m<br class=""> debuginfo-tests/trunk/ctor.cpp<br class=""> debuginfo-tests/trunk/dbg-arg.c<br class=""> debuginfo-tests/trunk/foreach.m<br class=""> debuginfo-tests/trunk/forward-declare-class.cpp<br class=""> debuginfo-tests/trunk/lit.local.cfg<br class=""> debuginfo-tests/trunk/llgdb.py<br class=""> debuginfo-tests/trunk/nested-struct.cpp<br class=""> debuginfo-tests/trunk/nrvo-string.cpp<br class=""> debuginfo-tests/trunk/safestack.c<br class=""> debuginfo-tests/trunk/sret.cpp<br class=""> debuginfo-tests/trunk/stack-var.c<br class=""> debuginfo-tests/trunk/static-member-2.cpp<br class=""> debuginfo-tests/trunk/static-member.cpp<br class=""> debuginfo-tests/trunk/vla.c<br class=""><br class="">Added: debuginfo-tests/trunk/CMakeLists.txt<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/CMakeLists.txt?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/CMakeLists.txt?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/CMakeLists.txt (added)<br class="">+++ debuginfo-tests/trunk/CMakeLists.txt Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,36 @@<br class="">+# Debug Info tests. These tests invoke clang to generate programs with<br class="">+# various types of debug info, and then run those programs under a debugger<br class="">+# such as GDB or LLDB to verify the results.<br class="">+<br class="">+set(DEBUGINFO_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})<br class="">+set(DEBUGINFO_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})<br class="">+<br class="">+set(DEBUGINFO_TEST_DEPS<br class="">+ clang<br class="">+ llvm-config<br class="">+ FileCheck<br class="">+ count<br class="">+ not<br class="">+ )<br class="">+<br class="">+get_target_property(CLANG_SOURCE_DIR clang SOURCE_DIR)<br class="">+<br class="">+if (TARGET lld)<br class="">+ set(DEBUGINFO_TESTS_HAS_LLD 1)<br class="">+ list(APPEND DEBUGINFO_TEST_DEPS lld)<br class="">+ get_target_property(LLD_SOURCE_DIR lld SOURCE_DIR)<br class="">+endif()<br class="">+<br class="">+configure_lit_site_cfg(<br class="">+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in<br class="">+ ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py<br class="">+ MAIN_CONFIG<br class="">+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py<br class="">+ )<br class="">+<br class="">+add_lit_testsuite(check-debuginfo "Running debug info integration tests"<br class="">+ ${CMAKE_CURRENT_BINARY_DIR}<br class="">+ DEPENDS ${DEBUGINFO_TEST_DEPS}<br class="">+ )<br class="">+<br class="">+set_target_properties(check-debuginfo PROPERTIES FOLDER "Debug info tests")<br class="">\ No newline at end of file<br class=""><br class="">Removed: debuginfo-tests/trunk/aggregate-indirect-arg.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/aggregate-indirect-arg.cpp?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/aggregate-indirect-arg.cpp?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/aggregate-indirect-arg.cpp (original)<br class="">+++ debuginfo-tests/trunk/aggregate-indirect-arg.cpp (removed)<br class="">@@ -1,32 +0,0 @@<br class="">-// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">-// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out<br class="">-// RUN: %test_debuginfo %s %t.out <br class="">-// Radar 8945514<br class="">-// DEBUGGER: break 22<br class="">-// DEBUGGER: r<br class="">-// DEBUGGER: p v<br class="">-// CHECK: ${{[0-9]+}} =<br class="">-// CHECK: Data ={{.*}} 0x0{{(0*)}}<br class="">-// CHECK: Kind = 2142<br class="">-<br class="">-class SVal {<br class="">-public:<br class="">- ~SVal() {}<br class="">- const void* Data;<br class="">- unsigned Kind;<br class="">-};<br class="">-<br class="">-void bar(SVal &v) {}<br class="">-class A {<br class="">-public:<br class="">- void foo(SVal v) { bar(v); }<br class="">-};<br class="">-<br class="">-int main() {<br class="">- SVal v;<br class="">- v.Data = 0;<br class="">- v.Kind = 2142;<br class="">- A a;<br class="">- a.foo(v);<br class="">- return 0;<br class="">-}<br class=""><br class="">Removed: debuginfo-tests/trunk/asan-blocks.c<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/asan-blocks.c?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/asan-blocks.c?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/asan-blocks.c (original)<br class="">+++ debuginfo-tests/trunk/asan-blocks.c (removed)<br class="">@@ -1,41 +0,0 @@<br class="">-// RUN: %clang -fblocks %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=address<br class="">-// RUN: %test_debuginfo %s %t.out<br class="">-// FIXME: Remove system-darwin when we build BlocksRuntime everywhere.<br class="">-// REQUIRES: not_asan, system-darwin<br class="">-// Zorg configures the ASAN stage2 bots to not build the asan<br class="">-// compiler-rt. Only run this test on non-asanified configurations.<br class="">-void b();<br class="">-struct S {<br class="">- int a[8];<br class="">-};<br class="">-<br class="">-int f(struct S s, unsigned i) {<br class="">- // DEBUGGER: break 17<br class="">- // DEBUGGER: r<br class="">- // DEBUGGER: p s<br class="">- // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)<br class="">- return s.a[i];<br class="">-}<br class="">-<br class="">-int main(int argc, const char **argv) {<br class="">- struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}};<br class="">- if (f(s, 4) == 4) {<br class="">- // DEBUGGER: break 27<br class="">- // DEBUGGER: c<br class="">- // DEBUGGER: p s<br class="">- // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)<br class="">- b();<br class="">- }<br class="">- return 0;<br class="">-}<br class="">-<br class="">-void c() {}<br class="">-<br class="">-void b() {<br class="">- // DEBUGGER: break 40<br class="">- // DEBUGGER: c<br class="">- // DEBUGGER: p x<br class="">- // CHECK: 42<br class="">- __block int x = 42;<br class="">- c();<br class="">-}<br class=""><br class="">Removed: debuginfo-tests/trunk/asan.c<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/asan.c?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/asan.c?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/asan.c (original)<br class="">+++ debuginfo-tests/trunk/asan.c (removed)<br class="">@@ -1,31 +0,0 @@<br class="">-// RUN: %clang -fblocks %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=address<br class="">-// RUN: %test_debuginfo %s %t.out<br class="">-// REQUIRES: not_asan<br class="">-// Zorg configures the ASAN stage2 bots to not build the asan<br class="">-// compiler-rt. Only run this test on non-asanified configurations.<br class="">-//<br class="">-<br class="">-struct S {<br class="">- int a[8];<br class="">-};<br class="">-<br class="">-int f(struct S s, unsigned i) {<br class="">- // DEBUGGER: break 14<br class="">- return s.a[i];<br class="">-}<br class="">-<br class="">-int main(int argc, const char **argv) {<br class="">- struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}};<br class="">- if (f(s, 4) == 4)<br class="">- return f(s, 0);<br class="">- return 0;<br class="">-}<br class="">-<br class="">-// DEBUGGER: r<br class="">-// DEBUGGER: p s<br class="">-// CHECK: a =<br class="">-// DEBUGGER: p s.a[0]<br class="">-// CHECK: = 0<br class="">-// DEBUGGER: p s.a[1]<br class="">-// CHECK: = 1<br class="">-// DEBUGGER: p s.a[7]<br class=""><br class="">Removed: debuginfo-tests/trunk/block_var.m<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/block_var.m?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/block_var.m?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/block_var.m (original)<br class="">+++ debuginfo-tests/trunk/block_var.m (removed)<br class="">@@ -1,32 +0,0 @@<br class="">-// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">-// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation<br class="">-// RUN: %test_debuginfo %s %t.out <br class="">-<br class="">-// REQUIRES: system-darwin<br class="">-<br class="">-// DEBUGGER: break 24<br class="">-// DEBUGGER: r<br class="">-// DEBUGGER: p result<br class="">-// CHECK: ${{[0-9]}} = 42<br class="">-<br class="">-void doBlock(void (^block)(void))<br class="">-{<br class="">- block();<br class="">-}<br class="">-<br class="">-int I(int n)<br class="">-{<br class="">- __block int result;<br class="">- int i = 2;<br class="">- doBlock(^{<br class="">- result = n;<br class="">- });<br class="">- return result + i; /* Check value of 'result' */<br class="">-}<br class="">-<br class="">-<br class="">-int main (int argc, const char * argv[]) {<br class="">- return I(42);<br class="">-}<br class="">-<br class="">-<br class=""><br class="">Removed: debuginfo-tests/trunk/blocks.m<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/blocks.m?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/blocks.m?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/blocks.m (original)<br class="">+++ debuginfo-tests/trunk/blocks.m (removed)<br class="">@@ -1,43 +0,0 @@<br class="">-// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">-// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation<br class="">-// RUN: %test_debuginfo %s %t.out <br class="">-<br class="">-// REQUIRES: system-darwin<br class="">-// Radar 9279956<br class="">-<br class="">-// DEBUGGER: break 31<br class="">-// DEBUGGER: r<br class="">-// DEBUGGER: p m2<br class="">-// CHECK: ${{[0-9]}} = 1<br class="">-// DEBUGGER: p dbTransaction<br class="">-// CHECK: ${{[0-9]}} = 0<br class="">-// DEBUGGER: p master<br class="">-// CHECK: ${{[0-9]}} = 0<br class="">-<br class="">-#include <Cocoa/Cocoa.h><br class="">-<br class="">-extern void foo(void(^)(void));<br class="">-<br class="">-@interface A:NSObject @end<br class="">-@implementation A<br class="">-- (void) helper {<br class="">- int master = 0;<br class="">- __block int m2 = 0;<br class="">- __block int dbTransaction = 0;<br class="">- int (^x)(void) = ^(void) { (void) self; <br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>(void) master; <br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>(void) dbTransaction; <br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>m2++;<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>return m2;<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>};<br class="">- master = x();<br class="">-}<br class="">-@end<br class="">-<br class="">-void foo(void(^x)(void)) {}<br class="">-<br class="">-int main() {<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>A *a = [A alloc];<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>[a helper];<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>return 0;<br class="">-}<br class=""><br class="">Removed: debuginfo-tests/trunk/ctor.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/ctor.cpp?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/ctor.cpp?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/ctor.cpp (original)<br class="">+++ debuginfo-tests/trunk/ctor.cpp (removed)<br class="">@@ -1,25 +0,0 @@<br class="">-// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">-// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out<br class="">-// RUN: %test_debuginfo %s %t.out <br class="">-<br class="">-<br class="">-// DEBUGGER: break 14<br class="">-// DEBUGGER: r<br class="">-// DEBUGGER: p *this<br class="">-// CHECK-NEXT-NOT: Cannot access memory at address <br class="">-<br class="">-class A {<br class="">-public:<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>A() : zero(0), data(42)<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>{<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>}<br class="">-private:<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>int zero;<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>int data;<br class="">-};<br class="">-<br class="">-int main() {<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>A a;<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>return 0;<br class="">-}<br class="">-<br class=""><br class="">Removed: debuginfo-tests/trunk/dbg-arg.c<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/dbg-arg.c?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/dbg-arg.c?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/dbg-arg.c (original)<br class="">+++ debuginfo-tests/trunk/dbg-arg.c (removed)<br class="">@@ -1,46 +0,0 @@<br class="">-// This test case checks debug info during register moves for an argument.<br class="">-// RUN: %clang %target_itanium_abi_host_triple -m64 -mllvm -fast-isel=false %s -c -o %t.o -g<br class="">-// RUN: %clang %target_itanium_abi_host_triple -m64 %t.o -o %t.out<br class="">-// RUN: %test_debuginfo %s %t.out<br class="">-//<br class="">-// DEBUGGER: break 26<br class="">-// DEBUGGER: r<br class="">-// DEBUGGER: print mutex<br class="">-// CHECK: ={{.* 0x[0-9A-Fa-f]+}}<br class="">-//<br class="">-// Radar 8412415<br class="">-<br class="">-struct _mtx<br class="">-{<br class="">- long unsigned int ptr;<br class="">- int waiters;<br class="">- struct {<br class="">- int tag;<br class="">- int pad;<br class="">- } mtxi;<br class="">-};<br class="">-<br class="">-<br class="">-int foobar(struct _mtx *mutex) {<br class="">- int r = 1;<br class="">- int l = 0;<br class="">- int j = 0;<br class="">- do {<br class="">- if (mutex->waiters) {<br class="">- r = 2;<br class="">- }<br class="">- j = bar(r, l);<br class="">- ++l;<br class="">- } while (l < j);<br class="">- return r + j;<br class="">-}<br class="">-<br class="">-int bar(int i, int j) {<br class="">- return i + j;<br class="">-}<br class="">-<br class="">-int main() {<br class="">- struct _mtx m;<br class="">- m.waiters = 0;<br class="">- return foobar(&m);<br class="">-}<br class=""><br class="">Removed: debuginfo-tests/trunk/foreach.m<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/foreach.m?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/foreach.m?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/foreach.m (original)<br class="">+++ debuginfo-tests/trunk/foreach.m (removed)<br class="">@@ -1,31 +0,0 @@<br class="">-// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">-// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation<br class="">-// RUN: %test_debuginfo %s %t.out <br class="">-//<br class="">-// REQUIRES: system-darwin<br class="">-// Radar 8757124<br class="">-<br class="">-// DEBUGGER: break 25<br class="">-// DEBUGGER: r<br class="">-// DEBUGGER: po thing<br class="">-// CHECK: aaa<br class="">-<br class="">-#import <Foundation/Foundation.h><br class="">-<br class="">-int main (int argc, const char * argv[]) {<br class="">-<br class="">- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];<br class="">- NSArray *things = [NSArray arrayWithObjects:@"one", @"two", @"three" , nil];<br class="">- for (NSString *thing in things) {<br class="">- NSLog (@"%@", thing);<br class="">- }<br class="">- <br class="">- things = [NSArray arrayWithObjects:@"aaa", @"bbb", @"ccc" , nil];<br class="">- for (NSString *thing in things) {<br class="">- NSLog (@"%@", thing);<br class="">- }<br class="">- [pool release];<br class="">- return 0;<br class="">-}<br class="">-<br class="">-<br class=""><br class="">Removed: debuginfo-tests/trunk/forward-declare-class.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/forward-declare-class.cpp?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/forward-declare-class.cpp?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/forward-declare-class.cpp (original)<br class="">+++ debuginfo-tests/trunk/forward-declare-class.cpp (removed)<br class="">@@ -1,27 +0,0 @@<br class="">-// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">-// RUN: %test_debuginfo %s %t.o<br class="">-// Radar 9168773<br class="">-<br class="">-// DEBUGGER: ptype A<br class="">-// Work around a gdb bug where it believes that a class is a<br class="">-// struct if there aren't any methods - even though it's tagged<br class="">-// as a class.<br class="">-// CHECK: type = {{struct|class}} A {<br class="">-// CHECK-NEXT: {{(public:){0,1}}}<br class="">-// CHECK-NEXT: int MyData;<br class="">-// CHECK-NEXT: }<br class="">-class A;<br class="">-class B {<br class="">-public:<br class="">- void foo(const A *p);<br class="">-};<br class="">-<br class="">-B iEntry;<br class="">-<br class="">-class A {<br class="">-public:<br class="">- int MyData;<br class="">-};<br class="">-<br class="">-A irp;<br class="">-<br class=""><br class="">Added: debuginfo-tests/trunk/lit.cfg.py<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/lit.cfg.py?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/lit.cfg.py?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/lit.cfg.py (added)<br class="">+++ debuginfo-tests/trunk/lit.cfg.py Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,59 @@<br class="">+# -*- Python -*-<br class="">+<br class="">+import os<br class="">+import platform<br class="">+import re<br class="">+import subprocess<br class="">+import tempfile<br class="">+<br class="">+import lit.formats<br class="">+import lit.util<br class="">+<br class="">+from lit.llvm import llvm_config<br class="">+from lit.llvm.subst import ToolSubst<br class="">+from lit.llvm.subst import FindTool<br class="">+<br class="">+# Configuration file for the 'lit' test runner.<br class="">+<br class="">+# name: The name of this test suite.<br class="">+config.name = 'debuginfo-tests'<br class="">+<br class="">+# testFormat: The test format to use to interpret tests.<br class="">+#<br class="">+# For now we require '&&' between commands, until they get globally killed and<br class="">+# the test runner updated.<br class="">+config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)<br class="">+<br class="">+# suffixes: A list of file extensions to treat as test files.<br class="">+config.suffixes = ['.c', '.cpp', '.m']<br class="">+<br class="">+# excludes: A list of directories to exclude from the testsuite. The 'Inputs'<br class="">+# subdirectories contain auxiliary inputs for various tests in their parent<br class="">+# directories.<br class="">+config.excludes = ['Inputs']<br class="">+<br class="">+# test_source_root: The root path where tests are located.<br class="">+config.test_source_root = os.path.join(config.debuginfo_tests_src_root, 'tests')<br class="">+<br class="">+# test_exec_root: The root path where tests should be run.<br class="">+config.test_exec_root = config.debuginfo_tests_obj_root<br class="">+<br class="">+llvm_config.use_default_substitutions()<br class="">+<br class="">+llvm_config.use_clang()<br class="">+<br class="">+if config.llvm_use_sanitizer:<br class="">+ # Propagate path to symbolizer for ASan/MSan.<br class="">+ llvm_config.with_system_environment(<br class="">+ ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'])<br class="">+<br class="">+tool_dirs = [config.llvm_tools_dir]<br class="">+<br class="">+tools = [<br class="">+ ToolSubst('%test_debuginfo', command=os.path.join(<br class="">+ config.llvm_src_root, 'utils', 'test_debuginfo.pl')),<br class="">+]<br class="">+<br class="">+llvm_config.add_tool_substitutions(tools, tool_dirs)<br class="">+<br class="">+lit.util.usePlatformSdkOnDarwin(config, lit_config)<br class=""><br class="">Removed: debuginfo-tests/trunk/lit.local.cfg<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/lit.local.cfg?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/lit.local.cfg?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/lit.local.cfg (original)<br class="">+++ debuginfo-tests/trunk/lit.local.cfg (removed)<br class="">@@ -1,3 +0,0 @@<br class="">-# debuginfo-tests are not expected to pass in a cross-compilation setup.<br class="">-if 'native' not in config.available_features:<br class="">- config.unsupported = True<br class=""><br class="">Added: debuginfo-tests/trunk/lit.site.cfg.py.in<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/lit.site.cfg.py.in?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/lit.site.cfg.py.in?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/lit.site.cfg.py.in (added)<br class="">+++ debuginfo-tests/trunk/lit.site.cfg.py.in Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,25 @@<br class="">+@LIT_SITE_CFG_IN_HEADER@<br class="">+<br class="">+import lit.util<br class="">+<br class="">+config.test_exec_root = "@CMAKE_BINARY_DIR@"<br class="">+<br class="">+config.llvm_src_root = "@LLVM_SOURCE_DIR@"<br class="">+config.llvm_obj_root = "@LLVM_BINARY_DIR@"<br class="">+config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"<br class="">+config.llvm_libs_dir = "@LLVM_LIBS_DIR@"<br class="">+config.llvm_shlib_dir = "@SHLIBDIR@"<br class="">+config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@"<br class="">+config.debuginfo_tests_obj_root = "@DEBUGINFO_TESTS_BINARY_DIR@"<br class="">+config.debuginfo_tests_src_root = "@DEBUGINFO_TESTS_SOURCE_DIR@"<br class="">+config.has_lld = lit.util.pythonize_bool("@DEBUGINFO_TESTS_HAS_LLD@")<br class="">+config.host_triple = "@LLVM_HOST_TRIPLE@"<br class="">+config.target_triple = "@TARGET_TRIPLE@"<br class="">+config.host_arch = "@HOST_ARCH@"<br class="">+<br class="">+config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"<br class="">+<br class="">+@LIT_SITE_CFG_IN_FOOTER@<br class="">+<br class="">+# Let the main config do the real work.<br class="">+lit_config.load_config(config, "@DEBUGINFO_TESTS_SOURCE_DIR@/lit.cfg.py")<br class=""><br class="">Removed: debuginfo-tests/trunk/llgdb.py<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/llgdb.py?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/llgdb.py?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/llgdb.py (original)<br class="">+++ debuginfo-tests/trunk/llgdb.py (removed)<br class="">@@ -1,157 +0,0 @@<br class="">-#!/bin/env python<br class="">-"""<br class="">-A gdb-compatible frontend for lldb that implements just enough<br class="">-commands to run the tests in the debuginfo-tests repository with lldb.<br class="">-"""<br class="">-<br class="">-# ----------------------------------------------------------------------<br class="">-# Auto-detect lldb python module.<br class="">-import commands, platform, os, sys<br class="">-try:<br class="">- # Just try for LLDB in case PYTHONPATH is already correctly setup.<br class="">- import lldb<br class="">-except ImportError:<br class="">- lldb_python_dirs = list()<br class="">- # lldb is not in the PYTHONPATH, try some defaults for the current platform.<br class="">- platform_system = platform.system()<br class="">- if platform_system == 'Darwin':<br class="">- # On Darwin, try the currently selected Xcode directory<br class="">- xcode_dir = commands.getoutput("xcode-select --print-path")<br class="">- if xcode_dir:<br class="">- lldb_python_dirs.append(os.path.realpath(xcode_dir +<br class="">-'/../SharedFrameworks/LLDB.framework/Resources/Python'))<br class="">- lldb_python_dirs.append(xcode_dir +<br class="">-'/Library/PrivateFrameworks/LLDB.framework/Resources/Python')<br class="">- lldb_python_dirs.append(<br class="">-'/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')<br class="">- success = False<br class="">- for lldb_python_dir in lldb_python_dirs:<br class="">- if os.path.exists(lldb_python_dir):<br class="">- if not (sys.path.__contains__(lldb_python_dir)):<br class="">- sys.path.append(lldb_python_dir)<br class="">- try:<br class="">- import lldb<br class="">- except ImportError:<br class="">- pass<br class="">- else:<br class="">- print 'imported lldb from: "%s"' % (lldb_python_dir)<br class="">- success = True<br class="">- break<br class="">- if not success:<br class="">- print "error: couldn't locate the 'lldb' module, please set PYTHONPATH correctly"<br class="">- sys.exit(1)<br class="">-# ----------------------------------------------------------------------<br class="">-<br class="">-# Command line option handling.<br class="">-import argparse<br class="">-parser = argparse.ArgumentParser(description=__doc__)<br class="">-parser.add_argument('--quiet', '-q', action="store_true", help='ignored')<br class="">-parser.add_argument('-batch', action="store_true",<br class="">- help='exit after processing comand line')<br class="">-parser.add_argument('-n', action="store_true", help='ignore .lldb file')<br class="">-parser.add_argument('-x', dest='script', type=file, help='execute commands from file')<br class="">-parser.add_argument("target", help="the program to debug")<br class="">-args = parser.parse_args()<br class="">-<br class="">-<br class="">-# Create a new debugger instance.<br class="">-debugger = lldb.SBDebugger.Create()<br class="">-debugger.SkipLLDBInitFiles(args.n)<br class="">-<br class="">-# Don't return from lldb function calls until the process stops.<br class="">-debugger.SetAsync(False)<br class="">-<br class="">-# Create a target from a file and arch.<br class="">-arch = os.popen("file "+args.target).read().split()[-1]<br class="">-target = debugger.CreateTargetWithFileAndArch(args.target, arch)<br class="">-<br class="">-if not target:<br class="">- print "Could not create target", args.target<br class="">- sys.exit(1)<br class="">-<br class="">-if not args.script:<br class="">- print "Interactive mode is not implemented."<br class="">- sys.exit(1)<br class="">-<br class="">-import re<br class="">-for command in args.script:<br class="">- # Strip newline and whitespaces and split into words.<br class="">- cmd = command[:-1].strip().split()<br class="">- if not cmd:<br class="">- continue<br class="">-<br class="">- print '> %s'% command[:-1]<br class="">-<br class="">- try:<br class="">- if re.match('^r|(run)$', cmd[0]):<br class="">- error = lldb.SBError()<br class="">- launchinfo = lldb.SBLaunchInfo([])<br class="">- launchinfo.SetWorkingDirectory(os.getcwd())<br class="">- process = target.Launch(launchinfo, error)<br class="">- print error<br class="">- if not process or error.fail:<br class="">- state = process.GetState()<br class="">- print "State = %d" % state<br class="">- print """<br class="">-ERROR: Could not launch process.<br class="">-NOTE: There are several reasons why this may happen:<br class="">- * Root needs to run "DevToolsSecurity --enable".<br class="">- * Older versions of lldb cannot launch more than one process simultaneously.<br class="">-"""<br class="">- sys.exit(1)<br class="">-<br class="">- elif re.match('^b|(break)$', cmd[0]) and len(cmd) == 2:<br class="">- if re.match('[0-9]+', cmd[1]):<br class="">- # b line<br class="">- mainfile = target.FindFunctions('main')[0].compile_unit.file<br class="">- print target.BreakpointCreateByLocation(mainfile, int(cmd[1]))<br class="">- else:<br class="">- # b file:line<br class="">- file, line = cmd[1].split(':')<br class="">- print target.BreakpointCreateByLocation(file, int(line))<br class="">-<br class="">- elif re.match('^ptype$', cmd[0]) and len(cmd) == 2:<br class="">- # GDB's ptype has multiple incarnations depending on its<br class="">- # argument (global variable, function, type). The definition<br class="">- # here is for looking up the signature of a function and only<br class="">- # if that fails it looks for a type with that name.<br class="">- # Type lookup in LLDB would be "image lookup --type".<br class="">- for elem in target.FindFunctions(cmd[1]):<br class="">- print elem.function.type<br class="">- continue<br class="">- print target.FindFirstType(cmd[1])<br class="">-<br class="">- elif re.match('^po$', cmd[0]) and len(cmd) > 1:<br class="">- try:<br class="">- opts = lldb.SBExpressionOptions()<br class="">- opts.SetFetchDynamicValue(True)<br class="">- opts.SetCoerceResultToId(True)<br class="">- print target.EvaluateExpression(' '.join(cmd[1:]), opts)<br class="">- except:<br class="">- # FIXME: This is a fallback path for the <a href="http://lab.llvm.org" class="">lab.llvm.org</a><br class="">- # buildbot running OS X 10.7; it should be removed.<br class="">- thread = process.GetThreadAtIndex(0)<br class="">- frame = thread.GetFrameAtIndex(0)<br class="">- print frame.EvaluateExpression(' '.join(cmd[1:]))<br class="">-<br class="">- elif re.match('^p|(print)$', cmd[0]) and len(cmd) > 1:<br class="">- thread = process.GetThreadAtIndex(0)<br class="">- frame = thread.GetFrameAtIndex(0)<br class="">- print frame.EvaluateExpression(' '.join(cmd[1:]))<br class="">-<br class="">- elif re.match('^n|(next)$', cmd[0]):<br class="">- thread = process.GetThreadAtIndex(0)<br class="">- thread.StepOver()<br class="">-<br class="">- elif re.match('^q|(quit)$', cmd[0]):<br class="">- sys.exit(0)<br class="">-<br class="">- else:<br class="">- print debugger.HandleCommand(' '.join(cmd))<br class="">-<br class="">- except SystemExit:<br class="">- lldb.SBDebugger_Terminate()<br class="">- raise<br class="">- except:<br class="">- print 'Could not handle the command "%s"' % ' '.join(cmd)<br class="">-<br class=""><br class="">Removed: debuginfo-tests/trunk/nested-struct.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/nested-struct.cpp?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/nested-struct.cpp?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/nested-struct.cpp (original)<br class="">+++ debuginfo-tests/trunk/nested-struct.cpp (removed)<br class="">@@ -1,21 +0,0 @@<br class="">-// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">-// RUN: %test_debuginfo %s %t.o<br class="">-// Radar 9440721<br class="">-// If debug info for my_number() is emitted outside function foo's scope<br class="">-// then a debugger may not be able to handle it. At least one version of<br class="">-// gdb crashes in such cases.<br class="">-<br class="">-// DEBUGGER: ptype foo<br class="">-// CHECK: int (void)<br class="">-<br class="">-int foo() {<br class="">- struct Local {<br class="">- static int my_number() {<br class="">- return 42;<br class="">- }<br class="">- };<br class="">-<br class="">- int i = 0;<br class="">- i = Local::my_number();<br class="">- return i + 1;<br class="">-}<br class=""><br class="">Removed: debuginfo-tests/trunk/nrvo-string.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/nrvo-string.cpp?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/nrvo-string.cpp?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/nrvo-string.cpp (original)<br class="">+++ debuginfo-tests/trunk/nrvo-string.cpp (removed)<br class="">@@ -1,27 +0,0 @@<br class="">-// This ensures that DW_OP_deref is inserted when necessary, such as when NRVO<br class="">-// of a string object occurs in C++.<br class="">-//<br class="">-// RUN: %clangxx -O0 -fno-exceptions %target_itanium_abi_host_triple %s -o %t.out -g<br class="">-// RUN: %test_debuginfo %s %t.out<br class="">-// RUN: %clangxx -O1 -fno-exceptions %target_itanium_abi_host_triple %s -o %t.out -g<br class="">-// RUN: %test_debuginfo %s %t.out<br class="">-//<br class="">-// PR34513<br class="">-<br class="">-struct string {<br class="">- string() {}<br class="">- string(int i) : i(i) {}<br class="">- ~string() {}<br class="">- int i = 0;<br class="">-};<br class="">-string get_string() {<br class="">- string unused;<br class="">- string result = 3;<br class="">-// DEBUGGER: break 21<br class="">- return result;<br class="">-}<br class="">-int main() { get_string(); }<br class="">-<br class="">-// DEBUGGER: r<br class="">-// DEBUGGER: print result.i<br class="">-// CHECK: = 3<br class=""><br class="">Removed: debuginfo-tests/trunk/safestack.c<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/safestack.c?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/safestack.c?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/safestack.c (original)<br class="">+++ debuginfo-tests/trunk/safestack.c (removed)<br class="">@@ -1,51 +0,0 @@<br class="">-// RUN: %clang %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=safe-stack<br class="">-// RUN: %test_debuginfo %s %t.out<br class="">-// REQUIRES: not_asan<br class="">-// Zorg configures the ASAN stage2 bots to not build the<br class="">-// safestack compiler-rt. Only run this test on<br class="">-// non-asanified configurations.<br class="">-<br class="">-struct S {<br class="">- int a[8];<br class="">-};<br class="">-<br class="">-int f(struct S s, unsigned i);<br class="">-<br class="">-int main(int argc, const char **argv) {<br class="">- struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}};<br class="">- // DEBUGGER: break 17<br class="">- f(s, 4);<br class="">- // DEBUGGER: break 19<br class="">- return 0;<br class="">-}<br class="">-<br class="">-int f(struct S s, unsigned i) {<br class="">- // DEBUGGER: break 24<br class="">- return s.a[i];<br class="">-}<br class="">-<br class="">-// DEBUGGER: r<br class="">-// DEBUGGER: p s<br class="">-// CHECK: a =<br class="">-// DEBUGGER: p s.a[0]<br class="">-// CHECK: = 0<br class="">-// DEBUGGER: p s.a[1]<br class="">-// CHECK: = 1<br class="">-// DEBUGGER: p s.a[7]<br class="">-// CHECK: = 7<br class="">-// DEBUGGER: c<br class="">-// DEBUGGER: p s<br class="">-// CHECK: a =<br class="">-// DEBUGGER: p s.a[0]<br class="">-// CHECK: = 0<br class="">-// DEBUGGER: p s.a[1]<br class="">-// CHECK: = 1<br class="">-// DEBUGGER: p s.a[7]<br class="">-// DEBUGGER: c<br class="">-// DEBUGGER: p s<br class="">-// CHECK: a =<br class="">-// DEBUGGER: p s.a[0]<br class="">-// CHECK: = 0<br class="">-// DEBUGGER: p s.a[1]<br class="">-// CHECK: = 1<br class="">-// DEBUGGER: p s.a[7]<br class=""><br class="">Removed: debuginfo-tests/trunk/sret.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/sret.cpp?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/sret.cpp?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/sret.cpp (original)<br class="">+++ debuginfo-tests/trunk/sret.cpp (removed)<br class="">@@ -1,71 +0,0 @@<br class="">-// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">-// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out<br class="">-// RUN: %test_debuginfo %s %t.out <br class="">-// Radar 8775834<br class="">-// DEBUGGER: break 62<br class="">-// DEBUGGER: r<br class="">-// DEBUGGER: p a<br class="">-// CHECK: ${{[0-9]+}} =<br class="">-// LLDB does not print artificial members.<br class="">-// CHECK: {{(_vptr\$A =)?.*}}m_int = 12<br class="">-<br class="">-class A<br class="">-{<br class="">-public:<br class="">- A (int i=0);<br class="">- A (const A& rhs);<br class="">- const A&<br class="">- operator= (const A& rhs);<br class="">- virtual ~A() {}<br class="">-<br class="">- int get_int();<br class="">-<br class="">-protected:<br class="">- int m_int;<br class="">-};<br class="">-<br class="">-A::A (int i) : <br class="">- m_int(i)<br class="">-{<br class="">-}<br class="">-<br class="">-A::A (const A& rhs) :<br class="">- m_int (rhs.m_int)<br class="">-{<br class="">-}<br class="">-<br class="">-const A &<br class="">-A::operator =(const A& rhs)<br class="">-{<br class="">- m_int = rhs.m_int;<br class="">- return *this;<br class="">-}<br class="">-<br class="">-int A::get_int()<br class="">-{<br class="">- return m_int;<br class="">-}<br class="">-<br class="">-class B<br class="">-{<br class="">-public:<br class="">- B () {}<br class="">- <br class="">- A AInstance();<br class="">-};<br class="">-<br class="">-A <br class="">-B::AInstance()<br class="">-{<br class="">- A a(12);<br class="">- return a;<br class="">-}<br class="">-<br class="">-int main (int argc, char const *argv[])<br class="">-{<br class="">- B b;<br class="">- int return_val = b.AInstance().get_int();<br class="">- <br class="">- A a(b.AInstance());<br class="">- return return_val;<br class="">-}<br class=""><br class="">Removed: debuginfo-tests/trunk/stack-var.c<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/stack-var.c?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/stack-var.c?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/stack-var.c (original)<br class="">+++ debuginfo-tests/trunk/stack-var.c (removed)<br class="">@@ -1,18 +0,0 @@<br class="">-// RUN: %clang %target_itanium_abi_host_triple %s -O -o %t.out -g<br class="">-// RUN: %test_debuginfo %s %t.out<br class="">-<br class="">-void __attribute__((noinline, optnone)) bar(int *test) {}<br class="">-int main() {<br class="">- int test;<br class="">- test = 23;<br class="">- // DEBUGGER: break 12<br class="">- // DEBUGGER: r<br class="">- // DEBUGGER: p test<br class="">- // CHECK: = 23<br class="">- bar(&test);<br class="">- // DEBUGGER: break 17<br class="">- // DEBUGGER: c<br class="">- // DEBUGGER: p test<br class="">- // CHECK: = 23<br class="">- return test;<br class="">-}<br class=""><br class="">Removed: debuginfo-tests/trunk/static-member-2.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/static-member-2.cpp?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/static-member-2.cpp?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/static-member-2.cpp (original)<br class="">+++ debuginfo-tests/trunk/static-member-2.cpp (removed)<br class="">@@ -1,39 +0,0 @@<br class="">-// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -o %t -c<br class="">-// RUN: %clangxx %target_itanium_abi_host_triple %t -o %t.out<br class="">-// RUN: %test_debuginfo %s %t.out<br class="">-<br class="">-// FIXME: LLDB finds the wrong symbol for "C". <a href="rdar://problem/14933867" class="">rdar://problem/14933867</a><br class="">-// XFAIL: darwin<br class="">-<br class="">-// DEBUGGER: delete breakpoints<br class="">-// DEBUGGER: break static-member.cpp:33<br class="">-// DEBUGGER: r<br class="">-// DEBUGGER: ptype C<br class="">-// CHECK: {{struct|class}} C {<br class="">-// CHECK: static const int a;<br class="">-// CHECK-NEXT: static int b;<br class="">-// CHECK-NEXT: static int c;<br class="">-// CHECK-NEXT: int d;<br class="">-// CHECK-NEXT: }<br class="">-// DEBUGGER: p C::a<br class="">-// CHECK: ${{[0-9]}} = 4<br class="">-// DEBUGGER: p C::c<br class="">-// CHECK: ${{[0-9]}} = 15<br class="">-<br class="">-// PR14471, PR14734<br class="">-<br class="">-class C {<br class="">-public:<br class="">- const static int a = 4;<br class="">- static int b;<br class="">- static int c;<br class="">- int d;<br class="">-};<br class="">-<br class="">-int C::c = 15;<br class="">-const int C::a;<br class="">-<br class="">-int main() {<br class="">- C instance_C;<br class="">- return C::a;<br class="">-}<br class=""><br class="">Removed: debuginfo-tests/trunk/static-member.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/static-member.cpp?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/static-member.cpp?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/static-member.cpp (original)<br class="">+++ debuginfo-tests/trunk/static-member.cpp (removed)<br class="">@@ -1,36 +0,0 @@<br class="">-// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -o %t -c<br class="">-// RUN: %clangxx %target_itanium_abi_host_triple %t -o %t.out<br class="">-// RUN: %test_debuginfo %s %t.out<br class="">-<br class="">-// DEBUGGER: delete breakpoints<br class="">-// DEBUGGER: break static-member.cpp:33<br class="">-// DEBUGGER: r<br class="">-// DEBUGGER: ptype MyClass<br class="">-// CHECK: {{struct|class}} MyClass {<br class="">-// CHECK: static const int a;<br class="">-// CHECK-NEXT: static int b;<br class="">-// CHECK-NEXT: static int c;<br class="">-// CHECK-NEXT: int d;<br class="">-// CHECK-NEXT: }<br class="">-// DEBUGGER: p MyClass::a<br class="">-// CHECK: ${{[0-9]}} = 4<br class="">-// DEBUGGER: p MyClass::c<br class="">-// CHECK: ${{[0-9]}} = 15<br class="">-<br class="">-// PR14471, PR14734<br class="">-<br class="">-class MyClass {<br class="">-public:<br class="">- const static int a = 4;<br class="">- static int b;<br class="">- static int c;<br class="">- int d;<br class="">-};<br class="">-<br class="">-int MyClass::c = 15;<br class="">-const int MyClass::a;<br class="">-<br class="">-int main() {<br class="">- MyClass instance_MyClass;<br class="">- return MyClass::a;<br class="">-}<br class=""><br class="">Added: debuginfo-tests/trunk/tests/aggregate-indirect-arg.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/aggregate-indirect-arg.cpp?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/aggregate-indirect-arg.cpp?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/aggregate-indirect-arg.cpp (added)<br class="">+++ debuginfo-tests/trunk/tests/aggregate-indirect-arg.cpp Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,32 @@<br class="">+// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">+// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out<br class="">+// RUN: %test_debuginfo %s %t.out<br class="">+// Radar 8945514<br class="">+// DEBUGGER: break 22<br class="">+// DEBUGGER: r<br class="">+// DEBUGGER: p v<br class="">+// CHECK: ${{[0-9]+}} =<br class="">+// CHECK: Data ={{.*}} 0x0{{(0*)}}<br class="">+// CHECK: Kind = 2142<br class="">+<br class="">+class SVal {<br class="">+public:<br class="">+ ~SVal() {}<br class="">+ const void* Data;<br class="">+ unsigned Kind;<br class="">+};<br class="">+<br class="">+void bar(SVal &v) {}<br class="">+class A {<br class="">+public:<br class="">+ void foo(SVal v) { bar(v); }<br class="">+};<br class="">+<br class="">+int main() {<br class="">+ SVal v;<br class="">+ v.Data = 0;<br class="">+ v.Kind = 2142;<br class="">+ A a;<br class="">+ a.foo(v);<br class="">+ return 0;<br class="">+}<br class=""><br class="">Added: debuginfo-tests/trunk/tests/asan-blocks.c<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/asan-blocks.c?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/asan-blocks.c?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/asan-blocks.c (added)<br class="">+++ debuginfo-tests/trunk/tests/asan-blocks.c Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,41 @@<br class="">+// RUN: %clang -fblocks %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=address<br class="">+// RUN: %test_debuginfo %s %t.out<br class="">+// FIXME: Remove system-darwin when we build BlocksRuntime everywhere.<br class="">+// REQUIRES: not_asan, system-darwin<br class="">+// Zorg configures the ASAN stage2 bots to not build the asan<br class="">+// compiler-rt. Only run this test on non-asanified configurations.<br class="">+void b();<br class="">+struct S {<br class="">+ int a[8];<br class="">+};<br class="">+<br class="">+int f(struct S s, unsigned i) {<br class="">+ // DEBUGGER: break 17<br class="">+ // DEBUGGER: r<br class="">+ // DEBUGGER: p s<br class="">+ // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)<br class="">+ return s.a[i];<br class="">+}<br class="">+<br class="">+int main(int argc, const char **argv) {<br class="">+ struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}};<br class="">+ if (f(s, 4) == 4) {<br class="">+ // DEBUGGER: break 27<br class="">+ // DEBUGGER: c<br class="">+ // DEBUGGER: p s<br class="">+ // CHECK: a = ([0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7)<br class="">+ b();<br class="">+ }<br class="">+ return 0;<br class="">+}<br class="">+<br class="">+void c() {}<br class="">+<br class="">+void b() {<br class="">+ // DEBUGGER: break 40<br class="">+ // DEBUGGER: c<br class="">+ // DEBUGGER: p x<br class="">+ // CHECK: 42<br class="">+ __block int x = 42;<br class="">+ c();<br class="">+}<br class=""><br class="">Added: debuginfo-tests/trunk/tests/asan.c<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/asan.c?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/asan.c?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/asan.c (added)<br class="">+++ debuginfo-tests/trunk/tests/asan.c Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,31 @@<br class="">+// RUN: %clang -fblocks %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=address<br class="">+// RUN: %test_debuginfo %s %t.out<br class="">+// REQUIRES: not_asan<br class="">+// Zorg configures the ASAN stage2 bots to not build the asan<br class="">+// compiler-rt. Only run this test on non-asanified configurations.<br class="">+//<br class="">+<br class="">+struct S {<br class="">+ int a[8];<br class="">+};<br class="">+<br class="">+int f(struct S s, unsigned i) {<br class="">+ // DEBUGGER: break 14<br class="">+ return s.a[i];<br class="">+}<br class="">+<br class="">+int main(int argc, const char **argv) {<br class="">+ struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}};<br class="">+ if (f(s, 4) == 4)<br class="">+ return f(s, 0);<br class="">+ return 0;<br class="">+}<br class="">+<br class="">+// DEBUGGER: r<br class="">+// DEBUGGER: p s<br class="">+// CHECK: a =<br class="">+// DEBUGGER: p s.a[0]<br class="">+// CHECK: = 0<br class="">+// DEBUGGER: p s.a[1]<br class="">+// CHECK: = 1<br class="">+// DEBUGGER: p s.a[7]<br class=""><br class="">Added: debuginfo-tests/trunk/tests/block_var.m<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/block_var.m?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/block_var.m?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/block_var.m (added)<br class="">+++ debuginfo-tests/trunk/tests/block_var.m Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,32 @@<br class="">+// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">+// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation<br class="">+// RUN: %test_debuginfo %s %t.out<br class="">+<br class="">+// REQUIRES: system-darwin<br class="">+<br class="">+// DEBUGGER: break 24<br class="">+// DEBUGGER: r<br class="">+// DEBUGGER: p result<br class="">+// CHECK: ${{[0-9]}} = 42<br class="">+<br class="">+void doBlock(void (^block)(void))<br class="">+{<br class="">+ block();<br class="">+}<br class="">+<br class="">+int I(int n)<br class="">+{<br class="">+ __block int result;<br class="">+ int i = 2;<br class="">+ doBlock(^{<br class="">+ result = n;<br class="">+ });<br class="">+ return result + i; /* Check value of 'result' */<br class="">+}<br class="">+<br class="">+<br class="">+int main (int argc, const char * argv[]) {<br class="">+ return I(42);<br class="">+}<br class="">+<br class="">+<br class=""><br class="">Added: debuginfo-tests/trunk/tests/blocks.m<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/blocks.m?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/blocks.m?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/blocks.m (added)<br class="">+++ debuginfo-tests/trunk/tests/blocks.m Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,43 @@<br class="">+// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">+// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation<br class="">+// RUN: %test_debuginfo %s %t.out<br class="">+<br class="">+// REQUIRES: system-darwin<br class="">+// Radar 9279956<br class="">+<br class="">+// DEBUGGER: break 31<br class="">+// DEBUGGER: r<br class="">+// DEBUGGER: p m2<br class="">+// CHECK: ${{[0-9]}} = 1<br class="">+// DEBUGGER: p dbTransaction<br class="">+// CHECK: ${{[0-9]}} = 0<br class="">+// DEBUGGER: p master<br class="">+// CHECK: ${{[0-9]}} = 0<br class="">+<br class="">+#include <Cocoa/Cocoa.h><br class="">+<br class="">+extern void foo(void(^)(void));<br class="">+<br class="">+@interface A:NSObject @end<br class="">+@implementation A<br class="">+- (void) helper {<br class="">+ int master = 0;<br class="">+ __block int m2 = 0;<br class="">+ __block int dbTransaction = 0;<br class="">+ int (^x)(void) = ^(void) { (void) self;<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>(void) master;<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>(void) dbTransaction;<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>m2++;<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>return m2;<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>};<br class="">+ master = x();<br class="">+}<br class="">+@end<br class="">+<br class="">+void foo(void(^x)(void)) {}<br class="">+<br class="">+int main() {<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>A *a = [A alloc];<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>[a helper];<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>return 0;<br class="">+}<br class=""><br class="">Added: debuginfo-tests/trunk/tests/ctor.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/ctor.cpp?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/ctor.cpp?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/ctor.cpp (added)<br class="">+++ debuginfo-tests/trunk/tests/ctor.cpp Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,25 @@<br class="">+// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">+// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out<br class="">+// RUN: %test_debuginfo %s %t.out<br class="">+<br class="">+<br class="">+// DEBUGGER: break 14<br class="">+// DEBUGGER: r<br class="">+// DEBUGGER: p *this<br class="">+// CHECK-NEXT-NOT: Cannot access memory at address<br class="">+<br class="">+class A {<br class="">+public:<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>A() : zero(0), data(42)<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>{<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>}<br class="">+private:<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>int zero;<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>int data;<br class="">+};<br class="">+<br class="">+int main() {<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>A a;<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>return 0;<br class="">+}<br class="">+<br class=""><br class="">Added: debuginfo-tests/trunk/tests/dbg-arg.c<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/dbg-arg.c?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/dbg-arg.c?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/dbg-arg.c (added)<br class="">+++ debuginfo-tests/trunk/tests/dbg-arg.c Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,46 @@<br class="">+// This test case checks debug info during register moves for an argument.<br class="">+// RUN: %clang %target_itanium_abi_host_triple -m64 -mllvm -fast-isel=false %s -c -o %t.o -g<br class="">+// RUN: %clang %target_itanium_abi_host_triple -m64 %t.o -o %t.out<br class="">+// RUN: %test_debuginfo %s %t.out<br class="">+//<br class="">+// DEBUGGER: break 26<br class="">+// DEBUGGER: r<br class="">+// DEBUGGER: print mutex<br class="">+// CHECK: ={{.* 0x[0-9A-Fa-f]+}}<br class="">+//<br class="">+// Radar 8412415<br class="">+<br class="">+struct _mtx<br class="">+{<br class="">+ long unsigned int ptr;<br class="">+ int waiters;<br class="">+ struct {<br class="">+ int tag;<br class="">+ int pad;<br class="">+ } mtxi;<br class="">+};<br class="">+<br class="">+<br class="">+int foobar(struct _mtx *mutex) {<br class="">+ int r = 1;<br class="">+ int l = 0;<br class="">+ int j = 0;<br class="">+ do {<br class="">+ if (mutex->waiters) {<br class="">+ r = 2;<br class="">+ }<br class="">+ j = bar(r, l);<br class="">+ ++l;<br class="">+ } while (l < j);<br class="">+ return r + j;<br class="">+}<br class="">+<br class="">+int bar(int i, int j) {<br class="">+ return i + j;<br class="">+}<br class="">+<br class="">+int main() {<br class="">+ struct _mtx m;<br class="">+ m.waiters = 0;<br class="">+ return foobar(&m);<br class="">+}<br class=""><br class="">Added: debuginfo-tests/trunk/tests/foreach.m<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/foreach.m?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/foreach.m?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/foreach.m (added)<br class="">+++ debuginfo-tests/trunk/tests/foreach.m Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,31 @@<br class="">+// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">+// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation<br class="">+// RUN: %test_debuginfo %s %t.out<br class="">+//<br class="">+// REQUIRES: system-darwin<br class="">+// Radar 8757124<br class="">+<br class="">+// DEBUGGER: break 25<br class="">+// DEBUGGER: r<br class="">+// DEBUGGER: po thing<br class="">+// CHECK: aaa<br class="">+<br class="">+#import <Foundation/Foundation.h><br class="">+<br class="">+int main (int argc, const char * argv[]) {<br class="">+<br class="">+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];<br class="">+ NSArray *things = [NSArray arrayWithObjects:@"one", @"two", @"three" , nil];<br class="">+ for (NSString *thing in things) {<br class="">+ NSLog (@"%@", thing);<br class="">+ }<br class="">+<br class="">+ things = [NSArray arrayWithObjects:@"aaa", @"bbb", @"ccc" , nil];<br class="">+ for (NSString *thing in things) {<br class="">+ NSLog (@"%@", thing);<br class="">+ }<br class="">+ [pool release];<br class="">+ return 0;<br class="">+}<br class="">+<br class="">+<br class=""><br class="">Added: debuginfo-tests/trunk/tests/forward-declare-class.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/forward-declare-class.cpp?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/forward-declare-class.cpp?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/forward-declare-class.cpp (added)<br class="">+++ debuginfo-tests/trunk/tests/forward-declare-class.cpp Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,27 @@<br class="">+// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">+// RUN: %test_debuginfo %s %t.o<br class="">+// Radar 9168773<br class="">+<br class="">+// DEBUGGER: ptype A<br class="">+// Work around a gdb bug where it believes that a class is a<br class="">+// struct if there aren't any methods - even though it's tagged<br class="">+// as a class.<br class="">+// CHECK: type = {{struct|class}} A {<br class="">+// CHECK-NEXT: {{(public:){0,1}}}<br class="">+// CHECK-NEXT: int MyData;<br class="">+// CHECK-NEXT: }<br class="">+class A;<br class="">+class B {<br class="">+public:<br class="">+ void foo(const A *p);<br class="">+};<br class="">+<br class="">+B iEntry;<br class="">+<br class="">+class A {<br class="">+public:<br class="">+ int MyData;<br class="">+};<br class="">+<br class="">+A irp;<br class="">+<br class=""><br class="">Added: debuginfo-tests/trunk/tests/lit.local.cfg<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/lit.local.cfg?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/lit.local.cfg?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/lit.local.cfg (added)<br class="">+++ debuginfo-tests/trunk/tests/lit.local.cfg Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,3 @@<br class="">+# debuginfo-tests are not expected to pass in a cross-compilation setup.<br class="">+if 'native' not in config.available_features:<br class="">+ config.unsupported = True<br class=""><br class="">Added: debuginfo-tests/trunk/tests/llgdb.py<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/llgdb.py?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/llgdb.py?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/llgdb.py (added)<br class="">+++ debuginfo-tests/trunk/tests/llgdb.py Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,157 @@<br class="">+#!/bin/env python<br class="">+"""<br class="">+A gdb-compatible frontend for lldb that implements just enough<br class="">+commands to run the tests in the debuginfo-tests repository with lldb.<br class="">+"""<br class="">+<br class="">+# ----------------------------------------------------------------------<br class="">+# Auto-detect lldb python module.<br class="">+import commands, platform, os, sys<br class="">+try:<br class="">+ # Just try for LLDB in case PYTHONPATH is already correctly setup.<br class="">+ import lldb<br class="">+except ImportError:<br class="">+ lldb_python_dirs = list()<br class="">+ # lldb is not in the PYTHONPATH, try some defaults for the current platform.<br class="">+ platform_system = platform.system()<br class="">+ if platform_system == 'Darwin':<br class="">+ # On Darwin, try the currently selected Xcode directory<br class="">+ xcode_dir = commands.getoutput("xcode-select --print-path")<br class="">+ if xcode_dir:<br class="">+ lldb_python_dirs.append(os.path.realpath(xcode_dir +<br class="">+'/../SharedFrameworks/LLDB.framework/Resources/Python'))<br class="">+ lldb_python_dirs.append(xcode_dir +<br class="">+'/Library/PrivateFrameworks/LLDB.framework/Resources/Python')<br class="">+ lldb_python_dirs.append(<br class="">+'/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')<br class="">+ success = False<br class="">+ for lldb_python_dir in lldb_python_dirs:<br class="">+ if os.path.exists(lldb_python_dir):<br class="">+ if not (sys.path.__contains__(lldb_python_dir)):<br class="">+ sys.path.append(lldb_python_dir)<br class="">+ try:<br class="">+ import lldb<br class="">+ except ImportError:<br class="">+ pass<br class="">+ else:<br class="">+ print 'imported lldb from: "%s"' % (lldb_python_dir)<br class="">+ success = True<br class="">+ break<br class="">+ if not success:<br class="">+ print "error: couldn't locate the 'lldb' module, please set PYTHONPATH correctly"<br class="">+ sys.exit(1)<br class="">+# ----------------------------------------------------------------------<br class="">+<br class="">+# Command line option handling.<br class="">+import argparse<br class="">+parser = argparse.ArgumentParser(description=__doc__)<br class="">+parser.add_argument('--quiet', '-q', action="store_true", help='ignored')<br class="">+parser.add_argument('-batch', action="store_true",<br class="">+ help='exit after processing comand line')<br class="">+parser.add_argument('-n', action="store_true", help='ignore .lldb file')<br class="">+parser.add_argument('-x', dest='script', type=file, help='execute commands from file')<br class="">+parser.add_argument("target", help="the program to debug")<br class="">+args = parser.parse_args()<br class="">+<br class="">+<br class="">+# Create a new debugger instance.<br class="">+debugger = lldb.SBDebugger.Create()<br class="">+debugger.SkipLLDBInitFiles(args.n)<br class="">+<br class="">+# Don't return from lldb function calls until the process stops.<br class="">+debugger.SetAsync(False)<br class="">+<br class="">+# Create a target from a file and arch.<br class="">+arch = os.popen("file "+args.target).read().split()[-1]<br class="">+target = debugger.CreateTargetWithFileAndArch(args.target, arch)<br class="">+<br class="">+if not target:<br class="">+ print "Could not create target", args.target<br class="">+ sys.exit(1)<br class="">+<br class="">+if not args.script:<br class="">+ print "Interactive mode is not implemented."<br class="">+ sys.exit(1)<br class="">+<br class="">+import re<br class="">+for command in args.script:<br class="">+ # Strip newline and whitespaces and split into words.<br class="">+ cmd = command[:-1].strip().split()<br class="">+ if not cmd:<br class="">+ continue<br class="">+<br class="">+ print '> %s'% command[:-1]<br class="">+<br class="">+ try:<br class="">+ if re.match('^r|(run)$', cmd[0]):<br class="">+ error = lldb.SBError()<br class="">+ launchinfo = lldb.SBLaunchInfo([])<br class="">+ launchinfo.SetWorkingDirectory(os.getcwd())<br class="">+ process = target.Launch(launchinfo, error)<br class="">+ print error<br class="">+ if not process or error.fail:<br class="">+ state = process.GetState()<br class="">+ print "State = %d" % state<br class="">+ print """<br class="">+ERROR: Could not launch process.<br class="">+NOTE: There are several reasons why this may happen:<br class="">+ * Root needs to run "DevToolsSecurity --enable".<br class="">+ * Older versions of lldb cannot launch more than one process simultaneously.<br class="">+"""<br class="">+ sys.exit(1)<br class="">+<br class="">+ elif re.match('^b|(break)$', cmd[0]) and len(cmd) == 2:<br class="">+ if re.match('[0-9]+', cmd[1]):<br class="">+ # b line<br class="">+ mainfile = target.FindFunctions('main')[0].compile_unit.file<br class="">+ print target.BreakpointCreateByLocation(mainfile, int(cmd[1]))<br class="">+ else:<br class="">+ # b file:line<br class="">+ file, line = cmd[1].split(':')<br class="">+ print target.BreakpointCreateByLocation(file, int(line))<br class="">+<br class="">+ elif re.match('^ptype$', cmd[0]) and len(cmd) == 2:<br class="">+ # GDB's ptype has multiple incarnations depending on its<br class="">+ # argument (global variable, function, type). The definition<br class="">+ # here is for looking up the signature of a function and only<br class="">+ # if that fails it looks for a type with that name.<br class="">+ # Type lookup in LLDB would be "image lookup --type".<br class="">+ for elem in target.FindFunctions(cmd[1]):<br class="">+ print elem.function.type<br class="">+ continue<br class="">+ print target.FindFirstType(cmd[1])<br class="">+<br class="">+ elif re.match('^po$', cmd[0]) and len(cmd) > 1:<br class="">+ try:<br class="">+ opts = lldb.SBExpressionOptions()<br class="">+ opts.SetFetchDynamicValue(True)<br class="">+ opts.SetCoerceResultToId(True)<br class="">+ print target.EvaluateExpression(' '.join(cmd[1:]), opts)<br class="">+ except:<br class="">+ # FIXME: This is a fallback path for the <a href="http://lab.llvm.org" class="">lab.llvm.org</a><br class="">+ # buildbot running OS X 10.7; it should be removed.<br class="">+ thread = process.GetThreadAtIndex(0)<br class="">+ frame = thread.GetFrameAtIndex(0)<br class="">+ print frame.EvaluateExpression(' '.join(cmd[1:]))<br class="">+<br class="">+ elif re.match('^p|(print)$', cmd[0]) and len(cmd) > 1:<br class="">+ thread = process.GetThreadAtIndex(0)<br class="">+ frame = thread.GetFrameAtIndex(0)<br class="">+ print frame.EvaluateExpression(' '.join(cmd[1:]))<br class="">+<br class="">+ elif re.match('^n|(next)$', cmd[0]):<br class="">+ thread = process.GetThreadAtIndex(0)<br class="">+ thread.StepOver()<br class="">+<br class="">+ elif re.match('^q|(quit)$', cmd[0]):<br class="">+ sys.exit(0)<br class="">+<br class="">+ else:<br class="">+ print debugger.HandleCommand(' '.join(cmd))<br class="">+<br class="">+ except SystemExit:<br class="">+ lldb.SBDebugger_Terminate()<br class="">+ raise<br class="">+ except:<br class="">+ print 'Could not handle the command "%s"' % ' '.join(cmd)<br class="">+<br class=""><br class="">Added: debuginfo-tests/trunk/tests/nested-struct.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/nested-struct.cpp?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/nested-struct.cpp?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/nested-struct.cpp (added)<br class="">+++ debuginfo-tests/trunk/tests/nested-struct.cpp Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,21 @@<br class="">+// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">+// RUN: %test_debuginfo %s %t.o<br class="">+// Radar 9440721<br class="">+// If debug info for my_number() is emitted outside function foo's scope<br class="">+// then a debugger may not be able to handle it. At least one version of<br class="">+// gdb crashes in such cases.<br class="">+<br class="">+// DEBUGGER: ptype foo<br class="">+// CHECK: int (void)<br class="">+<br class="">+int foo() {<br class="">+ struct Local {<br class="">+ static int my_number() {<br class="">+ return 42;<br class="">+ }<br class="">+ };<br class="">+<br class="">+ int i = 0;<br class="">+ i = Local::my_number();<br class="">+ return i + 1;<br class="">+}<br class=""><br class="">Added: debuginfo-tests/trunk/tests/nrvo-string.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/nrvo-string.cpp?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/nrvo-string.cpp?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/nrvo-string.cpp (added)<br class="">+++ debuginfo-tests/trunk/tests/nrvo-string.cpp Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,27 @@<br class="">+// This ensures that DW_OP_deref is inserted when necessary, such as when NRVO<br class="">+// of a string object occurs in C++.<br class="">+//<br class="">+// RUN: %clangxx -O0 -fno-exceptions %target_itanium_abi_host_triple %s -o %t.out -g<br class="">+// RUN: %test_debuginfo %s %t.out<br class="">+// RUN: %clangxx -O1 -fno-exceptions %target_itanium_abi_host_triple %s -o %t.out -g<br class="">+// RUN: %test_debuginfo %s %t.out<br class="">+//<br class="">+// PR34513<br class="">+<br class="">+struct string {<br class="">+ string() {}<br class="">+ string(int i) : i(i) {}<br class="">+ ~string() {}<br class="">+ int i = 0;<br class="">+};<br class="">+string get_string() {<br class="">+ string unused;<br class="">+ string result = 3;<br class="">+// DEBUGGER: break 21<br class="">+ return result;<br class="">+}<br class="">+int main() { get_string(); }<br class="">+<br class="">+// DEBUGGER: r<br class="">+// DEBUGGER: print result.i<br class="">+// CHECK: = 3<br class=""><br class="">Added: debuginfo-tests/trunk/tests/safestack.c<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/safestack.c?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/safestack.c?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/safestack.c (added)<br class="">+++ debuginfo-tests/trunk/tests/safestack.c Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,51 @@<br class="">+// RUN: %clang %target_itanium_abi_host_triple -arch x86_64 %s -o %t.out -g -fsanitize=safe-stack<br class="">+// RUN: %test_debuginfo %s %t.out<br class="">+// REQUIRES: not_asan<br class="">+// Zorg configures the ASAN stage2 bots to not build the<br class="">+// safestack compiler-rt. Only run this test on<br class="">+// non-asanified configurations.<br class="">+<br class="">+struct S {<br class="">+ int a[8];<br class="">+};<br class="">+<br class="">+int f(struct S s, unsigned i);<br class="">+<br class="">+int main(int argc, const char **argv) {<br class="">+ struct S s = {{0, 1, 2, 3, 4, 5, 6, 7}};<br class="">+ // DEBUGGER: break 17<br class="">+ f(s, 4);<br class="">+ // DEBUGGER: break 19<br class="">+ return 0;<br class="">+}<br class="">+<br class="">+int f(struct S s, unsigned i) {<br class="">+ // DEBUGGER: break 24<br class="">+ return s.a[i];<br class="">+}<br class="">+<br class="">+// DEBUGGER: r<br class="">+// DEBUGGER: p s<br class="">+// CHECK: a =<br class="">+// DEBUGGER: p s.a[0]<br class="">+// CHECK: = 0<br class="">+// DEBUGGER: p s.a[1]<br class="">+// CHECK: = 1<br class="">+// DEBUGGER: p s.a[7]<br class="">+// CHECK: = 7<br class="">+// DEBUGGER: c<br class="">+// DEBUGGER: p s<br class="">+// CHECK: a =<br class="">+// DEBUGGER: p s.a[0]<br class="">+// CHECK: = 0<br class="">+// DEBUGGER: p s.a[1]<br class="">+// CHECK: = 1<br class="">+// DEBUGGER: p s.a[7]<br class="">+// DEBUGGER: c<br class="">+// DEBUGGER: p s<br class="">+// CHECK: a =<br class="">+// DEBUGGER: p s.a[0]<br class="">+// CHECK: = 0<br class="">+// DEBUGGER: p s.a[1]<br class="">+// CHECK: = 1<br class="">+// DEBUGGER: p s.a[7]<br class=""><br class="">Added: debuginfo-tests/trunk/tests/sret.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/sret.cpp?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/sret.cpp?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/sret.cpp (added)<br class="">+++ debuginfo-tests/trunk/tests/sret.cpp Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,71 @@<br class="">+// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">+// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out<br class="">+// RUN: %test_debuginfo %s %t.out<br class="">+// Radar 8775834<br class="">+// DEBUGGER: break 62<br class="">+// DEBUGGER: r<br class="">+// DEBUGGER: p a<br class="">+// CHECK: ${{[0-9]+}} =<br class="">+// LLDB does not print artificial members.<br class="">+// CHECK: {{(_vptr\$A =)?.*}}m_int = 12<br class="">+<br class="">+class A<br class="">+{<br class="">+public:<br class="">+ A (int i=0);<br class="">+ A (const A& rhs);<br class="">+ const A&<br class="">+ operator= (const A& rhs);<br class="">+ virtual ~A() {}<br class="">+<br class="">+ int get_int();<br class="">+<br class="">+protected:<br class="">+ int m_int;<br class="">+};<br class="">+<br class="">+A::A (int i) :<br class="">+ m_int(i)<br class="">+{<br class="">+}<br class="">+<br class="">+A::A (const A& rhs) :<br class="">+ m_int (rhs.m_int)<br class="">+{<br class="">+}<br class="">+<br class="">+const A &<br class="">+A::operator =(const A& rhs)<br class="">+{<br class="">+ m_int = rhs.m_int;<br class="">+ return *this;<br class="">+}<br class="">+<br class="">+int A::get_int()<br class="">+{<br class="">+ return m_int;<br class="">+}<br class="">+<br class="">+class B<br class="">+{<br class="">+public:<br class="">+ B () {}<br class="">+<br class="">+ A AInstance();<br class="">+};<br class="">+<br class="">+A<br class="">+B::AInstance()<br class="">+{<br class="">+ A a(12);<br class="">+ return a;<br class="">+}<br class="">+<br class="">+int main (int argc, char const *argv[])<br class="">+{<br class="">+ B b;<br class="">+ int return_val = b.AInstance().get_int();<br class="">+<br class="">+ A a(b.AInstance());<br class="">+ return return_val;<br class="">+}<br class=""><br class="">Added: debuginfo-tests/trunk/tests/stack-var.c<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/stack-var.c?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/stack-var.c?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/stack-var.c (added)<br class="">+++ debuginfo-tests/trunk/tests/stack-var.c Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,18 @@<br class="">+// RUN: %clang %target_itanium_abi_host_triple %s -O -o %t.out -g<br class="">+// RUN: %test_debuginfo %s %t.out<br class="">+<br class="">+void __attribute__((noinline, optnone)) bar(int *test) {}<br class="">+int main() {<br class="">+ int test;<br class="">+ test = 23;<br class="">+ // DEBUGGER: break 12<br class="">+ // DEBUGGER: r<br class="">+ // DEBUGGER: p test<br class="">+ // CHECK: = 23<br class="">+ bar(&test);<br class="">+ // DEBUGGER: break 17<br class="">+ // DEBUGGER: c<br class="">+ // DEBUGGER: p test<br class="">+ // CHECK: = 23<br class="">+ return test;<br class="">+}<br class=""><br class="">Added: debuginfo-tests/trunk/tests/static-member-2.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/static-member-2.cpp?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/static-member-2.cpp?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/static-member-2.cpp (added)<br class="">+++ debuginfo-tests/trunk/tests/static-member-2.cpp Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,39 @@<br class="">+// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -o %t -c<br class="">+// RUN: %clangxx %target_itanium_abi_host_triple %t -o %t.out<br class="">+// RUN: %test_debuginfo %s %t.out<br class="">+<br class="">+// FIXME: LLDB finds the wrong symbol for "C". <a href="rdar://problem/14933867" class="">rdar://problem/14933867</a><br class="">+// XFAIL: darwin<br class="">+<br class="">+// DEBUGGER: delete breakpoints<br class="">+// DEBUGGER: break static-member.cpp:33<br class="">+// DEBUGGER: r<br class="">+// DEBUGGER: ptype C<br class="">+// CHECK: {{struct|class}} C {<br class="">+// CHECK: static const int a;<br class="">+// CHECK-NEXT: static int b;<br class="">+// CHECK-NEXT: static int c;<br class="">+// CHECK-NEXT: int d;<br class="">+// CHECK-NEXT: }<br class="">+// DEBUGGER: p C::a<br class="">+// CHECK: ${{[0-9]}} = 4<br class="">+// DEBUGGER: p C::c<br class="">+// CHECK: ${{[0-9]}} = 15<br class="">+<br class="">+// PR14471, PR14734<br class="">+<br class="">+class C {<br class="">+public:<br class="">+ const static int a = 4;<br class="">+ static int b;<br class="">+ static int c;<br class="">+ int d;<br class="">+};<br class="">+<br class="">+int C::c = 15;<br class="">+const int C::a;<br class="">+<br class="">+int main() {<br class="">+ C instance_C;<br class="">+ return C::a;<br class="">+}<br class=""><br class="">Added: debuginfo-tests/trunk/tests/static-member.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/static-member.cpp?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/static-member.cpp?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/static-member.cpp (added)<br class="">+++ debuginfo-tests/trunk/tests/static-member.cpp Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,36 @@<br class="">+// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -o %t -c<br class="">+// RUN: %clangxx %target_itanium_abi_host_triple %t -o %t.out<br class="">+// RUN: %test_debuginfo %s %t.out<br class="">+<br class="">+// DEBUGGER: delete breakpoints<br class="">+// DEBUGGER: break static-member.cpp:33<br class="">+// DEBUGGER: r<br class="">+// DEBUGGER: ptype MyClass<br class="">+// CHECK: {{struct|class}} MyClass {<br class="">+// CHECK: static const int a;<br class="">+// CHECK-NEXT: static int b;<br class="">+// CHECK-NEXT: static int c;<br class="">+// CHECK-NEXT: int d;<br class="">+// CHECK-NEXT: }<br class="">+// DEBUGGER: p MyClass::a<br class="">+// CHECK: ${{[0-9]}} = 4<br class="">+// DEBUGGER: p MyClass::c<br class="">+// CHECK: ${{[0-9]}} = 15<br class="">+<br class="">+// PR14471, PR14734<br class="">+<br class="">+class MyClass {<br class="">+public:<br class="">+ const static int a = 4;<br class="">+ static int b;<br class="">+ static int c;<br class="">+ int d;<br class="">+};<br class="">+<br class="">+int MyClass::c = 15;<br class="">+const int MyClass::a;<br class="">+<br class="">+int main() {<br class="">+ MyClass instance_MyClass;<br class="">+ return MyClass::a;<br class="">+}<br class=""><br class="">Added: debuginfo-tests/trunk/tests/vla.c<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/vla.c?rev=318435&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/tests/vla.c?rev=318435&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/tests/vla.c (added)<br class="">+++ debuginfo-tests/trunk/tests/vla.c Thu Nov 16 10:26:20 2017<br class="">@@ -0,0 +1,24 @@<br class="">+// This test case verifies the debug location for variable-length arrays.<br class="">+// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">+// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out<br class="">+// RUN: %test_debuginfo %s %t.out<br class="">+//<br class="">+// DEBUGGER: break 18<br class="">+// DEBUGGER: r<br class="">+// DEBUGGER: p vla[0]<br class="">+// CHECK: 23<br class="">+// DEBUGGER: p vla[1]<br class="">+// CHECK: 22<br class="">+<br class="">+void init_vla(int size) {<br class="">+ int i;<br class="">+ int vla[size];<br class="">+ for (i = 0; i < size; i++)<br class="">+ vla[i] = size-i;<br class="">+ vla[0] = size; // line 18<br class="">+}<br class="">+<br class="">+int main(int argc, const char **argv) {<br class="">+ init_vla(23);<br class="">+ return 0;<br class="">+}<br class=""><br class="">Removed: debuginfo-tests/trunk/vla.c<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/vla.c?rev=318434&view=auto" class="">http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/vla.c?rev=318434&view=auto</a><br class="">==============================================================================<br class="">--- debuginfo-tests/trunk/vla.c (original)<br class="">+++ debuginfo-tests/trunk/vla.c (removed)<br class="">@@ -1,24 +0,0 @@<br class="">-// This test case verifies the debug location for variable-length arrays.<br class="">-// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o<br class="">-// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out<br class="">-// RUN: %test_debuginfo %s %t.out <br class="">-//<br class="">-// DEBUGGER: break 18<br class="">-// DEBUGGER: r<br class="">-// DEBUGGER: p vla[0]<br class="">-// CHECK: 23<br class="">-// DEBUGGER: p vla[1]<br class="">-// CHECK: 22<br class="">-<br class="">-void init_vla(int size) {<br class="">- int i;<br class="">- int vla[size];<br class="">- for (i = 0; i < size; i++)<br class="">- vla[i] = size-i;<br class="">- vla[0] = size; // line 18<br class="">-}<br class="">-<br class="">-int main(int argc, const char **argv) {<br class="">- init_vla(23);<br class="">- return 0;<br class="">-}<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br class=""></div></div></blockquote></div><br class=""></div></body></html>