This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Be lazy about refreshing the windows in tui_show_frame_info (PR tui/13378)
- From: Patrick Palka <patrick at parcs dot ath dot cx>
- To: Pedro Alves <palves at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 30 Jun 2015 11:15:32 -0400
- Subject: Re: [PATCH] Be lazy about refreshing the windows in tui_show_frame_info (PR tui/13378)
- Authentication-results: sourceware.org; auth=none
- References: <1435372525-1374-2-git-send-email-patrick at parcs dot ath dot cx> <1435631532-32504-1-git-send-email-patrick at parcs dot ath dot cx> <5592A753 dot 4030004 at redhat dot com> <CA+C-WL_6V6jTry9cVFZPNtOx8D510k-Ni_=cv_riXju01rp41g at mail dot gmail dot com> <5592B187 dot 20507 at redhat dot com>
On Tue, Jun 30, 2015 at 11:11 AM, Pedro Alves <palves@redhat.com> wrote:
> On 06/30/2015 03:44 PM, Patrick Palka wrote:
>> On Tue, Jun 30, 2015 at 10:27 AM, Pedro Alves <palves@redhat.com> wrote:
>
>>> Can't element->proc_name be NULL here?
>>
>> Don't think so, since it is an inline array. It's defined as:
>>
>> struct tui_locator_element
>> {
>> ...
>> char full_name[MAX_LOCATOR_ELEMENT_LEN];
>> char proc_name[MAX_LOCATOR_ELEMENT_LEN];
>> }
>>
>> (and tui_alloc_content makes sure to set full_name[0] = proc_name[0] = '\0').
>
> Ah.
>
>>
>>>
>>> For the string fields, do we also need to compare
>>> whether we go from NULL <-> non-NULL ?
>>>
>>> locator_changed_p |= ((fullname == NULL) != (element->full_name == NULL));
>>>
>>> etc.?
>>
>> Yeah, that would be more correct I think. But I think the logic would
>> have to look like "if (procname == NULL) locator_changed_p |= strlen
>> (element->proc_name) != 0;" because proc_name cannot be NULL. When
>> procname is NULL, proc_name[0] gets set to 0.
>>
>
> Or alternatively:
>
> if (fullname == NULL)
> fullname = "";
> locator_changed_p |= strncmp (element->proc_name, procname,
> MAX_LOCATOR_ELEMENT_LEN) != 0;
I'll do that.
> ...
>
> Thanks,
> Pedro Alves
>