summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-07-31 17:58:00 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-07-31 17:58:00 +0000
commit07b1a2b9ae12604566fd35f9f4f4a9230466b62b (patch)
tree8be790f80caa51a3743b8ea9f576ba592433e18c /lldb/packages/Python/lldbsuite/test
parent14ebf723158e520a359c363378be3efb9e69027d (diff)
downloadbcm5719-llvm-07b1a2b9ae12604566fd35f9f4f4a9230466b62b.tar.gz
bcm5719-llvm-07b1a2b9ae12604566fd35f9f4f4a9230466b62b.zip
Fix completion for functions in anonymous namespaces
I was going through some of the old bugs and came across PR21069 which I was able to reproduce. The issue is that we match the regex `^foo` against the `DW_AT_name` in the DWARF, which for our anonymous function is indeed `foo`. However, when we get the function name from the symbol context, the result is `(anonymous namespace)::foo()`. This throws off completions, which assumes that it's appending to whatever is already present on the input, resulting in a bogus `b fooonymous\ namespace)::foo()`. Bug report: https://llvm.org/PR21069 Differential revision: https://reviews.llvm.org/D65498 llvm-svn: 367455
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py3
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/completion/main.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py b/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
index c073425a93f..23d3d999ca2 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
@@ -297,3 +297,6 @@ class CommandLineCompletionTestCase(TestBase):
self.complete_from_to('breakpoint set -n Fo',
'breakpoint set -n Foo::Bar(int,\\ int)',
turn_off_re_match=True)
+ # No completion for Qu because the candidate is
+ # (anonymous namespace)::Quux().
+ self.complete_from_to('breakpoint set -n Qu', '')
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/completion/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/completion/main.cpp
index 0814bb9cc0a..eba81dc4c54 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/completion/main.cpp
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/completion/main.cpp
@@ -7,6 +7,8 @@ public:
}
};
+namespace { int Quux (void) { return 0; } }
+
struct Container { int MemberVar; };
int main()
@@ -17,5 +19,6 @@ int main()
Container container;
Container *ptr_container = &container;
+ int q = Quux();
return container.MemberVar = 3; // Break here
}
OpenPOWER on IntegriCloud