with_output_to_variable runs its commands outside the caller's scope and hides errors
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- tooling
Direzione di ricerca
Inizia con with_output_to_variable in tcl/CmdUtil.tcl e confrontane il comportamento con proc_redirect in tcl/Util.tcl, che l’issue indica come esempio. Verifica l’ambito e il comportamento degli errori con gli esempi Tcl mostrati, compreso test/set_path_margin_common.tcl come soluzione temporanea esistente. Il lavoro è terminato quando i comandi possono accedere alle variabili del chiamante e i loro errori raggiungono il chiamante dopo la fine del reindirizzamento dell’output.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
with_output_to_variable evaluates its commands inside its own proc, not in the caller's scope, and it swallows any error they raise.
Inside a proc, a body that uses the proc's local variables fails, but the failure is hidden: the output variable is just empty. For example:
proc capture { pin } {
with_output_to_variable out { report_edges -from [get_pins $pin] }
return $out
}
puts "<[capture reg1/CK]>"
This prints <> with no error, because $pin doesn't exist in with_output_to_variable's frame. At the top level the body can't see local variables either, and variables it sets are lost:
with_output_to_variable out { set x 1; report_units }
puts $x ;# can't read "x": no such variable
Errors are caught and returned as the command's result:
puts [catch {with_output_to_variable v { report_units; error boom }} msg]
# prints 0; msg is "boom"
Callers can't tell that the commands failed and that the captured output is incomplete. Some tests work around the scope problem. For example, test/set_path_margin_common.tcl builds the body with [list report_checks {*}$args -format json] so that $args is substituted before the call.
parallaxsw/OpenSTA master has the same code.
Cause
tcl/CmdUtil.tcl:
proc with_output_to_variable { var_name args } {
upvar 1 $var_name var
set body [lindex $args 0]
sta::redirect_string_begin;
catch $body ret
set var [sta::redirect_string_end]
return $ret
}
catch $body runs the body in the proc's frame, and the catch result code is discarded. The body should be run with uplevel 1, and an error should be re-raised once the redirection has ended, as proc_redirect in tcl/Util.tcl already does.
- Lingua principale
- Verilog
- Stelle
- 655
- Fork
- 296
- Merge medio
- 1g 12h
- PR unite (30g)
- 28
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di The-OpenROAD-Project/OpenSTA
-
get_fanin/get_fanout drop pins of nets with more than one pinForse già presa @dsengupta0628 l’ha presa 25 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
The-OpenROAD-Project/OpenSTA#457 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
get_timing_edges -of_objects returns nested lists and ignores -toForse già presa @dsengupta0628 l’ha presa 25 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
The-OpenROAD-Project/OpenSTA#456 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
`write_sdf` record order causes a conditional IOPATH delay to be overwrittenForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
The-OpenROAD-Project/OpenSTA#495 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
The-OpenROAD-Project/OpenSTA#477 ·
I maintainer di solito rispondono entro 1 giorno
-
CRPR: paths, memory and runtime grow faster than the design on large propagated clock networksForse già presa @dsengupta0628 l’ha presa 25 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 22/100
The-OpenROAD-Project/OpenSTA#452 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di The-OpenROAD-Project/OpenSTA
Issue simili
-
XML grammar: only the closing --> of a comment gets the scope comment.block.xmlForse già presa @alexeyfala l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
danipen/TextMateSharp#145 · 2 commenti ·
-
accepted
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
future-agi/future-agi#6368 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
omacom/omarchy#21787 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Windows 内置更新报“更新进程启动确认超时”:Explorer ShellExecute 冗余的 -WindowStyle Hidden + -EncodedCommand 触发卡巴斯基挂起Apertabug status/needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
WhiteBr1ck/agy-powertools#397 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
leanprover/vscode-lean4#841 ·
I maintainer di solito rispondono entro 2 giorni