aboutsummaryrefslogtreecommitdiff
path: root/gdb/scm-valprint.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2008-09-11 14:27:34 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2008-09-11 14:27:34 +0000
commit3e3b026fee8cd62ac6c2cfc7f86cec972d8f5676 (patch)
treebc601c999d48b731197ac2a508aafb6c06ad054c /gdb/scm-valprint.c
parentf8dcfc0affda04681b337c807c15d3c59badc33c (diff)
downloadgdb-3e3b026fee8cd62ac6c2cfc7f86cec972d8f5676.zip
gdb-3e3b026fee8cd62ac6c2cfc7f86cec972d8f5676.tar.gz
gdb-3e3b026fee8cd62ac6c2cfc7f86cec972d8f5676.tar.bz2
* valops.c: Include "objfiles.h" and "symtab.h".
(find_function_in_inferior): New argument OBJF_P. Use it to return objfile where function is defined. Use per-objfile arch types instead of builtin_type_ to define default return type. * linux-fork.c (checkpoint_command): Update calls. Use per-objfile architecture to define inferior call argument types. * gcore.c (derive_heap_segment): Likewise. * objc-lang.c (value_nsstring): Likewise. * scm-lang.c (scm_lookup_name): Likewise. * scm-valprint.c (scm_inferior_print): Likewise. * valops.c (value_allocate_space_in_inferior): Likewise. * eval.c (evaluate_subexp_standard): Update calls. * objc-lang.c (lookup_objc_class, print_object_command): Likewise. * linux-fork.c: Include "objfiles.h". * scm-lang.c: Include "objfiles.h". * scm-valprint.c: Include "objfiles.h".
Diffstat (limited to 'gdb/scm-valprint.c')
-rw-r--r--gdb/scm-valprint.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/scm-valprint.c b/gdb/scm-valprint.c
index 746bd03..feb43dd 100644
--- a/gdb/scm-valprint.c
+++ b/gdb/scm-valprint.c
@@ -30,6 +30,7 @@
#include "gdbcore.h"
#include "c-lang.h"
#include "infcall.h"
+#include "objfiles.h"
static void scm_ipruk (char *, LONGEST, struct ui_file *);
static void scm_scmlist_print (LONGEST, struct ui_file *, int, int,
@@ -45,13 +46,16 @@ static int
scm_inferior_print (LONGEST value, struct ui_file *stream, int format,
int deref_ref, int recurse, enum val_prettyprint pretty)
{
+ struct objfile *objf;
+ struct gdbarch *gdbarch;
struct value *func, *arg, *result;
struct symbol *gdb_output_sym, *gdb_output_len_sym;
char *output;
int ret, output_len;
- func = find_function_in_inferior ("gdb_print");
- arg = value_from_longest (builtin_type_CORE_ADDR, value);
+ func = find_function_in_inferior ("gdb_print", &objf);
+ gdbarch = get_objfile_arch (objf);
+ arg = value_from_longest (builtin_type (gdbarch)->builtin_core_addr, value);
result = call_function_by_hand (func, 1, &arg);
ret = (int) value_as_long (result);
@@ -73,7 +77,7 @@ scm_inferior_print (LONGEST value, struct ui_file *stream, int format,
(char *) &output_len, sizeof (output_len));
output = (char *) alloca (output_len);
- remote_buffer = value_at (builtin_type_CORE_ADDR,
+ remote_buffer = value_at (builtin_type (gdbarch)->builtin_core_addr,
SYMBOL_VALUE_ADDRESS (gdb_output_sym));
read_memory (value_as_address (remote_buffer),
output, output_len);