diff options
| author | nerix <nerixdev@outlook.de> | 2025-10-31 10:33:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-31 10:33:37 +0100 |
| commit | 44fefe70e41a3b8e68545f45798740f74f4231cd (patch) | |
| tree | 51ba43ed772b79a20e06625bb3218a7d513962ec /lldb/test/API/functionalities/multiple-slides/TestMultipleSlides.py | |
| parent | f2443861d7850279280457a6090039bcf8c60748 (diff) | |
| download | llvm-44fefe70e41a3b8e68545f45798740f74f4231cd.zip llvm-44fefe70e41a3b8e68545f45798740f74f4231cd.tar.gz llvm-44fefe70e41a3b8e68545f45798740f74f4231cd.tar.bz2 | |
[LLDB][NativePDB] Estimate symbol sizes (#165727)
In #165604, a test was skipped on Windows, because the native PDB plugin
didn't set sizes on symbols. While the test isn't compiled with debug
info, it's linked with `-gdwarf`, causing a PDB to be created on
Windows. This PDB will only contain the public symbols (written by the
linker) and section information. The symbols themselves don't have a
size, however the DIA SDK sets a size for them.
It seems like, for these data symbols, the size given from DIA is the
distance to the next symbol (or the section end).
This PR implements the naive approach for the native plugin. The main
difference is in function/code symbols. There, DIA searches for a
corresponding `S_GPROC32` which have a "code size" that is sometimes
slightly smaller than the difference to the next symbol.
Diffstat (limited to 'lldb/test/API/functionalities/multiple-slides/TestMultipleSlides.py')
| -rw-r--r-- | lldb/test/API/functionalities/multiple-slides/TestMultipleSlides.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lldb/test/API/functionalities/multiple-slides/TestMultipleSlides.py b/lldb/test/API/functionalities/multiple-slides/TestMultipleSlides.py index 7fd2ff4..5fd2b76 100644 --- a/lldb/test/API/functionalities/multiple-slides/TestMultipleSlides.py +++ b/lldb/test/API/functionalities/multiple-slides/TestMultipleSlides.py @@ -12,10 +12,6 @@ from lldbsuite.test import lldbutil class MultipleSlidesTestCase(TestBase): NO_DEBUG_INFO_TESTCASE = True - # The intermediate object main.o is compiled without debug info, but - # a.out is linked with `-gdwarf` on Windows. This creates a PDB. - # However, in the native PDB plugin, the symbols don't have a size. - @expectedFailureWindows def test_mulitple_slides(self): """Test that a binary can be slid multiple times correctly.""" self.build() @@ -33,10 +29,13 @@ class MultipleSlidesTestCase(TestBase): first_sym.GetEndAddress().GetOffset() - first_sym.GetStartAddress().GetOffset() ) + int_size = target.FindFirstType("int").GetByteSize() + self.assertGreaterEqual(first_size, 2048 * int_size) second_size = ( second_sym.GetEndAddress().GetOffset() - second_sym.GetStartAddress().GetOffset() ) + self.assertGreaterEqual(second_size, 2048 * int_size) # View the first element of `first` and `second` while # they have no load address set. |
