mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-21 18:39:34 +08:00
* inf-child.c (inf_child_follow_fork) New parameter
detach_fork. * inf-ptrace.c (inf_ptrace_follow_fork): Likewise. * inf-ttrace.c (inf_ttrace_follow_fork): Likewise. * inferior.h (detach_fork): Remove. * infrun.c (detach_fork): Adjust comment and make it static. (follow_fork): Pass detach_fork parameter to target_follow_fork. * linux-nat.c (linux_child_follow_fork): New parameter detach_fork. * target.c (target_follow_fork): New parameter detach_fork. Pass detach_fork as parameter and print its value. * target.h (struct target_ops) <to_follow_fork>: New int parameter. (target_follow_fork): New parameter detach_fork.
This commit is contained in:
@ -1,3 +1,22 @@
|
|||||||
|
2013-09-03 Luis Machado <lgustavo@codesourcery.com>
|
||||||
|
|
||||||
|
* inf-child.c (inf_child_follow_fork) New parameter
|
||||||
|
detach_fork.
|
||||||
|
* inf-ptrace.c (inf_ptrace_follow_fork): Likewise.
|
||||||
|
* inf-ttrace.c (inf_ttrace_follow_fork): Likewise.
|
||||||
|
* inferior.h (detach_fork): Remove.
|
||||||
|
* infrun.c (detach_fork): Adjust comment and make it
|
||||||
|
static.
|
||||||
|
(follow_fork): Pass detach_fork parameter to
|
||||||
|
target_follow_fork.
|
||||||
|
* linux-nat.c (linux_child_follow_fork): New parameter
|
||||||
|
detach_fork.
|
||||||
|
* target.c (target_follow_fork): New parameter detach_fork.
|
||||||
|
Pass detach_fork as parameter and print its value.
|
||||||
|
* target.h (struct target_ops) <to_follow_fork>: New int
|
||||||
|
parameter.
|
||||||
|
(target_follow_fork): New parameter detach_fork.
|
||||||
|
|
||||||
2013-09-03 Joel Brobecker <brobecker@adacore.com>
|
2013-09-03 Joel Brobecker <brobecker@adacore.com>
|
||||||
|
|
||||||
* solib-ia64-hpux.c (ia64_hpux_relocate_section_addresses):
|
* solib-ia64-hpux.c (ia64_hpux_relocate_section_addresses):
|
||||||
|
@ -118,7 +118,8 @@ inf_child_post_startup_inferior (ptid_t ptid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
inf_child_follow_fork (struct target_ops *ops, int follow_child)
|
inf_child_follow_fork (struct target_ops *ops, int follow_child,
|
||||||
|
int detach_fork)
|
||||||
{
|
{
|
||||||
/* This version of Unix doesn't support following fork or vfork
|
/* This version of Unix doesn't support following fork or vfork
|
||||||
events. */
|
events. */
|
||||||
|
@ -40,7 +40,8 @@
|
|||||||
#ifdef PT_GET_PROCESS_STATE
|
#ifdef PT_GET_PROCESS_STATE
|
||||||
|
|
||||||
static int
|
static int
|
||||||
inf_ptrace_follow_fork (struct target_ops *ops, int follow_child)
|
inf_ptrace_follow_fork (struct target_ops *ops, int follow_child,
|
||||||
|
int detach_fork)
|
||||||
{
|
{
|
||||||
pid_t pid, fpid;
|
pid_t pid, fpid;
|
||||||
ptrace_state_t pe;
|
ptrace_state_t pe;
|
||||||
|
@ -409,7 +409,8 @@ inf_ttrace_stopped_by_watchpoint (void)
|
|||||||
static pid_t inf_ttrace_vfork_ppid = -1;
|
static pid_t inf_ttrace_vfork_ppid = -1;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
inf_ttrace_follow_fork (struct target_ops *ops, int follow_child)
|
inf_ttrace_follow_fork (struct target_ops *ops, int follow_child,
|
||||||
|
int detach_fork)
|
||||||
{
|
{
|
||||||
pid_t pid, fpid;
|
pid_t pid, fpid;
|
||||||
lwpid_t lwpid, flwpid;
|
lwpid_t lwpid, flwpid;
|
||||||
|
@ -119,11 +119,6 @@ extern int step_stop_if_no_debug;
|
|||||||
are kept running freely. */
|
are kept running freely. */
|
||||||
extern int non_stop;
|
extern int non_stop;
|
||||||
|
|
||||||
/* If set (default), when following a fork, GDB will detach from one
|
|
||||||
the fork branches, child or parent. Exactly which branch is
|
|
||||||
detached depends on 'set follow-fork-mode' setting. */
|
|
||||||
extern int detach_fork;
|
|
||||||
|
|
||||||
/* When set (default), the target should attempt to disable the operating
|
/* When set (default), the target should attempt to disable the operating
|
||||||
system's address space randomization feature when starting an inferior. */
|
system's address space randomization feature when starting an inferior. */
|
||||||
extern int disable_randomization;
|
extern int disable_randomization;
|
||||||
|
10
gdb/infrun.c
10
gdb/infrun.c
@ -132,8 +132,12 @@ int sync_execution = 0;
|
|||||||
|
|
||||||
static ptid_t previous_inferior_ptid;
|
static ptid_t previous_inferior_ptid;
|
||||||
|
|
||||||
/* Default behavior is to detach newly forked processes (legacy). */
|
/* If set (default for legacy reasons), when following a fork, GDB
|
||||||
int detach_fork = 1;
|
will detach from one of the fork branches, child or parent.
|
||||||
|
Exactly which branch is detached depends on 'set follow-fork-mode'
|
||||||
|
setting. */
|
||||||
|
|
||||||
|
static int detach_fork = 1;
|
||||||
|
|
||||||
int debug_displaced = 0;
|
int debug_displaced = 0;
|
||||||
static void
|
static void
|
||||||
@ -497,7 +501,7 @@ follow_fork (void)
|
|||||||
|
|
||||||
/* Tell the target to do whatever is necessary to follow
|
/* Tell the target to do whatever is necessary to follow
|
||||||
either parent or child. */
|
either parent or child. */
|
||||||
if (target_follow_fork (follow_child))
|
if (target_follow_fork (follow_child, detach_fork))
|
||||||
{
|
{
|
||||||
/* Target refused to follow, or there's some other reason
|
/* Target refused to follow, or there's some other reason
|
||||||
we shouldn't resume. */
|
we shouldn't resume. */
|
||||||
|
@ -376,7 +376,8 @@ delete_lwp_cleanup (void *lp_voidp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linux_child_follow_fork (struct target_ops *ops, int follow_child)
|
linux_child_follow_fork (struct target_ops *ops, int follow_child,
|
||||||
|
int detach_fork)
|
||||||
{
|
{
|
||||||
int has_vforked;
|
int has_vforked;
|
||||||
int parent_pid, child_pid;
|
int parent_pid, child_pid;
|
||||||
|
@ -2811,7 +2811,7 @@ target_program_signals (int numsigs, unsigned char *program_signals)
|
|||||||
follow forks. */
|
follow forks. */
|
||||||
|
|
||||||
int
|
int
|
||||||
target_follow_fork (int follow_child)
|
target_follow_fork (int follow_child, int detach_fork)
|
||||||
{
|
{
|
||||||
struct target_ops *t;
|
struct target_ops *t;
|
||||||
|
|
||||||
@ -2819,11 +2819,12 @@ target_follow_fork (int follow_child)
|
|||||||
{
|
{
|
||||||
if (t->to_follow_fork != NULL)
|
if (t->to_follow_fork != NULL)
|
||||||
{
|
{
|
||||||
int retval = t->to_follow_fork (t, follow_child);
|
int retval = t->to_follow_fork (t, follow_child, detach_fork);
|
||||||
|
|
||||||
if (targetdebug)
|
if (targetdebug)
|
||||||
fprintf_unfiltered (gdb_stdlog, "target_follow_fork (%d) = %d\n",
|
fprintf_unfiltered (gdb_stdlog,
|
||||||
follow_child, retval);
|
"target_follow_fork (%d, %d) = %d\n",
|
||||||
|
follow_child, detach_fork, retval);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -440,7 +440,7 @@ struct target_ops
|
|||||||
int (*to_remove_fork_catchpoint) (int);
|
int (*to_remove_fork_catchpoint) (int);
|
||||||
int (*to_insert_vfork_catchpoint) (int);
|
int (*to_insert_vfork_catchpoint) (int);
|
||||||
int (*to_remove_vfork_catchpoint) (int);
|
int (*to_remove_vfork_catchpoint) (int);
|
||||||
int (*to_follow_fork) (struct target_ops *, int);
|
int (*to_follow_fork) (struct target_ops *, int, int);
|
||||||
int (*to_insert_exec_catchpoint) (int);
|
int (*to_insert_exec_catchpoint) (int);
|
||||||
int (*to_remove_exec_catchpoint) (int);
|
int (*to_remove_exec_catchpoint) (int);
|
||||||
int (*to_set_syscall_catchpoint) (int, int, int, int, int *);
|
int (*to_set_syscall_catchpoint) (int, int, int, int, int *);
|
||||||
@ -1235,7 +1235,7 @@ void target_create_inferior (char *exec_file, char *args,
|
|||||||
This function returns 1 if the inferior should not be resumed
|
This function returns 1 if the inferior should not be resumed
|
||||||
(i.e. there is another event pending). */
|
(i.e. there is another event pending). */
|
||||||
|
|
||||||
int target_follow_fork (int follow_child);
|
int target_follow_fork (int follow_child, int detach_fork);
|
||||||
|
|
||||||
/* On some targets, we can catch an inferior exec event when it
|
/* On some targets, we can catch an inferior exec event when it
|
||||||
occurs. These functions insert/remove an already-created
|
occurs. These functions insert/remove an already-created
|
||||||
|
Reference in New Issue
Block a user