llvm-project
llvm-debuginfo-analyzer
These are the notes collected during the development, review and test. They describe limitations, known issues and future work.
Remove the use of macros in LVReader.h
that describe the bumpallocators
.
Use a standard (or LLVM)
with
(would need a specialization
to expose equality and hasher) for the allocators and the creation
functions could be a function template.
Use a lit test instead of a unit test for the logical readers.
As the
library is sufficiently exposed via the
tool, follow the LLVM general approach and
use
tests to validate the logical readers.
Convert the
:
llvm-project/llvm/unittests/DebugInfo/LogicalView/CodeViewReaderTest.cpp
llvm-project/llvm/unittests/DebugInfo/LogicalView/DWARFReaderTest.cpp
into
tests:
llvm-project/llvm/test/DebugInfo/LogicalView/CodeViewReader.test
llvm-project/llvm/test/DebugInfo/LogicalView/DWARFReader.test
Eliminate calls to getInputFileDirectory()
in the unittests
.
Rewrite the unittests
and
to eliminate
the call:
getInputFileDirectory()
as use of that call is discouraged.
Fix mismatch between %d/%x
format strings and uint64_t
type.
Incorrect printing of
on
platforms.
Add the
specifier to the printing code (
).
Remove LVScope::Children
container.
Use a chaining iterator over the other containers rather than keep a
separate container
that mirrors their contents.
Use TableGen
for command line options.
The current trend is to use
for command-line options in tools.
Change command line options to use
as many other LLVM tools.
LVDoubleMap
to return optional<ValueType>
instead of null pointer
.
The more idiomatic LLVM way to handle this would be to have
return
.
Pass references instead of pointers (Comparison functions).
In the comparison functions, pass references instead of pointers (when pointers cannot be null).
Use StringMap
where possible.
LLVM has a
class that is advertised as more efficient than
. Mainly it does fewer allocations
because the key is not a
.
Replace the use of
with
.
One specific case is the
definitions.
Calculate unique offset for CodeView elements.
In order to have the same logical functionality as the DWARF reader, such as:
- find scopes contribution to debug info
- sort by its physical location
The logical elements must have an unique offset (similar like the DWARF
offset).
Move initializeFileAndStringTables
to the CodeView Library.
There is some code in the CodeView reader that was extracted/adapted
from
that can be moved to the CodeView
library.
We had a similar case with code shared with
that was moved
to the PDB library: D122226
Move getSymbolKindName
and formatRegisterId
to the CodeView Library.
There is some code in the CodeView reader that was extracted/adapted
from
that can be used.
Use of std::unordered_set
instead of std::set
.
Replace the
usage for
,
and
with
and get the benefit
of the O(1) while inserting/searching, as the order is not important.
Optimize LVNamespaceDeduction::find
funtion.
Optimize the
method to use the proposed code:
LVStringRefs::iterator Iter = std::find_if(Components.begin(), Components.end(),
[](StringRef Name) {
return IdentifiedNamespaces.find(Name) == IdentifiedNamespaces.end();
});
LVStringRefs::size_type FirstNonNamespace = std::distance(Components.begin(), Iter);
Move all the printing support to a common module.
Factor out printing functionality from the logical elements into a common module.
Refactor LVBinaryReader::processLines
.
During the traversal of the debug information sections, we created the logical lines representing the disassembled instructions from the text section and the logical lines representing the line records from the debug line section. Using the ranges associated with the logical scopes, we will allocate those logical lines to their logical scopes.
Consider the case when any of those lines become orphans, causing incorrect scope parent for disassembly or line records.
Add support for -ffunction-sections
.
Only linked executables are handled. It does not support relocatable
files compiled with
.
Add support for DWARF v5 .debug_names
section / CodeView public symbols stream.
The DWARF and CodeView readers use the public names information to create
the instructions (
). Instead of relying on DWARF section
names (
,
) and CodeView public symbol stream
(
), the readers should collect the needed information while processing
the debug information.
If the object file supports the above section names and stream, use them to create the public names.
Add support for some extra DWARF locations.
The following DWARF debug location operands are not supported:
- DW_OP_const_type
- DW_OP_entry_value
- DW_OP_implicit_value
Add support for additional binary formats.
- Extended COFF (
)XCOFF
Add support for JSON
or YAML
The logical view uses its own and non-standard free form text when displaying information on logical elements.