The MASM Forum

General => The Workshop => Topic started by: NoCforMe on January 09, 2023, 04:59:26 PM

Title: A useful debugging tool
Post by: NoCforMe on January 09, 2023, 04:59:26 PM
There are tons of debugging aids out there, and I'm sure all of us have our collection of routines and code snippets that we use to try to figure what the hell's going on in there, apart from Olly or some other real debugger.

Well, here's another tool I came up with. I like this one; it's a logging window you can attach to your program to display info while it's running. And I'm really kinda proud of myself at the moment because this is my very first DLL! All these years and I never tried it; one day and I got one running. Not right off the bat, of course, 'cuz I had to make the usual stupid mistakes first ...

I opted for a DLL because I wanted to have minimum intrusion into the code being debugged; don't like having to link in extra modules, and I also don't like having to insert huge swaths of code to display stuff. This tool is, I think, a pretty good compromise. I call it LogBuddy.

Here's now it works:

1. You insert some minimal code into your program you want debugged: the header file at the top:


include LogBuddy.inc


and a not-too-big stub module at the end:


include LogBuddyStub.asm


2. In your code, you first need to initialize LogBuddy--this loads the DLL and gets all the procedure addresses in it:


CALL LogBuddyInit


3. At the point where you want the logging window to appear, you start LogBuddy like so, which creates the logging window:


INVOKE LogBuddyStart, OFFSET OurWinTitle ;or pass NULL to use the default window title


4. Now you can use it to log stuff. You have the following functions at your disposal:
These are all implemented through small stub routines in your code that call the DLL routines (using push-push-call). The stub checks for errors, so if the DLL isn't loaded for some reason it'll report that and prevent you from trying to call through null pointers.

The DLL can go in whatever folder your program is running from.

The log window has some toolbar buttons in it for interactive control as well. One nice feature is that if you're logging messages and you start getting overwhelmed by a flood of them, you can turn off logging, and turn it back on later.

Anyhow, maybe someone wants to give this a try. All the files should be in the .zip.

This is not finished. Several missing things and some issues:
1. Write to file is not yet implemented.
2. This only works with 32-bit assembly-language code. Later I might add support for C, but since I don't use 64-bit, probably won't do that. But when it gets closer to being finished I'll post my complete code here and you can modify it yourself.
3. I plan on improving the message logging to include WM_NOTIFY notifications and other additional information.
4. I still haven't gotten how to scroll my edit control (a RichEdit) to the end when I add stuff to it so the last info added is visible. Any advice here would be appreciated.
5. Still need to refine the clean-up phase, make sure all handles are released or deleted, etc. So far, I haven't noticed any major problems. Of course, the last thing you want is a buggy debugging tool!

Oh, and I managed to get all the bitmaps into the DLL without using any resource stuff. (Like someone here said, "Look Ma, no resources!") That BMP loading routine I came up with is a killer.

Title: Re: A useful debugging tool
Post by: jj2007 on January 09, 2023, 07:51:08 PM
cannot open file : \masm32\include\my_masm32rt.inc

It is also good practice to use the full path for ML and LINK, instead of relying on environment variables:

\Masm32\bin\ml /c /coff /Fl /Sg /Sn LogBuddyTest.asm
Title: Re: A useful debugging tool
Post by: NoCforMe on January 09, 2023, 07:52:55 PM
Damn! I keep forgetting that.

I'm just so tired of having to wrap those include files with .nolist ... .list. Why the hell didn't whoever wrote those put those lines in? Nobody wants to see 10,000 lines of crap in their listing file.

And really, is there one single person here who uses this stuff who doesn't have their path set to \masm32\bin? (Or more specifically, who doesn't have their path set to the folder where those executables are, wherever that happens to be.)

Update .zip in previous post.
Title: Re: A useful debugging tool
Post by: hutch-- on January 09, 2023, 08:57:27 PM
I get the most useful information with the /EP option. Trick is to put an easy to find pattern in the source then open the editor on the /EP output file, search for the pattern string and you get past all of the include data.
Title: Re: A useful debugging tool
Post by: NoCforMe on January 09, 2023, 08:59:35 PM
You mean you see all that stuff in your listings? No thanks. Life's too short for that.
Title: Re: A useful debugging tool
Post by: jj2007 on January 09, 2023, 09:09:54 PM
Quote from: NoCforMe on January 09, 2023, 07:52:55 PM
I'm just so tired of having to wrap those include files with .nolist ... .list. Why the hell didn't whoever wrote those put those lines in? Nobody wants to see 10,000 lines of crap in their listing file.

Just don't use the /Fl option. The RichMasm source assembles in 8 seconds with that option set, 2.5 seconds without; and it generates 14MB listing. There are very few situations where I have to see that listing.

QuoteAnd really, is there one single person here who uses this stuff who doesn't have their path set to \masm32\bin?

Yes, me. Plus every n00b who just installed the Masm32 SDK. Environment variables are DOS era; there is a reason why the SDK has the hard-coded \Masm32\bin path: it just works, out of the box, always. Unless some n00b insists to use C:\Masm32\bin, while C: is not my Masm32 drive.
Title: Re: A useful debugging tool
Post by: NoCforMe on January 09, 2023, 09:18:45 PM
Quote from: jj2007 on January 09, 2023, 09:09:54 PM
There are very few situations where I have to see that listing.

So what do you do when you get assembly errors? or doesn't that happen for you?
Title: Re: A useful debugging tool
Post by: jj2007 on January 09, 2023, 09:33:31 PM
Quote from: NoCforMe on January 09, 2023, 09:18:45 PM
Quote from: jj2007 on January 09, 2023, 09:09:54 PM
There are very few situations where I have to see that listing.

So what do you do when you get assembly errors? or doesn't that happen for you?

It happens all the time to me :biggrin:

When it happens, RichMasm jumps to the offending line, and I see immediately the "missing bracket" or whatever was the reason. On very rare occasions, I need the full listing, and then a simple case-sensitive search for Error A points me to the problem. Or it doesn't, sometimes the assembler emits the error message to the console (where the editor picks up the offending line) but "forgets" to write Error A1234 to its 79MB listing.
Title: Re: A useful debugging tool
Post by: hutch-- on January 09, 2023, 10:25:01 PM
 :biggrin:

> You mean you see all that stuff in your listings? No thanks. Life's too short for that.

No, you have read it incorrectly, when yo use the /EP option, you get all of the includes so you put an easy to find pattern in the beginning of YOUR source.

; xxxxxxxxxx    ; or anything else you like.

Do a search for this pattern, you jump over all of the includes, but a /EP listing makes more sense with less garbage.
Title: Re: A useful debugging tool
Post by: zedd151 on January 10, 2023, 12:49:30 AM
Quote from: NoCforMe on January 09, 2023, 07:52:55 PM
And really, is there one single person here who uses this stuff who doesn't have their path set to \masm32\bin?
There are quite a few actually. There is a requirement of the Masm32 SDK that it be in the root of a drive. This simplifies things from the perspective of the SDK.  As far as actually setting "PATH= xxxxxx" to include the paths to the masm32 binaries, I would'nt do that. But certain that others may tend too do things 'their way'.
At any rate, I'll check out the .dll later today ...  :biggrin: 


I truncated this post from a much longer version. I didn't want it to sound like a rant.  :undecided:  So nevermind if you had read the original extended post.  :tongue:
Title: Re: A useful debugging tool
Post by: zedd151 on January 10, 2023, 02:03:55 AM
Upon looking at the test piece for the dll, it seems that the dll mostly catches WM_xxxx mesages. I am not sure if I have any practical uses for the dll debugging tool at the moment, but will test it when I do find a possible need for it. As far as using the options that you listed, could you elaborate if possible.
Title: Re: A useful debugging tool
Post by: NoCforMe on January 10, 2023, 07:38:46 AM
Sure, although I though I pretty much spelled it out in the original post. You can show
That's pretty much it, apart from some niceties like visual separators in the log. This is not a debugger, simply a debugging aid.

I could add timestamps to it for those who want to check timing; do you think that would be a good idea?
Title: Re: A useful debugging tool
Post by: hutch-- on January 10, 2023, 09:58:36 AM
Z,

As far as fixed paths, once you have had to deal with hundreds who did not read the installation instructions and turned up here with the normal "It Dozen Wurk", Fixed paths on installation solved the problem and it also made posting code between members a lot easier and compatible.

When you get code posted that uses something else, its a case of whether you could be bothered testing it.
Title: Re: A useful debugging tool
Post by: NoCforMe on January 10, 2023, 10:07:42 AM
Since you continued this discussion of paths, Hutch, consider this: Yes, I have MASM installed in the "right" place, (x):\masm32, where (x) is a drive other than C:. So far, so good.

But I use what I'll bet a lot of people here use, if not most of us: a command window for assembling and linking. (Rather than the default dumbass Windows "cm.exe", I use much nicer one, 4DOS, that I've been using since 1990.) And it allows me to set paths, something that still works under Windows 10 and is still useful. So if I need to fire up the assembler, linker or librarian, I can just type "ml xxxxxx" or "link xxxx" without having type the complete pathname (\masm32\ml, etc.). Now and then I need to see what all the options are for these programs. See how that works?

I'm just curious, how many people here have paths set to the masm32 executables? Show of hands?

(btw, this makes me wonder about some of Micro$oft's tools. Anyone else notice how every time you run lib it totally messes up the command window, so you have to issue a cls command to clear the screen?)
Title: Re: A useful debugging tool
Post by: hutch-- on January 10, 2023, 11:00:14 AM
Hi David,

The problem is that CMD.EXE is installed on every computer that will run 32 bit PE files and it runs command line apps with no problems at all. Most have heard of 4DOS but you would struggle to get above a 0.00000000000000? user base in comparison to CMD.EXE.

You can also bypass any command prompt by using CreateProcess() and create a binary that calls any of the Microsoft command line tools and this is how most of the IDE's do it but you don't want to be limited to any one particular IDE.

A batch file is a solution that can be run directly from the command line, you don't need any editor or IDE and you can run any command line option you want, all you have to do is write it.
Title: Re: A useful debugging tool
Post by: NoCforMe on January 10, 2023, 11:56:35 AM
My mention of 4DOS was only a side comment, but it points out how wrong the people in the "you must only use the latest software" crowd are. Coming up on 30 years old and it still does its job admirably.

But basically it does exactly the same thing as cmd.exe: run batch files. (Well, that's its primary use where assembling and linking our software is concerned. I use Windows Explorer for all my file-system moving-stuff-around work. Only die-hard Unix geeks sit there at the command prompt typing "copy myfile.asm thisfolder" or whatever.)

How many people here don't run batch files from the command line, but instead use some kind of IDE? Apart from JJ's minions who use MasmBasic, I don't think there are too many. Batch files are what I use.
Title: Re: A useful debugging tool
Post by: NoCforMe on January 10, 2023, 12:00:10 PM
OK, so here's the latest and greatest. Now with log file writing! Slightly better-looking toolbar buttons (those are all homemade, so give me a break; and I kinda actually like that mid-1990s look.) Use it and let me know whatcha think.

I'll post complete code later if anyone's interested. My first DLL!
Title: Re: A useful debugging tool
Post by: jj2007 on January 10, 2023, 12:04:29 PM
Quote from: NoCforMe on January 10, 2023, 11:56:35 AMHow many people here don't run batch files from the command line, but instead use some kind of IDE? Apart from JJ's minions who use MasmBasic, I don't think there are too many. Batch files are what I use.

David,

Many forum members use QEditor, which has a project menu with a decent number of building options.

Btw I don't have "minions". Nobody in this forum has, we are all grown ups. You seem to be really p*ssed off, what's wrong?
Title: Re: A useful debugging tool
Post by: NoCforMe on January 10, 2023, 12:06:46 PM
[Foghorn Leghorn voice] It was a, a, it was a joke, son. [/Foghorn Leghorn voice]

So you can assemble and link from Qeditor? Didn't know that. Wonder how many here use that.

OK, just looked at it. So you can open a command window from it: big deal. Handy, yes, but that's exactly the same "workflow" I use (edit file, then go to command window to assemble & link). Not really an IDE.

But it's handy, I'll grant you that. I could add that to my editor. (Which I've been using regularly, btw. Only a few annoying things in it that need fixed.)
Title: Re: A useful debugging tool: New version here
Post by: NoCforMe on January 24, 2023, 11:34:32 AM
Here's LogBuddy, all nicely packaged up ready to use. There's even a manual. New features: Now with Message Inclusion and Exclusion! Works nicely.

If you use it let me know how it works for you.

Aaaaargh; updated because I forgot the .def file to make the DLL.

Ideas for future additions:
Inclusions now are handled by a list of messages you want to see, so only those specific messages are logged. There is exclusion by class: cursor messages, window size/move messages, etc. Could make inclusion work the same way ("show me all mouse-related messages").
Title: Re: A useful debugging tool
Post by: hutch-- on January 24, 2023, 11:59:32 AM
David,

> Not really an IDE

QE is not an IDE, its an ASCII editor for writing code. It run a batch file to build apps directly off the menu.

Why a batch file ?
So anyone can edit the build process.  :biggrin:
Title: Re: A useful debugging tool: New version here
Post by: jj2007 on January 24, 2023, 12:02:46 PM
Quote from: NoCforMe on January 24, 2023, 11:34:32 AM
Here's LogBuddy, all nicely packaged up ready to use

makelogbuddytest.bat is not so useful, because you assume that certain environment variables are set, but strangely enough, simply hitting F6 in RichMasm does the job. Works fine :thumbsup:
Title: Re: A useful debugging tool: New new version
Post by: NoCforMe on January 25, 2023, 12:08:19 PM
Just for fun I added a timestamp logging function to LogBuddy:


CALL LogBuddyPutTime


You can see the output in the attached picture. It's obviously not good for pinpoint accuracy when analyzing small code fragments, more appropriate for timing code that takes some time, like file I/O or a long computation. Still, it was easy to code up and may be useful to someone.
Title: Re: A useful debugging tool
Post by: jj2007 on January 25, 2023, 07:53:06 PM
Works fine :thumbsup:

What I would miss is an option to exclude certain messages, similar to the NoDebMsg option:

WndProc proc uses esi edi ebx hWnd, uMsg, wParam:WPARAM, lParam:LPARAM
  inc msgCount
  NoDebMsg CATSTR NoDebMsg, <, WM_ENTERIDLE, WM_SETCURSOR, WM_MOUSEMOVE> ; don't show these messages
  deb 4, "msg", chg:msgCount


Especially WM_SETCURSOR and WM_MOUSEMOVE in your example deserve to be excluded ;-)
Title: Re: A useful debugging tool
Post by: NoCforMe on January 25, 2023, 08:14:54 PM
I thought about that, and I could easily add it, but I'm not sure it would be that useful since there would still be a flood of other messages. It does have message exclusion by class (mouse, cursor, non-client, move/size). Maybe I'll just put your suggestion in.
Title: Re: A useful debugging tool
Post by: jj2007 on January 25, 2023, 08:21:18 PM
I need the exclusion all the time when I am searching for particular messages. You don't want to see a steady flow of WM_SETCURSOR, WM_MOUSEMOVE, WM_SETICON messages unless you are specifically looking for them :cool:

My defaults:
NoDebMsg equ <WM_MOUSEMOVE, WM_NCHITTEST, WM_SETCURSOR, WM_GETICON, WM_NCMOUSEMOVE, WM_MOVING>

All messages allowed, moving the mouse over a window's client area. Kind of boring, isn't it?
msg     2130  04E50B48 02000002 WM_SETCURSOR
msg     2131  00000002 00A603D5 WM_NCMOUSEMOVE
msg     2132  00000000 00A603CD WM_NCHITTEST
msg     2133  04E50B48 02000002 WM_SETCURSOR
msg     2134  00000002 00A603CD WM_NCMOUSEMOVE
msg     2135  00000000 00A603C7 WM_NCHITTEST
msg     2136  04E50B48 02000002 WM_SETCURSOR
msg     2137  00000002 00A603C7 WM_NCMOUSEMOVE
msg     2138  00000000 00A603C1 WM_NCHITTEST
msg     2139  04E50B48 02000002 WM_SETCURSOR
msg     2140  00000002 00A603C1 WM_NCMOUSEMOVE
msg     2141  00000000 00A603BD WM_NCHITTEST
msg     2142  04E50B48 02000002 WM_SETCURSOR
msg     2143  00000002 00A603BD WM_NCMOUSEMOVE
msg     2144  00000000 00A603B9 WM_NCHITTEST
msg     2145  04E50B48 02000002 WM_SETCURSOR
msg     2146  00000002 00A603B9 WM_NCMOUSEMOVE
msg     2147  00000000 00A603B6 WM_NCHITTEST
msg     2148  04E50B48 02000002 WM_SETCURSOR
msg     2149  00000002 00A603B6 WM_NCMOUSEMOVE
msg     2150  00000000 00A603B4 WM_NCHITTEST
msg     2151  04E50B48 02000002 WM_SETCURSOR
msg     2152  00000002 00A603B4 WM_NCMOUSEMOVE
msg     2153  00000000 00A603B2 WM_NCHITTEST
msg     2154  04E50B48 02000002 WM_SETCURSOR
msg     2155  00000002 00A603B2 WM_NCMOUSEMOVE
msg     2156  00000000 00A603B1 WM_NCHITTEST
msg     2157  04E50B48 02000002 WM_SETCURSOR
msg     2158  00000002 00A603B1 WM_NCMOUSEMOVE
msg     2159  00000000 00A603AF WM_NCHITTEST
msg     2160  04E50B48 02000002 WM_SETCURSOR
msg     2161  00000002 00A603AF WM_NCMOUSEMOVE
msg     2162  00000000 00A603AD WM_NCHITTEST
msg     2163  04E50B48 02000002 WM_SETCURSOR
msg     2164  00000002 00A603AD WM_NCMOUSEMOVE
msg     2165  00000000 00A603AB WM_NCHITTEST
msg     2166  04E50B48 02000002 WM_SETCURSOR
msg     2167  00000002 00A603AB WM_NCMOUSEMOVE
msg     2168  00000000 00A603A9 WM_NCHITTEST
msg     2169  04E50B48 02000002 WM_SETCURSOR
msg     2170  00000002 00A603A9 WM_NCMOUSEMOVE
msg     2171  00000000 00A603A6 WM_NCHITTEST
msg     2172  04E50B48 02000002 WM_SETCURSOR
msg     2173  00000002 00A603A6 WM_NCMOUSEMOVE
msg     2174  00000000 00A603A4 WM_NCHITTEST
msg     2175  04E50B48 02000002 WM_SETCURSOR
msg     2176  00000002 00A603A4 WM_NCMOUSEMOVE
msg     2177  00000000 00A603A0 WM_NCHITTEST
msg     2178  04E50B48 02000002 WM_SETCURSOR
msg     2179  00000002 00A603A0 WM_NCMOUSEMOVE
msg     2180  00000000 00A6039C WM_NCHITTEST
msg     2181  04E50B48 02000002 WM_SETCURSOR
msg     2182  00000002 00A6039C WM_NCMOUSEMOVE
msg     2183  00000000 00A60398 WM_NCHITTEST
msg     2184  04E50B48 02000002 WM_SETCURSOR
msg     2185  00000002 00A60398 WM_NCMOUSEMOVE
msg     2186  00000000 00A60394 WM_NCHITTEST
msg     2187  04E50B48 02000002 WM_SETCURSOR
msg     2188  00000002 00A60394 WM_NCMOUSEMOVE
msg     2189  00000000 00A90390 WM_NCHITTEST
msg     2190  04E50B48 02000002 WM_SETCURSOR
msg     2191  00000002 00A90390 WM_NCMOUSEMOVE
msg     2192  00000000 00A9038D WM_NCHITTEST
msg     2193  04E50B48 02000002 WM_SETCURSOR
msg     2194  00000002 00A9038D WM_NCMOUSEMOVE
msg     2195  00000000 00A9038C WM_NCHITTEST
msg     2196  04E50B48 02000002 WM_SETCURSOR
msg     2197  00000002 00A9038C WM_NCMOUSEMOVE
msg     2198  00000000 00A90389 WM_NCHITTEST
msg     2199  04E50B48 02000002 WM_SETCURSOR
msg     2200  00000002 00A90389 WM_NCMOUSEMOVE
msg     2201  00000000 00A90388 WM_NCHITTEST
msg     2202  04E50B48 02000002 WM_SETCURSOR
msg     2203  00000002 00A90388 WM_NCMOUSEMOVE
msg     2204  00000000 00A90386 WM_NCHITTEST
msg     2205  04E50B48 02000002 WM_SETCURSOR
msg     2206  00000002 00A90386 WM_NCMOUSEMOVE
msg     2207  00000000 00A90385 WM_NCHITTEST
msg     2208  04E50B48 02000002 WM_SETCURSOR
msg     2209  00000002 00A90385 WM_NCMOUSEMOVE
msg     2210  00000000 00A90384 WM_NCHITTEST
msg     2211  04E50B48 02000002 WM_SETCURSOR
msg     2212  00000002 00A90384 WM_NCMOUSEMOVE
msg     2213  00000000 00A90382 WM_NCHITTEST
msg     2214  04E50B48 02000002 WM_SETCURSOR
msg     2215  00000002 00A90382 WM_NCMOUSEMOVE
msg     2216  00000000 00A90380 WM_NCHITTEST
msg     2217  04E50B48 02000002 WM_SETCURSOR
msg     2218  00000002 00A90380 WM_NCMOUSEMOVE
msg     2219  00000000 00A9037F WM_NCHITTEST
msg     2220  04E50B48 02000002 WM_SETCURSOR
msg     2221  00000002 00A9037F WM_NCMOUSEMOVE
msg     2222  00000000 00A9037B WM_NCHITTEST
msg     2223  04E50B48 02000002 WM_SETCURSOR
msg     2224  00000002 00A9037B WM_NCMOUSEMOVE
msg     2225  00000000 00A90376 WM_NCHITTEST
msg     2226  04E50B48 02000002 WM_SETCURSOR
msg     2227  00000002 00A90376 WM_NCMOUSEMOVE
msg     2228  00000000 00A90371 WM_NCHITTEST
msg     2229  04E50B48 02000002 WM_SETCURSOR
msg     2230  00000002 00A90371 WM_NCMOUSEMOVE
msg     2231  00000000 00A9036A WM_NCHITTEST
msg     2232  04E50B48 02000002 WM_SETCURSOR
msg     2233  00000002 00A9036A WM_NCMOUSEMOVE
msg     2234  00000000 00000000 WM_GETICON
msg     2235  00000000 00A80364 WM_NCHITTEST
msg     2236  04E50B48 02000002 WM_SETCURSOR
msg     2237  00000002 00A80364 WM_NCMOUSEMOVE
msg     2238  00000000 00A80364 WM_NCHITTEST
msg     2239  04E50B48 02000002 WM_SETCURSOR
msg     2240  00000002 00A80364 WM_NCMOUSEMOVE
msg     2241  00000000 00A8035F WM_NCHITTEST
msg     2242  04E50B48 02000002 WM_SETCURSOR
msg     2243  00000002 00A8035F WM_NCMOUSEMOVE
msg     2244  00000000 00A80359 WM_NCHITTEST
msg     2245  04E50B48 02000002 WM_SETCURSOR
msg     2246  00000002 00A80359 WM_NCMOUSEMOVE
msg     2247  00000000 00A80355 WM_NCHITTEST
msg     2248  04E50B48 02000002 WM_SETCURSOR
msg     2249  00000002 00A80355 WM_NCMOUSEMOVE
msg     2250  00000000 00A70352 WM_NCHITTEST
msg     2251  04E50B48 02000002 WM_SETCURSOR
msg     2252  00000002 00A70352 WM_NCMOUSEMOVE
msg     2253  00000000 00A7034F WM_NCHITTEST
msg     2254  04E50B48 02000002 WM_SETCURSOR
msg     2255  00000002 00A7034F WM_NCMOUSEMOVE
msg     2256  00000000 00A7034E WM_NCHITTEST
msg     2257  04E50B48 02000002 WM_SETCURSOR
msg     2258  00000002 00A7034E WM_NCMOUSEMOVE
msg     2259  00000000 00A7034D WM_NCHITTEST
msg     2260  04E50B48 02000002 WM_SETCURSOR
msg     2261  00000002 00A7034D WM_NCMOUSEMOVE
msg     2262  00000000 00A7034C WM_NCHITTEST
msg     2263  04E50B48 02000002 WM_SETCURSOR
msg     2264  00000002 00A7034C WM_NCMOUSEMOVE
msg     2265  00000000 00A7034A WM_NCHITTEST
msg     2266  04E50B48 02000002 WM_SETCURSOR
msg     2267  00000002 00A7034A WM_NCMOUSEMOVE
msg     2268  00000000 00A70347 WM_NCHITTEST
msg     2269  04E50B48 02000002 WM_SETCURSOR
msg     2270  00000002 00A70347 WM_NCMOUSEMOVE
msg     2271  00000000 00A70345 WM_NCHITTEST
msg     2272  04E50B48 02000002 WM_SETCURSOR
msg     2273  00000002 00A70345 WM_NCMOUSEMOVE
msg     2274  00000000 00A70344 WM_NCHITTEST
msg     2275  04E50B48 02000002 WM_SETCURSOR
msg     2276  00000002 00A70344 WM_NCMOUSEMOVE
msg     2277  00000000 00A70343 WM_NCHITTEST
msg     2278  04E50B48 02000002 WM_SETCURSOR
msg     2279  00000002 00A70343 WM_NCMOUSEMOVE
msg     2280  00000000 00A70341 WM_NCHITTEST
msg     2281  04E50B48 02000002 WM_SETCURSOR
msg     2282  00000002 00A70341 WM_NCMOUSEMOVE
msg     2283  00000000 00A7033F WM_NCHITTEST
msg     2284  04E50B48 02000002 WM_SETCURSOR
msg     2285  00000002 00A7033F WM_NCMOUSEMOVE
msg     2286  00000000 00A7033D WM_NCHITTEST
msg     2287  04E50B48 02000002 WM_SETCURSOR
msg     2288  00000002 00A7033D WM_NCMOUSEMOVE
msg     2289  00000000 00A7033B WM_NCHITTEST
msg     2290  04E50B48 02000002 WM_SETCURSOR
msg     2291  00000002 00A7033B WM_NCMOUSEMOVE
msg     2292  00000000 00A7033A WM_NCHITTEST
msg     2293  04E50B48 02000002 WM_SETCURSOR
msg     2294  00000002 00A7033A WM_NCMOUSEMOVE
msg     2295  00000000 00A70338 WM_NCHITTEST
msg     2296  04E50B48 02000002 WM_SETCURSOR
msg     2297  00000002 00A70338 WM_NCMOUSEMOVE
msg     2298  00000000 00A70336 WM_NCHITTEST
msg     2299  04E50B48 02000002 WM_SETCURSOR
msg     2300  00000002 00A70336 WM_NCMOUSEMOVE
msg     2301  00000000 00A70333 WM_NCHITTEST
msg     2302  04E50B48 02000002 WM_SETCURSOR
msg     2303  00000002 00A70333 WM_NCMOUSEMOVE
msg     2304  00000000 00A70332 WM_NCHITTEST
msg     2305  04E50B48 02000002 WM_SETCURSOR
msg     2306  00000002 00A70332 WM_NCMOUSEMOVE
msg     2307  00000000 00A70331 WM_NCHITTEST
msg     2308  04E50B48 02000002 WM_SETCURSOR
msg     2309  00000002 00A70331 WM_NCMOUSEMOVE
msg     2310  00000000 00A70330 WM_NCHITTEST
msg     2311  04E50B48 02000002 WM_SETCURSOR
msg     2312  00000002 00A70330 WM_NCMOUSEMOVE
msg     2313  00000000 00000000 WM_GETICON
msg     2314  00000000 00A70330 WM_NCHITTEST
msg     2315  04E50B48 02000002 WM_SETCURSOR
msg     2316  00000002 00A70330 WM_NCMOUSEMOVE
msg     2317  00000000 00A7032E WM_NCHITTEST
msg     2318  04E50B48 02000002 WM_SETCURSOR
msg     2319  00000002 00A7032E WM_NCMOUSEMOVE
msg     2320  00000000 00A7032B WM_NCHITTEST
msg     2321  04E50B48 02000002 WM_SETCURSOR
msg     2322  00000002 00A7032B WM_NCMOUSEMOVE
msg     2323  00000000 00A70327 WM_NCHITTEST
msg     2324  04E50B48 02000002 WM_SETCURSOR
msg     2325  00000002 00A70327 WM_NCMOUSEMOVE
msg     2326  00000000 00A70323 WM_NCHITTEST
msg     2327  04E50B48 02000002 WM_SETCURSOR
msg     2328  00000002 00A70323 WM_NCMOUSEMOVE
msg     2329  00000000 00A70320 WM_NCHITTEST
msg     2330  04E50B48 02000002 WM_SETCURSOR
msg     2331  00000002 00A70320 WM_NCMOUSEMOVE
msg     2332  00000000 00A7031C WM_NCHITTEST
msg     2333  04E50B48 02000002 WM_SETCURSOR
msg     2334  00000002 00A7031C WM_NCMOUSEMOVE
msg     2335  00000000 00A70319 WM_NCHITTEST
msg     2336  04E50B48 02000002 WM_SETCURSOR
msg     2337  00000002 00A70319 WM_NCMOUSEMOVE
msg     2338  00000000 00A70317 WM_NCHITTEST
msg     2339  04E50B48 02000002 WM_SETCURSOR
msg     2340  00000002 00A70317 WM_NCMOUSEMOVE
msg     2341  00000000 00A70315 WM_NCHITTEST
msg     2342  04E50B48 02000002 WM_SETCURSOR
msg     2343  00000002 00A70315 WM_NCMOUSEMOVE
msg     2344  00000000 00A50311 WM_NCHITTEST
msg     2345  04E50B48 02000002 WM_SETCURSOR
msg     2346  00000002 00A50311 WM_NCMOUSEMOVE
msg     2347  00000000 00A3030D WM_NCHITTEST
msg     2348  04E50B48 02000002 WM_SETCURSOR
msg     2349  00000002 00A3030D WM_NCMOUSEMOVE
msg     2350  00000000 009F0308 WM_NCHITTEST
msg     2351  04E50B48 02000002 WM_SETCURSOR
msg     2352  00000002 009F0308 WM_NCMOUSEMOVE
msg     2353  00000000 009B0303 WM_NCHITTEST
msg     2354  04E50B48 0200000C WM_SETCURSOR
msg     2355  0000000C 009B0303 WM_NCMOUSEMOVE
msg     2356  00000000 00990301 WM_NCHITTEST
msg     2357  04E50B48 0200000C WM_SETCURSOR
msg     2358  0000000C 00990301 WM_NCMOUSEMOVE
msg     2359  00000000 009602FD WM_NCHITTEST
Title: Re: A useful debugging tool
Post by: daydreamer on January 25, 2023, 09:39:17 PM
Quote from: NoCforMe on January 10, 2023, 11:56:35 AM
but it points out how wrong the people in the "you must only use the latest software"
There are 32bit old software that lately been released free, also saves money not getting latest 64bit version which still uses 90%+ older functions
I use mostly qeditor which have masm32 "wizards",masm32 oriented help files in help menu,and uses. Bat file when building project, which is very useful when some want to edit to use their favourite assembler or newer. Ml version, or newer linker version
Title: Re: A useful debugging tool
Post by: NoCforMe on January 26, 2023, 12:58:44 PM
Quote from: jj2007 on January 25, 2023, 08:21:18 PM
My defaults:
NoDebMsg equ <WM_MOUSEMOVE, WM_NCHITTEST, WM_SETCURSOR, WM_GETICON, WM_NCMOUSEMOVE, WM_MOVING>

It's done. Your wish is my command. Besides, it was incredibly easy to code up. (I'm waiting to post the new version in case other changes need to be made.)

; Prepare list of messages we want to exclude:
MOV msgList, -2
MOV msgList + 4, WM_MOUSEMOVE
MOV msgList + 8, WM_NCHITTEST
MOV msgList + 12, WM_SETCURSOR
MOV msgList + 16, WM_SETCURSOR
MOV msgList + 20, WM_GETICON
MOV msgList + 24, WM_NCMOUSEMOVE
MOV msgList + 28, WM_MOVING
MOV msgList + 32, 0 ;List terminator

INVOKE LogBuddyLogMsg, uMsg, wParam, lParam, ADDR msgList


I'm sure you can cook up a macro to make it even easier to use, probably all on one line.

Question: For the elasped-time logging function, should I display the elapsed time in mS? in addition to the raw hex of QueryPerformanceCounter(), or in place of it? How much resolution would be realistic and useful here?