Commit Graph

15 Commits

Author SHA1 Message Date
Carlos Alberto Enciso 9d56d9a95f [llvm-debuginfo-analyzer] Fix memory leak reported by sanitizers.
The sanitizer reported memory leak issues; the command line
used in the test case is:

llvm-debuginfo-analyzer --attribute=level
                        --print=instructions
                        pr-incorrect-instructions-dwarf-clang.o

When dealing with logical instruction lines associated with
an artificial logical scope, skip the process of finding
their enclosing scope. Just add them to the scope.

Create logical debug lines only if the command line specifies:
  --print=lines or --print=elements or --print=all

Reviewed By: jryans, vitalybuka

Differential Revision: https://reviews.llvm.org/D137156
2022-11-02 06:07:33 +00:00
Carlos Alberto Enciso 1f9ef39968 [llvm-debuginfo-analyzer] (08/09) - ELF Reader
The fix for the unitest case introduced a dependency on the
MC library causing a failure in:

  https://lab.llvm.org/buildbot/#/builders/121/builds/24567
  clang-ppc64le-multistage/stage1
  undefined reference to symbol 'llvm::TargetRegistry::lookupTarget'

Added:
- MC to the LLVM_LINK_COMPONENTS list.

Reviewed By: jryans

Differential Revision: https://reviews.llvm.org/D136837
2022-10-27 13:05:18 +01:00
Carlos Alberto Enciso d858447584 [llvm-debuginfo-analyzer] (08/09) - ELF Reader
The unitest and test cases are platform dependent (x86_64)
causing failures in:

  https://lab.llvm.org/buildbot/#/builders/245/builds/146
  https://lab.llvm.org/buildbot/#/builders/188/builds/21397
  No available targets are compatible with triple "x86_64-unknown-unknown".

Added:
- ';REQUIRES: x86-registered-target' to the LIT tests.
- Code to check if the target 'Triple::x86_64' is supported to
  the unittest case.
2022-10-27 10:01:04 +01:00
Carlos Alberto Enciso 4f06d46f46 [llvm-debuginfo-analyzer] (08/09) - ELF Reader
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.

ELF Reader
- Support for ELF/DWARF.
  LVBinaryReader, LVELFReader

Reviewed By: psamolysov, probinson

Differential Revision: https://reviews.llvm.org/D125783
2022-10-27 05:37:51 +01:00
Carlos Alberto Enciso cddea67663 [llvm-debuginfo-analyzer] (07/09) - Compare elements
The test case 'CompareElements' caused a failure in:

  https://lab.llvm.org/buildbot#builders/5/builds/28502
  https://lab.llvm.org/buildbot#builders/168/builds/9671
  SUMMARY: AddressSanitizer: 2144 byte(s) leaked in 14 allocation(s).

The 'Insert' function conditionally adds the 'Child' logical
element to a logical scope. The not added logical elements,
caused the memory leak. Just record them to be destroyed
when the logical reader is destroyed.

Changed 'EXPECT_NE' with 'ASSERT_NE'.
Missing in the main review.
2022-10-24 19:23:44 +01:00
Carlos Alberto Enciso e98a4c5acb [llvm-debuginfo-analyzer] (07/09) - Compare elements
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:

Compare elements
- Support for logical elements comparison. See '--compare' options.
  LVCompare

Reviewed By: psamolysov, probinson

Differential Revision: https://reviews.llvm.org/D125782
2022-10-24 08:27:06 +01:00
Carlos Alberto Enciso 2c155d3799 [llvm-debuginfo-analyzer] (06/09) - Warning and internal options
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:

Warning and internal options
- Support for '--warning' options.
- Support for '--internal' options.

Reviewed By: psamolysov, probinson

Differential Revision: https://reviews.llvm.org/D125781
2022-10-24 05:12:57 +01:00
Simon Pilgrim 182d1c2a62 [DebugInfo] Fix MSVC warning: "truncation from 'double' to 'float'" 2022-10-21 10:16:40 +01:00
Carlos Alberto Enciso 0332a8e7d6 [llvm-debuginfo-analyzer] (05/09) - Select elements
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:

Select elements
- Support for logical elements selection:
  LVPatterns

Reviewed By: psamolysov, probinson

Differential Revision: https://reviews.llvm.org/D125780
2022-10-21 05:55:09 +01:00
Carlos Alberto Enciso a401ce4416 [llvm-debuginfo-analyzer] (04/09) - Locations and ranges
The test case 'LocationCoverage' caused a failure in:

  https://lab.llvm.org/buildbot/#/builders/5/builds/28385
  https://lab.llvm.org/buildbot/#/builders/168/builds/9585
  SUMMARY: AddressSanitizer: 176 byte(s) leaked in 2 allocation(s).

The logical debug locations 'LocationThree' and 'LocationFour'
are not added to any logical scope.

The test case is checking the logical symbol coverage and
it does not use those 2 debug locations.

Reviewed By: probinson

Differential Revision: https://reviews.llvm.org/D136333
2022-10-20 13:48:52 +01:00
Carlos Alberto Enciso 3c397c90c1 [llvm-debuginfo-analyzer] (04/09) - Locations and ranges
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:

Locations and ranges
- All functionality for logical debug locations and ranges:
  LVLocation, LVRanges.

Reviewed By: psamolysov, probinson

Differential Revision: https://reviews.llvm.org/D125779
2022-10-20 08:31:13 +01:00
Carlos Alberto Enciso e28b9357b1 [llvm-debuginfo-analyzer] (03/09) - Logical elements
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:

Logical elements
- All basic functionality for the logical elements:
  LVScope, LVLine, LVSymbol, LVType.
- The logical reader:
  LVReader.h

Reviewed By: psamolysov, probinson

Differential Revision: https://reviews.llvm.org/D125778
2022-10-20 06:19:20 +01:00
Carlos Alberto Enciso c28a977b87 Recommit [llvm-debuginfo-analyzer] (02/09) - Driver and documentation
Originally committed in fe7a3cedf7

Reverted in 26dd64ba9c

Buildbot failures:
https://lab.llvm.org/buildbot#builders/139/builds/29663
- unittest trigger an invalid assertion.

https://lab.llvm.org/buildbot#builders/196/builds/19665
- 'has virtual functions but non-virtual destructor' warning as error.

Recommitted with fix:
- Removed the assertion.
- Added virtual destructor.
2022-10-18 08:39:26 +01:00
Carlos Alberto Enciso 26dd64ba9c Revert "[llvm-debuginfo-analyzer] (02/09) - Driver and documentation"
This reverts commit fe7a3cedf7.
2022-10-17 14:26:48 +01:00
Carlos Alberto Enciso fe7a3cedf7 [llvm-debuginfo-analyzer] (02/09) - Driver and documentation
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:

Driver and documentation
- Command line options.
- Full documentation.
- String Pool table.

Reviewed By: psamolysov, probinson

Differential Revision: https://reviews.llvm.org/D125777
2022-10-17 13:46:55 +01:00