Skip to content

[lldb] Fix TestDiagnoseDereferenceFunctionReturn on linux #128512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 25, 2025
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
11 changes: 6 additions & 5 deletions lldb/source/Target/StackFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1670,13 +1670,14 @@ lldb::ValueObjectSP DoGuessValueAt(StackFrame &frame, ConstString reg,
break;
case Instruction::Operand::Type::Immediate: {
SymbolContext sc;
Address load_address;
if (!frame.CalculateTarget()->ResolveLoadAddress(
operands[0].m_immediate, load_address)) {
if (!pc.GetModule())
break;
Address address(operands[0].m_immediate,
pc.GetModule()->GetSectionList());
if (!address.IsValid())
break;
}
frame.CalculateTarget()->GetImages().ResolveSymbolContextForAddress(
load_address, eSymbolContextFunction, sc);
address, eSymbolContextFunction, sc);
if (!sc.function) {
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class TestDiagnoseDereferenceFunctionReturn(TestBase):
@expectedFailureAll(oslist=no_match(lldbplatformutil.getDarwinOSTriples()))
@expectedFailureAll(oslist=["windows"])
@skipIf(
archs=no_match(["x86_64"])
) # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
Expand All @@ -19,9 +19,6 @@ def test_diagnose_dereference_function_return(self):
TestBase.setUp(self)
self.build()
exe = self.getBuildArtifact("a.out")
# FIXME: This default changed in lldbtest.py and this test
# seems to rely on having it turned off.
self.runCmd("settings set target.disable-aslr true")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped", substrs=["stopped"])
Expand Down