]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix bug in gdb.lookup_type
authorTom Tromey <tom@tromey.com>
Fri, 4 Apr 2025 04:13:00 +0000 (22:13 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 30 Sep 2025 14:08:30 +0000 (08:08 -0600)
commit7d43a7afc1a8193a93f534c1b6875630d3b83612
tree789a6200b53498f7e60f2b939f0f9637d3f098f7
parent1e58e321200cb4cd40b396f7e60ebf5fd60dc1bc
Fix bug in gdb.lookup_type

gdb.lookup_type accepts a 'block' argument, but in some cases does not
use it.  This can cause the wrong type to be returned.

This patch fixes the problem by simply passing the block through.  I
have no idea why it worked the way it did, and there weren't any tests
for the 'block' parameter.  (I didn't look at git blame out of fear
that it was my patch back in the day.)

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=16942
gdb/python/py-type.c
gdb/testsuite/gdb.python/lookup-type-block.exp [new file with mode: 0644]
gdb/testsuite/gdb.python/lookup1.c [new file with mode: 0644]
gdb/testsuite/gdb.python/lookup2.c [new file with mode: 0644]