summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorwolfsuit <wolfsuit>2005-03-09 19:40:50 (GMT)
committerwolfsuit <wolfsuit>2005-03-09 19:40:50 (GMT)
commit88040acda86230fe9cc4ebfef29321940976db05 (patch)
tree9d44f0e9e176ad5cda43cfb0cf279dfaf1d94da8 /macosx
parent72d7d96374d5a0dd032e725c1bd1279ca115c218 (diff)
downloadtk-88040acda86230fe9cc4ebfef29321940976db05.zip
tk-88040acda86230fe9cc4ebfef29321940976db05.tar.gz
tk-88040acda86230fe9cc4ebfef29321940976db05.tar.bz2
Add a hack to work around some issues with remote debugging with Xcode. Xcode requires
that stdin & stdout be closed or you won't be able to interrupt the running program. So I added a check for XCNOSTDIN environment variable in the startup, and I force them closed if it is set. With that, remote debugging works pretty well.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/README6
-rw-r--r--macosx/tkMacOSXInit.c11
2 files changed, 15 insertions, 2 deletions
diff --git a/macosx/README b/macosx/README
index ba58466..39687e0 100644
--- a/macosx/README
+++ b/macosx/README
@@ -1,7 +1,7 @@
TclTkAqua README
----------------
-RCS: @(#) $Id: README,v 1.10 2004/11/11 01:24:32 das Exp $
+RCS: @(#) $Id: README,v 1.11 2005/03/09 19:40:52 wolfsuit Exp $
This is the README file for the Mac OS X native versions of Tcl & Tk.
@@ -131,6 +131,10 @@ name. So, for instance this code will spin the spinner:
}
This was added in Tk 8.4.2
+- If you want to use Remote Debugging with Xcode 1.5 or 2.0, then you need to set
+the environment variable XCNOSTDIN to 1 in the Executable editor for Wish Shell. That
+will cause us to force closing stdin & stdout. Otherwise, given how Xcode launches
+Wish remotely, they will be left open and then Wish & gdb will fight for stdin...
3. Building TclTkAqua
---------------------
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index b7acd4f..3c20b5f 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXInit.c,v 1.7 2005/01/25 06:54:18 das Exp $
+ * RCS: @(#) $Id: tkMacOSXInit.c,v 1.8 2005/03/09 19:40:52 wolfsuit Exp $
*/
#include "tkInt.h"
@@ -167,6 +167,15 @@ TkpInit(interp)
* then use the Tk based console interpreter.
*/
+ /* REMOVE ME: Close stdin & stdout for remote debugging otherwise we
+ * will fight with gdb for stdin & stdout
+ */
+
+ if (getenv ("XCNOSTDIN") != NULL) {
+ close (0);
+ close (1);
+ }
+
if (!isatty(0)) {
struct stat st;
if (fstat(0, &st) || (S_ISCHR(st.st_mode) && st.st_blocks == 0)) {