| 648 | static ImGuiTextFilter local_filter; |
| 649 | static ImGuiTextFilter global_filter; |
| 650 | ASDebugger::BreakAction ASDebugger::UpdateGUI() { |
| 651 | BreakAction action = NONE; |
| 652 | |
| 653 | ImGui::SetNextWindowSize(ImVec2(1024.0f, 768.0f), ImGuiCond_FirstUseEver); |
| 654 | ImGui::Begin("Angelscript debugger", &show_performance); |
| 655 | |
| 656 | ImGui::Text("Currently executing %s", current_file.resolved); |
| 657 | |
| 658 | if (ImGui::Button("Continue")) { |
| 659 | action = CONTINUE; |
| 660 | } |
| 661 | ImGui::SameLine(); |
| 662 | if (ImGui::Button("Step over")) { |
| 663 | action = OVER; |
| 664 | } |
| 665 | ImGui::SameLine(); |
| 666 | if (ImGui::Button("Step into")) { |
| 667 | action = INTO; |
| 668 | } |
| 669 | ImGui::SameLine(); |
| 670 | if (ImGui::Button("Step out")) { |
| 671 | action = LEAVE; |
| 672 | } |
| 673 | |
| 674 | ImGui::Checkbox("Show local variables", &show_local_variables); |
| 675 | ImGui::SameLine(); |
| 676 | ImGui::Checkbox("Show global variables", &show_global_variables); |
| 677 | ImGui::SameLine(); |
| 678 | ImGui::Checkbox("Show stack trace", &show_stack_trace); |
| 679 | |
| 680 | const ScriptFile* script = ScriptFileUtil::GetScriptFile(current_file); |
| 681 | const char* file_name = script->file_path.GetFullPath(); |
| 682 | int last_slash = 0; |
| 683 | for (size_t i = 0; i < std::strlen(file_name); ++i) { |
| 684 | if (file_name[i] == '\\' || file_name[i] == '/') |
| 685 | last_slash = i; |
| 686 | } |
| 687 | file_name += last_slash + 1; |
| 688 | |
| 689 | const std::string& script_source = script->unexpanded_contents; |
| 690 | int start_index = 0; |
| 691 | int end_index = 0; |
| 692 | |
| 693 | ImGui::BeginChild("ASSourceMain", ImVec2(0, 0), false, 0); |
| 694 | ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.0f, 0.0f, 0.0f, 0.0f)); |
| 695 | ImGui::Columns(2); |
| 696 | |
| 697 | int line_nr = 1; |
| 698 | |
| 699 | const int MAX_LINE_LENGTH = 255; |
| 700 | char line[MAX_LINE_LENGTH + 1]; |
| 701 | |
| 702 | const std::vector<int>* breakpoints = GetBreakpoints(file_name); |
| 703 | |
| 704 | ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0.0f, 0.5f)); |
| 705 | ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0.0f, 0.0f)); |
| 706 | while (end_index != (int)script_source.size()) { |
| 707 | end_index = std::min(script_source.find('\n', start_index), script_source.size()); |
nothing calls this directly
no test coverage detected