package
1.23.0
Repository: https://github.com/shogo82148/std.git
Documentation: pkg.go.dev

# Functions

Newは、指定されたパラメータから初期化された新しい [Data] オブジェクトを返します。 この関数を直接呼び出す代わりに、クライアントは通常、適切なパッケージ [debug/elf]、[debug/macho]、または [debug/pe] のFile型のDWARFメソッドを使用する必要があります。 []byte引数は、オブジェクトファイルの対応するデバッグセクションからのデータです。 たとえば、ELFオブジェクトの場合、abbrevは".debug_abbrev"セクションの内容です。.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
以下はDWARF 3で新しくなったものです。.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
以下はDWARF 4で新しくなったものです。.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
以下はDWARF 5で新しくなったものです。.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ClassAddressは、ターゲットマシン上のアドレスであるuint64型の値を表します。.
ClassAddrPtrは、"addr"セクション内のint64オフセットである値を表します。.
ClassBlockは、属性に依存する[]byte型の値を表します。.
ClassConstantは、定数であるint64型の値を表します。 この定数の解釈は、属性に依存します。.
ClassExprLocは、エンコードされたDWARF式またはロケーション記述を含む[]byte型の値を表します。.
ClassFlagは、bool型の値を表します。.
ClassLinePtrは、int64オフセットである値を表します。 このオフセットは、"line"セクション内の位置を指します。.
ClassLocListは、"loclists"セクション内のint64オフセットである値を表します。.
ClassLocListPtrは、int64オフセットである値を表します。 このオフセットは、"loclist"セクション内の位置を指します。.
ClassMacPtrは、int64オフセットである値を表します。 このオフセットは、"mac"セクション内の位置を指します。.
ClassRangeListPtrは、int64オフセットである値を表します。 このオフセットは、"rangelist"セクション内の位置を指します。.
ClassReferenceは、infoセクション内のEntryのオフセットを表す値を表します。 (Reader.Seekで使用するため)。 DWARF仕様は、ClassReferenceとClassReferenceSigをクラス"reference"に結合します。.
ClassReferenceAltは、代替オブジェクトファイルのDWARF "info"セクション内のオフセットを表すint64型の値を表します。.
ClassReferenceSigは、型Entryを参照するuint64型のシグネチャを表す値を表します。.
ClassRngListは、"rnglists"セクションのベースからのuint64オフセットを表す値を表します。.
ClassRngListsPtrは、"rnglists"セクション内のint64オフセットである値を表します。 これらは、ClassRngList値のベースとして使用されます。.
ClassStringは、文字列を表す値を表します。 コンパイルユニットがAttrUseUTF8フラグ(強く推奨)を指定している場合、 文字列値はUTF-8でエンコードされます。それ以外の場合、エンコーディングは未指定です。.
ClassStringAltは、代替オブジェクトファイルのDWARF文字列セクション内のオフセットを表すint64型の値を表します。.
ClassStrOffsetsPtrは、"str_offsets"セクション内のint64オフセットである値を表します。.
ClassUnknownは、未知のDWARFクラスの値を表します。.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
以下はDWARF 5で新しくなったものです。.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
以下はDWARF 3で新しくなったものです。.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
以下はDWARF 4で新しくなったものです。.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

ErrUnknownPCは、LineReader.ScanPCが行テーブルのエントリによってカバーされていないPCを検出した場合に返されるエラーです。.

# Structs

AddrTypeは、マシンアドレス型を表します。.
ArrayTypeは、固定サイズの配列型を表します。.
BasicTypeは、すべての基本型に共通するフィールドを保持します。 BitSize / BitOffset / DataBitOffsetフィールドの解釈に関する詳細については、[StructField] のドキュメントを参照してください。.
BoolTypeは、ブール型を表します。.
CharTypeは、符号付き文字型を表します。.
CommonTypeは、複数の型で共通のフィールドを保持します。 フィールドが特定の型に対して不明または適用できない場合、 ゼロ値が使用されます。.
ComplexTypeは、複素数の浮動小数点数型を表します。.
Dataは、実行可能ファイル(例えば、ELFまたはMach-O実行可能ファイル)からロードされた DWARFデバッグ情報を表します。.
No description provided by the author
DotDotDotTypeは、可変長の...関数パラメータを表します。.
Entry
エントリは、属性/値のペアのシーケンスです。.
EnumTypeは、列挙型を表します。 ネイティブの整数型の唯一の指標は、[CommonType] 内のByteSizeです。.
EnumValueは、単一の列挙値を表します。.
Fieldは、[Entry] 内の単一の属性/値ペアです。 値は、DWARFによって定義されたいくつかの「属性クラス」のうちの1つです。 各クラスに対応するGoの型は次のとおりです。 DWARFクラス Goの型 クラス ----------- ------- ----- address uint64 ClassAddress block []byte ClassBlock constant int64 ClassConstant flag bool ClassFlag reference to info dwarf.Offset ClassReference to type unit uint64 ClassReferenceSig string string ClassString exprloc []byte ClassExprLoc lineptr int64 ClassLinePtr loclistptr int64 ClassLocListPtr macptr int64 ClassMacPtr rangelistptr int64 ClassRangeListPtr 識別できないまたはベンダー定義の属性の場合、[Class] は [ClassUnknown] になります。.
FloatTypeは、浮動小数点数型を表します。.
FuncTypeは、関数の型を表します。.
IntTypeは、符号付き整数型を表します。.
LineEntryは、DWARF行テーブル内の行を表します。.
LineFileは、DWARF行テーブルエントリによって参照されるソースファイルです。.
LineReaderは、単一のコンパイルユニットのDWARF「line」セクションから [LineEntry] 構造体のシーケンスを読み取ります。 [LineEntry] は、PCの増加順に発生し、各 [LineEntry] は、その [LineEntry] のPCから次の [LineEntry] のPCの直前までの命令のメタデータを提供します。 最後のエントリには、[LineEntry.EndSequence] フィールドが設定されます。.
LineReaderPosは、行テーブル内の位置を表します。.
PtrTypeは、ポインタ型を表します。.
QualTypeは、C/C++の「const」、「restrict」、または「volatile」修飾子を持つ型を表します。.
Readerは、DWARF「info」セクションから [Entry] 構造体を読み取ることを可能にします。 [Entry] 構造体はツリー形式で配置されています。[Reader.Next] 関数は、 ツリーの先行順序の走査から連続するエントリを返します。 エントリに子がある場合、そのChildrenフィールドはtrueになり、子は [Tag] 0の [Entry] で終了します。.
StructFieldは、構造体、共用体、またはC++クラス型のフィールドを表します。 # ビットフィールド BitSize、BitOffset、DataBitOffsetフィールドは、C/C++のstruct/union/class型でビットフィールドとして宣言されたデータメンバーのビットサイズとオフセットを記述します。 BitSizeは、ビットフィールドのビット数です。 DataBitOffsetが0以外の場合、それは、 ビットフィールドの開始位置から囲むエンティティ(例:含まれるstruct/class/union)の開始位置までのビット数です。 これは、DWARF 4で導入されたDW_AT_data_bit_offset DWARF属性に対応します。 BitOffsetが0以外の場合、それは、 ビットフィールドを保持するストレージユニットの最上位ビットからビットフィールドの最上位ビットまでのビット数です。 ここで「ストレージユニット」とは、ビットフィールドの前の型名です(フィールド「unsigned x:17」の場合、ストレージユニットは「unsigned」です)。 BitOffsetの値は、システムのエンディアンによって異なる場合があります。 BitOffsetは、DWARF 4で廃止され、DWARF 5で削除されたDW_AT_bit_offset DWARF属性に対応します。 DataBitOffsetとBitOffsetのうち、最大1つだけが非ゼロになります。 DataBitOffset/BitOffsetは、BitSizeが非ゼロの場合にのみ非ゼロになります。 Cコンパイラがどちらを使用するかは、コンパイラのバージョンとコマンドラインオプションに依存します。 以下は、C/C++のビットフィールドの使用例と、DWARFビットオフセット情報の期待値の例です。 このコードを考えてみましょう。 struct S { int q; int j:5; int k:6; int m:5; int n:8; } s; 上記のコードに対して、GCC 8を使用している場合、DW_AT_bit_offsetの値は次のようになることが期待されます。 Little | Big Endian | Endian | "j": 27 | 0 "k": 21 | 5 "m": 16 | 11 "n": 8 | 16 上記のように、j/k/m/nの含まれるストレージユニットに対するオフセットのみが考慮されます。これらの値は、含まれる構造体の前のデータメンバーのサイズに基づいて変化することはありません。 コンパイラがDW_AT_data_bit_offsetを出力する場合、期待される値は次のようになります。 "j": 32 "k": 37 "m": 43 "n": 48 ここで、"j"の値32は、ビットフィールドが他のデータメンバーに続くことを反映しています(DW_AT_data_bit_offset値は、含まれる構造体の開始位置を基準としています)。 したがって、DW_AT_data_bit_offset値は、多数のフィールドを持つ構造体ではかなり大きくなる可能性があります。 DWARFは、ビットサイズとビットオフセットがゼロでない基本型の可能性も許容しているため、これらの情報は基本型に対してもキャプチャされます。 ただし、主流の言語を使用してこの動作をトリガーすることはできないことに注意する価値があります。.
StructTypeは、構造体、共用体、またはC++クラス型を表します。.
TypedefTypeは、名前付き型を表します。.
UcharTypeは、符号なし文字型を表します。.
UintTypeは、符号なし整数型を表します。.
UnspecifiedTypeは、暗黙的な、不明な、曖昧な、または存在しない型を表します。.
UnsupportedTypeは、サポートされていない型に遭遇した場合に返されるプレースホルダーです。.
VoidTypeは、Cのvoid型を表します。.

# Interfaces

Typeは、通常、特定のType構造体([CharType]、[StructType] など)のいずれかへのポインタを表します。.

# Type aliases

Attrは、[Entry.Field] 内の属性タイプを識別します。.
Classは、属性値のDWARF 4クラスです。 一般的に、特定の属性の値は、DWARFによって定義されたいくつかの可能なクラスのうちの1つを取ることができます。 それぞれのクラスは、属性のわずかに異なる解釈につながります。 DWARFバージョン4は、以前のDWARFバージョンよりも属性値クラスを細かく区別します。 リーダーは、以前のDWARFバージョンの粗いクラスを、適切なDWARF 4クラスに明確に区別します。 たとえば、DWARF 2は、定数だけでなくすべてのタイプのセクションオフセットに対して「constant」を使用しますが、 リーダーは、セクションオフセットを参照するDWARF 2ファイルの属性を、Class*Ptrクラスの1つに正規化します。 これらのクラスは、DWARF 3でのみ定義されていたにもかかわらずです。.
Offsetは、DWARF情報内の [Entry] の位置を表します。 ([Reader.Seek] を参照してください。).
Tagは、[Entry] の分類(タイプ)です。.