[PATCH] D156834: Remove some noisy log messages from showing up in llvm-gsymutil output.
Greg Clayton via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 1 15:56:35 PDT 2023
clayborg created this revision.
clayborg added reviewers: ayermolo, aprantl, yinghuitan.
Herald added a subscriber: hiraditya.
Herald added a project: All.
clayborg requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This patch removes two log messages that were causing noisy output:
- when we have a zero sized symbol that gets removed in favor of something with a size or with debug info
- when an inlined function's address range has the same high and low pc, don't emit an error message as this is a common technique to indicate a function has been stripped or is no longer present.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D156834
Files:
llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
Index: llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
===================================================================
--- llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
+++ llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
@@ -270,11 +270,9 @@
}
} else {
if (Prev.Range.size() == 0 && Curr.Range.contains(Prev.Range.start())) {
- if (!Quiet) {
- OS << "warning: removing symbol:\n"
- << Prev << "\nKeeping:\n"
- << Curr << "\n";
- }
+ // Symbols on macOS don't have address ranges, so if the range
+ // doesn't match and the size is zero, then we replace the empty
+ // symbol function info with the current one.
std::swap(Prev, Curr);
} else {
FinalizedFuncs.emplace_back(std::move(Curr));
Index: llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
===================================================================
--- llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
+++ llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
@@ -221,13 +221,17 @@
// Check that the inlined function is within the any of the range the
// parent InlineInfo. If it isn't remove it!
AddressRange InlineRange(Range.LowPC, Range.HighPC);
- if (parent.Ranges.contains(InlineRange)) {
- II.Ranges.insert(InlineRange);
- } else {
- Log << "error: inlined function DIE at " << HEX32(Die.getOffset())
- << " has a range [" << HEX64(Range.LowPC) << " - "
- << HEX64(Range.HighPC) << ") that isn't contained in any parent "
- << "address ranges, this inline range will be removed.\n";
+ // Check for empty inline range in case inline function was outlined
+ // or has not code
+ if (!InlineRange.empty()) {
+ if (parent.Ranges.contains(InlineRange)) {
+ II.Ranges.insert(InlineRange);
+ } else {
+ Log << "error: inlined function DIE at " << HEX32(Die.getOffset())
+ << " has a range [" << HEX64(Range.LowPC) << " - "
+ << HEX64(Range.HighPC) << ") that isn't contained in any parent "
+ << "address ranges, this inline range will be removed.\n";
+ }
}
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156834.546256.patch
Type: text/x-patch
Size: 2279 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230801/488addcb/attachment.bin>
More information about the llvm-commits
mailing list