From owner-svn-src-stable@FreeBSD.ORG Tue Dec 11 12:58:28 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8AC2DC27; Tue, 11 Dec 2012 12:58:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 54A628FC13; Tue, 11 Dec 2012 12:58:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBBCwS2v096139; Tue, 11 Dec 2012 12:58:28 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBBCwSg3096138; Tue, 11 Dec 2012 12:58:28 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201212111258.qBBCwSg3096138@svn.freebsd.org> From: Ed Maste Date: Tue, 11 Dec 2012 12:58:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r244119 - stable/8/contrib/gdb/gdb X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2012 12:58:28 -0000 Author: emaste Date: Tue Dec 11 12:58:27 2012 New Revision: 244119 URL: http://svnweb.freebsd.org/changeset/base/244119 Log: MFC r242943: Do not unwind past a zero PC frame. This improves GDB usability when debugging code compiled with optimization. Upstream GDB revision f0031b6d3ae9b164b3747986ab898190bd4dcf8c (prior to GDB's switch to GPLv3), with frame_debug_got_null_frame expanded inline. | 2004-12-12 Andrew Cagney | | * frame.c (get_prev_frame): When unwinding normal frames, check | that the PC isn't zero. Sponsored by: ADARA Networks Modified: stable/8/contrib/gdb/gdb/frame.c Directory Properties: stable/8/contrib/gdb/ (props changed) Modified: stable/8/contrib/gdb/gdb/frame.c ============================================================================== --- stable/8/contrib/gdb/gdb/frame.c Tue Dec 11 12:57:08 2012 (r244118) +++ stable/8/contrib/gdb/gdb/frame.c Tue Dec 11 12:58:27 2012 (r244119) @@ -1846,6 +1846,23 @@ get_prev_frame (struct frame_info *this_ return NULL; } + /* Assume that the only way to get a zero PC is through something + like a SIGSEGV or a dummy frame, and hence that NORMAL frames + will never unwind a zero PC. */ + if (this_frame->level > 0 + && get_frame_type (this_frame) == NORMAL_FRAME + && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME + && get_frame_pc (this_frame) == 0) + { + if (frame_debug) + { + fprintf_unfiltered (gdb_stdlog, "-> "); + fprint_frame (gdb_stdlog, this_frame->prev); + fprintf_unfiltered (gdb_stdlog, " // zero PC \n"); + } + return NULL; + } + /* Only try to do the unwind once. */ if (this_frame->prev_p) {