From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19021 invoked by alias); 22 Feb 2009 11:19:56 -0000 Received: (qmail 19009 invoked by uid 22791); 22 Feb 2009 11:19:55 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.23) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Feb 2009 11:19:49 +0000 Received: from kahikatea.snap.net.nz (unknown [123.255.30.49]) by viper.snap.net.nz (Postfix) with ESMTP id 0193C3DBA14 for ; Mon, 23 Feb 2009 00:19:47 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id DCD048FC6D; Mon, 23 Feb 2009 00:19:39 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18849.13514.379735.375860@kahikatea.snap.net.nz> Date: Sun, 22 Feb 2009 19:37:00 -0000 To: gdb-patches@sourceware.org Subject: [PATCH] PR backtrace/9786 X-IsSubscribed: yes 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: 2009-02/txt/msg00417.txt.bz2 This patch prevents the assertion error reported in: http://sourceware.org/bugzilla/show_bug.cgi?id=9786 Output from "info frame" after connecting to a remote target now looks like: (gdb) info frame Stack level 0, frame at 0x0: eip = 0xb7f7d810; saved eip none Outermost frame: unwinder did not report frame ID Arglist at unknown address. Locals at unknown address, Previous frame's sp in esp With native targets "info frame" works as before and there are no regressions in the testsuite. I don't understand the last line of output but I think this is better than having Gdb throw an assertion error. -- Nick http://www.inet.net.nz/~nickrob 2009-02-23 Nick Roberts PR backtrace/9786 * stack.c (frame_info): Avoid assertion error when there is no saved pc. --- stack.c 12 Feb 2009 19:33:27 +1300 1.185 +++ stack.c 23 Feb 2009 00:09:02 +1300 @@ -894,6 +894,7 @@ frame_info (char *addr_exp, int from_tty int selected_frame_p; struct gdbarch *gdbarch; struct cleanup *back_to = make_cleanup (null_cleanup, NULL); + struct value *value; fi = parse_frame_specification_1 (addr_exp, "No stack.", &selected_frame_p); gdbarch = get_frame_arch (fi); @@ -976,7 +977,12 @@ frame_info (char *addr_exp, int from_tty puts_filtered ("; "); wrap_here (" "); printf_filtered ("saved %s ", pc_regname); - fputs_filtered (paddress (frame_pc_unwind (fi)), gdb_stdout); + value = frame_unwind_register_value (fi, gdbarch_pc_regnum (gdbarch)); + if (VALUE_LVAL (value) == lval_register + && !(frame_id_p (VALUE_FRAME_ID (value)))) + printf_filtered ("none"); + else + fputs_filtered (paddress (frame_pc_unwind (fi)), gdb_stdout); printf_filtered ("\n"); if (calling_frame_info == NULL)