aboutsummaryrefslogtreecommitdiff
path: root/scumm/scummvm.cpp
diff options
context:
space:
mode:
authorJames Brown2003-04-20 16:25:48 +0000
committerJames Brown2003-04-20 16:25:48 +0000
commit79189f2e12ef24312848d152a599a65373447b37 (patch)
treecd1716306ddf61756c6ae93abc2ad47321e0add6 /scumm/scummvm.cpp
parentce6859d6c6d0baa6d663fe0d36f10db3eb558531 (diff)
downloadscummvm-rg350-79189f2e12ef24312848d152a599a65373447b37.tar.gz
scummvm-rg350-79189f2e12ef24312848d152a599a65373447b37.tar.bz2
scummvm-rg350-79189f2e12ef24312848d152a599a65373447b37.zip
Dump Scumm error() to debugger
svn-id: r7033
Diffstat (limited to 'scumm/scummvm.cpp')
-rw-r--r--scumm/scummvm.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index 436cf777d7..21fc0df335 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -1400,7 +1400,7 @@ void Scumm::processKbd() {
_vars[VAR_CHARINC] = _defaultTalkDelay / 20;
} else if (_lastKeyHit == '~' || _lastKeyHit == '#') { // Debug console
- g_debugger.attach(this);
+ g_debugger.attach(this, NULL);
}
_mouseButStat = _lastKeyHit;
@@ -1591,6 +1591,15 @@ void Scumm::errorString(const char *buf1, char *buf2) {
} else {
strcpy(buf2, buf1);
}
+
+ // Unless an error -originated- within the debugger, spawn the debugger. Otherwise
+ // exit out normally.
+ if (!_debugger) {
+ printf("%s", buf2); // (Print it again in-case debugger segfaults)
+ g_debugger.attach(this, buf2);
+ g_debugger.on_frame();
+ }
+
}
void Scumm::waitForTimer(int msec_delay) {
@@ -1638,7 +1647,7 @@ void Scumm::parseEvents() {
else if (event.kbd.keycode == 'g')
_fastMode ^= 2;
else if ((event.kbd.keycode == 'd') && (!_system->property(OSystem::PROP_GET_FULLSCREEN, 0)))
- g_debugger.attach(this);
+ g_debugger.attach(this, NULL);
else if (event.kbd.keycode == 's')
resourceStats();
else