From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20907 invoked by alias); 18 Jan 2010 10:55:00 -0000 Received: (qmail 20894 invoked by uid 22791); 18 Jan 2010 10:54:59 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Jan 2010 10:54:51 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 1C25B2BABE9; Mon, 18 Jan 2010 05:54:50 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id JYa1mDIL8vSG; Mon, 18 Jan 2010 05:54:50 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 729212BAB2C; Mon, 18 Jan 2010 05:54:49 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id B41E7F5970; Mon, 18 Jan 2010 14:54:35 +0400 (RET) Date: Mon, 18 Jan 2010 10:55:00 -0000 From: Joel Brobecker To: Kai Tietz Cc: gdb-patches@sourceware.org Subject: Re: Fix build-failure of gdb in python.c Message-ID: <20100118105435.GK17397@adacore.com> References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="l76fUT7nc3MelDdI" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2010-01/txt/msg00454.txt.bz2 --l76fUT7nc3MelDdI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1269 > in file python/python.c is the method throw_error with constant > UNSUPPORTED_ERROR used, but the header exceptions.h isn't included, so I > get a build failure. I am not sure if this happens for other targets, too. > The attached patch fixes this by adding the necessary include. Outch, sorry. My mistake. I had seen that exceptions.h might be needed if !HAVE_PYTHON, but was lazy and only did a visual check. I should have attempted a build --without-python. > 2010-01-18 Kai Tietz > > * python/python.c: Add include of exception.h header. Unfortunately, this is not the right fix. 2 things: - The needed include was conditionalized on HAVE_PYTHON, so the right fix was simply to move the #include out of the conditionalized section; - the right include is "exceptions.h", not "../exceptions.h". Sources in python/ are compiled from the gdb/ subdirectory. I have applied the following patch to fix the problem. 2010-01-18 Joel Brobecker Fix build failure when building without Python support. * python/python.c: Always include exceptions.h, even when HAVE_PYTHON is not defined. Tested by rebuilding GDB --with-python and --without-python. -- Joel --l76fUT7nc3MelDdI Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="python.diff" Content-length: 637 Index: python/python.c =================================================================== RCS file: /cvs/src/src/gdb/python/python.c,v retrieving revision 1.24 diff -u -p -r1.24 python.c --- python/python.c 18 Jan 2010 06:25:22 -0000 1.24 +++ python/python.c 18 Jan 2010 10:50:11 -0000 @@ -27,6 +27,7 @@ #include "observer.h" #include "value.h" #include "language.h" +#include "exceptions.h" #include @@ -45,7 +46,6 @@ static int gdbpy_auto_load = 1; #include "cli/cli-decode.h" #include "charset.h" #include "top.h" -#include "exceptions.h" #include "python-internal.h" #include "version.h" #include "target.h" --l76fUT7nc3MelDdI--