From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31677 invoked by alias); 5 Dec 2012 17:36:53 -0000 Received: (qmail 31588 invoked by uid 22791); 5 Dec 2012 17:36:53 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS 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, 05 Dec 2012 17:36:47 +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 qB5Halqu019130 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 5 Dec 2012 12:36:47 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qB5Hakju016299 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 5 Dec 2012 12:36:46 -0500 From: Tom Tromey To: Phil Muldoon Cc: "gdb-patches\@sourceware.org" Subject: Re: [patch][python] 0 of 5 - Frame filters and Wrappers References: <50B8C313.2070404@redhat.com> <87k3syvmzd.fsf@fleche.redhat.com> <50BF3E9D.4080403@redhat.com> Date: Wed, 05 Dec 2012 17:36:00 -0000 In-Reply-To: <50BF3E9D.4080403@redhat.com> (Phil Muldoon's message of "Wed, 05 Dec 2012 12:31:25 +0000") Message-ID: <87624gtn81.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (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-12/txt/msg00081.txt.bz2 >>>>> "Phil" == Phil Muldoon writes: Tom> What is it that is inconsistent? Phil> Just the naming. With MI, because it is a machine interface, option Phil> length is not so important. So --no-frame-filters in the MI command Phil> turns off a specific feature. However, "raw" in the "bt" command Phil> does not turn off a specific function, or is ambiguous. I would Phil> really like to think of an option name that is small enough not to be Phil> painful to type, but meaningful and specific. I could not, so I just Phil> highlighted it in the review. Ok, thanks. I do think it would be useful to have an option meaning "disable value pretty printing for this bt". Perhaps that should be "raw" and we should have a different name for this. Or maybe "raw" should mean both -- since that would truly be "raw". Phil> Well there are two steps. The actual filtering, this occurs when Phil> frame filters operate on the frame iterator. Errors can occur Phil> here, though I suppose the scope for that is considerably narrower Phil> than in the printing phase. If an error occurs in this phase I think Phil> (though the patch does not do this right now), we abandon the stack Phil> trace with an error message of the name of the erroring filter, and Phil> defer to GDB's inbuilt backtrace. For both MI and CLI. As no frames Phil> have been printed yet, this would be fairly clear. Filtering and printing, in most cases, have to be interleaved. Otherwise I think there will be scaling issues. The case where interleaving is not possible is when printing the tail end of the stack trace: "bt -50". Here you have to save the last N frames somewhere before printing. Phil> At the printing step this is a different issue. At this point all of Phil> the frame filters have executed. Now the Python code is printing out Phil> the backtrace frame-by-frame with its own built-in routines according Phil> to how each frame wrapper decorates each frame. I think an error Phil> with the frame wrapper as you suggested, then moving onto the next Phil> frame is probably best here? I tend to think just erroring out immediately is ok. A tool like ABRT ought to send both "bt full" and "bt full raw" anyway, to avoid these kinds of potential problems; and users can react accordingly easily enough -- just disable the printer and repeat the command. Tom