From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100580 invoked by alias); 30 Jun 2015 14:45:08 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 100568 invoked by uid 89); 30 Jun 2015 14:45:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-ob0-f177.google.com Received: from mail-ob0-f177.google.com (HELO mail-ob0-f177.google.com) (209.85.214.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 30 Jun 2015 14:45:06 +0000 Received: by obbop1 with SMTP id op1so7935092obb.2 for ; Tue, 30 Jun 2015 07:45:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=hih49sCY7SGzN34wIQ0n652S8nGlJgQsHY384YQ012Q=; b=gcTwrN/LC8vLj6xPClWNY3N/CM+1z75zCPw9+K1wS1JALwcVuczU0b+p8BISH8Z6xk GfpDQ+r6ak91ggOprkeBqcRYzg3/bX6W2liZ9QdWzd1roR9BNcXe84VFoNrvPaW1bbMo 1KEfc0OhbCnREJlCt4spliOxkBky+PqotWcWiVKOKZg5/+NSaEvXBFSy/9LgwdT9Tw/E FrRBpcOPPTGaIapJtjediVkEbrwbzElTTSMOCy/R3FHxlfM+jjSXvqE817mv28EHGNQb mOuH8dpjOLGZiFQCWY/xMY33nbdIIrd7unQyv3T/dkJalk9FdViXsv83Tp17fXIM7CxO 9Slw== X-Gm-Message-State: ALoCoQlwMdB5X4X8k3KcY1snjDEm4HttcxGXPnbWaMxx9LIcMFycbTMrTYLNRRjTKgxgq/Xh/h+Y X-Received: by 10.60.68.44 with SMTP id s12mr19704687oet.22.1435675504313; Tue, 30 Jun 2015 07:45:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.96.167 with HTTP; Tue, 30 Jun 2015 07:44:44 -0700 (PDT) In-Reply-To: <5592A753.4030004@redhat.com> References: <1435372525-1374-2-git-send-email-patrick@parcs.ath.cx> <1435631532-32504-1-git-send-email-patrick@parcs.ath.cx> <5592A753.4030004@redhat.com> From: Patrick Palka Date: Tue, 30 Jun 2015 14:45:00 -0000 Message-ID: Subject: Re: [PATCH] Be lazy about refreshing the windows in tui_show_frame_info (PR tui/13378) To: Pedro Alves Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-06/txt/msg00637.txt.bz2 On Tue, Jun 30, 2015 at 10:27 AM, Pedro Alves wrote: > On 06/30/2015 03:32 AM, Patrick Palka wrote: >> This revised patch makes sure that tui_set_locator_info returns 1 when the >> locator is first constructed, just in case none of the later checks trigger >> for some reason. > > I have a couple questions below, but I'm fine with this approach. > >> @@ -302,21 +306,36 @@ tui_set_locator_info (struct gdbarch *gdbarch, >> { >> struct tui_gen_win_info *locator = tui_locator_win_info_ptr (); >> struct tui_locator_element *element; >> + int locator_changed_p = 0; >> >> /* Allocate the locator content if necessary. */ >> if (locator->content_size <= 0) >> { >> locator->content = tui_alloc_content (1, LOCATOR_WIN); >> locator->content_size = 1; >> + locator_changed_p = 1; >> } >> >> element = &locator->content[0]->which_element.locator; >> + >> + if (procname != NULL) >> + locator_changed_p |= strncmp (element->proc_name, procname, >> + MAX_LOCATOR_ELEMENT_LEN) != 0; > > 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'). > > 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. > > Thanks, > Pedro Alves >