* 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".
This commit is contained in:
parent
f8dcfc0aff
commit
3e3b026fee
9 changed files with 106 additions and 40 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue