fixed regressions in debug mode

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402402
This commit is contained in:
David Anderson 2008-07-11 09:24:12 +00:00
parent e1882f97a1
commit fa5ee3287f
4 changed files with 7 additions and 7 deletions

View File

@ -68,7 +68,7 @@ void DebugReport::GenerateError(IPluginContext *ctx, cell_t func_idx, int err, c
{
func_idx >>= 1;
sp_public_t *function;
if (ctx->GetPublicByIndex(func_idx, &function) == SP_ERROR_NONE)
if (ctx->GetRuntime()->GetPublicByIndex(func_idx, &function) == SP_ERROR_NONE)
{
g_Logger.LogError("[SM] Unable to call function \"%s\" due to above error(s).", function->name);
}
@ -98,7 +98,7 @@ void DebugReport::GenerateCodeError(IPluginContext *pContext, uint32_t code_addr
g_Logger.LogError("[SM] %s", buffer);
IPluginDebugInfo *pDebug;
if ((pDebug = pContext->GetDebugInfo()) == NULL)
if ((pDebug = pContext->GetRuntime()->GetDebugInfo()) == NULL)
{
g_Logger.LogError("[SM] Debug mode is not enabled for \"%s\"", plname);
g_Logger.LogError("[SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug %d on",

View File

@ -47,6 +47,7 @@ BaseRuntime::~BaseRuntime()
free(m_pPlugin->base);
delete [] m_pPlugin->memory;
delete [] m_pPlugin->natives;
delete m_pPlugin;
}

View File

@ -401,7 +401,7 @@ bool CContextTrace::GetTraceInfo(CallStackInfo *trace)
}
IPluginContext *pContext = m_pIterator->ctx;
IPluginDebugInfo *pInfo = pContext->GetDebugInfo();
IPluginDebugInfo *pInfo = pContext->GetRuntime()->GetDebugInfo();
if (!pInfo)
{

View File

@ -2684,7 +2684,7 @@ jit_rewind:
ctx->n_err = SP_ERROR_NONE;
ctx->n_idx = SP_ERROR_NONE;
plugin->prof_flags = data->profile;
plugin->flags = data->debug ? SPFLAG_PLUGIN_DEBUG : 0;
plugin->run_flags = data->debug ? SPFLAG_PLUGIN_DEBUG : 0;
const char *strbase = plugin->info.stringbase;
uint32_t max, iter;
@ -2717,7 +2717,8 @@ jit_rewind:
}
/* relocate native info */
if ((max = plugin->info.natives_num))
if ((max = plugin->info.natives_num)
&& plugin->natives == NULL)
{
plugin->natives = new sp_native_t[max];
plugin->jit_memsize += sizeof(sp_native_t) * max;
@ -2995,7 +2996,6 @@ void JITX86::FreePluginVars(sp_plugin_t *pl)
{
delete [] pl->files;
delete [] pl->lines;
delete [] pl->natives;
delete [] pl->publics;
delete [] pl->pubvars;
delete [] pl->symbols;
@ -3008,7 +3008,6 @@ void JITX86::FreePluginVars(sp_plugin_t *pl)
pl->files = NULL;
pl->lines = NULL;
pl->natives = NULL;
pl->publics = NULL;
pl->pubvars = NULL;
pl->symbols = NULL;