From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15799 invoked by alias); 28 May 2014 18:31:39 -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 15786 invoked by uid 89); 28 May 2014 18:31:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 May 2014 18:31:38 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4SIVWC1012799 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 May 2014 14:31:35 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s4SIVUao011033; Wed, 28 May 2014 14:31:31 -0400 Message-ID: <53862B81.2070306@redhat.com> Date: Wed, 28 May 2014 18:31:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Andrew Burgess , gdb-patches@sourceware.org Subject: Re: [PATCH v3 4/4] Add a TRY_CATCH to get_prev_frame to better handle errors during unwind. References: <533EC5B7.6080600@broadcom.com> <1398855344-25278-1-git-send-email-aburgess@broadcom.com> <1398855344-25278-5-git-send-email-aburgess@broadcom.com> In-Reply-To: <1398855344-25278-5-git-send-email-aburgess@broadcom.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-05/txt/msg00697.txt.bz2 On 04/30/2014 11:55 AM, Andrew Burgess wrote: > Here a new TRY_CATCH is added to the core of get_prev_frame, all uncaught > errors are turned into UNWIND_MISC_ERROR, and where possible the error > message associated with the error is stored as a frame specific stop reason > string. The reason string is held of the frame OBSTACK so it lives as long > as the frame does. > > There's a new function for getting the frame_stop_reason_string, this > replaces the now (thanks to patch #3) old frame_stop_reason_string > function, I know that reusing the name could confuse, but this function was > not widely used, so I hope that'll not be an issue. Sounds like we'll want to expose this to Python too. If you're not planning on doing that, could you file a PR once this goes in? > > Finally, I update the expected results from the tests in patch #1 now that > everything should pass. > > I don't know if you'll all be happy with me catching _all_ errors in > get_prev_frame. Yeah, that makes me somewhat nervous. E.g., this catches and swallows TARGET_CLOSE_ERROR. > Given that the issues I'm seeing "in the wild" and which > I've put into the tests are for accessing invalid memory through a bad > stack pointer, I could reduce the catching to only catch MEMORY_ERRORs, > then UNWIND_MISC_ERROR would become UNWIND_MEMORY_ERROR. I think I'd prefer that. This swallows TARGET_CLOSE_ERROR, for example. Could you please include both MI and CLI before/after examples in the description/commit log, please? You had something close to that in the cover letter, but that doesn't make it to the repository. > I could even add > the memory error detection on top of the new MISC_ERROR case if preferred, > though I'd need to think of a new test... I didn't understand this. > > Feedback welcome, or is this OK? > * unwind_stop_reason.def: Add UNWIND_MISC_ERROR. Values added here are exposed to Python/scheme automatically. But, we need to document them manually in the manual. E.g. for python, in gdb/python.texi in the table beneath the description of Frame.unwind_stop_reason (). -- Pedro Alves