Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lldb/source/ValueObject/DILEval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ lldb::ValueObjectSP LookupGlobalIdentifier(
// Get a global variables list without the locals from the current frame
SymbolContext symbol_context =
stack_frame->GetSymbolContext(lldb::eSymbolContextCompUnit);
lldb::VariableListSP variable_list =
symbol_context.comp_unit->GetVariableList(true);
lldb::VariableListSP variable_list;
if (symbol_context.comp_unit)
variable_list = symbol_context.comp_unit->GetVariableList(true);

name_ref.consume_front("::");
lldb::ValueObjectSP value_sp;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CXX_SOURCES := main.cpp
CFLAGS_EXTRAS := -g0

include Makefile.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""
Test DIL without debug info.
"""

import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
from lldbsuite.test import lldbutil


class TestFrameVarDILNoDebugInfo(TestBase):
NO_DEBUG_INFO_TESTCASE = True

def test_no_debug_info(self):
self.build()
lldbutil.run_to_name_breakpoint(self, "main")

self.runCmd("settings set target.experimental.use-DIL true")

self.expect(
"frame var 'argc'",
error=True,
substrs=["use of undeclared identifier"],
)
self.expect(
"frame var 'foo'",
error=True,
substrs=["use of undeclared identifier"],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int foo = 1;

int main(int argc, char **argv) { return foo; }
Loading