Download
(3 Kb)
Download
Updated: 01-09-07 06:51 AM
Pictures
File Info
Updated:01-09-07 06:51 AM
Created:unknown
Downloads:1,970
Favorites:4
MD5:
JIM's Debugger
Version: 2.0.36
by: JIM the Inventor [More]
This AddOn is provided as a service to AddOn programmers, and anyone that is willing to help JIM find and correct errors. Please note: The average player has no use for this AddOn.

JIM's Debugger is an AddOn-programming tool that permits you to include feedback in the AddOns that you make - feedback that only you (and other JIM Debugger users) get to see.

The key to this ability is the existence of the LUA function "assert". Assert was provided as a debugging tool long before JIM found it, but it is normally just used to tell you whether a variable has a nil value. [I.E.: assert(nil) produces an error. assert(varName) does nothing as long as varName ~= nil.] Debugger replaces assert with another function that takes whatever values you give it, turns those values into strings, and dumps them to the Chat Window of your choice.


HOW TO USE:

I apologize in advance for not making this easy. At least it only needs to be done once!

Debugger will do nothing on first installation. Load up any character. Right-click the tab "General", which appears when you hover the mouse point over your Chat Window. From the menu that appears, choose "Create New Window". Give the New Window the name "Test".

Type "/jimdebug Test". If you have done everything correctly, you should see the message "Debugging set to frame # 3". If you already have Chat Windows other than General and Combat Log, then the # may not be 3, but you get the idea.

From then on, assert statements included in AddOns will start to dump a LOT of information into your Test Chat Window. If you are a programmer, I recommend using lines like: assert("functionName", myTable); It's best to lead with a string constant like functionName because then you can use the extra features that I put in.


FEATURE: Slash Command (Runtime Toggle)

If you type "/jimdebug" with no parameters, it will enable or disable the AddOn without the need to reload the UI. Any other parameter should be the name of an existing Test Chat Window.


FEATURE: Debug-Only Processing

It may be that you have need of information when testing, but this information slows down your AddOn when it is included in your releases. No problem. If assert is passed a function as its first parameter, then it will behave much like pcall, running the function only when Debugger is installed. The return values of the function are then run through assert a second time, resulting in text output.


FEATURE: Suppress a Category of Assert Messages

Suppose your AddOn listing has lines like this:

aVar = 42; assert( "CountingFunction", aVar );
bVar = 7; assert( "CountingFunction", bVar );
cVar = { name="happy table", n=3 }; assert( "ReportingFunction", cVar );

Whenever these lines are used, the Test Chat Window will show:

CountingFunction 42
CountingFunction 7
ReportingFunction table:0C1AB5 {
name="happy table",
n=3,
}

If you click "ReportingFunction" then you will get no feedback beginning with ReportingFunction until the UI is reloaded:

Ignoring messages labeled "ReportingFunction".
CountingFunction 42
CountingFunction 7


JIM's version rules:

The first two parts of the version number (2.x) are the same as a compatible version number of World of Warcraft.
Whenever any JIM AddOn is updated, all JIM AddOns that update after it will have the same version number or higher.

Changed in version 2.0.36:

o Updated TOC for WoW 2.0.3 patch.

Changed in version 2.0.32:

o Compatability ensured for the Burning Crusade.
o Added the "JIM_toolbox" folder that I always seem to forget for an AddOn's introduction.

Changed in version 1.12.30:

o This was the first release of JIM's Debugger. It was provided to help solve a mystery with JIM's Cooldown Pulse.
o "Suppress a Category of Assert Messages" was the only feature documented.
Optional Files (0)


There have been no comments posted to this file.
Be the first to add one.



Category Jump: