From 80b27572d9613f3d2944404f745154779f910847 Mon Sep 17 00:00:00 2001 From: felix Date: Sun, 22 Apr 2018 16:00:08 +0200 Subject: [PATCH] Lookup the argument for the executable in feathers. Also enable text widget in case error message is printed on startup. Signed-off-by: felix --- feathers.mdoc | 5 +++++ feathers.tcl | 19 +++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) mode change 100644 => 100755 feathers.tcl diff --git a/feathers.mdoc b/feathers.mdoc index ccfd9efa..01f8169b 100644 --- a/feathers.mdoc +++ b/feathers.mdoc @@ -48,6 +48,11 @@ environment variable which holds a connection address of the form .Ao ADDRESS Ac : Ns Ao PORT Ac . .Pp +.Ar PROGRAM +must give the path to the executable that is to be run, +.Ev PATH +is not searched. +.Pp The program accepts following arguments: .Bl -tag -width Ds .It Fl help diff --git a/feathers.tcl b/feathers.tcl old mode 100644 new mode 100755 index 1d896daa..0ad41c40 --- a/feathers.tcl +++ b/feathers.tcl @@ -700,7 +700,17 @@ proc RunProcess {{prg ""}} { if {$program_name == ""} return - lappend search_path [file dirname [lindex $program_name 0]] + set args [lassign $program_name prgfname] + set prgfname [file normalize $prgfname] + + if {![file exists $prgfname]} { + .t configure -state normal + .t insert end "Could not start program:\n\nfile `$prgfname' does not exist" + .t see end + .t configure -state disabled + } + + lappend search_path [file dirname $prgfname] set reply_queue {} set data_queue {} set bp_queue {} @@ -728,8 +738,11 @@ proc RunProcess {{prg ""}} { .data.t delete [.data.t children $arguments_item_id] } - if {[catch {eval exec $program_name <@ stdin >@ stdout 2>@ stderr &} result]} { + if {[catch {eval exec $prgfname {*}$args <@ stdin >@ stdout 2>@ stderr &} result]} { + .t configure -state normal .t insert end "Could not start program:\n\n$result" + .t see end + .t configure -state disabled } else { set process_id $result } @@ -1886,8 +1899,6 @@ if {$program_name != ""} { # - setting breakpoints on yet unregistered (i.e. dynamically loaded) files # is not possible - a file must be registered first # - check whether "listening" check works -# - backport to chicken4 -# - feature ("dbg-client") # - when retrieved data is wrong, clear queues # - must watched globals be mangled, when qualified? (GET_GLOBAL) # - dview: monospace font (needs tags, it seems) -- 2.11.0