From 69368a60a4878ec4ef1060732020e9eaf19b32b0 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Tue, 29 Sep 2009 00:48:32 +0000 Subject: * eval.c (evaluate_subexp_standard) [OP_OBJC_MSGCALL]: Support platforms that use function descriptors. Prefer to use function pointer types instead of function types. * linespec.c (decode_objc): Support function descriptors. Fully initialize SAL result. * objc-lang.c (find_methods): Support function descriptors. Do not require function symbol to point to text section. * ppc-sysv-tdep.c (ppc64_sysv_abi_push_dummy_call): When calling via a function pointer, use the descriptor it points to. --- gdb/linespec.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'gdb/linespec.c') diff --git a/gdb/linespec.c b/gdb/linespec.c index 70e27f76..19df329 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1172,11 +1172,19 @@ decode_objc (char **argptr, int funfirstline, struct symtab *file_symtab, } else { - /* The only match was a non-debuggable symbol. */ - values.sals[0].symtab = NULL; - values.sals[0].line = 0; - values.sals[0].end = 0; - values.sals[0].pc = SYMBOL_VALUE_ADDRESS (sym_arr[0]); + /* The only match was a non-debuggable symbol, which might point + to a function descriptor; resolve it to the actual code address + instead. */ + struct minimal_symbol *msymbol = (struct minimal_symbol *)sym_arr[0]; + struct objfile *objfile = msymbol_objfile (msymbol); + struct gdbarch *gdbarch = get_objfile_arch (objfile); + CORE_ADDR pc = SYMBOL_VALUE_ADDRESS (msymbol); + + pc = gdbarch_convert_from_func_ptr_addr (gdbarch, pc, + ¤t_target); + + init_sal (&values.sals[0]); + values.sals[0].pc = pc; } return values; } -- cgit v1.1