Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class GsymCreator {
bool IsSegment = false;
bool Finalized = false;
bool Quiet;

bool UseMergedFuncs = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we document this variable?


/// Get the first function start address.
///
Expand Down Expand Up @@ -486,6 +486,9 @@ class GsymCreator {
/// encode.
llvm::Expected<std::unique_ptr<GsymCreator>>
createSegment(uint64_t SegmentSize, size_t &FuncIdx) const;

bool getUseMergedFunctions() const { return UseMergedFuncs; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems you're matching get/set pair, but this is just about checking a status. I prefer isSomething() for the check. Maybe isUsingMergedFunctions(). For the set part, you can do enableUseMergedFunctions(bool) or something.

void setUseMergedFunctions(bool Enable) { UseMergedFuncs = Enable; }
};

} // namespace gsym
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ static void convertFunctionLineTable(OutputAggregator &Out, CUInfo &CUI,
OS << "warning: duplicate line table detected for DIE:\n";
Die.dump(OS, 0, DIDumpOptions::getForSingleDIE());
});
else
else if (!Gsym.getUseMergedFunctions())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out.Report("Non-monotonically increasing addresses",
[&](raw_ostream &OS) {
OS << "error: line table has addresses that do not "
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using namespace llvm;
using namespace gsym;

GsymCreator::GsymCreator(bool Quiet)
: StrTab(StringTableBuilder::ELF), Quiet(Quiet) {
: StrTab(StringTableBuilder::ELF), Quiet(Quiet), UseMergedFuncs(false) {
insertFile(StringRef());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
# RUN: split-file %s %t
# RUN: yaml2obj %t/merged_callsites.dSYM.yaml -o %t/merged_callsites.dSYM

# RUN: llvm-gsymutil --convert=%t/merged_callsites.dSYM --merged-functions --callsites-yaml-file=%t/callsites.yaml -o %t/call_sites_dSYM.gsym
# RUN: llvm-gsymutil --convert=%t/merged_callsites.dSYM --merged-functions --dwarf-callsites -o %t/dwarf_call_sites_dSYM.gsym
# RUN: llvm-gsymutil --convert=%t/merged_callsites.dSYM --merged-functions --callsites-yaml-file=%t/callsites.yaml -o %t/call_sites_dSYM.gsym | FileCheck --check-prefix=CHECK-CONVERT %s
# RUN: llvm-gsymutil --convert=%t/merged_callsites.dSYM --merged-functions --dwarf-callsites -o %t/dwarf_call_sites_dSYM.gsym | FileCheck --check-prefix=CHECK-CONVERT %s

# Dump the GSYM file and check the output for callsite information
# RUN: llvm-gsymutil %t/call_sites_dSYM.gsym | FileCheck --check-prefix=CHECK-MERGED-CALLSITES %s
# RUN: llvm-gsymutil %t/dwarf_call_sites_dSYM.gsym | FileCheck --check-prefix=CHECK-MERGED-CALLSITES %s

# CHECK-CONVERT-NOT: line table has addresses that do not monotonically increase
# CHECK-CONVERT-NOT: Non-monotonically increasing addresses occurred

# CHECK-MERGED-CALLSITES: FunctionInfo @ 0x[[#%x,FUNC4_1:]]: [0x[[#%x,FUNC4_1_START:]] - 0x[[#%x,FUNC4_1_END:]]) "function4_copy1"
# CHECK-MERGED-CALLSITES: ++ Merged FunctionInfos[0]:
# CHECK-MERGED-CALLSITES-NEXT: [0x[[#%x,FUNC4_2_START:]] - 0x[[#%x,FUNC4_2_END:]]) "function4_copy2"
Expand Down
1 change: 1 addition & 0 deletions llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ static llvm::Error handleObjectFile(ObjectFile &Obj, const std::string &OutFile,
NumThreads > 0 ? NumThreads : std::thread::hardware_concurrency();

GsymCreator Gsym(Quiet);
Gsym.setUseMergedFunctions(UseMergedFunctions);

// See if we can figure out the base address for a given object file, and if
// we can, then set the base address to use to this value. This will ease
Expand Down
Loading