summaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/GSYM/ObjectFileTransformer.cpp
AgeCommit message (Collapse)Author
2024-11-17[DebugInfo] Remove unused includes (NFC) (#116551)Kazu Hirata
Identified with misc-include-cleaner.
2024-02-12Gsymutil aggregation similar to DwarfDump --verify (#81154)Kevin Frei
GsymUtil, like DwarfDump --verify, spews a *lot* of data necessary to understand/diagnose issues with DWARF data. The trouble is that the kind of information necessary to make the messages useful also makes them nearly impossible to easily categorize. I put together a similar output categorizer (https://github.com/llvm/llvm-project/pull/79648) that will emit a summary of issues identified at the bottom of the (very verbose) output, enabling easier tracking of issues as they arise or are addressed. There's a single output change, where a message "warning: Unable to retrieve DWO .debug_info section for some object files. (Remove the --quiet flag for full output)" was being dumped the first time it was encountered (in what looks like an attempt to make something easily grep-able), but rather than keep the output in the same order, that message is now a 'category' so gets emitted at the end of the output. The test 'tools/llvm-gsymutil/X86/elf-dwo.yaml' was changed to reflect this difference. --------- Co-authored-by: Kevin Frei <freik@meta.com>
2023-08-09Improve llvm-gsymutil performance in quiet mode.Greg Clayton
The GSYM code alwasy logging to streams even in quiet mode. When in quiet mode we would use the "nulls()" stream to avoid logging to the terminal, but this still caused logging functions to be called on DWARFDie objects and other messages which were quite expensive and not needed if we weren't logging anything. This patch switches some logs in performant areas to be "raw_ostream *" values and if the ostream pointer is NULL, then we don't call the expensive logging functions on DWARFDie and other objects which will improve performance. Differential Revision: https://reviews.llvm.org/D157466
2023-08-01Increase performance of llvm-gsymutil by up to 200%.Greg Clayton
llvm-gsymutil was maintaining an address ranges collection behind a mutex and having the multi-threaded code access this and hold the mutex was causing slowdown when converting DWARF to GSYM. This patch does the following: - removes the "Ranges" variable from the GsymCreator and any functions and places that used it - clients don't try to detect if a function has been added for an address range, we now remove any inferior copies of information in the GsymCreator::finalize() routine as was done before, we just have more items to remove, though performance is greator due to less mutex thread locking - after I started adding all of the inferior funtion info objects the previous patch that tried to remove infrior debug info had bugs in it, so I replace the removeIfBinary() function in GsymCreator with a more efficient and easier to debug way to do things which copies items from the GsymCreator::Funcs into a new vector of FunctionInfo objects and then replaces GsymCreator::Funcs at the end. - Sorting of FunctionInfo objects has been modified to also compare InlineInfo objects. We found cases where LTO was ruining inline function address ranges and we ended up with a variety of FunctionInfo objects for the same range that had varying amounts of valid debug info. This patch now ensure that two function info objects with different inline info for the same function address range, the best one will be picked to ensure the greatest fidelity. - If we detect that a DW_TAG_subprogram has inline functions and after parsing it, we don't end up with any valid inline information, we set the optional to std::nullopt to avoid emitting empty inline information and wasting space. My tests show a 200% perf increase on M1 macs and a 100% performance increase on linux machines for the same complex large DWARF input binary. Differential Revision: https://reviews.llvm.org/D156773
2020-05-02[Object] Change ObjectFile::getSymbolValue() return type to Expected<uint64_t>Xing GUO
Summary: In D77860, we have changed `getSymbolFlags()` return type to `Expected<uint32_t>`. This change helps bubble the error further up the stack. Reviewers: jhenderson, grimar, JDevlieghere, MaskRay Reviewed By: jhenderson Subscribers: hiraditya, MaskRay, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D79075
2020-04-28[DebugInfo] Fix crash caused by unhandled error.Xing GUO
Summary: This patch helps fix LLVM crash caused by unhandled error. Reviewers: clayborg, aprantl Reviewed By: clayborg Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78924
2020-02-25Add a llvm-gsymutil tool that can convert object files to GSYM and perform ↵Greg Clayton
lookups. Summary: This patch creates the llvm-gsymutil binary that can convert object files to GSYM using the --convert <path> option. It can also dump and lookup addresses within GSYM files that have been saved to disk. To dump a file: llvm-gsymutil /path/to/a.gsym To perform address lookups, like with atos, on GSYM files: llvm-gsymutil --address 0x1000 --address 0x1100 /path/to/a.gsym To convert a mach-o or ELF file, including any DWARF debug info contained within the object files: llvm-gsymutil --convert /path/to/a.out --out-file /path/to/a.out.gsym Conversion highlights: - convert DWARF debug info in mach-o or ELF files to GSYM - convert symbols in symbol table to GSYM and don't convert symbols that overlap with DWARF debug info - extract UUID from object files - extract .text (read + execute) section address ranges and filter out any DWARF or symbols that don't fall in those ranges. - if .text sections are extracted, and if the last gsym::FunctionInfo object has no size, cap the size to the end of the section the function was contained in Dumping GSYM files will dump all sections of the GSYM file in textual format. Reviewers: labath, aadsm, serhiy.redko, jankratochvil, xiaobai, wallace, aprantl, JDevlieghere, jdoerfert Subscribers: mgorny, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D74883