// Hook called by the VM when a file is loaded. Gives the debugger a chance // to apply any pending breakpoints that might be in the file. void phpDebuggerFileLoadHook(Eval::PhpFile* efile) { Eval::DebuggerProxyPtr proxy = Eval::Debugger::GetProxy(); if (!proxy) { return; } addBreakPointsInFile(proxy.get(), efile); }
// Helper which will look at every loaded file and attempt to see if any // existing file:line breakpoints should be set. void phpSetBreakPointsInAllFiles(Eval::DebuggerProxy* proxy) { for (EvaledFilesMap::const_iterator it = g_vmContext->m_evaledFiles.begin(); it != g_vmContext->m_evaledFiles.end(); ++it) { addBreakPointsInFile(proxy, it->second); } std::vector<const StringData*> clsNames; proxy->getBreakClsMethods(clsNames); for (unsigned int i = 0; i < clsNames.size(); i++) { Class* cls = Unit::lookupClass(clsNames[i]); if (cls) { addBreakPointsClass(proxy, cls); } } std::vector<const StringData*> funcFullNames; proxy->getBreakFuncs(funcFullNames); for (unsigned int i = 0; i < funcFullNames.size(); i++) { // This list contains class method as well but they shouldn't hit anything Func* f = Unit::lookupFunc(funcFullNames[i]); if (f) { addBreakPointFuncEntry(f); } } }
// Called by the VM when a file is loaded. void phpDebuggerFileLoadHook(Unit* unit) { Eval::DebuggerProxyPtr proxy = Eval::Debugger::GetProxy(); if (proxy == nullptr) return; addBreakPointsInFile(proxy.get(), unit); }