mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-29 15:32:36 +00:00
# big refactor of error display code. fixes crash in release-mode selftest
* debug_write_crashlog and debug_dump_stack are now responsible for detecting reentrancy (reported via new ERR_REENTERED error code). * export debug_error_message_build to allow unit test of stack dumper * split+clean up debug_display_error to allow this. * error_description_r now returns buf for convenience * ia32: fix typo causing disassembly to fail * wdbg_sym: bugfix causing incorrect debug_walk_stack return value. prevent recursive locking, provide locked version of debug_resolve_symbol. add skip_this_frame for convenience. refs #130 This was SVN commit r4067.
This commit is contained in:
@@ -55,7 +55,7 @@ static const char* LibError_description(LibError err)
|
||||
// stores up to <max_chars> in the given buffer.
|
||||
// if error is unknown/invalid, the string will be something like
|
||||
// "Unknown error (65536, 0x10000)".
|
||||
void error_description_r(LibError err, char* buf, size_t max_chars)
|
||||
char* error_description_r(LibError err, char* buf, size_t max_chars)
|
||||
{
|
||||
// lib error
|
||||
const char* str = LibError_description(err);
|
||||
@@ -64,11 +64,14 @@ void error_description_r(LibError err, char* buf, size_t max_chars)
|
||||
// <err> was one of our error codes (chosen so as not to conflict
|
||||
// with any others), so we're done.
|
||||
strcpy_s(buf, max_chars, str);
|
||||
return;
|
||||
}
|
||||
// unknown
|
||||
else
|
||||
{
|
||||
snprintf(buf, max_chars, "Unknown error (%d, 0x%X)", err, err);
|
||||
}
|
||||
|
||||
// fallback
|
||||
snprintf(buf, max_chars, "Unknown error (%d, 0x%X)", err, err);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user