aboutsummaryrefslogtreecommitdiff
path: root/gdb/objc-lang.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-09-29 00:48:32 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-09-29 00:48:32 +0000
commit69368a60a4878ec4ef1060732020e9eaf19b32b0 (patch)
treee42355f5c9bd92ed24f12457f1b50f24f1b216f8 /gdb/objc-lang.c
parent67f470de12c95c08410c46543072c22f857a0a3b (diff)
downloadgdb-69368a60a4878ec4ef1060732020e9eaf19b32b0.zip
gdb-69368a60a4878ec4ef1060732020e9eaf19b32b0.tar.gz
gdb-69368a60a4878ec4ef1060732020e9eaf19b32b0.tar.bz2
* 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.
Diffstat (limited to 'gdb/objc-lang.c')
-rw-r--r--gdb/objc-lang.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index 0e4fb71..f3a8b73 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -1173,16 +1173,18 @@ find_methods (struct symtab *symtab, char type,
ALL_OBJFILE_MSYMBOLS (objfile, msymbol)
{
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
+ CORE_ADDR pc = SYMBOL_VALUE_ADDRESS (msymbol);
+
QUIT;
- if ((MSYMBOL_TYPE (msymbol) != mst_text)
- && (MSYMBOL_TYPE (msymbol) != mst_file_text))
- /* Not a function or method. */
- continue;
+ /* The minimal symbol might point to a function descriptor;
+ resolve it to the actual code address instead. */
+ pc = gdbarch_convert_from_func_ptr_addr (gdbarch, pc,
+ &current_target);
if (symtab)
- if ((SYMBOL_VALUE_ADDRESS (msymbol) < BLOCK_START (block)) ||
- (SYMBOL_VALUE_ADDRESS (msymbol) >= BLOCK_END (block)))
+ if (pc < BLOCK_START (block) || pc >= BLOCK_END (block))
/* Not in the specified symtab. */
continue;
@@ -1221,7 +1223,7 @@ find_methods (struct symtab *symtab, char type,
((nselector == NULL) || (strcmp (selector, nselector) != 0)))
continue;
- sym = find_pc_function (SYMBOL_VALUE_ADDRESS (msymbol));
+ sym = find_pc_function (pc);
if (sym != NULL)
{
const char *newsymname = SYMBOL_NATURAL_NAME (sym);