News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

DebugCenter for everybody

Started by HSE, August 21, 2023, 08:50:23 AM

Previous topic - Next topic

HSE

Hi Biterider!

Playing "Resguard Game" with an standard MASM64 SDK application (CodeEdit) only requiere resguard.inc and resguard.lib. Resguard DLL send messages to DebugCenter without problems.

The interestig part is that an application trough an DLL can access any debug function. For example I added to Resguard in a very elemental way:
ResGuardDbgHex proc
    DbgHex rcx
    ret
ResGuardDbgHex endp

ResGuardDbgDec proc
    DbgDec rcx
    ret
ResGuardDbgDec endp

ResGuardDbgStr proc
    DbgStr rcx
    ret
ResGuardDbgStr endp

Called from Masm64 SDK app:
            rcall ResGuardDbgStr, "vuelve"
            rcall CloseMMF,pMMF,hMMF                            ; close the memory mapped file

            rcall ResGuardDbgDec, 36
            rcall ResGuardDbgHex, 36

Result is:
rcx -> vuelve [ResGuard.asm, 1476]
Hook_CloseHandle HSD [ResGuard.asm, 1094]
rcx = 36 [ResGuard.asm, 1470]
rcx = 0000000000000024h [ResGuard.asm, 1464]
+ ResGuardShow  [ResGuard.asm, 1493]

Perhaps with a very little DLL could be posible to make useful DebugCenter for everybody in a simple way.

More elaborated, a set of macros can capture file name and line, etc.

HSE.
Equations in Assembly: SmplMath

Biterider

#1
Hi HSE
This is really a good idea.  :icon_idea:

I had something similar in mind some time ago, to provide DebugCenter functionality for all masm applications, using a special set of macros.
Using a DLL or (static)LIB for this has some advantages and disadvantages. The big disadvantage is that some compile time information is needed for the actual macros and cannot be precompiled.
Maybe a combination of both will do the trick.

I will add it to my to do list.  :thumbsup:

Biterider