For those 64 bit GoAsm developers who use RadAsm 3.x as their primary IDE I have attached a set of runtime debug macros They allow you to get runtime data from your project as well as a few other useful functions such as code disassembly and symbol table dumps, single step variable spy, MMX and FPU contents. See the readme file for syntax. The library is loosely based on vKim's excellent macros for MASM and is pretty much all I use when debugging 64 bit apps because of the lack of 64 bit compatible tools (PEBrowse and WinDbg being the only ones I have). This is a work in progress since I add functions as I need them or someone asks for them so if you find it useful you might want to check in every once in a while to see if its been updated.

You must use the /MIX GoLink switch when building with this library. You need the latest headers from my website in order to rebuild the lib project, they are available here. Source code and RadAsm 3.x project file are included.

Some sample outputs:

Disassemble(offset SomeLabel,10)
----------------------------------------
Disassembling 10 lines beginning at 0000000000401114
----------------------------------------
00000000`00401114 48894c2408      mov     qword ptr ,rcx
00000000`00401119 4889542410      mov     qword ptr ,rdx
00000000`0040111e 4c89442418      mov     qword ptr ,r8
00000000`00401123 4c894c2420      mov     qword ptr ,r9
00000000`00401128 55              push    rbp
00000000`00401129 4889e5          mov     rbp,rsp
00000000`0040112c 4881ec88000000  sub     rsp,88h
00000000`00401133 c745b050000000  mov     dword ptr ,50h
00000000`0040113a c745b403000000  mov     dword ptr ,3
00000000`00401141 48c745b8fa124000 mov     qword ptr ,offset test64+0x12fa (00000000`004012fa)
----------------------------------------
Disassembly ended, next instruction at 0000000000401149
----------------------------------------


DumpSymbols
----------------------------------------
Dumping symbol table
----------------------------------------
0x0000000000401057 : CODE : START
0x0000000000401114 : CODE : WinMain
0x00000000004012FA : CODE : DlgProc
0x000000000040131D : CODE : DlgProc.WM_COMMAND
0x0000000000401356 : CODE : DlgProc.WM_DESTROY
0x0000000000401374 : CODE : DlgProc.DEFPROC
0x00000000004013A0 : CODE : DlgProc.EXIT
0x0000000000405000 : DATA : szRad30WinClass
0x0000000000405878 : DATA : hInstance
0x0000000000405880 : DATA : hDlg
0x0000000000405888 : DATA : buffer
0x0000000000406000 : CNST : TestConstant
----------------------------------------


DumpMem(offset ClassName,64)
----------------------------------------
Line 83 : Hex dump of 64 bytes at address 0x405012
0000000000405012: 44 69 61 6C 6F 67 43 6C 61 73 73 00 00 00 00 00 DialogClass.....
0000000000405022: 00 00 F4 3F 52 B8 9E 3F 98 FF 00 00 98 FF 00 00 ...?R..?........
0000000000405032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 39 56 ..............9V
0000000000405042: FE 27 07 84 47 4F 83 64 EE 11 8F B0 8A C8 68 E6 .'..GO.d......h.
----------------------------------------


Note that it only works in 64 bit programs and with RadAsm 3.x. Symbols require a COFF based debug build. Include the following in your source, change the paths to reflect your system:

#define DBG64LIB C:\Programming\RadASM3\GoAsm\dbg\Debug64.lib
#include C:\Programming\RadASM3\GoAsm\dbg\Debug64.a


Edgar
Attachments:
Posted on 2011-03-18 00:07:47 by donkey