This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
[patch] [python] Make GDB buildable on python without threads.
- From: Paul Pluzhnikov <ppluzhnikov at google dot com>
- To: Project Archer <archer at sourceware dot org>
- Date: Mon, 15 Dec 2008 16:10:56 -0800
- Subject: [patch] [python] Make GDB buildable on python without threads.
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta;t=1229386259; bh=EGetwBFNqdlqJ6kkKvWck+rrTtY=;h=DomainKey-Signature:MIME-Version:Date:Message-ID:Subject:From:To: Content-Type:Content-Transfer-Encoding; b=QSrGEKMwve27WE2Fw7aE3Q/+6vf2U9irToSztr58nK3bGzBVDI66ze2lwsRMk6ZTQFjUssZeMKumRCYttqs8Mg==
- Domainkey-signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns;h=mime-version:date:message-id:subject:from:to:content-type:content-transfer-encoding;b=oqhiqmuLAEiw/1rIPHojkphy73BLHbyFOyFv3rOTWdCslQeBed8A7ZBcPRzfqYN0piZAwFCq6CR9xJ88efrz3g==
Greetings,
Getting back into the swing ...
My freshly-pulled archer-tromey-python failed to build with:
cc1: warnings being treated as errors
../../gdb/python/python.c: In function '_initialize_python':
../../gdb/python/python.c:1503: error: implicit declaration of
function 'PyEval_ReleaseLock'
make[2]: *** [python.o] Error 1
This is because my Python 2.4.5 was configured with --without-threads.
Ok to commit?
Thanks,
--
Paul Pluzhnikov
2008-12-15 Paul Pluzhnikov <ppluzhnikov@google.com>
python/python.c (_initialize_python): Allow build with non-threaded
Python.
diff --git a/gdb/python/python.c b/gdb/python/python.c
index fd84f60..a040de0 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1500,7 +1500,10 @@ if hasattr (gdb, 'datadir'):\n\
/* Release the GIL while gdb runs. */
PyThreadState_Swap (NULL);
+
+#if WITH_THREAD /* If Python was built with thread support. */
PyEval_ReleaseLock ();
+#endif
#endif /* HAVE_PYTHON */
}