aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-fork.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/linux-fork.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/linux-fork.c')
-rw-r--r--gdb/linux-fork.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index fcc8a29..443b63d 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -22,6 +22,7 @@
#include "regcache.h"
#include "gdbcmd.h"
#include "infcall.h"
+#include "objfiles.h"
#include "gdb_assert.h"
#include "gdb_string.h"
#include "linux-fork.h"
@@ -528,6 +529,8 @@ save_detach_fork (int *saved_val)
static void
checkpoint_command (char *args, int from_tty)
{
+ struct objfile *fork_objf;
+ struct gdbarch *gdbarch;
struct target_waitstatus last_target_waitstatus;
ptid_t last_target_ptid;
struct value *fork_fn = NULL, *ret;
@@ -545,14 +548,15 @@ checkpoint_command (char *args, int from_tty)
/* Make the inferior fork, record its (and gdb's) state. */
if (lookup_minimal_symbol ("fork", NULL, NULL) != NULL)
- fork_fn = find_function_in_inferior ("fork");
+ fork_fn = find_function_in_inferior ("fork", &fork_objf);
if (!fork_fn)
if (lookup_minimal_symbol ("_fork", NULL, NULL) != NULL)
- fork_fn = find_function_in_inferior ("fork");
+ fork_fn = find_function_in_inferior ("fork", &fork_objf);
if (!fork_fn)
error (_("checkpoint: can't find fork function in inferior."));
- ret = value_from_longest (builtin_type_int, 0);
+ gdbarch = get_objfile_arch (fork_objf);
+ ret = value_from_longest (builtin_type (gdbarch)->builtin_int, 0);
old_chain = save_detach_fork (&temp_detach_fork);
detach_fork = 0;
ret = call_function_by_hand (fork_fn, 0, &ret);