summaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.cpp
AgeCommit message (Collapse)Author
2025-06-06[llvm-debuginfo-analyzer] Add support for parsing DWARF / CodeView ↵Javier Lopez-Gomez
SourceLanguage (#137223) This pull request adds support for parsing the source language in both DWARF and CodeView. Specifically, - The `LVSourceLanguage` class is introduced to represent any supported language by any of the debug info representations. - Update `LVDWARFReader.cpp` and `LVCodeViewVisitor.cpp` to parse the source language where it applies. Added a new `=Language` attribute; `getAttributeLanguage()` is internally used to control whether this information is being printed.
2025-05-22[llvm-debuginfo-analyzer] Add support for DWARF `DW_AT_byte_size` (#139110)Javier Lopez-Gomez
This PR was split from https://github.com/llvm/llvm-project/pull/137228 (which introduced support for `DW_TAG_module` and `DW_AT_byte_size`). This PR improves `LVDWARFReader` by introducing handling of `DW_AT_byte_size`. Most DWARF emitters include this attribute for types to specify the size of an entity of the given type.
2025-02-26[DebugInfo] Avoid repeated map lookups (NFC) (#128826)Kazu Hirata
2025-02-21[DebugInfo] Avoid repeated hash lookups (NFC) (#128127)Kazu Hirata
2024-11-17[DebugInfo] Remove unused includes (NFC) (#116551)Kazu Hirata
Identified with misc-include-cleaner.
2024-10-11[DebugInfo] Avoid repeated map lookups (NFC) (#111936)Kazu Hirata
2024-05-07[Analysis, CodeGen, DebugInfo] Use StringRef::operator== instead of ↵Kazu Hirata
StringRef::equals (NFC) (#91304) I'm planning to remove StringRef::equals in favor of StringRef::operator==. - StringRef::operator==/!= outnumber StringRef::equals by a factor of 53 under llvm/ in terms of their usage. - The elimination of StringRef::equals brings StringRef closer to std::string_view, which has operator== but not equals. - S == "foo" is more readable than S.equals("foo"), especially for !Long.Expression.equals("str") vs Long.Expression != "str".
2023-10-12[llvm] Use llvm::erase_if (NFC)Kazu Hirata
2023-10-10Use llvm::endianness::{big,little,native} (NFC)Kazu Hirata
Note that llvm::support::endianness has been renamed to llvm::endianness while becoming an enum class as opposed to an enum. This patch replaces llvm::support::{big,little,native} with llvm::endianness::{big,little,native}.
2023-09-27[llvm] Implement S_INLINEES debug symbol (#67490)Daniel Paoliello
The `S_INLINEES` debug symbol is used to record all the functions that are directly inlined within the current function (nested inlining is ignored). This change implements support for emitting the `S_INLINEES` debug symbol in LLVM, and cleans up how the `S_INLINEES` and `S_CALLEES` debug symbols are dumped.
2023-08-31Emit the CodeView `S_ARMSWITCHTABLE` debug symbol for jump tablesDaniel Paoliello
The CodeView `S_ARMSWITCHTABLE` debug symbol is used to describe the layout of a jump table, it contains the following information: * The address of the branch instruction that uses the jump table. * The address of the jump table. * The "base" address that the values in the jump table are relative to. * The type of each entry (absolute pointer, a relative integer, a relative integer that is shifted). Together this information can be used by debuggers and binary analysis tools to understand what an jump table indirect branch is doing and where it might jump to. Documentation for the symbol can be found in the Microsoft PDB library dumper: https://github.com/microsoft/microsoft-pdb/blob/0fe89a942f9a0f8e061213313e438884f4c9b876/cvdump/dumpsym7.cpp#L5518 This change adds support to LLVM to emit the `S_ARMSWITCHTABLE` debug symbol as well as to dump it out (for testing purposes). Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D149367
2023-08-25Revert "Emit the CodeView `S_ARMSWITCHTABLE` debug symbol for jump tables"Arthur Eubanks
This reverts commit 8d0c3db388143f4e058b5f513a70fd5d089d51c3. Causes crashes, see comments in https://reviews.llvm.org/D149367. Some follow-up fixes are also reverted: This reverts commit 636269f4fca44693bfd787b0a37bb0328ffcc085. This reverts commit 5966079cf4d4de0285004eef051784d0d9f7a3a6. This reverts commit e7294dbc85d24a08c716d9babbe7f68390cf219b.
2023-08-25Emit the CodeView `S_ARMSWITCHTABLE` debug symbol for jump tablesDaniel Paoliello
The CodeView `S_ARMSWITCHTABLE` debug symbol is used to describe the layout of a jump table, it contains the following information: * The address of the branch instruction that uses the jump table. * The address of the jump table. * The "base" address that the values in the jump table are relative to. * The type of each entry (absolute pointer, a relative integer, a relative integer that is shifted). Together this information can be used by debuggers and binary analysis tools to understand what an jump table indirect branch is doing and where it might jump to. Documentation for the symbol can be found in the Microsoft PDB library dumper: https://github.com/microsoft/microsoft-pdb/blob/0fe89a942f9a0f8e061213313e438884f4c9b876/cvdump/dumpsym7.cpp#L5518 This change adds support to LLVM to emit the `S_ARMSWITCHTABLE` debug symbol as well as to dump it out (for testing purposes). Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D149367
2023-06-19[DebugInfo] Support more than 2 operands in DWARF operationsScott Linder
Update DWARFExpression::Operation and LVOperation to support more than 2 operands. Take the opportunity to use a SmallVector, which will handle at least 2 operands without allocation anyway, and removes the static limit completely. As there is no longer the concept of an "unused operand", remove Operation::Encoding::SizeNA. Any use of it is now replaced with explicit checks for how many operands an operation has. There are still places where the limit remains 2, namely in the DWARFLinker and in DIExpressions, but these can be updated in later patches as-needed. There are no explicit tests as this is nearly NFC: no new operation is added which makes use of the additional operand capacity yet. A future patch adding a new DWARF extension point will include operations which require the support. Reviewed By: Orlando, CarlosAlbertoEnciso Differential Revision: https://reviews.llvm.org/D147270
2023-06-06reland: [Demangle] make llvm::demangle take std::string_view rather than ↵Nick Desaulniers
const std::string& As suggested by @erichkeane in https://reviews.llvm.org/D141451#inline-1429549 There's potential for a lot more cleanups around these APIs. This is just a start. Callers need to be more careful about sub-expressions producing strings that don't outlast the expression using `llvm::demangle`. Add a release note. Differential Revision: https://reviews.llvm.org/D149104
2023-05-02Revert "[Demangle] make llvm::demangle take std::string_view rather than ↵Nick Desaulniers
const std::string&" This reverts commit c117c2c8ba4afd45a006043ec6dd858652b2ffcc. itaniumDemangle calls std::strlen with the results of std::string_view::data() which may not be NUL-terminated. This causes lld/test/wasm/why-extract.s to fail when "expensive checks" are enabled via -DLLVM_ENABLE_EXPENSIVE_CHECKS=ON. See D149675 for further discussion. Back this out until the individual demanglers are converted to use std::string_view.
2023-05-02[Demangle] make llvm::demangle take std::string_view rather than const ↵Nick Desaulniers
std::string& As suggested by @erichkeane in https://reviews.llvm.org/D141451#inline-1429549 There's potential for a lot more cleanups around these APIs. This is just a start. Callers need to be more careful about sub-expressions producing strings that don't outlast the expression using ``llvm::demangle``. Add a release note. Reviewed By: MaskRay, #lld-macho Differential Revision: https://reviews.llvm.org/D149104
2023-02-27[llvm-debuginfo-analyzer] (09/09) - CodeView ReaderCarlos Alberto Enciso
llvm-debuginfo-analyzer is a command line tool that processes debug info contained in a binary file and produces a debug information format agnostic “Logical View”, which is a high-level semantic representation of the debug info, independent of the low-level format. The code has been divided into the following patches: 1) Interval tree 2) Driver and documentation 3) Logical elements 4) Locations and ranges 5) Select elements 6) Warning and internal options 7) Compare elements 8) ELF Reader 9) CodeView Reader Full details: https://discourse.llvm.org/t/llvm-dev-rfc-llvm-dva-debug-information-visual-analyzer/62570 This patch: This is a high level summary of the changes in this patch. CodeView Reader - Support for CodeView/PDB. LVCodeViewReader, LVTypeVisitor, LVSymbolVisitor, LVLogicalVisitor Reviewed By: psamolysov, probinson, djtodoro, zequanwu Differential Revision: https://reviews.llvm.org/D125784