Skip to content

Commit

Permalink
Remove some noisy log messages from showing up in llvm-gsymutil output.
Browse files Browse the repository at this point in the history
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.

Differential Revision: https://reviews.llvm.org/D156834
  • Loading branch information
clayborg committed Aug 9, 2023
1 parent 18e161f commit a3afff9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
19 changes: 12 additions & 7 deletions llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,18 @@ static void parseInlineInfo(GsymCreator &Gsym, raw_ostream *Log, CUInfo &CUI,
// 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 if (Log) {
*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 if (Log) {
*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";
}
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,9 @@ llvm::Error GsymCreator::finalize(llvm::raw_ostream &OS) {
}
} 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));
Expand Down

0 comments on commit a3afff9

Please sign in to comment.