private void DebugServiceDataReady(object sender, SledDebugServiceEventArgs e) { var typeCode = (Scmp.LuaTypeCodes)e.Scmp.TypeCode; switch (typeCode) { case Scmp.LuaTypeCodes.LuaStateBegin: m_luaStatesCollection.ValidationBeginning(); break; case Scmp.LuaTypeCodes.LuaStateAdd: { var scmp = m_debugService.GetScmpBlob<Scmp.LuaStateAdd>(); var domNode = new DomNode(SledLuaSchema.SledLuaStateType.Type); var luaState = domNode.As<SledLuaStateType>(); luaState.Address = scmp.Address; luaState.Name = scmp.Name; luaState.Checked = scmp.Debugging == 1; m_luaStatesCollection.LuaStates.Add(luaState); } break; case Scmp.LuaTypeCodes.LuaStateRemove: { var scmp = m_debugService.GetScmpBlob<Scmp.LuaStateRemove>(); var sentinel = m_luaStatesCollection.LuaStates.FirstOrDefault( luaState => string.Compare(luaState.Address, scmp.Address, StringComparison.Ordinal) == 0); if (sentinel != null) m_luaStatesCollection.LuaStates.Remove(sentinel); } break; case Scmp.LuaTypeCodes.LuaStateEnd: m_luaStatesCollection.ValidationEnding(); break; } }
private void DebugServiceDataReady(object sender, SledDebugServiceEventArgs e) { if (e.Scmp.TypeCode != (UInt16)TypeCodes.ScriptCache) return; var scriptCache = m_debugService.GetScmpBlob<ScriptCache>(); var szAbsFilePath = SledUtil.GetAbsolutePath(scriptCache.RelScriptPath, m_projectService.AssetDirectory); if (!File.Exists(szAbsFilePath)) { SledOutDevice.OutLine( SledMessageType.Error, SledUtil.TransSub(Localization.SledRemoteTargetErrorScriptCacheFileNotExist, scriptCache.RelScriptPath, szAbsFilePath)); } else { SledProjectFilesFileType file; m_projectService.AddFile(szAbsFilePath, out file); } }
private void DebugServiceDataReady(object sender, SledDebugServiceEventArgs e) { var typeCode = (Scmp.LuaTypeCodes)e.Scmp.TypeCode; switch (typeCode) { case Scmp.LuaTypeCodes.LuaLimits: { var scmp = m_debugService.GetScmpBlob<Scmp.LuaLimits>(); m_iMaxBreakpoints = scmp.MaxBreakpoints; SledOutDevice.OutLine( SledMessageType.Info, SledUtil.TransSub( "[%s0] Maximum breakpoints set to %s1 on the target.", m_luaLanguagePlugin.LanguageName, m_iMaxBreakpoints)); } break; } }
private void DebugServiceError(object sender, SledDebugServiceEventArgs e) { SledOutDevice.OutLine(SledMessageType.Info, "DebugService.Error"); }
private void DebugServicePluginsReady(object sender, SledDebugServiceEventArgs e) { SledOutDevice.OutLine(SledMessageType.Info, "DebugService.PluginsReady"); }
private void DebugServiceDataReady(object sender, SledDebugServiceEventArgs e) { var typeCode = (TypeCodes)e.Scmp.TypeCode; switch (typeCode) { case TypeCodes.TtyBegin: HandleTtyBegin(); break; case TypeCodes.Tty: HandleTty(); break; case TypeCodes.TtyEnd: HandleTtyEnd(); break; } }
private void DebugServiceDisconnected(object sender, SledDebugServiceEventArgs e) { ColorBreakpoints(false); }
private void DebugServiceDisconnected(object sender, SledDebugServiceEventArgs e) { RemoveCurrentStatementIndicators(); MarkProjectDocsReadOnly(false); }
private void DebugServiceDisconnected(object sender, SledDebugServiceEventArgs e) { StopHeartbeat(); }
private void DebugServiceDataReady(object sender, SledDebugServiceEventArgs e) { UpdateHeartbeat(); }
private void DebugServiceReady(object sender, SledDebugServiceEventArgs e) { StartHeartbeat(); }
private void DebugServiceDisconnected(object sender, SledDebugServiceEventArgs e) { if (m_bMemoryTracerRunning) ToggleMemoryTracer(); m_bMemoryTracerEnabled = false; }
private void DebugServiceDataReady(object sender, SledDebugServiceEventArgs e) { var typeCode = (Scmp.LuaTypeCodes)e.Scmp.TypeCode; switch (typeCode) { //case Scmp.LuaTypeCodes.LuaMemoryTraceBegin: // break; case Scmp.LuaTypeCodes.LuaMemoryTrace: { var scmp = m_debugService.GetScmpBlob<Scmp.LuaMemoryTrace>(); var chWhat = (char)scmp.What; RemoteTargetMemoryTraceStreamAdd( Create( chWhat, scmp.OldSize, scmp.NewSize, scmp.OldPtr, scmp.NewPtr)); } break; //case Scmp.LuaTypeCodes.LuaMemoryTraceEnd: // break; //case Scmp.LuaTypeCodes.LuaMemoryTraceStreamBegin: // break; case Scmp.LuaTypeCodes.LuaMemoryTraceStream: { var scmp = m_debugService.GetScmpBlob<Scmp.LuaMemoryTraceStream>(); var chWhat = (char)scmp.What; RemoteTargetMemoryTraceStreamAdd( Create( chWhat, scmp.OldSize, scmp.NewSize, scmp.OldPtr, scmp.NewPtr)); } break; //case Scmp.LuaTypeCodes.LuaMemoryTraceStreamEnd: // break; case Scmp.LuaTypeCodes.LuaLimits: { var scmp = m_debugService.GetScmpBlob<Scmp.LuaLimits>(); m_bMemoryTracerEnabled = scmp.MemoryTracerEnabled; if (!m_bMemoryTracerEnabled) { SledOutDevice.OutLine( SledMessageType.Info, "[Lua] Memory tracer is disabled due to target settings."); } } break; } }
private void DebugServiceDisconnected(object sender, SledDebugServiceEventArgs e) { InputEnabled = false; }
private void DebugServiceDataReady(object sender, SledDebugServiceEventArgs e) { // Gets too spammy with this one //SledOutDevice.OutLine(SledMessageType.Info, "DebugService.DataReady"); }
private void DebugServiceDebugConnect(object sender, SledDebugServiceEventArgs e) { SledOutDevice.OutLine(SledMessageType.Info, "DebugService.DebugConnect"); }
private void DebugServiceConnecting(object sender, SledDebugServiceEventArgs e) { StartTimer(); }
private void DebugServiceDebugConnect(object sender, SledDebugServiceEventArgs e) { SaveOpenDocuments(); MarkProjectDocsReadOnly(true); }
private void DebugServiceDisconnected(object sender, SledDebugServiceEventArgs e) { StopTimer(); }
private void DebugServiceConnected(object sender, SledDebugServiceEventArgs e) { CreateLuaStatesCollection(); }
private void DebugService_PluginsReady(object sender, SledDebugServiceEventArgs e) { var dictBreakpoints = new Dictionary<ISledLanguagePlugin, List<SledProjectFilesBreakpointType>>(); // Gather all breakpoints foreach (var projFile in m_projectService.AllFiles) { if (projFile.LanguagePlugin == null) continue; // Add breakpoints under appropriate language plugin if (dictBreakpoints.ContainsKey(projFile.LanguagePlugin)) { // Add to existing dictBreakpoints[projFile.LanguagePlugin].AddRange(projFile.Breakpoints); } else { // Add to new dictBreakpoints.Add( projFile.LanguagePlugin, new List<SledProjectFilesBreakpointType>(projFile.Breakpoints)); } } var plugins = SledServiceInstance.GetAll<ISledBreakpointPlugin>(); // Figure out if any breakpoints need to be removed due to hard limits in plugins foreach (var plugin in plugins) { // Iterate through checking with each language plugin foreach (var kv in dictBreakpoints) { if (plugin != kv.Key) continue; // Get maximum number of breakpoints for this plugin int maxBreakpoints; if (plugin.TryGetMax(out maxBreakpoints)) { // If over maximum number of breakpoints remove // until equal to maximum number of breakpoints if (kv.Value.Count > maxBreakpoints) { while (kv.Value.Count > maxBreakpoints) { if (kv.Value.Count <= 0) break; // Arbitrarily removing breakpoint from the end of the list var pos = kv.Value.Count - 1; var bp = kv.Value[pos]; try { // Remove breakpoint from file m_bRemoving = true; bp.File.Breakpoints.Remove(bp); } finally { m_bRemoving = false; } // Remove breakpoint from list kv.Value.RemoveAt(pos); } } } } } // Send breakpoints foreach (var kv in dictBreakpoints) { var enabledBps = kv.Value.Where(bp => bp.Enabled); foreach (var bp in enabledBps) SendBreakpoint(bp); } }
private void DebugServiceDisconnected(object sender, SledDebugServiceEventArgs e) { DestroyLuaStatesCollection(); }
private void DebugServiceConnected(object sender, SledDebugServiceEventArgs e) { SendNetVarFilterState(); }