ホーム › System.Diagnostics.Debug.Extensions › SYMBOL_INFO_EX
SYMBOL_INFO_EX
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| SizeOfStruct | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。呼び出し前に設定する。 |
| TypeOfInfo | DWORD | 4 | +4 | +4 | 格納されている情報の種類を示す値。 |
| Offset | ULONGLONG | 8 | +8 | +8 | シンボルのアドレスまたはオフセット値。 |
| Line | DWORD | 4 | +16 | +16 | 対応するソースコードの行番号。 |
| Displacement | DWORD | 4 | +20 | +20 | シンボルまたは行頭からの変位(バイト)。 |
| Reserved | DWORD | 16 | +24 | +24 | 将来の拡張用予約フィールド。 |
各言語での定義
#include <windows.h>
// SYMBOL_INFO_EX (x64 40 / x86 40 バイト)
typedef struct SYMBOL_INFO_EX {
DWORD SizeOfStruct;
DWORD TypeOfInfo;
ULONGLONG Offset;
DWORD Line;
DWORD Displacement;
DWORD Reserved[4];
} SYMBOL_INFO_EX;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SYMBOL_INFO_EX
{
public uint SizeOfStruct;
public uint TypeOfInfo;
public ulong Offset;
public uint Line;
public uint Displacement;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public uint[] Reserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SYMBOL_INFO_EX
Public SizeOfStruct As UInteger
Public TypeOfInfo As UInteger
Public Offset As ULong
Public Line As UInteger
Public Displacement As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public Reserved() As UInteger
End Structureimport ctypes
from ctypes import wintypes
class SYMBOL_INFO_EX(ctypes.Structure):
_fields_ = [
("SizeOfStruct", wintypes.DWORD),
("TypeOfInfo", wintypes.DWORD),
("Offset", ctypes.c_ulonglong),
("Line", wintypes.DWORD),
("Displacement", wintypes.DWORD),
("Reserved", wintypes.DWORD * 4),
]#[repr(C)]
pub struct SYMBOL_INFO_EX {
pub SizeOfStruct: u32,
pub TypeOfInfo: u32,
pub Offset: u64,
pub Line: u32,
pub Displacement: u32,
pub Reserved: [u32; 4],
}import "golang.org/x/sys/windows"
type SYMBOL_INFO_EX struct {
SizeOfStruct uint32
TypeOfInfo uint32
Offset uint64
Line uint32
Displacement uint32
Reserved [4]uint32
}type
SYMBOL_INFO_EX = record
SizeOfStruct: DWORD;
TypeOfInfo: DWORD;
Offset: UInt64;
Line: DWORD;
Displacement: DWORD;
Reserved: array[0..3] of DWORD;
end;const SYMBOL_INFO_EX = extern struct {
SizeOfStruct: u32,
TypeOfInfo: u32,
Offset: u64,
Line: u32,
Displacement: u32,
Reserved: [4]u32,
};type
SYMBOL_INFO_EX {.bycopy.} = object
SizeOfStruct: uint32
TypeOfInfo: uint32
Offset: uint64
Line: uint32
Displacement: uint32
Reserved: array[4, uint32]struct SYMBOL_INFO_EX
{
uint SizeOfStruct;
uint TypeOfInfo;
ulong Offset;
uint Line;
uint Displacement;
uint[4] Reserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SYMBOL_INFO_EX サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; SizeOfStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; TypeOfInfo : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Offset : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Line : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Displacement : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Reserved : DWORD (+24, 16byte) varptr(st)+24 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SYMBOL_INFO_EX
#field int SizeOfStruct
#field int TypeOfInfo
#field int64 Offset
#field int Line
#field int Displacement
#field int Reserved 4
#endstruct
stdim st, SYMBOL_INFO_EX ; NSTRUCT 変数を確保
st->SizeOfStruct = 100
mes "SizeOfStruct=" + st->SizeOfStruct