Bug 2082508
| Summary: | lldb don't print std::vector variables correctly | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Jesus Checa <jchecahi> |
| Component: | lldb | Assignee: | Timm Bäder <tbaeder> |
| Status: | CLOSED ERRATA | QA Contact: | Jesus Checa <jchecahi> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 8.7 | CC: | jchecahi, jistone, mprchlik, sipoyare, tbaeder, tstellar |
| Target Milestone: | rc | Keywords: | Bugfix, Triaged |
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | llvm-toolset:rhel8:8070020220608151004:3b9f49c4 | Doc Type: | No Doc Update |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 2077932 | Environment: | |
| Last Closed: | 2022-11-08 09:34:58 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 2077932 | ||
| Bug Blocks: | |||
|
Description
Jesus Checa
2022-05-06 09:48:15 UTC
The output is actually using lldb's pretty printer for libstdc++, which says:
# C++ STL formatters for LLDB
# As there are many versions of the libstdc++, you are encouraged to look at the STL
# implementation for your platform before relying on these formatters to do the right
# thing for your setup
When compiling the reproducer with clang, dwarfdump reports results for _Vector_impl_data:
DW_AT_name _Vector_impl_data
DW_AT_name _Vector_impl_data
DW_AT_name _Vector_impl_data
DW_AT_linkage_name _ZNSt12_Vector_baseIiSaIiEE17_Vector_impl_data12_M_copy_dataERKS2_
DW_AT_linkage_name _ZNSt12_Vector_baseIiSaIiEE17_Vector_impl_data12_M_swap_dataERS2_
DW_AT_linkage_name _ZNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataC2Ev
name at offset 0x00000654, length 17 is '_Vector_impl_data'
name at offset 0x00000666, length 66 is '_ZNSt12_Vector_baseIiSaIiEE17_Vector_impl_data12_M_copy_dataERKS2_'
name at offset 0x000006b6, length 65 is '_ZNSt12_Vector_baseIiSaIiEE17_Vector_impl_data12_M_swap_dataERS2_'
name at offset 0x00001f56, length 50 is '_ZNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataC2Ev'
but when it's compiled with g++, no such results are found.
I think this is just an incompatibility between the lldb pretty-printer and what libstdc++/gcc emit. Or maybe a bug in gcc 8.5,
since compiling it with clang yields the expected (by the pretty-printer) result.
Tested with llvm-toolset:rhel8:8070020220608151004:3b9f49c4. After disabling the pretty printer, the output from lldb with the test.cpp file from the description is as follows:
===============================================================================
(lldb) target create "a.out"
Current executable set to '/var/tmp/tmt/run-139/tests/build-gating/discover/lldb-tests/tests/tests/python-embedded-interpreter/a.out' (s390x).
(lldb) breakpoint set --file test.cpp --line 7
Breakpoint 1: where = a.out`main + 94 at test.cpp:7:41, address = 0x0000000001000876
(lldb) run
Process 35430 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
frame #0: 0x0000000001000876 a.out`main at test.cpp:7:41
4 main ()
5 {
6 std::vector<int> v (1, 2);
-> 7 std::vector<int>::iterator it(v.begin());
^
8 return 0;
9 }
Process 35430 launched: '/var/tmp/tmt/run-139/tests/build-gating/discover/lldb-tests/tests/tests/python-embedded-interpreter/a.out' (s390x)
(lldb) p v
(std::vector<int, std::allocator<> >) $0 = error: summary string parsing error {
std::_Vector_base<int, std::allocator<> > = {
_M_impl = {
_M_start = 0x0000000001015eb0
_M_finish = 0x0000000001015eb4
_M_end_of_storage = 0x0000000001015eb4
}
}
}
===============================================================================
Complete testing shows no regressions.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (llvm-toolset:rhel8 bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2022:7537 |