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 3/3] MI notification on trace stop: triggered by remote


On 12/19/2012 10:54 AM, Yao Qi wrote:
>  static void
>  remote_notif_trace_parse (struct notif_client *self, char *buf,
>  			  struct notif_event *event)
>  {
>    if (strncmp (buf, "stop:", 5) == 0)
> -    parse_trace_status (buf + 5 + 1, current_trace_status ());
> +    {
> +      struct trace_status *ts = current_trace_status ();
> +
> +      parse_trace_status (buf + 5 + 1, ts);
> +      gdb_assert (!ts->running);
> +      observer_notify_trace_stopped (trace_stop_notes);

I don't think trace_stop_notes is correct here.  The user
could have changed GDB's notes since they were set it
in the target, or the target could have decided to report
different notes, right?  I think ts->notes instead gives you
the notes as reported by the target, so that'd be better.

BTW, isn't the frontend always going to fetch the trace status
afterwards anyway?  IOW is putting the notes on the MI
notification actually useful?  Or rather, why are notes in
the notification while other status bits are not?

> +    }
>    else


On 12/19/2012 10:54 AM, Yao Qi wrote:
> +	gdb_expect {
> +	    -re ".*${mi_gdb_prompt}$" {
> +		pass $test
> +	    }
> +	    timeout {
> +		fail "$test (timeout)"
> +	    }
> +	}
> +	# No =trace-started notification.
> +	mi_gdb_test "-trace-start" "-trace-start\r\n=breakpoint-modified\[^\n\]+\r\n\\^done" \
> +	    "start trace without notification"
> +	mi_gdb_test "-break-insert end" {.*\^done,bkpt=.*} \
> +	    "insert breakpoint on end"
> +
> +	mi_send_resuming_command "exec-continue" \
> +	    "continuing execution to end"
> +	set test "trace-stopped triggered by bufferfull"

Is "bufferfull" (instead of "buffer full") a typo?

-- 
Pedro Alves


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