Skip to content

Commit 92fb650

Browse files
[lldb] Strip pointer metadata when in Swift Task formatters
This is mostly a cosmetic choice (and also to fix test expectations). Users don't need the metadata when running `task` commands that expect a pointer.
1 parent 761ac92 commit 92fb650

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lldb/source/Plugins/Language/Swift/SwiftFormatters.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,8 @@ class TaskSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
863863
m_ts->GetTypeFromMangledTypename(ConstString("$sSVD"));
864864

865865
addr_t value = m_task_ptr;
866+
if (auto process_sp = m_backend.GetProcessSP())
867+
value = process_sp->FixDataAddress(value);
866868
DataExtractor data{reinterpret_cast<const void *>(&value),
867869
sizeof(value), endian::InlHostByteOrder(),
868870
sizeof(void *)};
@@ -903,7 +905,7 @@ class TaskSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
903905
parent_addr = 0;
904906
}
905907

906-
addr_t value = parent_addr;
908+
addr_t value = process_sp->FixDataAddress(parent_addr);
907909
DataExtractor data{reinterpret_cast<const void *>(&value),
908910
sizeof(value), endian::InlHostByteOrder(),
909911
sizeof(void *)};

0 commit comments

Comments
 (0)