Fix LogStackTrace Anomaly (#863)
This commit is contained in:
parent
255b9323cc
commit
7068c3e865
@ -940,9 +940,8 @@ static cell_t FrameIterator_GetFilePath(IPluginContext *pContext, const cell_t *
|
|||||||
static cell_t LogStackTrace(IPluginContext *pContext, const cell_t *params)
|
static cell_t LogStackTrace(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
char buffer[512];
|
char buffer[512];
|
||||||
|
|
||||||
g_pSM->FormatString(buffer, sizeof(buffer), pContext, params, 1);
|
g_pSM->FormatString(buffer, sizeof(buffer), pContext, params, 1);
|
||||||
|
|
||||||
IFrameIterator *it = pContext->CreateFrameIterator();
|
IFrameIterator *it = pContext->CreateFrameIterator();
|
||||||
ke::Vector<ke::AString> arr = g_DbgReporter.GetStackTrace(it);
|
ke::Vector<ke::AString> arr = g_DbgReporter.GetStackTrace(it);
|
||||||
pContext->DestroyFrameIterator(it);
|
pContext->DestroyFrameIterator(it);
|
||||||
@ -951,7 +950,7 @@ static cell_t LogStackTrace(IPluginContext *pContext, const cell_t *params)
|
|||||||
|
|
||||||
g_Logger.LogError("[SM] Stack trace requested: %s", buffer);
|
g_Logger.LogError("[SM] Stack trace requested: %s", buffer);
|
||||||
g_Logger.LogError("[SM] Called from: %s", pPlugin->GetFilename());
|
g_Logger.LogError("[SM] Called from: %s", pPlugin->GetFilename());
|
||||||
for (size_t i = 0; i < arr.length(); i)
|
for (size_t i = 0; i < arr.length(); ++i)
|
||||||
{
|
{
|
||||||
g_Logger.LogError("%s", arr[i].chars());
|
g_Logger.LogError("%s", arr[i].chars());
|
||||||
}
|
}
|
||||||
|
@ -312,6 +312,16 @@ native void SetFailState(const char[] string, any ...);
|
|||||||
*/
|
*/
|
||||||
native void ThrowError(const char[] fmt, any ...);
|
native void ThrowError(const char[] fmt, any ...);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logs a stack trace from the current function call. Code
|
||||||
|
* execution continues after the call
|
||||||
|
*
|
||||||
|
* @param fmt Format string to send with the stack trace.
|
||||||
|
* @param ... Format arguments.
|
||||||
|
* @error Always logs a stack trace.
|
||||||
|
*/
|
||||||
|
native void LogStackTrace(const char[] fmt, any ...);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the system time as a unix timestamp.
|
* Gets the system time as a unix timestamp.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user