This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 8/8] Call target_traceframe_info when traceframe is selected.
- From: Yao Qi <yao at codesourcery dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 21 Feb 2014 16:19:53 +0800
- Subject: Re: [PATCH 8/8] Call target_traceframe_info when traceframe is selected.
- Authentication-results: sourceware.org; auth=none
- References: <1392185152-21220-1-git-send-email-yao at codesourcery dot com> <1392185152-21220-9-git-send-email-yao at codesourcery dot com> <5306036A dot 1030904 at redhat dot com>
On 02/20/2014 09:30 PM, Pedro Alves wrote:
> On 02/12/2014 06:05 AM, Yao Qi wrote:
>
>> --- a/gdb/tracepoint.c
>> +++ b/gdb/tracepoint.c
>> @@ -4290,7 +4290,7 @@ parse_traceframe_info (const char *tframe_info)
>> struct traceframe_info *
>> get_traceframe_info (void)
>> {
>> - if (traceframe_info == NULL)
>> + if (traceframe_info == NULL && get_traceframe_number () >= 0)
>> traceframe_info = target_traceframe_info ();
>>
>> return traceframe_info;
>
> Hmm, it looks cleaner to me to not have the check here.
> It looked to me that after this patch, all callers of
> get_traceframe_info or traceframe_available_memory are already
> checking whether a traceframe is selected. So why's this hunk
> needed? What did I miss?
>
No, you are right that this check becomes unnecessary. I added
this check in get_traceframe_info in order to guard
remote_traceframe_info, but didn't notice that "whether a traceframe
is selected" is checked in the callers of get_traceframe_info.
I'll remove this part from the patch.
--
Yao (éå)