aboutsummaryrefslogtreecommitdiff
path: root/lldb/tools
diff options
context:
space:
mode:
authorAdrian Prantl <adrian-prantl@users.noreply.github.com>2024-01-09 10:45:30 -0800
committerGitHub <noreply@github.com>2024-01-09 10:45:30 -0800
commitfa9284589f111cfd3614a75bfbe0709db39a8f15 (patch)
tree32bc0b6656ec2dc17caa6d47b6d6e1c90f95e48d /lldb/tools
parent7620f03ef7a662384d67b6bd1fad8582dfe9dd82 (diff)
downloadllvm-fa9284589f111cfd3614a75bfbe0709db39a8f15.zip
llvm-fa9284589f111cfd3614a75bfbe0709db39a8f15.tar.gz
llvm-fa9284589f111cfd3614a75bfbe0709db39a8f15.tar.bz2
[lldb] DWARFDIE: Follow DW_AT_specification when computing CompilerCo… (#77157)
…ntext Following the specification chain seems to be clearly the expected behavior of GetDeclContext(). Otherwise C++ methods have an empty CompilerContext instead of being nested in their struct/class. Theprimary motivation for this functionality is the Swift plugin. In order to test the change I added a proof-of-concept implementation of a Module::FindFunction() variant that takes a CompilerContext, expesed via lldb-test. rdar://120553412
Diffstat (limited to 'lldb/tools')
-rw-r--r--lldb/tools/lldb-test/lldb-test.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/tools/lldb-test/lldb-test.cpp b/lldb/tools/lldb-test/lldb-test.cpp
index e326a84..33281cf 100644
--- a/lldb/tools/lldb-test/lldb-test.cpp
+++ b/lldb/tools/lldb-test/lldb-test.cpp
@@ -466,6 +466,7 @@ static lldb::DescriptionLevel GetDescriptionLevel() {
Error opts::symbols::findFunctions(lldb_private::Module &Module) {
SymbolFile &Symfile = *Module.GetSymbolFile();
SymbolContextList List;
+ auto compiler_context = parseCompilerContext();
if (!File.empty()) {
assert(Line != 0);
@@ -498,6 +499,9 @@ Error opts::symbols::findFunctions(lldb_private::Module &Module) {
assert(RE.IsValid());
List.Clear();
Symfile.FindFunctions(RE, true, List);
+ } else if (!compiler_context.empty()) {
+ List.Clear();
+ Module.FindFunctions(compiler_context, getFunctionNameFlags(), {}, List);
} else {
Expected<CompilerDeclContext> ContextOr = getDeclContext(Symfile);
if (!ContextOr)