From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16407 invoked by alias); 19 Nov 2012 23:03:59 -0000 Received: (qmail 16389 invoked by uid 22791); 19 Nov 2012 23:03:58 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-bk0-f41.google.com (HELO mail-bk0-f41.google.com) (209.85.214.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Nov 2012 23:03:54 +0000 Received: by mail-bk0-f41.google.com with SMTP id jg9so2320959bkc.0 for ; Mon, 19 Nov 2012 15:03:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.136.207 with SMTP id s15mr5380253bkt.5.1353366233011; Mon, 19 Nov 2012 15:03:53 -0800 (PST) Received: by 10.204.143.76 with HTTP; Mon, 19 Nov 2012 15:03:52 -0800 (PST) In-Reply-To: <878v9xp88o.fsf@fleche.redhat.com> References: <878v9xp88o.fsf@fleche.redhat.com> Date: Mon, 19 Nov 2012 23:03:00 -0000 Message-ID: Subject: Re: Fwd: Addresses in pretty-printing From: Jim Blandy To: Tom Tromey Cc: gdb ml Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00057.txt.bz2 On Mon, Nov 19, 2012 at 1:56 PM, Tom Tromey wrote: >>>>>> "Jim" == Jim Blandy writes: > > Jim> Here is proposed documentation for gdb.Value.format, and two > Jim> accompanying functions, gdb.value_print_options and > Jim> gdb.set_value_print_options. I'd be willing to implement something > Jim> like this. > > It seems like a worthwhile facility to me. > > I think one possible objection is that this kind of thing will let > pretty-printer authors effectively override user settings. However, > we've see that they already do this, and it isn't really possible (or > perhaps arguably desirable) to stop them. Your proposal makes the > resulting code cleaner and is also, I think, useful for writing > new commands. Yeah; badly-written pretty-printers can do anything they like. The proposal might make it easier for pretty-printers to respect user settings (like 'print elements', say). > Jim> @findex gdb.set_value_print_options > Jim> @defun gdb.set_value_print_options (options) > Jim> Set the value printing options as given in @var{options}, a dictionary > Jim> whose items' keys name value printing options, and whose values are > Jim> the values to which those options should be set. Permitted keys are as > Jim> for @code{gdb.value_print_options}, described above. > > This is just shorthand for a bunch of calls to gdb.execute, to set the > various parameters? Yes, and it could avoid the silly stringify/pass to gdb/destringify process and just write to user_print_options directly.