From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25728 invoked by alias); 17 Sep 2014 13:03:02 -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 25615 invoked by uid 89); 17 Sep 2014 13:03:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 17 Sep 2014 13:02:56 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8HD2opr010582 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 17 Sep 2014 09:02:50 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8HD2mTK005871; Wed, 17 Sep 2014 09:02:49 -0400 Message-ID: <54198678.10405@redhat.com> Date: Wed, 17 Sep 2014 13:03:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Ulrich Weigand CC: Edjunior Barbosa Machado , gdb-patches@sourceware.org Subject: Re: [PATCH] [PR tdep/17379] Fix internal-error when stack pointer is invalid References: <201409171241.s8HCfHqs007521@d06av02.portsmouth.uk.ibm.com> In-Reply-To: <201409171241.s8HCfHqs007521@d06av02.portsmouth.uk.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-09/txt/msg00584.txt.bz2 On 09/17/2014 01:41 PM, Ulrich Weigand wrote: > Pedro Alves wrote: > >> See https://sourceware.org/bugzilla/show_bug.cgi?id=17384 . >> >> When safe_read_memory_integer call fails, GDB prints a >> surprising/confusing error message, more so in case the unwinder >> is triggered for some reason other than the "bt" command, like >> with "step"/"next". I take you're now seeing the same errors >> with this patch. >> >> IMO, printing the error is not something a low-level helper function >> like safe_read_memory_integer should be doing, as GDB uses it when >> probing with heuristics because it can't sure its guesses make sense >> (whether there's a frame at all, etc.) safe_frame_unwind_memory, which is >> used in rs6000_in_function_epilogue_p doesn't print the error either. > > Agreed, it doesn't make sense for safe_read_memory_integer to ever > print an error. In fact, it doesn't make sense for it to start > using a routine that raises exceptions and then attempt to catch it. > The following patch simplifies the whole logic by just using > target_read_memory directly. Does this look reasonable? Definitely reasonable. Looks great to me. Thanks for doing this. > > [ B.t.w. the naming of safe_frame_unwind_memory is a bit weird. This > should either be "safe_read_memory" in corefile.c, or else something > like safe_get_frame_memory in analogy to get_frame_memory. ] Agreed. It seems like that and get_frame_memory were added in order to make sure frame code consistently used target_read_memory_nobpt to mask out breakpoints: https://sourceware.org/ml/gdb-patches/2004-04/msg00067.html Seems like all that wrapping is unnecessary nowadays, as we have to go out of way to bypass breakpoint masking. Thanks, Pedro Alves