From 0afd6b44d09fc92e6a58c34ee10515246457609c Mon Sep 17 00:00:00 2001
From: thrust26 The debugger in Stella may never be complete, as we're constantly
adding new features requested by homebrew developers. However, even in its
current form it's still quite powerful, and is able to boast at least one
feature that no other 2600 debugger has; it's completely cross-platform. Here's a (non-comprehensive) list of what the debugger can do so far: Pressing ` (aka backtick, backquote, grave accent) toggles the debugger on
& off. When you exit the debugger, the emulation resumes at the current
@@ -142,12 +211,14 @@ present in the debugger): For space reasons, the Prompt, TIA, I/O and Audio displays are split into
4 tabs, only one of which is visible at a time. You can use the mouse or
-keyboard to select which tab you want to view. Pressing Shift with the left
-or right arrow keys cycles between tabs from right-to-left and left-to-right,
-respectively. Pressing Tab cycles between widgets in the current tab (except
-for in the Prompt area, where 'tab' is used for something else).Stella Integrated Debugger (a work in progress)
+ Release 5.1
Integrated Debugger
(a work in progress)
+ Contents
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Features
Here's a (non-comprehensive) list of what the debugger can do so far:
+
-Future planned features:
+Future planned features:
-How to use the debugger
+
+How to use the Debugger
You can also enter the debugger at emulator startup by use the 'debug' command on the command line, or alternatively within the ROM launcher in 'Power-on options': +
You can also enter the debugger at emulator startup by use the 'debug' +command on the command line, or alternatively within the ROM launcher in +'Power-on options':
; will enter the debugger before any instructions run stella -debug mygame.bin @@ -160,15 +231,87 @@ for in the Prompt area, where 'tab' is used for something else).-
Using the ` key will always enter the debugger at the end of the -frame (scanline 262, for NTSC games). This is because Stella only checks +
Using the ` key will always enter the debugger at the end of +the frame (for NTSC games usually scanline 262). This is because Stella only checks for keystrokes once per frame. Once in the debugger, you can control execution by stepping one instruction, scanline, or frame at a time (or more than one at a time, using commands in the prompt). You can also set breakpoints or traps, which will cause the emulator to enter the debugger when they are triggered, even if it happens in mid-frame.
-There are some buttons on the right top that always show up no matter which +tab you are looking at. This is because these are the ones which you will use +most.
+ +The larger button at the left top (labeled '<') performs the rewind operation, +which will undo the previous Step/Trace/Scan/Frame advance, the smaller button at +the left bottom (labeled '>') performs the unwind operation, which will undo the +previous rewind operation. The rewind buffer is 100 levels deep by default.
+ +
The other operations are Step, Trace, Scan+1, Frame+1 and Exit (debugger).
+ +You can also use the buttons from anywhere in the GUI via hotkeys.
+ +Function | +Key (Standard) | +Key (MacOSX) | +
---|---|---|
Step | +Control + s | +Cmd + s | +
Trace | +Control + t | +Cmd + t | +
Scan+1 | +Control + L | +Cmd + L | +
Frame+1 | +Control + f | +Cmd + f | +
Rewind | +Control + r | +Cmd + r | +
Unwind | +Control + Shift + r | +Cmd + Shift + r | +
Exit | +Backquote (`) | +Backquote (`) | +
When you use these buttons, the prompt doesn't change. This means the +status lines with the registers and disassembly will be "stale". You +can update them just by re-running the relevant commands in the prompt.
+ + + +The debugger tracks changes to the CPU registers and RAM by displaying changed locations or registers with a red background after each step, @@ -181,9 +324,9 @@ already contained the same value, that's not considered a change (old value was $whatever, new value is the same, so nothing got tracked). This may change in a future version of Stella.
- -This is a command-line interface, similar to the DOS DEBUG command or Supermon for the C=64.
@@ -222,7 +365,7 @@ commands in future releases. People who like command prompts will be able to use the prompt, but people who hate them will have a fully functional debugger without typing (or without typing much, anyway). -While entering a command, label or function, you can type a partial name and press the Tab key to attempt to auto-complete it. If you've ever used @@ -241,7 +384,7 @@ or set during debugging with the "define" command. It also works with built-in functions and those defined with the "function" command, but it doesn't (yet) work on filenames.
-Almost every command takes a value: the "a" command takes a byte to stuff into the accumulator, the "break" command @@ -286,7 +429,7 @@ operands as 0 for false, non-zero for true, and return either 0 or 1. So $1234&$5678 results in $1230, whereas $1234&&$5678 results in 1. This is just like C or C++...
-Like some programming languages, the debugger uses prefixed characters to change the meaning of an expression. The prefixes are:
@@ -358,9 +501,9 @@ to change the meaning of an expression. The prefixes are: -A breakpoint is a "hotspot" in your program that causes the emulator to stop emulating and jump into the debugger. You can set as many @@ -386,7 +529,7 @@ breakpoint on & off, like a light switch.
You could also use "clearbreaks" to remove all the breakpoints. Also, there is a "listbreaks" command that will list them all.
-A conditional breakpoint causes the emulator to enter the debugger when some arbitrary condition becomes true. "True" means "not zero" here: @@ -434,7 +577,7 @@ the number comes from "listbreaks" or by entering the same conditional break aga conditional break, the reason will be displayed in the status area near the TIA Zoom display (area H).
-There is one annoyance about complex expressions: once we remove the conditional break with "delbreakif" or "clearbreaks", @@ -463,7 +606,7 @@ presses both Select and Reset:
and expression for each function. Functions can be removed with "delfunction label", where the labels come from "listfunctions". -Stella has some pre-defined functions for use with the "breakif" command. These allow you to break and enter the debugger on various @@ -499,7 +642,7 @@ Stella debugger.
Don't worry about memorizing them all: the Prompt "help" command will show you a list of them.
-These "registers" are provided for you to use in your conditional breaks. They're not registers in the conventional sense, since they don't exist in @@ -539,7 +682,7 @@ beginning of the 64th scanline.
This is similar to setting a regular breakpoint, but it will only trigger when bank 1 is selected.
-A watch is an expression that gets evaluated and printed before every prompt. This is useful for e.g. tracking the contents of a @@ -559,7 +702,7 @@ also delete them all with the "clearwatches" command.
without dereferencing it: Labels are constants, and CPU registers are already visible in the CPU Widget -A trap is similar to a breakpoint, except that it catches accesses to a memory address, rather than specific location in the @@ -598,7 +741,7 @@ can remove a trap with "deltrap number", where the number comes from all traps at once with the "cleartraps" command.
-Type "help" to see this list in the debugger.
Type "help 'cmd'" to see extended information about the given command.
When selected, this tab shows detailed status of all the TIA registers (except for audio; use the Audio tab for those).
@@ -827,7 +970,7 @@ are visualized in the debugger in the queued writes area of the TIA tab.When selected, this tab shows detailed status of the Input, Output, and Timer portion of the RIOT/M6532 chip (the RAM portion is accessed @@ -845,7 +988,7 @@ reflecting this result.
This tab lets you view the contents of the TIA audio registers and the effective volume resulting from the two channel volumes.
@@ -857,7 +1000,7 @@ volume resulting from the two channel volumes.In the upper left of the debugger, you'll see the current frame of video as generated by the TIA. If a complete frame hasn't been drawn, @@ -895,7 +1038,7 @@ as illustrated:
To the right of the TIA display (E) there is TIA information, as shown:
The indicators are as follows (note that all these are read-only):
@@ -923,7 +1066,7 @@ Position, and will range from 0 to 228).Below the TIA Info (F) is the TIA Zoom area. This allows you to enlarge part of the TIA display, so you can see fine details. Note that unlike the TIA display area, this one does generate frames as the real @@ -941,7 +1084,7 @@ a context menu in the TIA Display.
Below the TIA Zoom (G), there is a status line that shows the reason the debugger was entered (if a breakpoint/trap was hit), as shown:
This displays the current CPU state, as shown:
All the registers and flags are displayed, and can be changed by @@ -974,7 +1117,7 @@ learn :)
These buttons can be used to change values in either CPU Registers (I), or the RIOT RAM (K), depending on which of these widgets is currently active.
This is a spreadsheet-like GUI for inspecting and changing the contents of the 2600's zero-page RAM.
You can navigate with either the mouse or the keyboard arrow keys. @@ -1019,8 +1162,7 @@ The remaining buttons to the right are further explained in section (L).
-The RAM widget also lets you search memory for values such as lives or remaining energy, but it's also very useful when debugging to determine which memory location holds which quantity.
@@ -1053,7 +1195,7 @@ decreased by 1:This area contains a disassembly of the current bank of ROM. If a symbol file is loaded, the disassembly will have labels. Even without a symbol file, the standard TIA/RIOT labels will still be present.
The disassembly is often quite extensive, and whenever possible tries to automatically @@ -1184,7 +1326,7 @@ in either binary or hexidecimal. -
This area shows a detailed breakdown of the bankswitching scheme. Since the bankswitch schemes can greatly vary in operation, this tab will be @@ -1230,7 +1372,7 @@ Go ahead and try to change something!
If applicable, this area shows a detailed breakdown of any extra RAM supported by
the bankswitching scheme. Since the bankswitch schemes can greatly vary in operation,
@@ -1251,34 +1393,9 @@ or not viewable by the 6507 at all, the RAM addresses are labeled as the cart se
In the examples above, F8SC RAM is labeled starting at its read port, or $F080. However,
the RAM in the DPC scheme is not viewable by the 6507, so its addresses start from $0.
-
-
There are also buttons on the right top that always show up no matter which -tab you're looking at. The larger button at the left top (labeled '<') performs -the rewind operation, which will undo the previous Step/Trace/Scan/Frame advance, -the smaller button at the left bottom (labeled '>') performs the unwind operation, -which will undo the previous rewind operation. - -The rewind buffer is 100 levels deep by default. - -The other operations are Step, Trace, Scan+1, Frame+1 and Exit.
-When you use these buttons, the prompt doesn't change. This means the -status lines with the registers and disassembly will be "stale". You -can update them just by re-running the relevant commands in the prompt.
- -You can also use the Step, Trace, Scan+1, Frame+1, Rewind and Unwind buttons from -anywhere in the GUI via the keyboard, with Control-S, Control-T, Control-L, Control-F, -Control-R and Control-Shift-R.
- - - -As mentioned in ROM Disassembly (M), Stella supports the following directives:
CODE/GFX/PGFX/DATA/ROW. While the debugger will try to automatically mark address
space with the appropriate directive, there are times when it will fail. There are
@@ -1328,7 +1445,7 @@ named "rr.a26", with properties entry "River Raid". Attempts will be made as fol
-
Here is a step-by-step guide that shows you how to use the debugger to
actually do something useful. No experience with debuggers is necessary,
diff --git a/docs/index.html b/docs/index.html
index 49d296896..e553353b7 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -14,8 +14,9 @@