ホーム › System.Diagnostics.Debug.Extensions › DEBUG_SYMBOL_SOURCE_ENTRY
DEBUG_SYMBOL_SOURCE_ENTRY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ModuleBase | ULONGLONG | 8 | +0 | +0 | シンボルが属するモジュールの基底アドレス。 |
| Offset | ULONGLONG | 8 | +8 | +8 | コードのアドレス(または基底からのオフセット)。 |
| FileNameId | ULONGLONG | 8 | +16 | +16 | ソースファイル名を参照するID。 |
| EngineInternal | ULONGLONG | 8 | +24 | +24 | エンジン内部用の値。 |
| Size | DWORD | 4 | +32 | +32 | 対応するコード範囲のバイトサイズ。 |
| Flags | DWORD | 4 | +36 | +36 | エントリの属性フラグ。 |
| FileNameSize | DWORD | 4 | +40 | +40 | ソースファイル名文字列の必要バイト数。 |
| StartLine | DWORD | 4 | +44 | +44 | 対応するソースの開始行番号。 |
| EndLine | DWORD | 4 | +48 | +48 | 対応するソースの終了行番号。 |
| StartColumn | DWORD | 4 | +52 | +52 | 対応するソースの開始列番号。 |
| EndColumn | DWORD | 4 | +56 | +56 | 対応するソースの終了列番号。 |
| Reserved | DWORD | 4 | +60 | +60 | 予約フィールド。0が設定される。 |
各言語での定義
#include <windows.h>
// DEBUG_SYMBOL_SOURCE_ENTRY (x64 64 / x86 64 バイト)
typedef struct DEBUG_SYMBOL_SOURCE_ENTRY {
ULONGLONG ModuleBase;
ULONGLONG Offset;
ULONGLONG FileNameId;
ULONGLONG EngineInternal;
DWORD Size;
DWORD Flags;
DWORD FileNameSize;
DWORD StartLine;
DWORD EndLine;
DWORD StartColumn;
DWORD EndColumn;
DWORD Reserved;
} DEBUG_SYMBOL_SOURCE_ENTRY;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_SYMBOL_SOURCE_ENTRY
{
public ulong ModuleBase;
public ulong Offset;
public ulong FileNameId;
public ulong EngineInternal;
public uint Size;
public uint Flags;
public uint FileNameSize;
public uint StartLine;
public uint EndLine;
public uint StartColumn;
public uint EndColumn;
public uint Reserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_SYMBOL_SOURCE_ENTRY
Public ModuleBase As ULong
Public Offset As ULong
Public FileNameId As ULong
Public EngineInternal As ULong
Public Size As UInteger
Public Flags As UInteger
Public FileNameSize As UInteger
Public StartLine As UInteger
Public EndLine As UInteger
Public StartColumn As UInteger
Public EndColumn As UInteger
Public Reserved As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DEBUG_SYMBOL_SOURCE_ENTRY(ctypes.Structure):
_fields_ = [
("ModuleBase", ctypes.c_ulonglong),
("Offset", ctypes.c_ulonglong),
("FileNameId", ctypes.c_ulonglong),
("EngineInternal", ctypes.c_ulonglong),
("Size", wintypes.DWORD),
("Flags", wintypes.DWORD),
("FileNameSize", wintypes.DWORD),
("StartLine", wintypes.DWORD),
("EndLine", wintypes.DWORD),
("StartColumn", wintypes.DWORD),
("EndColumn", wintypes.DWORD),
("Reserved", wintypes.DWORD),
]#[repr(C)]
pub struct DEBUG_SYMBOL_SOURCE_ENTRY {
pub ModuleBase: u64,
pub Offset: u64,
pub FileNameId: u64,
pub EngineInternal: u64,
pub Size: u32,
pub Flags: u32,
pub FileNameSize: u32,
pub StartLine: u32,
pub EndLine: u32,
pub StartColumn: u32,
pub EndColumn: u32,
pub Reserved: u32,
}import "golang.org/x/sys/windows"
type DEBUG_SYMBOL_SOURCE_ENTRY struct {
ModuleBase uint64
Offset uint64
FileNameId uint64
EngineInternal uint64
Size uint32
Flags uint32
FileNameSize uint32
StartLine uint32
EndLine uint32
StartColumn uint32
EndColumn uint32
Reserved uint32
}type
DEBUG_SYMBOL_SOURCE_ENTRY = record
ModuleBase: UInt64;
Offset: UInt64;
FileNameId: UInt64;
EngineInternal: UInt64;
Size: DWORD;
Flags: DWORD;
FileNameSize: DWORD;
StartLine: DWORD;
EndLine: DWORD;
StartColumn: DWORD;
EndColumn: DWORD;
Reserved: DWORD;
end;const DEBUG_SYMBOL_SOURCE_ENTRY = extern struct {
ModuleBase: u64,
Offset: u64,
FileNameId: u64,
EngineInternal: u64,
Size: u32,
Flags: u32,
FileNameSize: u32,
StartLine: u32,
EndLine: u32,
StartColumn: u32,
EndColumn: u32,
Reserved: u32,
};type
DEBUG_SYMBOL_SOURCE_ENTRY {.bycopy.} = object
ModuleBase: uint64
Offset: uint64
FileNameId: uint64
EngineInternal: uint64
Size: uint32
Flags: uint32
FileNameSize: uint32
StartLine: uint32
EndLine: uint32
StartColumn: uint32
EndColumn: uint32
Reserved: uint32struct DEBUG_SYMBOL_SOURCE_ENTRY
{
ulong ModuleBase;
ulong Offset;
ulong FileNameId;
ulong EngineInternal;
uint Size;
uint Flags;
uint FileNameSize;
uint StartLine;
uint EndLine;
uint StartColumn;
uint EndColumn;
uint Reserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DEBUG_SYMBOL_SOURCE_ENTRY サイズ: 64 バイト(x64)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; ModuleBase : ULONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; Offset : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; FileNameId : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; EngineInternal : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; Size : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; Flags : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; FileNameSize : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; StartLine : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; EndLine : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; StartColumn : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; EndColumn : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; Reserved : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DEBUG_SYMBOL_SOURCE_ENTRY
#field int64 ModuleBase
#field int64 Offset
#field int64 FileNameId
#field int64 EngineInternal
#field int Size
#field int Flags
#field int FileNameSize
#field int StartLine
#field int EndLine
#field int StartColumn
#field int EndColumn
#field int Reserved
#endstruct
stdim st, DEBUG_SYMBOL_SOURCE_ENTRY ; NSTRUCT 変数を確保
st->ModuleBase = 100
mes "ModuleBase=" + st->ModuleBase