Re: [PATCH/7.10 1/2] Linux gdbserver confused when event randomization returns a process exit event

Yao Qi
2015-08-03T10:59:03Z

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 (齐尧)