aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authormd52011-03-25 13:26:20 +0200
committermd52011-03-25 13:37:00 +0200
commitd86504ef887c5f10fedbc081476a050295241cb4 (patch)
treebceaf93b0b1769a32596d63b46913bd76a9f0d19 /engines/sci
parent4ceb4838ed9c153337a7a07fc03d3d1e78351af4 (diff)
downloadscummvm-rg350-d86504ef887c5f10fedbc081476a050295241cb4.tar.gz
scummvm-rg350-d86504ef887c5f10fedbc081476a050295241cb4.tar.bz2
scummvm-rg350-d86504ef887c5f10fedbc081476a050295241cb4.zip
SCI: Cleaned up the BreakpointType enum and documented the bpe command
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/console.cpp4
-rw-r--r--engines/sci/debug.h12
-rw-r--r--engines/sci/engine/vm.cpp4
3 files changed, 9 insertions, 11 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 93d21c32e0..e2e5ee9682 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -3154,10 +3154,9 @@ bool Console::cmdBreakpointKernel(int argc, const char **argv) {
}
bool Console::cmdBreakpointFunction(int argc, const char **argv) {
- // TODO/FIXME: Why does this accept 2 parameters (the high and the low part of the address)?"
if (argc != 3) {
DebugPrintf("Sets a breakpoint on the execution of the specified exported function.\n");
- DebugPrintf("Usage: %s <addr1> <addr2>\n", argv[0]);
+ DebugPrintf("Usage: %s <script number> <export number\n", argv[0]);
return true;
}
@@ -3166,6 +3165,7 @@ bool Console::cmdBreakpointFunction(int argc, const char **argv) {
A breakpoint set on an invalid method name will just never trigger. */
Breakpoint bp;
bp.type = BREAK_EXPORT;
+ // script number, export number
bp.address = (atoi(argv[1]) << 16 | atoi(argv[2]));
_debugState._breakpoints.push_back(bp);
diff --git a/engines/sci/debug.h b/engines/sci/debug.h
index d9959f0b7f..8ddbbd0d45 100644
--- a/engines/sci/debug.h
+++ b/engines/sci/debug.h
@@ -34,18 +34,18 @@ namespace Sci {
// These types are used both as identifiers and as elements of bitfields
enum BreakpointType {
/**
- * Break when selector is executed. data contains (char *) selector name
+ * Break when a selector is executed. Data contains (char *) selector name
* (in the format Object::Method)
*/
- BREAK_SELECTOREXEC = 1 << 0, // break when selector gets executed
- BREAK_SELECTORREAD = 1 << 1, // break when selector gets executed
- BREAK_SELECTORWRITE = 1 << 2, // break when selector gets executed
+ BREAK_SELECTOREXEC = 1 << 0, // break when a function selector is executed
+ BREAK_SELECTORREAD = 1 << 1, // break when a variable selector is read
+ BREAK_SELECTORWRITE = 1 << 2, // break when a variable selector is written
/**
- * Break when an exported function is called. data contains
+ * Break when an exported function is called. Data contains
* script_no << 16 | export_no.
*/
- BREAK_EXPORT = 1 << 3
+ BREAK_EXPORT = 1 << 3
};
struct Breakpoint {
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index fdd4a4637f..1eb22ef754 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -272,9 +272,7 @@ static void validate_write_var(reg_t *r, reg_t *stack_base, int type, int max, i
bool SciEngine::checkExportBreakpoint(uint16 script, uint16 pubfunct) {
if (_debugState._activeBreakpointTypes & BREAK_EXPORT) {
- uint32 bpaddress;
-
- bpaddress = (script << 16 | pubfunct);
+ uint32 bpaddress = (script << 16 | pubfunct);
Common::List<Breakpoint>::const_iterator bp;
for (bp = _debugState._breakpoints.begin(); bp != _debugState._breakpoints.end(); ++bp) {