aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2008-05-03 00:37:35 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2008-05-03 00:37:35 +0000
commitbccdca4a5f7b9879d67a35d78063a9ac3b5f5104 (patch)
tree6f5c583a8507dcac9b3a08aa00929c6c123af41a /gdb/value.c
parent0315afbc1dfcbdd1af230eb7b6d5193634bc254a (diff)
downloadgdb-bccdca4a5f7b9879d67a35d78063a9ac3b5f5104.zip
gdb-bccdca4a5f7b9879d67a35d78063a9ac3b5f5104.tar.gz
gdb-bccdca4a5f7b9879d67a35d78063a9ac3b5f5104.tar.bz2
* linespec.c: Include "target.h".
(minsym_found): Handle minimal symbols pointing to function descriptors. Use find_function_start_pc. * minsyms.c (msymbol_objfile): New function. * parse.c (write_exp_msymbol): Handle minimal symbols pointing to function descriptors. * symtab.c (fixup_section): Only use minimal symbol at the same address to determine section of a symbol. (find_function_start_pc): New function. (find_function_start_sal): Use it. * symtab.h (msymbol_objfile): Add prototype. (find_function_start_pc): Likewise. * value.c: Include "objfiles.h". (value_fn_field): Handle minimal symbols pointing to function descriptors. * Makefile.in (linespec.o): Update dependencies. (value.o): Likewise.
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/value.c b/gdb/value.c
index 52d0030..21a7e6c 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -35,6 +35,7 @@
#include "regcache.h"
#include "block.h"
#include "dfp.h"
+#include "objfiles.h"
/* Prototypes for exported functions. */
@@ -1433,7 +1434,14 @@ value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *ty
}
else
{
- VALUE_ADDRESS (v) = SYMBOL_VALUE_ADDRESS (msym);
+ /* The minimal symbol might point to a function descriptor;
+ resolve it to the actual code address instead. */
+ struct objfile *objfile = msymbol_objfile (msym);
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
+
+ VALUE_ADDRESS (v)
+ = gdbarch_convert_from_func_ptr_addr
+ (gdbarch, SYMBOL_VALUE_ADDRESS (msym), &current_target);
}
if (arg1p)