From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11486 invoked by alias); 26 Jul 2013 20:18:05 -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 11461 invoked by uid 89); 26 Jul 2013 20:18:05 -0000 X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_50,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,RDNS_NONE,TW_CP autolearn=no version=3.3.1 Received: from Unknown (HELO homiemail-a79.g.dreamhost.com) (208.113.200.5) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 26 Jul 2013 20:18:04 +0000 Received: from homiemail-a79.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a79.g.dreamhost.com (Postfix) with ESMTP id 31E8E7D406E; Fri, 26 Jul 2013 13:17:19 -0700 (PDT) Received: from redwood.eagercon.com (c-50-148-128-197.hsd1.ca.comcast.net [50.148.128.197]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: eager@eagerm.com) by homiemail-a79.g.dreamhost.com (Postfix) with ESMTPSA id 13C5D7D4059; Fri, 26 Jul 2013 13:17:19 -0700 (PDT) Message-ID: <51F2D975.3060801@eagerm.com> Date: Fri, 26 Jul 2013 20:18:00 -0000 From: Michael Eager User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Tom Tromey 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> <874nbhtb80.fsf@fleche.redhat.com> In-Reply-To: <874nbhtb80.fsf@fleche.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-07/txt/msg00659.txt.bz2 On 07/26/13 11:41, Tom Tromey wrote: >>>>>> "Michael" == Michael Eager writes: > > Michael> +set|show display-linkage-name-len > > It's more gdb-ish to spell out "length". OK. > 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. I added the annotations at your request (4/19/13): >> I think for MI it is better to make this a real field. >> Also I wonder whether this should be emitted unconditionally if >> mi-like. Say: Perhaps I misunderstood what you meant by "make this a real field". > 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. What should it be? ui_out_field_string()? Something else? > 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. OK. -- Michael Eager eager@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077