From 14186773e79b8c6787afac2f9ee69738151377ec Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Tue, 30 May 2023 17:12:35 -0700 Subject: Fix SBValue::FindValue for file static variables This was just a thinko. The API StackFrame::GetVariableList takes a bool for "get_file_globals" which if true will also find file statics and file globals. But we only were passing that as true if the ValueType was eValueTypeVariableGlobal, which meant that we never find file statics. It's okay if we cast too wide a net when we do GetVariableList as later on we check against the ValueType to filter globals from statics. There was a test that had a whole bunch of globals and tested FindValue on all of them, but had no statics. So I just made one of the globals a file static, which verifies the fix. Differential Revision: https://reviews.llvm.org/D151392 --- lldb/test/API/python_api/process/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lldb/test/API/python_api/process/main.cpp') diff --git a/lldb/test/API/python_api/process/main.cpp b/lldb/test/API/python_api/process/main.cpp index 07cde05e2a05..54bf3590ad43 100644 --- a/lldb/test/API/python_api/process/main.cpp +++ b/lldb/test/API/python_api/process/main.cpp @@ -3,7 +3,7 @@ // This simple program is to test the lldb Python API related to process. -char my_char = 'u'; +static char my_char = 'u'; char my_cstring[] = "lldb.SBProcess.ReadCStringFromMemory() works!"; char *my_char_ptr = (char *)"Does it work?"; uint32_t my_uint32 = 12345; -- cgit v1.2.3