aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2009-09-21 21:38:07 +0000
committerMax Horn2009-09-21 21:38:07 +0000
commit7f728af76e6f1ff9b5eda7c5b26b6d2da78bef35 (patch)
treef766c96de76f5d3467a6469709d1001b5b078150 /engines
parent43da40996bb56c593622ffa12ff916083710ff2c (diff)
downloadscummvm-rg350-7f728af76e6f1ff9b5eda7c5b26b6d2da78bef35.tar.gz
scummvm-rg350-7f728af76e6f1ff9b5eda7c5b26b6d2da78bef35.tar.bz2
scummvm-rg350-7f728af76e6f1ff9b5eda7c5b26b6d2da78bef35.zip
SCI: Workaround for crash in debugger's backtrace
svn-id: r44239
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kernel.cpp20
-rw-r--r--engines/sci/engine/kernel.h8
2 files changed, 24 insertions, 4 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 1b06b78159..6c148833ff 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -391,6 +391,26 @@ Kernel::Kernel(ResourceManager *resMan) : _resMan(resMan) {
Kernel::~Kernel() {
}
+uint Kernel::getSelectorNamesSize() const {
+ return _selectorNames.size();
+}
+const Common::String &Kernel::getSelectorName(uint selector) const {
+ return _selectorNames[selector];
+}
+
+uint Kernel::getKernelNamesSize() const {
+ return _kernelNames.size();
+}
+const Common::String &Kernel::getKernelName(uint number) const {
+ // FIXME: The following check is a temporary workaround for
+ // an issue leading to crashes when using the debugger's backtrace
+ // command.
+ static const Common::String invalid = "(invalid)";
+ if (number >= _kernelNames.size())
+ return invalid;
+ return _kernelNames[number];
+}
+
void Kernel::detectSciFeatures() {
SciVersion version = _resMan->sciVersion();
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index 93f8de4157..888db2e0d9 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -65,11 +65,11 @@ public:
Kernel(ResourceManager *resMan);
~Kernel();
- uint getSelectorNamesSize() const { return _selectorNames.size(); }
- const Common::String &getSelectorName(uint selector) const { return _selectorNames[selector]; }
+ uint getSelectorNamesSize() const;
+ const Common::String &getSelectorName(uint selector) const;
- uint getKernelNamesSize() const { return _kernelNames.size(); }
- const Common::String &getKernelName(uint number) const { return _kernelNames[number]; }
+ uint getKernelNamesSize() const;
+ const Common::String &getKernelName(uint number) const;
/**
* Determines the selector ID of a selector by its name