From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32702 invoked by alias); 2 Jul 2003 18:27:41 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 32688 invoked from network); 2 Jul 2003 18:27:41 -0000 Received: from unknown (HELO localhost.redhat.com) (66.187.230.200) by sources.redhat.com with SMTP; 2 Jul 2003 18:27:41 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id C80452B5F for ; Wed, 2 Jul 2003 14:27:39 -0400 (EDT) Message-ID: <3F03241B.1020908@redhat.com> Date: Wed, 02 Jul 2003 18:27:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [patch, rfc, 6?] Enable identical frame sanity check Content-Type: multipart/mixed; boundary="------------030609040102050605060304" X-SW-Source: 2003-07/txt/msg00043.txt.bz2 This is a multi-part message in MIME format. --------------030609040102050605060304 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 376 Hello, This patch enables the `is the prev frame identical to this frame' check in get_prev_frame(). I forgot to enable it when I switched the frame ID code from using the frame's PC to using the frame's function. Noticed this when reviewing Daniel's Arm frame update. It should probably go straight into the mainline (tested on i386 and d10v). Thoughts on 6? Andrew --------------030609040102050605060304 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 2176 2003-07-02 Andrew Cagney * frame.c (get_prev_frame): Enable check for identical frames. Update comments. Update error messages. Index: frame.c =================================================================== RCS file: /cvs/src/src/gdb/frame.c,v retrieving revision 1.128 diff -u -r1.128 frame.c --- frame.c 29 Jun 2003 13:27:26 -0000 1.128 +++ frame.c 2 Jul 2003 18:22:38 -0000 @@ -1933,25 +1933,21 @@ } /* Check that this frame's ID isn't inner to (younger, below, next) - the next frame. This happens when frame unwind goes backwards. - Since the sentinel frame isn't valid, don't apply this if this - frame is entier the inner-most or sentinel frame. */ + the next frame. This happens when a frame unwind goes backwards. + Since the sentinel frame doesn't really exist, don't compare the + inner-most against that sentinel. */ if (this_frame->level > 0 && frame_id_inner (get_frame_id (this_frame), get_frame_id (this_frame->next))) - error ("This frame inner-to next frame (corrupt stack?)"); + error ("Previous frame inner to this frame (corrupt stack?)"); - /* Check that this and the next frame are different. If they are - not, there is most likely a stack cycle. As with the inner-than - test, avoid the inner-most and sentinel frames. */ - /* FIXME: cagney/2003-03-17: Can't yet enable this this check. The - frame_id_eq() method doesn't yet use function addresses when - comparing frame IDs. */ - if (0 - && this_frame->level > 0 + /* Check that this and the next frame are not identical. If they + are, there is most likely a stack cycle. As with the inner-than + test above, avoid comparing the inner-most and sentinel frames. */ + if (this_frame->level > 0 && frame_id_eq (get_frame_id (this_frame), get_frame_id (this_frame->next))) - error ("This frame identical to next frame (corrupt stack?)"); + error ("Previous frame identical to this frame (corrupt stack?)"); /* Allocate the new frame but do not wire it in to the frame chain. Some (bad) code in INIT_FRAME_EXTRA_INFO tries to look along --------------030609040102050605060304--