This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH/7.10 1/2] Linux gdbserver confused when event randomization returns a process exit event
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 03 Aug 2015 11:58:45 +0100
- Subject: Re: [PATCH/7.10 1/2] Linux gdbserver confused when event randomization returns a process exit event
- Authentication-results: sourceware.org; auth=none
- References: <1438362229-27653-1-git-send-email-palves at redhat dot com> <1438362229-27653-2-git-send-email-palves at redhat dot com>
Pedro Alves <palves@redhat.com> writes:
> @@ -3128,7 +3116,7 @@ linux_wait_1 (ptid_t ptid,
> || (gdb_breakpoint_here (event_child->stop_pc)
> && gdb_condition_true_at_breakpoint (event_child->stop_pc)
> && gdb_no_commands_at_breakpoint (event_child->stop_pc))
> - || extended_event_reported (&event_child->waitstatus));
> + || event_child->waitstatus.kind != TARGET_WAITKIND_IGNORE);
>
> run_breakpoint_commands (event_child->stop_pc);
>
> @@ -3150,9 +3138,11 @@ linux_wait_1 (ptid_t ptid,
> paddress (event_child->stop_pc),
> paddress (event_child->step_range_start),
> paddress (event_child->step_range_end));
> - if (extended_event_reported (&event_child->waitstatus))
> + if (event_child->waitstatus.kind != TARGET_WAITKIND_IGNORE)
> {
> - char *str = target_waitstatus_to_string (ourstatus);
> + char *str;
> +
> + str = target_waitstatus_to_string (&event_child->waitstatus);
> debug_printf ("LWP %ld: extended event with waitstatus %s\n",
> lwpid_of (get_lwp_thread (event_child)), str);
> xfree (str);
Looks this code is dead code even without your patch. This code is
guarded by "if (!report_to_gdb)", but if report_to_gdb is false,
"(event_child->waitstatus.kind != TARGET_WAITKIND_IGNORE)" is false too.
--
Yao (éå)