From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115280 invoked by alias); 7 Oct 2018 21:58:30 -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 115271 invoked by uid 89); 7 Oct 2018 21:58:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Marchi, marchi, toward, H*f:sk:2018090 X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 07 Oct 2018 21:58:27 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id D007B1E52B; Sun, 7 Oct 2018 17:58:24 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=simark.ca; s=mail; t=1538949505; bh=fmibtl5wd0YRJeMgAvRWxy3gQ7jvvcBXx5uFecfio0E=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=XJoXnjeUtE8yln9JK9+a3Fdz1Xq5QZsZbjE6wrT7Rn1/fK1/PyqfMZTYjjRil0PXk 7c89B5KrJ2LTGxS02GPtCx10CBnUKOlXrc+LdcxiwjJsXBE6jLI9Zm7+8/x8SWbBjO GVV1YGqx/ME9jNySMTud50nv7WXe0NQfVd9PBBP0= Subject: Re: [RFC 3/8] Add output styles to gdb To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20180906211303.11029-1-tom@tromey.com> <20180906211303.11029-4-tom@tromey.com> <87va6eevyo.fsf@tromey.com> From: Simon Marchi Message-ID: Date: Sun, 07 Oct 2018 21:58:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <87va6eevyo.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-10/txt/msg00161.txt.bz2 On 2018-10-06 3:06 p.m., Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> Could we pass an additional enum parameter to do_field_string to > Simon> indicate the type of element this field represents? If this > Simon> parameter has a default value of "NOTHING", then we can add then > Simon> incrementally. > > Yes, either this or, as you mentioned in another note, passing the style > directly, could be done. I suppose I tend to lean more toward the > semantic approach than the style approach, because maybe having some > kind of "type" attached to a field could be useful in other situations. > > Be sure to read this as well: > > https://sourceware.org/ml/gdb-patches/2018-10/msg00107.html > > It presents another alternative -- one I rejected but maybe it can be > rehabilitated. I guess you refer to Pedro's suggestion of having custom format strings. I am not against that, I am just afraid that because it's a lot more efforts than something like you did, it would postpone the results indefinitely (unless somebody is super motivated to do it right now). Also, I think these custom format strings (LLVM uses its own style too, as mentioned) need to bring significantly more value (in terms of code simplicity) than the other alternatives, because they are harder to learn, modify and debug than simple function calls. > These questions about the overall approach and the API are the main > things to resolve up front, since they have the highest cost to change. Indeed, but at least it's not external API, so we have the option to change. Simon