From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12449 invoked by alias); 14 Mar 2012 16:11:06 -0000 Received: (qmail 12439 invoked by uid 22791); 14 Mar 2012 16:11:05 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 14 Mar 2012 16:10:52 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2EGAOoc002464 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 14 Mar 2012 12:10:24 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q2EGAM6T009579 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 14 Mar 2012 12:10:22 -0400 From: Tom Tromey To: iam ahal Cc: Eli Zaretskii , pedro@codesourcery.com, dje@google.com, gdb-patches@sourceware.org, pmuldoon@redhat.com, brobecker@adacore.com, drow@false.org, jan.kratochvil@redhat.com Subject: Re: [patch] GDB 7.2: new feature for "backtrace" that cuts path to file (remain filename) References: <83fwgzbrp9.fsf@gnu.org> <201112061249.47758.pedro@codesourcery.com> Date: Wed, 14 Mar 2012 16:11:00 -0000 In-Reply-To: (iam ahal's message of "Sat, 10 Mar 2012 23:14:43 +0300") Message-ID: <87ty1rcgeq.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 X-SW-Source: 2012-03/txt/msg00485.txt.bz2 >>>>> "Iam" == iam ahal writes: Iam> First of all, I'm sorry for a late response (again). No problem :) Iam> Copyright assignment has been done. Super. I have just a few nits. Iam> +If backtraces isn't easy to read due to a long absolute filename path recorded and Iam> +you just want to see only a basename or a relative filename path, you can change this Iam> +behaviour: These lines are too long. gdb uses the American English spelling, "behavior". Eli will have to review the rest of the docs, these just jumped out at me immediately. Iam> + else if (filename_display_string == filename_display_relative_directory && Iam> + dirname && dlen && dlen <= strlen (filename) && Iam> + !filename_ncmp (filename, dirname, dlen)) In the GNU style, lines are broken before operators, not after. So, the "&&"s should be moved. Iam> + const char *filename_display = get_filename_display_from_sal (&sal); Iam> + Iam> + if (filename_display == NULL) Iam> + filename_display = sal.symtab->filename; It seems to me that you can just drop the NULL check. When can filename_display be NULL, except with sal.symtab->filename is already NULL? Tom