From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94008 invoked by alias); 30 Jun 2015 15:15:55 -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 93993 invoked by uid 89); 30 Jun 2015 15:15:54 -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-oi0-f52.google.com Received: from mail-oi0-f52.google.com (HELO mail-oi0-f52.google.com) (209.85.218.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 30 Jun 2015 15:15:53 +0000 Received: by oiyy130 with SMTP id y130so9796613oiy.0 for ; Tue, 30 Jun 2015 08:15:51 -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=kP0JChrPy8DmQX8uXfUPLLQ35uDbHi30nIRyQFnCwPw=; b=gBxEhDCAM0jBgQOaUlvZP8dcr3nCZ0/3yXFqcBlFv4VObTdfWX3RqeNKNjqP3+Oj+Z vXQTGHpCdFuuDP3h++nIFnqptf/vp8kGoTVL082nckZqRyxc1gWO4I3LKO27BgymPHBH vAvs4wTeYNOEciNBOw/3JR1Gqt/XNUCMm3/4OZWnYo2AjFUiWKvUAPSgBiWNyGTVKss6 FNZJdBiO21PFIn5MZWq9s62ipef1LO3Vt0uvg3W+IhK0l5twOeLikNU/KDwriAqOGeDc T7HIIo/tGf6z7YjKp5hiBO7h5JXgH94xBLdZhhfS4kchiwg3fGsLr1ebprzu5l+23xj0 ybCw== X-Gm-Message-State: ALoCoQnMVKbHxP1gt+2XcKxSQVXvg7oZ4vljW0Q8i5JjdBV1iK09Q5oKBrmEiBl0HD4D6e/DURcf X-Received: by 10.182.129.19 with SMTP id ns19mr17381242obb.3.1435677351744; Tue, 30 Jun 2015 08:15:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.96.167 with HTTP; Tue, 30 Jun 2015 08:15:32 -0700 (PDT) In-Reply-To: <5592B187.20507@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> <5592B187.20507@redhat.com> From: Patrick Palka Date: Tue, 30 Jun 2015 15:15: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/msg00647.txt.bz2 On Tue, Jun 30, 2015 at 11:11 AM, Pedro Alves wrote: > On 06/30/2015 03:44 PM, Patrick Palka wrote: >> On Tue, Jun 30, 2015 at 10:27 AM, Pedro Alves 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 >