Skip to content

Commit 7026a0c

Browse files
committed
[llvm][Support] Fix backtrace output by removing '#'. NFC
- '#' has the string "0x" prepended for non-zero values. That results in inconsistent behavior between zero and non-zero values.
1 parent 0f6ef9b commit 7026a0c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/lib/Support/Unix/Signals.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ public:
539539
uintptr_t StartAddress = Info->dlpi_addr + Phdr->p_vaddr;
540540
uintptr_t ModuleRelativeAddress = Phdr->p_vaddr;
541541
std::array<char, 4> ModeStr = modeStrFromFlags(Phdr->p_flags);
542-
OS << format("{{{mmap:%#016x:%#x:load:%d:%s:%#016x}}}\n", StartAddress,
542+
OS << format("{{{mmap:%016x:%x:load:%d:%s:%016x}}}\n", StartAddress,
543543
Phdr->p_memsz, ModuleCount, &ModeStr[0],
544544
ModuleRelativeAddress);
545545
}

llvm/unittests/Support/SignalsTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ TEST(SignalsTest, PrintsSymbolizerMarkup) {
4646
EXPECT_THAT(
4747
Res,
4848
MatchesRegex(".*" TAG_BEGIN
49-
"mmap:0x[0-9a-f]+:0x[0-9a-f]+:load:0:rx:[0-9a-f]+" TAG_END
49+
"mmap:[0-9a-f]+:[0-9a-f]+:load:0:rx:[0-9a-f]+" TAG_END
5050
".*"));
5151
// Backtrace line
5252
EXPECT_THAT(Res, MatchesRegex(".*" TAG_BEGIN "bt:0:[0-9a-f]+"

0 commit comments

Comments
 (0)