This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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 (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]