mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
gdb: pass child_ptid and fork kind to target_ops::follow_fork
This is a small cleanup I think would be nice, that I spotted while doing the following patch. gdb/ChangeLog: * target.h (struct target_ops) <follow_fork>: Add ptid and target_waitkind parameters. (target_follow_fork): Likewise. * target.c (default_follow_fork): Likewise. (target_follow_fork): Likewise. * fbsd-nat.h (class fbsd_nat_target) <follow_fork>: Likewise. * fbsd-nat.c (fbsd_nat_target::follow_fork): Likewise. * linux-nat.h (class linux_nat_target) <follow_fork>: Likewise. * linux-nat.c (linux_nat_target::follow_fork): Likewise. * obsd-nat.h (class obsd_nat_target) <follow_fork>: Likewise. * obsd-nat.c (obsd_nat_target::follow_fork): Likewise. * remote.c (class remote_target) <follow_fork>: Likewise. * target-debug.h (target_debug_print_target_waitkind): New. * target-delegates.c: Re-generate. Change-Id: I5421a542f2e19100a22b74cc333d2b235d0de3c8
This commit is contained in:
15
gdb/infrun.c
15
gdb/infrun.c
@ -404,13 +404,12 @@ show_follow_fork_mode_string (struct ui_file *file, int from_tty,
|
||||
static bool
|
||||
follow_fork_inferior (bool follow_child, bool detach_fork)
|
||||
{
|
||||
int has_vforked;
|
||||
ptid_t parent_ptid, child_ptid;
|
||||
|
||||
has_vforked = (inferior_thread ()->pending_follow.kind
|
||||
== TARGET_WAITKIND_VFORKED);
|
||||
parent_ptid = inferior_ptid;
|
||||
child_ptid = inferior_thread ()->pending_follow.value.related_pid;
|
||||
target_waitkind fork_kind = inferior_thread ()->pending_follow.kind;
|
||||
gdb_assert (fork_kind == TARGET_WAITKIND_FORKED
|
||||
|| fork_kind == TARGET_WAITKIND_VFORKED);
|
||||
bool has_vforked = fork_kind == TARGET_WAITKIND_VFORKED;
|
||||
ptid_t parent_ptid = inferior_ptid;
|
||||
ptid_t child_ptid = inferior_thread ()->pending_follow.value.related_pid;
|
||||
|
||||
if (has_vforked
|
||||
&& !non_stop /* Non-stop always resumes both branches. */
|
||||
@ -649,7 +648,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \
|
||||
switch_to_thread (child_thr);
|
||||
}
|
||||
|
||||
target_follow_fork (follow_child, detach_fork);
|
||||
target_follow_fork (child_ptid, fork_kind, follow_child, detach_fork);
|
||||
|
||||
/* If we ended up creating a new inferior, call post_create_inferior to inform
|
||||
the various subcomponents. */
|
||||
|
Reference in New Issue
Block a user