aboutsummaryrefslogtreecommitdiff
path: root/gdb/valops.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2008-07-27 02:00:04 +0000
committerTom Tromey <tromey@redhat.com>2008-07-27 02:00:04 +0000
commitfa8de41e93025afa77b80acac961c517920f7158 (patch)
treecb7b2225f8e0ed6f86f5e7419bb55fd633f07b85 /gdb/valops.c
parentccb3ac8a121682a5fc5fd767f80872ef3e5c7b47 (diff)
downloadgdb-fa8de41e93025afa77b80acac961c517920f7158.zip
gdb-fa8de41e93025afa77b80acac961c517920f7158.tar.gz
gdb-fa8de41e93025afa77b80acac961c517920f7158.tar.bz2
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.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r--gdb/valops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/valops.c b/gdb/valops.c
index aad9871..8c99218 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -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)