General

If you want to use my vc.dbg command, make sure you have a \tmp directory (see dumpio.c for details). Note: I usually make a s:\tmp to facilitate debugging in s:\brad :) Yeah, it's a cheap and sleazy hack...

If you need to dump something and don't know the routine to call, try "e/s Dump" and see what pops up...

Instructions

You can get a dump of instructions for current function via DumpRange anytime between FixEdges and start of GenObject.

You can dump an individual instruction via DumpIns

If you need live info for a basic block, find address and call DumpABlk( block ).

Symbols

If you need to see a list of symbols, use DumpSymTab.

To look at one symbol, use DumpSym.

Tree Problems

Find the line number of a piece of source near the problem.
Do a "bif { edx == LINENUMBER } DBSrcCue" to stop near that
Go to CGDone in order to see what resulting tree is (DumpTree)
If there is a problem with tree, but not with API calls, do to DBSrcCue as above and then break on next appropriate CG API call.

Optimization Problems (Loopopts et al)

Find the ordinal of the problem function in the file (ie 4th function)
Do a "bcnt 4 FixEdges" in order to stop on 4th call (for example) to FixEdges
Dump instructions (using DumpRange) and see if problem is in trees
If not, go to RegAlloc and see if problem shows up yet
If so, binary search between FixEdges and RegAlloc to find optimization at fault.

Instruction Select Problems

Go to RegAlloc for appropriate function (called once per function when not -od)
Find address of instruction which gets translated or handled improperly. (Look in results of DumpRange for this address).
Do a "bif { eax == address } ExpandIns" to look at what we do to this instruction (trace through).

Register Allocation Problem

Call John.

Instruction Encoding Problem

Go to RegAlloc invocation for routine in question.
Go to GenObject and call DumpRange.
Find address of instruction that gets encoded incorrectly, and do a "bif { eax == address } GenObjCode"
Trace into GenObjCode at appropriate time.