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 8/8] Call target_traceframe_info when traceframe is selected.


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


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