Skip to content

Commit df9e0d1

Browse files
authored
Merge pull request #6394 from Michael137/bugfix/lldb-ignore-ranges-frame-var-to-20221013
[cherry-pick][stable/20221013] Revert "[lldb] Ignore libcxx std::ranges global variables in frame var"
2 parents 43db6a5 + 8714d8c commit df9e0d1

File tree

7 files changed

+2
-69
lines changed

7 files changed

+2
-69
lines changed

lldb/include/lldb/Target/LanguageRuntime.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,6 @@ class LanguageRuntime : public Runtime, public PluginInterface {
172172
return llvm::None;
173173
}
174174

175-
/// Returns 'true' if we the variable with the specified 'name'
176-
/// should be hidden from variable views (e.g., when listing variables in
177-
/// 'frame variable' or 'target variable')
178-
virtual bool ShouldHideVariable(llvm::StringRef name) const { return false; }
179-
180175
void ModulesDidLoad(const ModuleList &module_list) override {}
181176

182177
// Called by ClangExpressionParser::PrepareForExecution to query for any

lldb/source/Core/ValueObject.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,20 +1679,12 @@ bool ValueObject::IsRuntimeSupportValue() {
16791679
if (!process)
16801680
return false;
16811681

1682-
if (!GetVariable())
1683-
return false;
1684-
1685-
auto *runtime = process->GetLanguageRuntime(GetVariable()->GetLanguage());
1686-
if (runtime)
1687-
if (runtime->ShouldHideVariable(GetName().GetStringRef()))
1688-
return true;
1689-
16901682
// We trust that the compiler did the right thing and marked runtime support
16911683
// values as artificial.
1692-
if (!GetVariable()->IsArtificial())
1684+
if (!GetVariable() || !GetVariable()->IsArtificial())
16931685
return false;
16941686

1695-
if (runtime)
1687+
if (auto *runtime = process->GetLanguageRuntime(GetVariable()->GetLanguage()))
16961688
if (runtime->IsAllowedRuntimeValue(GetName()))
16971689
return false;
16981690

lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "lldb/Target/StackFrame.h"
2929
#include "lldb/Target/ThreadPlanRunToAddress.h"
3030
#include "lldb/Target/ThreadPlanStepInRange.h"
31-
#include "lldb/Utility/RegularExpression.h"
3231
#include "lldb/Utility/Timer.h"
3332

3433
using namespace lldb;
@@ -41,17 +40,6 @@ char CPPLanguageRuntime::ID = 0;
4140
CPPLanguageRuntime::CPPLanguageRuntime(Process *process)
4241
: LanguageRuntime(process) {}
4342

44-
bool CPPLanguageRuntime::ShouldHideVariable(llvm::StringRef name) const {
45-
// Matches the global function objects in std::ranges/std::ranges::views
46-
// E.g.,
47-
// std::__1::ranges::views::__cpo::take
48-
// std::__1::ranges::__cpo::max_element
49-
static RegularExpression ignore_global_ranges_pattern(
50-
"std::__[[:alnum:]]+::ranges(::views)*::__cpo");
51-
52-
return ignore_global_ranges_pattern.Execute(name);
53-
}
54-
5543
bool CPPLanguageRuntime::IsAllowedRuntimeValue(ConstString name) {
5644
return name == g_this;
5745
}

lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ class CPPLanguageRuntime : public LanguageRuntime {
7777
lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread,
7878
bool stop_others) override;
7979

80-
bool ShouldHideVariable(llvm::StringRef name) const override;
81-
8280
bool IsAllowedRuntimeValue(ConstString name) override;
8381
protected:
8482
// Classes that inherit from CPPLanguageRuntime can see and modify these

lldb/test/API/lang/cpp/hide_global_ranges_vars/Makefile

Lines changed: 0 additions & 4 deletions
This file was deleted.

lldb/test/API/lang/cpp/hide_global_ranges_vars/TestHideGlobalRangesVars.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

lldb/test/API/lang/cpp/hide_global_ranges_vars/main.cpp

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)