with_output_to_variable runs its commands outside the caller's scope and hides errors
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- tooling
Hướng nghiên cứu
Bắt đầu với with_output_to_variable trong tcl/CmdUtil.tcl và so sánh hành vi của nó với proc_redirect trong tcl/Util.tcl, được issue nêu làm ví dụ. Kiểm tra phạm vi và cách xử lý lỗi bằng các ví dụ Tcl đã cho, bao gồm test/set_path_margin_common.tcl để xem giải pháp khắc phục hiện có. Hoàn tất khi các lệnh có thể truy cập biến của bên gọi và lỗi của chúng được chuyển đến bên gọi sau khi việc chuyển hướng đầu ra kết thúc.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Verilog
- Star
- 658
- Fork
- 299
- Merge trung bình
- 1 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 28
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của The-OpenROAD-Project/OpenSTA
-
get_fanin/get_fanout drop pins of nets with more than one pinCó thể đã có người làm @dsengupta0628 đã nhận 25 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
The-OpenROAD-Project/OpenSTA#457 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
get_timing_edges -of_objects returns nested lists and ignores -toCó thể đã có người làm @dsengupta0628 đã nhận 25 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
The-OpenROAD-Project/OpenSTA#456 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`write_sdf` record order causes a conditional IOPATH delay to be overwrittenCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
The-OpenROAD-Project/OpenSTA#495 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
The-OpenROAD-Project/OpenSTA#477 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CRPR: paths, memory and runtime grow faster than the design on large propagated clock networksCó thể đã có người làm @dsengupta0628 đã nhận 25 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 22/100
The-OpenROAD-Project/OpenSTA#452 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của The-OpenROAD-Project/OpenSTA
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
-
[优化]本地模型未启动时能否不要报上游不可用错误Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ranxianglei/billion-context#8315 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
XML grammar: only the closing --> of a comment gets the scope comment.block.xmlCó thể đã có người làm @alexeyfala đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
danipen/TextMateSharp#145 · 2 bình luận ·
-
accepted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
future-agi/future-agi#6368 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
omacom/omarchy#21787 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày