DbgWin released 10/28/2001.
It's a debug tool for the MASM32 package. You can use it to output debug information from Your programs. I like it and I hope You'll like it too. :)
Posted on 2001-10-28 00:16:58 by vkim
Hi vkim,

How do you get it and will it work with AsmEdit?

Posted on 2001-10-28 00:53:21 by Ewayne
Sorry, DbgWin is in attachment.
Posted on 2001-10-28 00:53:57 by vkim
In DbgWin.asm, where is (not included in your zip):

include \masm32\mymacros\macro.inc
include \masm32\mylib\mylib.inc
includelib \masm32\mylib\mylib.lib

Posted on 2001-10-28 06:41:08 by gscundiff
You cannot compile dbgwin.asm because You need some additional files (mylib.inc, etc). But dbgwin.exe is a ready application. It's merely an output window. To debug programs with this tool You need debug.inc, debug.lib and dbgwin.exe only. Please, look at the demonstration program and read readme.txt. If You are interested in mylib.lib I can send it to You.
Posted on 2001-10-28 07:31:59 by vkim
Hi all

Vkim's debug macros are great. With only a few minor adjustments the debug info is output to RadASM's output window. The source is included in RadASM 1.0.6 projects. Try it out, I know you will love it. Great work vkim. :alright:

Posted on 2001-10-28 08:02:26 by KetilO
Hi vkim..and KetilO !

Yes, I'd like to be able to recompile the DbgWin.asm program..I've used it in RadAsm1.0.6 and think it's a great idea.

Please send me your mymacros\macro.inc, mylib\mylib.inc, mylib\mylib.lib and anything else they call that I might need to compile DbgWin!

Posted on 2001-10-28 13:52:18 by gscundiff
2 KetilO:
Hi! I think RadASM is a most beautiful IDE for asm developers and I'm happy that You include my macros in the last version! :alright: Thank You for some optimizations of my code.

2 gscundiff:
I've just sent some files You want.

2 Ewayne:
You know that KetilO included my macros in RadASM package. And I will be very glad if You include them in AsmEdit too. :)
Posted on 2001-10-28 23:01:22 by vkim
Hi vkim,

I just checked out your DbgWin macros, nice job!

I already have a debug program for AsmEdit that I
output to my WorkArea, but it's only for registers
and dword values that outputs 3 bases dec, hex,
and bin.

I have been meaning to include strings, but I never
got around to it.

I would like to use your DbgWin macros in AsmEdit
if I could change some of the macros, I'll still
keep you name on them.


Posted on 2001-10-29 21:31:31 by Ewayne

I have just downloaded the debugging app and had a quick play with it, I have not fully digested how it all works yet as I am in the middle of building the next version of MASM32.

It looks like an interesting idea and one that many people would like to be able to use so is it possible to document the setting up and use of the debugging app so that a first time user in MASM32 could understand and use it.

If I can get it documented and working the way you want it to in the next few weeks, I would like to be able to include it in the next MASM32 package for other people to use.


Posted on 2001-10-30 01:51:44 by hutch--
Hi All!
Here is a new version of DbgWin http://www.asmcommunity.net/board/index.php?topic=1677.
Now it can be recompiled by yourself. All sources are included. Some macros have been optimized and fixed.
Posted on 2001-10-30 20:55:09 by vkim
Please excuse the dumb questions as I am just trying to
better understand your program.

I am using Softice now but have always had problems with
it. Does your program do symbolic debugging?
Would you consider it a complete replacement for Softice?
Does it work with Windows 98, windows XP?
Need more details before canning Softice.

Posted on 2001-10-31 07:57:40 by shankle
Hi, great job with the macros! One suggestion though: Make the macros do nothing unless some constant is defined as non-zero. Like this:

macro Whatever
if __DEBUG
(do macro stuff here)

Then it'd be easy to make a "release" version of a project that uses them by changing this line somewhere

__DEBUG equ 1

to this:

__DEBUG equ 0

See what I mean? It's not too big of a change, but it'd be convenient.

If you didn't want to break old code that doesn't have __DEBUG defined, you could put this at the top of your .inc file:

ifndef __DEBUG
__DEBUG equ 1

Anyway, just a suggestion. Keep up the good work. :)
Posted on 2001-10-31 11:15:09 by Irving W.
2 Shankle:
DbgWin is not a debugger. I think it can be compared with Immediate window from VB IDE. But it has some debugger features. Look at the Spy macro. I think it's a very perspective macro. It forces processor trace a program and shows value of spyed variable after each processor command. It is KetilO's idea. I am going to develop DbgWin in this direction.

2 Irving W.:
Good idea! I think it will be done it in the next version. Thanks!
Posted on 2001-10-31 23:21:57 by vkim
vkim: I like your program, good job. :alright: I have two suggestions, one which Irving W. already talked about: a flag that can be set to switch between debug and release. The second one is a 'trace'-like function like this:

DbgTrace MACRO sFormat:REQ, vars:VARARG
LOCAL @tmpFormat, @tmpBuffer
@tmpFormat db sFormat, 0
@tmpBuffer db 260 dup (?)
invoke wsprintf, addr @tmpBuffer, addr @tmpFormat, vars
invoke StdOut, addr @tmpBuffer

The example macro above just outputs to the standard output, but it should use DebugPrint in your case.. It is used like this:

DbgTrace "eax was %lX (hex) and ecx pointed to this string: '%s'..", eax, ecx

which would output something like this:

eax was 30023ABC (hex) and ecx pointed to this string: 'hello world!'..

The only problem is the size of the output buffer. When the string is too long, it will overflow the buffer.. I haven't found a way to determine the output size of wsprintf before outputting...
Maybe it's usefull though...

Posted on 2001-11-30 15:37:05 by Thomas

I am going to add the first suggestion in the next version. (The last one is included in MASM32v7 package). And I will think about Your macro DbgTrace. I don't like wsprintf function. And You can do the same actions with two other macros - PrintHex and PrintStringByAddr.;)
Posted on 2001-12-02 22:27:10 by vkim
Well do with it whatever you want, it's your package :)... I could use the other macros to do the same thing, but I like the trace macro because it can print many values easily (in one line), and most of my debug comments use multiple values. In my own version I allocated mem with globalalloc for wsprintf instead of using a buffer in the .data? section, to prevent many buffers to be added to the data section. It may be slower, but hey it's a debug version so it doesn't matter. :)

Posted on 2001-12-03 02:07:26 by Thomas

If You want You can add DbgTrace macro in debug.inc file to use it with DbgWin. There are no legal restrictions, only write Your copyright. If You have some other debug macros or ideas write to me, please. ;)
Posted on 2001-12-03 02:30:47 by vkim
Here's a memory dump macro I wrote. It's usage is this:

; example test data:
testData db "This is some testdata.",0
db "Here's an array of useless data:"
dd 44332211h, 12345, 100,1,2,3,4
db 10h,20h,30h,40h,50h,60h,70h
db "An array",0,"of",0,"Strings. Some values are: "
db 127, 254,23
testDatalen equ $-testData

DbgDump offset testData, testDatalen

It dumps the memory in your debug window like this:

00403023: 68 69 73 20-69 73 20 73-6F 6D 65 20-74 65 73 74 This is some tes
00403033: 64 61 74 61-2E 00 48 65-72 65 27 73-20 61 6E 20 tdata..Here's an
00403043: 61 72 72 61-79 20 6F 66-20 75 73 65-6C 65 73 73 array of useles
00403053: 20 64 61 74-61 3A 11 22-33 44 39 30-00 00 64 00 s data:."3D90..d
00403063: 00 00 01 00-00 00 02 00-00 00 03 00-00 00 04 00 ................
00403073: 00 00 10 20-30 40 50 60-70 41 6E 20-61 72 72 61 .... 0@P`pAn arr
00403083: 79 00 6F 66-00 53 74 72-69 6E 67 73-2E 20 53 6F ay.of.Strings. S
00403093: 6D 65 20 76-61 6C 75 65-73 20 61 72-65 3A 20 7F ome values are:
004030A3: FE 17 - - - ?..............

The macro code is:

DbgDump MACRO lpStart:REQ, lnData:req
; DbgDump debug macro. Dumps memory. Usage:
; DbgDump [startaddress], [length]
; Any mem locations, registers or
; immediate values may be used as parameters.
; Written by Thomas Bleeker [exagone].
; [url]http://exagone.cjb.net[/url]
LOCAL @pmem
@pmem dd ?

push lpStart
push lnData
invoke GlobalAlloc, GMEM_FIXED, 80
mov @pmem, eax

pop ebx ;lnData
pop esi ;lpStart

.WHILE ebx
mov edi, @pmem
invoke dw2hex, esi, edi
mov word ptr [edi+8], " :"
mov byte ptr [edi+10], " "
add edi, 11

push esi
push ebx
; dump hex values:
xor ecx, ecx
.WHILE ecx<16
.IF !ebx
mov dword ptr [edi], " "
add edi, 3
dec ebx
xor eax, eax

mov al, [esi]
inc esi

ror ax, 4
shr ah, 4
add ax, 3030h
cmp ah, 39h
jbe @F
add ah, "A"-3Ah
cmp al, 39h
jbe @F
add al, "A"-3Ah
mov word ptr [edi], ax
mov byte ptr [edi+2], " "
add edi, 3
inc ecx
pop ebx
pop esi
mov word ptr [edi], " "
add edi, 2

; dump text output:
xor ecx, ecx
.WHILE ecx<16
mov al, [esi]
.IF !ebx
mov al, "."
dec ebx
inc esi
cmp al, 20h
jae @F
mov al, "."
mov [edi], al
inc edi
inc ecx
mov byte ptr [edi],0
mov edi, @pmem

; write dashes:
mov byte ptr [edi+22], "-"
mov byte ptr [edi+34], "-"
mov byte ptr [edi+46], "-"

invoke DebugPrint, edi

invoke GlobalFree, @pmem


P.S. I haven't *fully* tested the code but everything I tried did work...
Posted on 2001-12-03 04:08:21 by Thomas
Hmm I just noticed a little bug, there's one NULL byte outputted at the end that shouldn't be outputted.. I'll post the correct code as soon as I fixed it.


I fixed the above code, it is working now.
Posted on 2001-12-03 04:16:18 by Thomas