| 4019 | } |
| 4020 | |
| 4021 | void ShaderViewer::updateDebugState() |
| 4022 | { |
| 4023 | if(!m_Trace || m_States.empty()) |
| 4024 | return; |
| 4025 | |
| 4026 | if(ui->debugToggle->isEnabled()) |
| 4027 | { |
| 4028 | if(isSourceDebugging()) |
| 4029 | ui->debugToggle->setText(tr("Debug in Assembly")); |
| 4030 | else |
| 4031 | ui->debugToggle->setText(tr("Debug in Source")); |
| 4032 | } |
| 4033 | |
| 4034 | const ShaderDebugState &state = GetCurrentState(); |
| 4035 | |
| 4036 | const bool done = IsLastState(); |
| 4037 | |
| 4038 | // add current instruction marker |
| 4039 | m_DisassemblyView->markerDeleteAll(CURRENT_MARKER); |
| 4040 | m_DisassemblyView->markerDeleteAll(CURRENT_MARKER + 1); |
| 4041 | m_DisassemblyView->markerDeleteAll(FINISHED_MARKER); |
| 4042 | m_DisassemblyView->markerDeleteAll(FINISHED_MARKER + 1); |
| 4043 | |
| 4044 | if(m_CurInstructionScintilla) |
| 4045 | { |
| 4046 | m_CurInstructionScintilla->markerDeleteAll(CURRENT_MARKER); |
| 4047 | m_CurInstructionScintilla->markerDeleteAll(CURRENT_MARKER + 1); |
| 4048 | m_CurInstructionScintilla->markerDeleteAll(FINISHED_MARKER); |
| 4049 | m_CurInstructionScintilla->markerDeleteAll(FINISHED_MARKER + 1); |
| 4050 | |
| 4051 | m_CurInstructionScintilla->indicatorClearRange(0, m_CurInstructionScintilla->length()); |
| 4052 | |
| 4053 | m_CurInstructionScintilla = NULL; |
| 4054 | } |
| 4055 | |
| 4056 | ui->callstack->clear(); |
| 4057 | |
| 4058 | for(const rdcstr &s : state.callstack) |
| 4059 | ui->callstack->insertItem(0, s); |
| 4060 | |
| 4061 | { |
| 4062 | LineColumnInfo lineInfo = GetInstInfo(state.nextInstruction).lineInfo; |
| 4063 | |
| 4064 | // highlight the current line |
| 4065 | { |
| 4066 | m_DisassemblyView->markerAdd(lineInfo.disassemblyLine - 1, |
| 4067 | done ? FINISHED_MARKER : CURRENT_MARKER); |
| 4068 | m_DisassemblyView->markerAdd(lineInfo.disassemblyLine - 1, |
| 4069 | done ? FINISHED_MARKER + 1 : CURRENT_MARKER + 1); |
| 4070 | |
| 4071 | int pos = m_DisassemblyView->positionFromLine(lineInfo.disassemblyLine - 1); |
| 4072 | m_DisassemblyView->setSelection(pos, pos); |
| 4073 | |
| 4074 | ensureLineScrolled(m_DisassemblyView, lineInfo.disassemblyLine - 1); |
| 4075 | } |
| 4076 | |
| 4077 | if(IsLastState() && (lineInfo.fileIndex < 0 || lineInfo.fileIndex >= m_FileScintillas.count())) |
| 4078 | { |
nothing calls this directly
no test coverage detected