Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Fix build-failure of gdb in python.c
@ 2010-01-18 10:30 Kai Tietz
  2010-01-18 10:55 ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Kai Tietz @ 2010-01-18 10:30 UTC (permalink / raw)
  To: gdb-patches

Hello,

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.

ChangeLog

2010-01-18  Kai Tietz  <kai.tietz@onevision.com>

        * python/python.c: Add include of exception.h header.

Tested for i686-pc-cygwin, i686-pc-mingw32, and x86_64-w64-mingw32. Of for 
apply?


Regards,
Kai

|  (\_/)  This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

Index: python.c
===================================================================
RCS file: /cvs/src/src/gdb/python/python.c,v
retrieving revision 1.24
diff -u -3 -r1.24 python.c
--- python.c    18 Jan 2010 06:25:22 -0000      1.24
+++ python.c    18 Jan 2010 10:27:20 -0000
@@ -27,7 +27,7 @@
 #include "observer.h"
 #include "value.h"
 #include "language.h"
-
+#include "../exceptions.h"
 #include <ctype.h>

 /* True if we should print the stack when catching a Python error,


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fix build-failure of gdb in python.c
  2010-01-18 10:30 Fix build-failure of gdb in python.c Kai Tietz
@ 2010-01-18 10:55 ` Joel Brobecker
  2010-01-18 11:02   ` Kai Tietz
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2010-01-18 10:55 UTC (permalink / raw)
  To: Kai Tietz; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1269 bytes --]

> 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  <kai.tietz@onevision.com>
> 
>         * 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  <brobecker@adacore.com>

        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

[-- Attachment #2: python.diff --]
[-- Type: text/x-diff, Size: 637 bytes --]

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 <ctype.h>
 
@@ -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"

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fix build-failure of gdb in python.c
  2010-01-18 10:55 ` Joel Brobecker
@ 2010-01-18 11:02   ` Kai Tietz
  0 siblings, 0 replies; 3+ messages in thread
From: Kai Tietz @ 2010-01-18 11:02 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Kai Tietz, gdb-patches

Thanks for the fast fix.

Regards,
Kai

-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-18 11:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-18 10:30 Fix build-failure of gdb in python.c Kai Tietz
2010-01-18 10:55 ` Joel Brobecker
2010-01-18 11:02   ` Kai Tietz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox