forked from Imagelibrary/binutils-gdb
gdb:
PR gdb/1158: * valops.c (value_struct_elt): Treat function-valued field as a static method. gdb/testsuite: * gdb.base/callfuncs.c (struct struct_with_fnptr): New struct. (function_struct, function_struct_ptr): New globals. * gdb.base/callfuncs.exp (do_function_calls): Test calling via a function pointer in a struct.
This commit is contained in:
@@ -1819,6 +1819,10 @@ value_struct_elt (struct value **argp, struct value **args,
|
||||
back. If it's not callable (i.e., a pointer to function),
|
||||
gdb should give an error. */
|
||||
v = search_struct_field (name, *argp, 0, t, 0);
|
||||
/* If we found an ordinary field, then it is not a method call.
|
||||
So, treat it as if it were a static member function. */
|
||||
if (v && static_memfuncp)
|
||||
*static_memfuncp = 1;
|
||||
}
|
||||
|
||||
if (!v)
|
||||
|
||||
Reference in New Issue
Block a user