diff --git a/src/Makefile b/src/Makefile index 6d74d67a..0135306e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -109,6 +109,7 @@ package: clean install -m 755 -t ../voss/bin ../bin/functor install -m 755 -t ../voss/bin ../bin/write_pexlif.so install -m 755 -t ../voss/bin ../bin/front_end.tcl + install -m 755 -t ../voss/bin ../bin/front_end_debug.tcl install -m 644 -t ../voss/bin ../bin/prefs.tcl install -m 644 -t ../voss/bin ../bin/utils.tcl install -m 644 -t ../voss/bin ../bin/builtins.fl @@ -200,6 +201,8 @@ install_all: fl functor \ @chmod ugo+r $(BIN_DIR)/preamble.fl @cp ./bin/fl/front_end.tcl $(BIN_DIR)/front_end.tcl @chmod ugo+r $(BIN_DIR)/front_end.tcl + @cp ./bin/fl/front_end_debug.tcl $(BIN_DIR)/front_end_debug.tcl + @chmod ugo+r $(BIN_DIR)/front_end_debug.tcl @cp ./bin/fl/utils.tcl $(BIN_DIR)/utils.tcl @chmod ugo+r $(BIN_DIR)/utils.tcl @cp ./bin/fl/prefs.tcl $(BIN_DIR)/prefs.tcl diff --git a/src/bin/fl/FL b/src/bin/fl/FL deleted file mode 100644 index ee25eab9..00000000 --- a/src/bin/fl/FL +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/csh -./fl diff --git a/src/bin/fl/fl.c b/src/bin/fl/fl.c index 8a5bb4a0..5d4cb68c 100644 --- a/src/bin/fl/fl.c +++ b/src/bin/fl/fl.c @@ -33,6 +33,7 @@ bool use_stdin = FALSE; bool use_stdout = FALSE; bool Interrupt_asap = FALSE; bool cephalopode_mode = FALSE; +bool debug_tcl = FALSE; bool profiling_active = FALSE; bool profiling_builtins = FALSE; #if DBG_TRACE_AND_SAVE @@ -289,6 +290,12 @@ fl_main(int argc, char *argv[]) unbuf_stdout = TRUE; argc--, argv++; } else + if( (strcmp(argv[1], "-debug_tcl") == 0) || + (strcmp(argv[1], "--debug_tcl") == 0) ) + { + debug_tcl = TRUE; + argc--, argv++; + } else if( (strcmp(argv[1], "-use_stdout") == 0) || (strcmp(argv[1], "--use_stdout") == 0) ) { @@ -904,13 +911,15 @@ setup_sockets() pid_t fl_pid = getpid(); + string front_end_tcl = debug_tcl ? "front_end_debug.tcl" : "front_end.tcl"; + if( use_window != NULL ) { - Sprintf(buf, "wish %s/front_end.tcl %d %d %d %s %s -use %s &", - binary_location, fl_pid, addr, port, Voss_tmp_dir, + Sprintf(buf, "wish %s/%s %d %d %d %s %s -use %s &", + binary_location, front_end_tcl, fl_pid, addr, port, Voss_tmp_dir, scaling_factor, use_window); } else { - Sprintf(buf, "wish %s/front_end.tcl %d %d %d %s %s &", - binary_location, fl_pid, addr, port, Voss_tmp_dir, + Sprintf(buf, "wish %s/%s %d %d %d %s %s &", + binary_location, front_end_tcl, fl_pid, addr, port, Voss_tmp_dir, scaling_factor); } if( system(buf) != 0 ) { @@ -1238,6 +1247,7 @@ print_help() P(" -hide-window hide the main window while still preserving X functionality\n"); P(" -noX do not use X windows (text only)\n"); P(" --noX do not use X windows (text only)\n"); + P(" -debug_tcl use tcl_pro_debug to debug tcl functions. Need to set FL_PRODEBUG_AUTOPATH\n"); P(" -use_stdin read inputs also from stdin\n"); P(" -use_stdout write outputs also to stdout\n"); P(" --hide-window hide the main window while still preserving X functionality\n"); diff --git a/src/bin/fl/front_end_debug.tcl b/src/bin/fl/front_end_debug.tcl new file mode 100644 index 00000000..7554c38a --- /dev/null +++ b/src/bin/fl/front_end_debug.tcl @@ -0,0 +1,9 @@ +set auto_path [linsert $auto_path 0 $::env(FL_PRODEBUG_AUTOPATH)] +package require remotedebug + + +debugger_init localhost 2576 +debugger_eval { + source [string map {front_end_debug front_end} $argv0] +} +