
.. by changing the signal stop reason format 🤦 The reason this did not work is because the code in `StopInfo::GetCrashingDereference` was looking for the string "address=" to extract the address of the crash. Macos stop reason strings have the form ``` EXC_BAD_ACCESS (code=1, address=0xdead) ``` while on linux they look like: ``` signal SIGSEGV: address not mapped to object (fault address: 0xdead) ``` Extracting the address from a string sounds like a bad idea, but I suppose there's some value in using a consistent format across platforms, so this patch changes the signal format to use the equals sign as well. All of the diagnose tests pass except one, which appears to fail due to something similar #115453 (disassembler reports unrelocated call targets). I've left the tests disabled on windows, as the stop reason reporting code works very differently there, and I suspect it won't work out of the box. If I'm wrong -- the XFAIL will let us know.
25 lines
822 B
Python
25 lines
822 B
Python
"""
|
|
Test the output of `frame diagnose` for dereferencing a local variable
|
|
"""
|
|
|
|
|
|
import lldb
|
|
from lldbsuite.test.decorators import *
|
|
from lldbsuite.test.lldbtest import *
|
|
from lldbsuite.test import lldbutil
|
|
|
|
|
|
class TestLocalVariable(TestBase):
|
|
@expectedFailureAll(oslist=["windows"])
|
|
@skipIf(
|
|
archs=no_match(["x86_64"])
|
|
) # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
|
|
def test_local_variable(self):
|
|
TestBase.setUp(self)
|
|
self.build()
|
|
exe = self.getBuildArtifact("a.out")
|
|
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
|
|
self.runCmd("run", RUN_SUCCEEDED)
|
|
self.expect("thread list", "Thread should be stopped", substrs=["stopped"])
|
|
self.expect("frame diagnose", "Crash diagnosis was accurate", substrs=["myInt"])
|