Anuj Vats
Anuj Vats

Reputation: 60

Error in TCL Script

i have return a command to invoke my RTL compiler (Cadence Tool)using tcl script line

puts [exec rc -f script.g ]

i am getting error like abort child process. while if write it directly on my console the to invoke the tool $-rc -f script.g it is getting perfectly exectuded.

Upvotes: 0

Views: 822

Answers (1)

glenn jackman
glenn jackman

Reputation: 247162

exec returns an error condition if:

  • the exec'ed command returns with a non-zero status
  • or it prints to stderr

Do this

if {[catch {exec rc -f script.g} output] == 0} {
    # normal exit status
    puts $output
} elseif {$errorCode eq NONE} {
    # normal exit status, but some output to stderr (contained in $output)
    puts $output
} else {
    # some error condition.
    # see http://wiki.tcl.tk/1039 for ways to handle
    puts "some error occurred: $errorCode"
}

Upvotes: 0

Related Questions