- record all line numbers during function generation. This is useful for error reporting and eventually debugging.

- throw a useful exception when a VM abort occurs, the simple enum was incapable of reporting anything more than the barest minimum, which at least for array index out of bounds errors was insufficient.

The current exception mechanism is still insufficient. It really has to report a proper crash location and print a stack trace to the maximum extent possible. Instead it just prints a message and happily goes on. This is not a good solution.
This commit is contained in:
Christoph Oelckers 2016-12-02 17:36:29 +01:00
commit 1e01e6e4df
10 changed files with 159 additions and 78 deletions

View file

@ -56,6 +56,12 @@ public:
strncpy (m_Message, message, MAX_ERRORTEXT-1);
m_Message[MAX_ERRORTEXT-1] = '\0';
}
void AppendMessage(const char *message)
{
size_t len = strlen(m_Message);
strncpy(m_Message + len, message, MAX_ERRORTEXT - 1 - len);
m_Message[MAX_ERRORTEXT - 1] = '\0';
}
const char *GetMessage (void) const
{
if (m_Message[0] != '\0')
@ -64,7 +70,7 @@ public:
return NULL;
}
private:
protected:
char m_Message[MAX_ERRORTEXT];
};