summaryrefslogtreecommitdiffstats
path: root/lldb/test/lang
diff options
context:
space:
mode:
authorSiva Chandra <sivachandra@google.com>2015-03-27 00:10:04 +0000
committerSiva Chandra <sivachandra@google.com>2015-03-27 00:10:04 +0000
commit462722d135431de2b35d410b941d61d4968b58af (patch)
tree13c44ee21c793114bae5fb0cbfbef1315ba8f37c /lldb/test/lang
parent7dd1d0630ee127eaeedc23f9c02212467aac5c62 (diff)
downloadbcm5719-llvm-462722d135431de2b35d410b941d61d4968b58af.tar.gz
bcm5719-llvm-462722d135431de2b35d410b941d61d4968b58af.zip
[DWARF] Generate qualified names of functions if linkage names are missing.
Summary: This is similar to the change introduced for variable DIEs in r233098. If the linkage names of functions are missing in the DWARF, then their fully qualified names (similar to the name that would be got by demangling their linkage name) is generated using the decl context. This change fixes TestNamespace when the test case is compiled with GCC, hence it is enabled for GCC. The test and the test case are also enhanced to cover variadic functions. Test Plan: dotest.py -C <clang|gcc> -p TestNamespace Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8623 llvm-svn: 233336
Diffstat (limited to 'lldb/test/lang')
-rw-r--r--lldb/test/lang/cpp/namespace/TestNamespace.py4
-rw-r--r--lldb/test/lang/cpp/namespace/main.cpp17
2 files changed, 20 insertions, 1 deletions
diff --git a/lldb/test/lang/cpp/namespace/TestNamespace.py b/lldb/test/lang/cpp/namespace/TestNamespace.py
index e9f78e03676..4e249264b1c 100644
--- a/lldb/test/lang/cpp/namespace/TestNamespace.py
+++ b/lldb/test/lang/cpp/namespace/TestNamespace.py
@@ -21,7 +21,6 @@ class NamespaceTestCase(TestBase):
self.namespace_variable_commands()
# rdar://problem/8668674
- @expectedFailureGcc # llvm.org/pr15302: lldb does not print 'anonymous namespace' when the inferior is built with GCC (4.7)
@dwarf_test
def test_with_dwarf_and_run_command(self):
"""Test that anonymous and named namespace variables display correctly."""
@@ -117,6 +116,9 @@ class NamespaceTestCase(TestBase):
self.expect("p myanonfunc",
patterns = ['\(anonymous namespace\)::myanonfunc\(int\)'])
+ self.expect("p variadic_sum",
+ patterns = ['\(anonymous namespace\)::variadic_sum\(int, ...\)'])
+
if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
diff --git a/lldb/test/lang/cpp/namespace/main.cpp b/lldb/test/lang/cpp/namespace/main.cpp
index 9f3583b47e2..4dec275c2c5 100644
--- a/lldb/test/lang/cpp/namespace/main.cpp
+++ b/lldb/test/lang/cpp/namespace/main.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+#include <cstdarg>
+
namespace {
typedef unsigned int my_uint_t;
int i; // Find the line number for anonymous namespace variable i.
@@ -15,6 +17,20 @@ namespace {
{
return a + a;
}
+
+ int
+ variadic_sum (int arg_count...)
+ {
+ int sum = 0;
+ va_list args;
+ va_start(args, arg_count);
+
+ for (int i = 0; i < arg_count; i++)
+ sum += va_arg(args, int);
+
+ va_end(args);
+ return sum;
+ }
}
namespace A {
@@ -67,6 +83,7 @@ int Foo::myfunc(int a)
j = 4;
printf("::i=%d\n", ::i);
printf("A::B::j=%d\n", A::B::j);
+ printf("variadic_sum=%d\n", variadic_sum(3, 1, 2, 3));
myanonfunc(3);
return myfunc2(3) + j + i + a + 2 + anon_uint + a_uint + b_uint + y_uint; // Set break point at this line.
}
OpenPOWER on IntegriCloud