From 0236cb689550ed2dac406443c652efb723cb2602 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Thu, 23 Jan 2025 13:04:36 +0100 Subject: [lldb] Enable "frame diagnose" on linux (#123217) .. by changing the signal stop reason format :facepalm: 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. --- lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp') diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp index de047ee214c1..a6d6a78357fe 100644 --- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp @@ -326,14 +326,14 @@ void NativeThreadLinux::AnnotateSyncTagCheckFault(lldb::addr_t fault_addr) { } // We assume that the stop description is currently: - // signal SIGSEGV: sync tag check fault (fault address: ) + // signal SIGSEGV: sync tag check fault (fault address=) // Remove the closing ) m_stop_description.pop_back(); std::stringstream ss; std::unique_ptr manager(std::move(details->manager)); - ss << " logical tag: 0x" << std::hex << manager->GetLogicalTag(fault_addr); + ss << " logical tag=0x" << std::hex << manager->GetLogicalTag(fault_addr); std::vector allocation_tag_data; // The fault address may not be granule aligned. ReadMemoryTags will granule @@ -347,7 +347,7 @@ void NativeThreadLinux::AnnotateSyncTagCheckFault(lldb::addr_t fault_addr) { llvm::Expected> allocation_tag = manager->UnpackTagsData(allocation_tag_data, 1); if (allocation_tag) { - ss << " allocation tag: 0x" << std::hex << allocation_tag->front() << ")"; + ss << " allocation tag=0x" << std::hex << allocation_tag->front() << ")"; } else { llvm::consumeError(allocation_tag.takeError()); ss << ")"; -- cgit v1.2.3