News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Final version of my debug tools

Started by donkey, February 02, 2012, 02:25:51 AM

Previous topic - Next topic

donkey

I have uploaded the final version of my runtime debug tools here. I won't be updating them much anymore though if a bug is reported I will take the time to look at it.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

ragdog

#1
Thanks Edgar :U

Can you post 1-2 example for use it for masm32?

donkey

#2
Hi RagDog,

It works the same way in MASM as in GoAsm, except that in MASM you don't have to have brackets around the parameters. I've attached here a new debug32.inc file that includes the DbgBreak macro. Here's a quick set of examples, it doesn't include all of the functions but if you go through the Debug32.inc file you'll find all the functions.

.data
SomeReal8 REAL8 11.234567
SomeReal4 REAL4 13.2345672
SomeQword DQ 12345h
p_sprintf DD 0

.data?
buffer DB 256 DUP (?)
SomeDword DD ?
fpurnd DW ?
.code

EssaiTry PROTO :DWORD
EssaiTry2 PROTO :DWORD

start:
PrintDouble SomeReal8
PrintFloat SomeReal4

DbgBreak TRUE

PrintDec eax

mov DWORD PTR buffer,1
mov eax,offset buffer
dec eax
ASSERT "buffer=eax"

mov eax,1234
assume fs:nothing
mov fs:[014h],eax
Watch SPY_TYPE_DOUBLE, SomeReal8
xor eax,eax
PointItHere:
mov eax,DWORD PTR SomeReal8
xor eax,eax
EndWatch

DumpHandles

DumpSymbols

PrintString RDBG_DbgWin

PrintDec SomeQword

fld SomeReal8
DumpFPU

SomePoint:
xor eax,eax
Spy SPY_TYPE_DOUBLE, SomeReal8
inc p_sprintf
inc p_sprintf
inc p_sprintf
inc p_sprintf
StopSpy

PrintError

Disassemble offset SomePoint,10

invoke EssaiTry,1

invoke GetModuleHandle,NULL
mov hInstance,eax

invoke ExitProcess,0

EssaiTry PROC param
LOCAL thisisatest:DWORD
invoke EssaiTry2,1
ret
EssaiTry endp

EssaiTry2 PROC param
Try
mov eax,3
mov eax,[eax]
EndTry
ret
EssaiTry2 endp
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

donkey

There was one last fix to take care of as well as an enhanced DbgBreak function so I uploaded it

http://www.masm32.com/board/index.php?topic=16317.msg154513#msg154513
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Howard

Hi Donkey
Don't know how I missed it before, but just found this thread on the weekend and downloaded your debug tools and figured them out. I will use in MASM32 - I've always used the VK 'til now, but there's more power in yours now.
I haven't tested everything yet, but there's one annoying thing so far - not sure whether it's something to do with Windows 7 perhaps... there is no effective C/R L/F after each line entry in the Debug Window, so every line attaches to the end of the previous. I've tried on 32 bit and 64 bit Win7.
This is evident for me with PrintDWORD, DumpMem, PrintLine, DumpSymbols,...

In your Debug32.asm:
   LOCAL StrCrLf   :D
   mov D[StrCrLf],0x0D0A
and later:
   invoke SendMessage,[hwnd],EM_SETSEL ,-1,-1
   invoke SendMessage,[hwnd],EM_REPLACESEL,0,offset StrCrLf

This looks OK to me, and I don't have GOASM to play with variations. Any suggestions?

Thanks
Howard

donkey

Hi Howard,

Thanks, glad you find them useful. The problem has been fixed, the 0x0d0a was backwards. I just moved it to the data section the same as in the 64 bit lib and it should be fine. The libs can be downloaded from the thread in the RadAsm forum.



Don't bother downloading the attachment in this post, its just the above image.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Howard

Thanks Donkey - works fine now - surprising, I would have thought that LF CR would have been the same as CR LF in effect.

Regards
Howard

donkey

Quote from: Howard on February 13, 2012, 07:54:26 PM
Thanks Donkey - works fine now - surprising, I would have thought that LF CR would have been the same as CR LF in effect.

Regards
Howard

I would have thought so too, it is equivalent in the RadAsm output window so I took it for granted that it would work in the Debug window which I haven't checked for quite some time. Oh well, live an learn, apparently the EDIT control handles things a bit differently. Been looking into moving the tools to a dll but that presents a number of problems and may not happen but it would allow the 64 bit tools to work with MASM (I think).

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable