1
0
forked from 0ad/0ad

Disables the JS debugger.

It's completely broken since 4b1297b328 and will have to be updated for
the new SpiderMonkey API.
I only uncomment it at the moment because I plan to fix/reimplement it
soon after the upgrade.

Closes #2348
Refs #2241
Refs #1886

This was SVN commit r14506.
This commit is contained in:
Yves 2014-01-04 20:47:56 +00:00
parent da1a2eaba6
commit 7d516e7e7a
6 changed files with 25 additions and 12 deletions

View File

@ -330,7 +330,7 @@ profiler2.gpu.ext.enable = true ; Allow GL_EXT_timer_query timing mo
profiler2.gpu.intel.enable = true ; Allow GL_INTEL_performance_queries timing mode when available
; > JS DEBUGGER
jsdebugger.enable = false ; Enable Javascript debugging (default off for security/performance)
jsdebugger.enable = false ; Enable Javascript debugging. The Debugger is currently broken and can't be enabled until the SpiderMonkey upgrade is done and the debugger is updated for the new API.
; > QUICKSAVE
hotkey.quicksave = "Shift+F5"

View File

@ -134,6 +134,8 @@ static void LoadGlobals()
CFG_GET_VAL("jsdebugger.enable", Bool, g_JSDebuggerEnabled);
CFG_GET_VAL("profiler2.script.enable", Bool, g_ScriptProfilingEnabled);
if (g_JSDebuggerEnabled)
LOGERROR(L"JS debugger temporarily disabled during the SpiderMonkey upgrade (check trac ticket #2348 for details)");
// Script Debugging and profiling does not make sense together because of the hooks
// that reduce performance a lot - and it wasn't tested if it even works together.
if (g_JSDebuggerEnabled && g_ScriptProfilingEnabled)

View File

@ -694,9 +694,10 @@ void Shutdown(int UNUSED(flags))
g_UserReporter.Deinitialize();
TIMER_END(L"shutdown UserReporter");
TIMER_BEGIN(L"shutdown DebuggingServer (if active)");
delete g_DebuggingServer;
TIMER_END(L"shutdown DebuggingServer (if active)");
// JS debugger temporarily disabled during the SpiderMonkey upgrade (check trac ticket #2348 for details)
//TIMER_BEGIN(L"shutdown DebuggingServer (if active)");
//delete g_DebuggingServer;
//TIMER_END(L"shutdown DebuggingServer (if active)");
TIMER_BEGIN(L"shutdown ConfigDB");
delete &g_ConfigDB;
@ -895,8 +896,9 @@ void Init(const CmdLineArgs& args, int flags)
CONFIG_Init(args);
// before scripting
if (g_JSDebuggerEnabled)
g_DebuggingServer = new CDebuggingServer();
// JS debugger temporarily disabled during the SpiderMonkey upgrade (check trac ticket #2348 for details)
//if (g_JSDebuggerEnabled)
// g_DebuggingServer = new CDebuggingServer();
// Optionally start profiler HTTP output automatically
// (By default it's only enabled by a hotkey, for security/performance)

View File

@ -14,7 +14,9 @@
* You should have received a copy of the GNU General Public License
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
// JS debugger temporarily disabled during the SpiderMonkey upgrade (check trac ticket #2348 for details)
/*
#include "precompiled.h"
#include "DebuggingServer.h"
@ -566,3 +568,4 @@ void CDebuggingServer::ReleaseBreakPointAccess(double breakPointsLockID)
ENSURE(m_BreakPointsLockID == breakPointsLockID);
SDL_SemPost(m_BreakPointsSem);
}
*/

View File

@ -566,13 +566,15 @@ ScriptInterface::ScriptInterface(const char* nativeScopeName, const char* debugN
g_ScriptStatsTable->Add(this, debugName);
}
// JS debugger temporarily disabled during the SpiderMonkey upgrade (check trac ticket #2348 for details)
/*
if (g_JSDebuggerEnabled && g_DebuggingServer != NULL)
{
if(!JS_SetDebugMode(GetContext(), true))
LOGERROR(L"Failed to set Spidermonkey to debug mode!");
else
g_DebuggingServer->RegisterScriptinterface(debugName, this);
}
} */
m_CxPrivate.pScriptInterface = this;
JS_SetContextPrivate(m->m_cx, (void*)&m_CxPrivate);
@ -587,8 +589,9 @@ ScriptInterface::~ScriptInterface()
}
// Unregister from the Debugger class
if (g_JSDebuggerEnabled && g_DebuggingServer != NULL)
g_DebuggingServer->UnRegisterScriptinterface(this);
// JS debugger temporarily disabled during the SpiderMonkey upgrade (check trac ticket #2348 for details)
//if (g_JSDebuggerEnabled && g_DebuggingServer != NULL)
// g_DebuggingServer->UnRegisterScriptinterface(this);
}
void ScriptInterface::ShutDown()

View File

@ -15,6 +15,8 @@
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
// JS debugger temporarily disabled during the SpiderMonkey upgrade (check trac ticket #2348 for details)
/*
#include "precompiled.h"
#include "ThreadDebugger.h"
@ -757,7 +759,7 @@ void CThreadDebugger::SaveStackFrameData(STACK_INFO stackInfo, uint nestingLevel
}
}
}
*/
/*
* TODO: This is very hacky and ugly and should be improved.
@ -772,6 +774,7 @@ void CThreadDebugger::SaveStackFrameData(STACK_INFO stackInfo, uint nestingLevel
* the rest of the game and because this part of code should be replaced anyway in the future.
*/
/*
namespace CyclicRefWorkaround
{
std::set<JSObject*> g_ProcessedObjects;
@ -933,4 +936,4 @@ uint CThreadDebugger::GetID()
CScopeLock lock(m->m_Mutex);
return m->m_ID;
}
*/