aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-function.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2025-07-09 11:35:12 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2025-08-01 00:25:54 -0400
commitcb208105eb5674fcc0fa2a4999ea0cc4f06bc8c6 (patch)
tree7d8af3dc06a6ab979edad13d902738dbcce34a00 /gdb/python/py-function.c
parent52f0642b075c9f81c63f554203cee84cbc1f5bf8 (diff)
downloadbinutils-cb208105eb5674fcc0fa2a4999ea0cc4f06bc8c6.zip
binutils-cb208105eb5674fcc0fa2a4999ea0cc4f06bc8c6.tar.gz
binutils-cb208105eb5674fcc0fa2a4999ea0cc4f06bc8c6.tar.bz2
gdb/dwarf: sort units when writing index
The order of all_units can't be relied on when writing the CU and TU lists to .gdb_index or .debug_names. Both the .gdb_index and .debug_names writers expect that all_units contains comp units followed by type units. As of this commit, when reading a DWARF 5 .debug_info, the all_units vector is ordered based on the order the units appear in .debug_info, where type units can be interleaved with comp units. It probably worked fine with DWARF 4, where type units were in a section of their own (.debug_types). They were read after comp units, and therefore after them in the all_units vector. Change the writers to use a common function that splits the units in two lists (comp units and type units). Sort both lists by section offset. This is more than required, but it should help produce a stable and predictable output. Change-Id: I5a22e2e354145e3d6b5b2822dc2a3af2f9d6bb76 Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/python/py-function.c')
0 files changed, 0 insertions, 0 deletions