aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python-internal.h
diff options
context:
space:
mode:
authorJan Vrany <jan.vrany@labware.com>2025-10-23 12:01:34 +0100
committerJan Vrany <jan.vrany@labware.com>2025-10-23 12:01:34 +0100
commit45b3bfcc906830d4feed35dbd0e2203f1886ead7 (patch)
tree79edf781db9d061b41b0b3543b4e6b087a8b97c9 /gdb/python/python-internal.h
parenta2bccd1858432b759c495369b8414881a7f89b12 (diff)
downloadbinutils-45b3bfcc906830d4feed35dbd0e2203f1886ead7.tar.gz
binutils-45b3bfcc906830d4feed35dbd0e2203f1886ead7.tar.bz2
binutils-45b3bfcc906830d4feed35dbd0e2203f1886ead7.zip
gdb: add block ordering predicate for ordering blocks in blockvector
This commit adds blockvector::block_less_than() predicate that defines required ordering of blocks within blockvector. It orders blocks so that blocks with lower start address come before blocks with higher start address. If two blocks start at the same address, enclosing (larger) block should come before nested (smaller) block. This ordering is depended upon in find_block_in_blockvector(). Although its comment did not say so, find_block_in_blockvector() is called from blockvector_for_pc_sect() which is explicit about it. While at it, I changed the comment of find_block_in_blockvector() to say so explicitly too. As Andrew pointed out, buildsym.c sorts block slightly differently, taking only the start address into account. The comment there says blocks with same start address should not be reordered as they are in correct order already and that order is needed. It is unclear to me if buildsym.c arranges blocks starting at the same address in required order before sorting them or this happens "by chance". I did modify buildsym_compunit::make_blockvector() to assert blocks are properly ordered and running testsuite did not show any regressions. Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/python/python-internal.h')
0 files changed, 0 insertions, 0 deletions