Skip to content

Commit

Permalink
Switch globals and statics
Browse files Browse the repository at this point in the history
  • Loading branch information
vadimcn committed Sep 15, 2023
1 parent 194d1d3 commit 5a7db41
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions adapter/codelldb/src/debug_session/variables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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) => {
Expand Down
5 changes: 4 additions & 1 deletion debuggee/cpp/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class DerivedClass : public Class
~DerivedClass() override {}
};


int global = 1234;

extern "C"
void vars()
{
Expand Down Expand Up @@ -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};
Expand Down
4 changes: 4 additions & 0 deletions debuggee/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5a7db41

Please sign in to comment.