Fixed a bug that caused types to be incorrectly
looked up. Queries for global types were made
too specific -- including the current module
and compile unit in the query was limiting the
search when we wanted a truly global search.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131145 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Symbol/SymbolContext.cpp b/source/Symbol/SymbolContext.cpp
index 135cf3b..2a56c34 100644
--- a/source/Symbol/SymbolContext.cpp
+++ b/source/Symbol/SymbolContext.cpp
@@ -9,6 +9,7 @@
#include "lldb/Symbol/SymbolContext.h"
+#include "lldb/Core/Log.h"
#include "lldb/Core/Module.h"
#include "lldb/Interpreter/Args.h"
#include "lldb/Symbol/CompileUnit.h"
@@ -453,7 +454,11 @@
if (module_sp && module_sp->FindTypes (*this, name, false, 1, types))
return types.GetTypeAtIndex(0);
- if (!return_value.get() && target_sp && target_sp->GetImages().FindTypes (*this, name, false, 1, types))
+ SymbolContext sc_for_global_search;
+
+ sc_for_global_search.target_sp = target_sp;
+
+ if (!return_value.get() && target_sp && target_sp->GetImages().FindTypes (sc_for_global_search, name, false, 1, types))
return types.GetTypeAtIndex(0);
return return_value;