diff --git a/adapter/codelldb/src/debug_session/variables.rs b/adapter/codelldb/src/debug_session/variables.rs index 830f328d..b735c192 100644 --- a/adapter/codelldb/src/debug_session/variables.rs +++ b/adapter/codelldb/src/debug_session/variables.rs @@ -95,7 +95,7 @@ impl super::DebugSession { statics: true, in_scope_only: true, }); - let mut vars_iter = variables.iter().filter(|v| v.value_type() != ValueType::VariableStatic); + let mut vars_iter = variables.iter().filter(|v| v.value_type() == ValueType::VariableStatic); self.convert_scope_values(&mut vars_iter, "", Some(container_handle), false)? } Container::Globals(frame) => { @@ -105,7 +105,7 @@ impl super::DebugSession { statics: true, in_scope_only: true, }); - let mut vars_iter = variables.iter().filter(|v| v.value_type() != ValueType::VariableGlobal); + let mut vars_iter = variables.iter().filter(|v| v.value_type() == ValueType::VariableGlobal); self.convert_scope_values(&mut vars_iter, "", Some(container_handle), false)? } Container::Registers(frame) => { diff --git a/debuggee/cpp/types.cpp b/debuggee/cpp/types.cpp index 091e77e5..04b19244 100644 --- a/debuggee/cpp/types.cpp +++ b/debuggee/cpp/types.cpp @@ -24,6 +24,9 @@ class DerivedClass : public Class ~DerivedClass() override {} }; + +int global = 1234; + extern "C" void vars() { @@ -57,7 +60,7 @@ void vars() int a = 30; int b = 40; float pi = 3.14159265f; - static int sss = 555; + static int static_ = 555; const char c[] = "foobar"; const char c2[] = { 'F', 'o', 'o', 'B', 'a', 'r' }; int large_array[100000] = {0}; diff --git a/debuggee/rust/src/lib.rs b/debuggee/rust/src/lib.rs index 0bac9d38..5545440b 100644 --- a/debuggee/rust/src/lib.rs +++ b/debuggee/rust/src/lib.rs @@ -246,11 +246,15 @@ struct PyKeywords { raise: i32, } +static GLOBAL: i32 = 1234; + pub fn misc() { let i32_ = 32; let f32_ = 42.0; let closure = move |x: i32| (x + i32_) as f32 * f32_; + static STATIC: i32 = 4321; + let class = PyKeywords { finally: 1, import: 2,