デバッグ時に利用できる機能が多数あります。多くの機能は、OSでホストされた状態で動作します。
runtime_safety: ブール型の値で、リリースモードがDebugとReleaseSafeのときはtrue、リリースモードがReleaseFastとReleaseSmallのときはfalseが返ります。実行バイナリのデバッグ情報にアクセスするための構造体です。プラットフォームごとにコンパイル時に異なる型を返します。
| プラットフォーム | デバッグ形式 |
|---|---|
| macOS, iOS, watchOS, tvOS | OFileTable |
| UEFI, Windows | PDB + COFF |
| Linux, FreeBSD, NetBSD | DWARF |
getSelfDebugInfo() !*mut DebugInfo: 実行バイナリ自身のデバッグ情報を取得します。openSelfDebugInfo(allocator: *mut vtable heap.Allocator) !DebugInfo: 実行バイナリ自身のデバッグ情報をオープンします。warn(comptime format: []u8, args: anytype) void: 標準エラーにフォーマットされた文字列を出力します。assert(ok: bool) void: okがtrueであることをアサーションします。okがfalseの場合、安全性保護付き未定義動作を引き起こします。この関数は、ビルドモードがReleaseFastとReleaseSmallのときは、最適化により取り除かれます。panic(comptime format: []u8, args: anytype) noreturn: 意図的にパニックを引き起こします。引数にメッセージを与えることが可能です。printError(comptime format: []u8, args: anytype) void: エラーを標準エラーに出力します。printHint(comptime format: []u8, args: anytype) void: ヒントを標準エラーに出力します。printInfo(comptime format: []u8, args: anytype) void: 情報を標準エラーに出力します。
☰ 人の生きた証は永遠に残るよう ☰
Copyright © 2018-2020 connectFree Corporation. All rights reserved. | 特定商取引法に基づく表示
Zen, the Zen three-circles logo and The Zen Programming Language are trademarks of connectFree corporation in Japan and other countries.