From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23416 invoked by alias); 26 Jul 2013 18:42:03 -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 23390 invoked by uid 89); 26 Jul 2013 18:42:02 -0000 X-Spam-SWARE-Status: No, score=-4.4 required=5.0 tests=AWL,BAYES_40,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,SPF_HELO_PASS,SPF_PASS,TW_CP autolearn=no version=3.3.1 Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 26 Jul 2013 18:42:02 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6QIfsPL004161 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 26 Jul 2013 14:41:54 -0400 Received: from barimba (ovpn-113-128.phx2.redhat.com [10.3.113.128]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r6QIfpJ2031233 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 26 Jul 2013 14:41:52 -0400 From: Tom Tromey To: Michael Eager Cc: Keith Seitz , "gdb-patches\@sourceware.org ml" Subject: Re: [PATCH] Revised display-linkage-name References: <519D086A.50105@eagerm.com> <51BF47DB.6070709@eagerm.com> <51DD891D.7090009@eagerm.com> <51DF3F97.90805@redhat.com> <51E07263.6080605@eagerm.com> <51E6E797.30709@eagerm.com> <51ED705A.5000601@redhat.com> <51ED90E3.30801@eagerm.com> <51EDAA3A.5090504@redhat.com> <51EFF8F8.6050807@eagerm.com> Date: Fri, 26 Jul 2013 18:42:00 -0000 In-Reply-To: <51EFF8F8.6050807@eagerm.com> (Michael Eager's message of "Wed, 24 Jul 2013 08:55:36 -0700") Message-ID: <874nbhtb80.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-07/txt/msg00647.txt.bz2 >>>>> "Michael" == Michael Eager writes: Michael> This is pretty pointless busywork, serving no useful purpose. It's part of the currently-agreed-upon coding style. You're always welcome to propose changes. Michael> +set|show display-linkage-name-len It's more gdb-ish to spell out "length". Michael> + /* Print linkage name after source name if requested and different. */ Michael> + if ((display_linkage_name || ui_out_is_mi_like_p (uiout)) Michael> + && linkname != NULL && strcmp (funname, linkname) != 0) Michael> + { Michael> + annotate_linkage_name (); FWIW there isn't much need to add new annotations. Annotations are officially deprecated. It's fine by me if you want to leave this in for some reason though. Michael> + ui_out_text (uiout, " ["); Michael> + Michael> + if (strlen (linkname) > display_linkage_name_len) Michael> + { Michael> + char *lname = alloca (display_linkage_name_len + 4); Michael> + Michael> + strncpy (lname, linkname, display_linkage_name_len); Michael> + lname[display_linkage_name_len] = '\0'; Michael> + strcat (lname, "..."); Michael> + ui_out_text (uiout, lname); Michael> + } Michael> + else Michael> + ui_out_text (uiout, linkname); Michael> + Michael> + ui_out_text (uiout, "]"); Michael> + ui_out_field_stream (uiout, "linkage_name", stb); This is emitting the linkage name using ui_out_text. That is wrong for MI. Then this emits the linkage_name field with the contents from "stb" -- which is reusing a result computed previously (look up for the fprintf_symbol_filtered). I tend to think that limiting the name length should only be done in the not-MI case. That is, for MI, it is better to always print the whole thing. Tom