mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 09:38:57 +00:00
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
45 lines
1.0 KiB
C
45 lines
1.0 KiB
C
/* This testcase is part of GDB, the GNU debugger.
|
|
|
|
Copyright 2025 Free Software Foundation, Inc.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
struct the_struct {
|
|
int one;
|
|
};
|
|
|
|
struct the_struct struct1;
|
|
|
|
enum the_enum {
|
|
one
|
|
};
|
|
|
|
enum the_enum enum1;
|
|
|
|
union the_union {
|
|
int one;
|
|
void *ptr;
|
|
};
|
|
|
|
union the_union union1;
|
|
|
|
typedef struct the_struct the_typedef;
|
|
|
|
the_typedef typedef1;
|
|
|
|
int function (void)
|
|
{
|
|
return 0;
|
|
}
|