summaryrefslogtreecommitdiff
path: root/gdb/infcall.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2007-07-03 15:58:42 +0000
committerDaniel Jacobowitz <dan@debian.org>2007-07-03 15:58:42 +0000
commit7375215e09ce2ec82b5c687210503859687c3214 (patch)
tree45b9ebdb8278a9f1270663f0e86a4899b4358965 /gdb/infcall.c
parentfb3723c72cc596a6f02376e747088a8e51137e02 (diff)
downloadgdb-7375215e09ce2ec82b5c687210503859687c3214.tar.gz
2007-07-03 Paul Gilliam <pgilliam@us.ibm.com>
Thiago Bauermann <bauerman@br.ibm.com> Joseph S. Myers <joseph@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> gdb/ * remote.c (remote_check_symbols): Use gdbarch_convert_from_func_ptr_addr. * infcall.c (find_function_addr): Handle function descriptors without debugging information. * ppc-linux-tdep.c (ppc_linux_convert_from_func_ptr_addr): Renamed from ppc64_linux_convert_from_func_ptr_addr. Handle -msecure-plt. (ppc_linux_init_abi): Always set convert_from_func_ptr_addr. * solib-svr4.c (solib_break_names): Remove "._dl_debug_state". (bfd_lookup_symbol): Do not take a SECT_FLAGS argument. Always allow SEC_CODE and SEC_DATA. (enable_break): Update calls. Pass current_target to solib_add. Use gdbarch_convert_from_func_ptr_addr. gdb/gdbserver/ * remote-utils.c (look_up_one_symbol): Handle 'm' packets.
Diffstat (limited to 'gdb/infcall.c')
-rw-r--r--gdb/infcall.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 537596984c1..e98b566d2ff 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -222,8 +222,24 @@ find_function_addr (struct value *function, struct type **retval_type)
if (TYPE_LENGTH (ftype) == 1)
funaddr = value_as_address (value_addr (function));
else
- /* Handle integer used as address of a function. */
- funaddr = (CORE_ADDR) value_as_long (function);
+ {
+ /* Handle function descriptors lacking debug info. */
+ int found_descriptor = 0;
+ if (VALUE_LVAL (function) == lval_memory)
+ {
+ CORE_ADDR nfunaddr;
+ funaddr = value_as_address (value_addr (function));
+ nfunaddr = funaddr;
+ funaddr = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
+ funaddr,
+ &current_target);
+ if (funaddr != nfunaddr)
+ found_descriptor = 1;
+ }
+ if (!found_descriptor)
+ /* Handle integer used as address of a function. */
+ funaddr = (CORE_ADDR) value_as_long (function);
+ }
value_type = builtin_type_int;
}