From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23281 invoked by alias); 13 Jan 2009 18:07:34 -0000 Received: (qmail 23271 invoked by uid 22791); 13 Jan 2009 18:07:33 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mtagate3.de.ibm.com (HELO mtagate3.de.ibm.com) (195.212.29.152) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Jan 2009 18:06:43 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.13.8/8.13.8) with ESMTP id n0DI6eCA214958 for ; Tue, 13 Jan 2009 18:06:40 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id n0DI6dfU3960882 for ; Tue, 13 Jan 2009 19:06:39 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n0DI6d1k012647 for ; Tue, 13 Jan 2009 19:06:39 +0100 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id n0DI6dYw012644 for ; Tue, 13 Jan 2009 19:06:39 +0100 Message-Id: <200901131806.n0DI6dYw012644@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 13 Jan 2009 19:06:39 +0100 Subject: [rfc] Add assert to catch get_frame_arch (NULL) calls To: gdb-patches@sourceware.org Date: Tue, 13 Jan 2009 18:07:00 -0000 From: "Ulrich Weigand" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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-01/txt/msg00285.txt.bz2 Hello, to prevent get_frame_arch (NULL) problems from being accidentally re-introduced, this patch adds an assertion to get_frame_arch. Tested with no regressions on powerpc-linux. If there are no objections to this, I'm planning on committing the patch within a couple of days ... Bye, Ulrich ChangeLog: * frame.c (get_frame_arch): Abort if called with NULL this_frame. Index: gdb/frame.c =================================================================== RCS file: /cvs/src/src/gdb/frame.c,v retrieving revision 1.257 diff -c -p -r1.257 frame.c *** gdb/frame.c 3 Jan 2009 05:57:51 -0000 1.257 --- gdb/frame.c 13 Jan 2009 17:51:38 -0000 *************** safe_frame_unwind_memory (struct frame_i *** 1795,1800 **** --- 1795,1805 ---- struct gdbarch * get_frame_arch (struct frame_info *this_frame) { + /* In the future, this function will return a per-frame + architecture instead of current_gdbarch. Calling the + routine with a NULL value of this_frame is a bug! */ + gdb_assert (this_frame); + return current_gdbarch; } -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com