248 snprintf (&exp[0],
sizeof (exp),
"(long) lseek (%d, %ld, %d)",
249 fd, (
long)
offset, whence);
275 for (i = 0; i <= fp->
maxfd; i++)
276 if (fp->
filepos[i] != (off_t) -1)
304 snprintf (path, PATH_MAX,
"/proc/%ld/fd",
306 if ((d = opendir (path)) != NULL)
311 while ((de = readdir (d)) != NULL)
315 tmp = strtol (&de->d_name[0], NULL, 10);
323 for (tmp = 0; tmp <= fp->
maxfd; tmp++)
328 while ((de = readdir (d)) != NULL)
329 if (isdigit (de->d_name[0]))
331 tmp = strtol (&de->d_name[0], NULL, 10);
455 struct value *waitpid_fn = NULL;
458 struct fork_info *oldfp = NULL, *newfp = NULL;
512 error (
_(
"Requires argument (checkpoint id to delete)"));
516 error (
_(
"No such checkpoint id, %s"), args);
520 Please switch to another checkpoint before deleting the current one"));
552 error (
_(
"Requires argument (checkpoint id to detach)"));
556 error (
_(
"No such checkpoint id, %s"), args);
560 Please switch to another checkpoint before detaching the current one"));
588 if (requested > 0 && fp->
num != requested)
650 int *count_p = (
int *) data;
677 struct value *fork_fn = NULL, *ret;
682 error (
_(
"The program is not being run."));
687 error (
_(
"checkpoint: can't checkpoint multiple threads."));
697 error (
_(
"checkpoint: can't find fork function in inferior."));
711 error (
_(
"checkpoint: call_function_by_hand returned null."));
723 fp != NULL ? fp->
num : -1, (
long) retpid);
735 error (
_(
"Failed to find new fork"));
769 error (
_(
"Requires argument (checkpoint id to restart)"));
772 error (
_(
"Not found: checkpoint id %s"), args);
786 Fork a duplicate process (experimental)."));
792 restart <n>: restore program context from a checkpoint.\n\ 793 Argument 'n' is checkpoint ID, as displayed by 'info checkpoints'."));
799 Delete a checkpoint (experimental)."),
806 Detach from a checkpoint (experimental)."),
813 _(
"IDs of currently known checkpoints."));
void get_last_target_status(ptid_t *ptidp, struct target_waitstatus *status)
const char * symtab_to_filename_for_display(struct symtab *symtab)
struct thread_info * find_thread_ptid(ptid_t ptid)
struct frame_info * get_selected_frame(const char *message)
#define MSYMBOL_LINKAGE_NAME(symbol)
void insert_breakpoints(void)
int ptid_get_pid(const ptid_t &ptid)
int linux_fork_checkpointing_p(int pid)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
LONGEST value_as_long(struct value *val)
void warning(const char *fmt,...)
struct cmd_list_element * add_info(const char *name, cmd_const_cfunc_ftype *fun, const char *doc)
void linux_fork_killall(void)
struct regcache * savedregs
struct cmd_list_element * deletelist
static ptid_t fork_id_to_ptid(int num)
void nullify_last_target_wait_ptid(void)
void linux_fork_mourn_inferior(void)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
static void checkpoint_command(const char *args, int from_tty)
static void fork_load_infrun_state(struct fork_info *fp)
struct regcache * get_current_regcache(void)
void printf_filtered(const char *format,...)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
static int highest_fork_num
ptid_t ptid_build(int pid, long lwp, long tid)
struct regcache * regcache_dup(struct regcache *src)
static void detach_checkpoint_command(const char *args, int from_tty)
static void delete_checkpoint_command(const char *args, int from_tty)
scoped_restore_tmpl< T > make_scoped_restore(T *var)
struct thread_info * iterate_over_threads(thread_callback_func, void *)
int is_stopped(ptid_t ptid)
static struct fork_info * find_fork_ptid(ptid_t ptid)
void _initialize_linux_fork(void)
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
struct fork_info * add_fork(pid_t pid)
void linux_fork_detach(const char *args, int from_tty)
struct value * find_function_in_inferior(const char *name, struct objfile **objf_p)
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
ptid_t pid_to_ptid(int pid)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
struct gdbarch * get_objfile_arch(const struct objfile *objfile)
static struct fork_info * find_last_fork(void)
static off_t call_lseek(int fd, off_t offset, int whence)
struct gdbarch * get_current_arch(void)
void regcache_cpy(struct regcache *dst, struct regcache *src)
struct value * value_from_longest(struct type *type, LONGEST num)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
static int inf_has_multiple_thread_cb(struct thread_info *tp, void *data)
struct fork_info * fork_list
#define target_has_execution
int putchar_filtered(int c)
static void info_checkpoints_command(const char *arg, int from_tty)
#define XRESIZEVEC(T, P, N)
long ptid_get_lwp(const ptid_t &ptid)
static void init_fork_list(void)
void print_stack_frame(struct frame_info *, int print_level, enum print_what print_what, int set_current_sal)
struct cmd_list_element * detachlist
struct value * value_from_pointer(struct type *type, CORE_ADDR addr)
struct bound_minimal_symbol lookup_minimal_symbol_by_pc(CORE_ADDR pc)
static int inf_has_multiple_threads(void)
void update_thread_list(void)
CORE_ADDR regcache_read_pc(struct regcache *regcache)
int remove_breakpoints(void)
const char * target_pid_to_str(ptid_t ptid)
void registers_changed(void)
static void linux_fork_context(struct fork_info *newfp, int from_tty)
static void delete_fork(ptid_t ptid)
int ptid_equal(const ptid_t &ptid1, const ptid_t &ptid2)
struct inferior * current_inferior(void)
unsigned long long ULONGEST
static void free_fork(struct fork_info *fp)
struct value * call_function_by_hand(struct value *function, type *default_return_type, int nargs, struct value **args)
static void restart_command(const char *args, int from_tty)
static int checkpointing_pid
void linux_nat_switch_fork(ptid_t new_ptid)
struct fork_info * find_fork_pid(pid_t pid)
static struct fork_info * find_fork_id(int num)
void reinit_frame_cache(void)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_const_cfunc_ftype *fun, const char *doc)
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
static void fork_save_infrun_state(struct fork_info *fp, int clobber_regs)
static void inferior_call_waitpid_cleanup(void *fp)
void error(const char *fmt,...)
static int inferior_call_waitpid(ptid_t pptid, int pid)
void do_cleanups(struct cleanup *old_chain)
void linux_nat_forget_process(pid_t pid)
LONGEST parse_and_eval_long(const char *exp)