dotnet-inspect-correctness
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedotnet-inspect: correctness and safety
dotnet-inspect:正确性与安全性
Use this skill to judge whether code is sound and safe to call: what it can
throw, how it handles errors, and where it steps outside safe, managed
execution. This is single-version analysis; for how these signals change
between versions, use the compatibility skill.
bash
dnx dotnet-inspect -y -- <command>使用该技能判断代码是否可靠且调用安全:它可能抛出什么异常、如何处理错误,以及在哪些地方脱离了安全的托管执行环境。这是单版本分析;若要查看这些信号在不同版本间的变化,请使用兼容性技能。
bash
dnx dotnet-inspect -y -- <command>What can it throw? (exception surface)
它可能抛出什么异常?(异常范围)
There is no dedicated "Exceptions" section; exception behavior comes from
method-body analysis. shows the exact catch/filter/finally
layout; graph fields and hidden facts summarize behavior:
Exception Regionsbash
dnx dotnet-inspect -y -- member Type Method:1 -S "Exception Regions"
dnx dotnet-inspect -y -- member Type Method:1 -S "Call Graph" --fields "Throws,ThrowSites,ExceptionTypes,ConstructedExceptions,Catch,Finally"
dnx dotnet-inspect -y -- member Type Method:1 -S "Call Graph" --fields "Throws,Catch,Finally"
dnx dotnet-inspect -y -- member Type Method:1 -S Facts --tsvThrowsThrowSitesExceptionTypesConstructedExceptionsCatchFinallyException Regions-S Facts--tsv没有专门的“异常”章节;异常行为来自方法体分析。展示了确切的捕获/筛选/最终块布局;图表字段和隐藏事实汇总了相关行为:
Exception Regionsbash
dnx dotnet-inspect -y -- member Type Method:1 -S "Exception Regions"
dnx dotnet-inspect -y -- member Type Method:1 -S "Call Graph" --fields "Throws,ThrowSites,ExceptionTypes,ConstructedExceptions,Catch,Finally"
dnx dotnet-inspect -y -- member Type Method:1 -S "Call Graph" --fields "Throws,Catch,Finally"
dnx dotnet-inspect -y -- member Type Method:1 -S Facts --tsvThrowsThrowSitesExceptionTypesConstructedExceptionsCatchFinallyException Regions-S Facts--tsvIs it memory-safe? (unsafe operations)
它是否内存安全?(不安全操作)
bash
dnx dotnet-inspect -y -- member Type Method:1 --library MyLib.dll -S "Unsafe Operations,IL"-S "Unsafe Operations"signalsFor one crash or profiler coordinate, use for the default source-location, member, instruction, exception,
callsite, and return-address context. Safety evidence is opt-in:
.
library --il-offset 0x06000001+0x5--il-offset 0x06000001+0x5 -S "Context: Safety"To confirm whether one definite unsafe operation appeared at an adjacent
version boundary, first correlate caller-selected package cells:
bash
dnx dotnet-inspect -y -- timeline --package MyLib@1.0.0..2.0.0 \
-t MyType -m Method \
--finding analysis.unsafety --at first --at lastRepeat for sparse probes or use for an explicitly bounded
dense traversal. A gap-spanning row locates a candidate boundary; it
does not claim the exact introduction version. Confirm the adjacent pair:
--at--at allAddedbash
dnx dotnet-inspect -y -- diff --package MyLib@1.4.0..1.5.0 \
-t MyType -m Method \
--finding analysis.unsafetyPairFinding.AddedPresentRemovedbash
dnx dotnet-inspect -y -- member Type Method:1 --library MyLib.dll -S "Unsafe Operations,IL"-S "Unsafe Operations"signals对于单个崩溃或探查器坐标,使用获取默认的源位置、成员、指令、异常、调用点和返回地址上下文。安全证据为可选开启:。
library --il-offset 0x06000001+0x5--il-offset 0x06000001+0x5 -S "Context: Safety"要确认某个明确的不安全操作是否出现在相邻版本边界,首先关联调用者选择的包单元:
bash
dnx dotnet-inspect -y -- timeline --package MyLib@1.0.0..2.0.0 \
-t MyType -m Method \
--finding analysis.unsafety --at first --at last重复参数可进行稀疏探查,或使用进行明确边界内的密集遍历。跨版本间隙的行定位了候选边界,但不代表确切的引入版本。请确认相邻版本对:
--at--at allAddedbash
dnx dotnet-inspect -y -- diff --package MyLib@1.4.0..1.5.0 \
-t MyType -m Method \
--finding analysis.unsafetyPairFinding.AddedPresentRemoved