2020-04-24 17:48:25 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-04-24 17:48:25 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-05-08 07:32:55 -03:00
|
|
|
#include "Debugger.h"
|
|
|
|
|
#include <AK/NonnullOwnPtr.h>
|
2020-08-17 16:12:45 -03:00
|
|
|
#include <LibGUI/Action.h>
|
2020-08-17 10:22:30 -03:00
|
|
|
#include <LibGUI/ListView.h>
|
2020-09-19 11:25:05 -03:00
|
|
|
#include <LibGUI/Menu.h>
|
2020-05-08 07:32:55 -03:00
|
|
|
#include <LibGUI/Model.h>
|
2020-08-25 00:39:29 -03:00
|
|
|
#include <LibGUI/TableView.h>
|
2021-04-13 11:18:20 -03:00
|
|
|
#include <LibGUI/Toolbar.h>
|
|
|
|
|
#include <LibGUI/ToolbarContainer.h>
|
2020-09-19 11:25:05 -03:00
|
|
|
#include <LibGUI/TreeView.h>
|
2020-05-08 07:32:55 -03:00
|
|
|
#include <LibGUI/Widget.h>
|
|
|
|
|
#include <sys/arch/i386/regs.h>
|
|
|
|
|
|
2020-08-17 10:22:30 -03:00
|
|
|
namespace HackStudio {
|
|
|
|
|
|
2020-05-08 07:32:55 -03:00
|
|
|
class DebugInfoWidget final : public GUI::Widget {
|
|
|
|
|
C_OBJECT(DebugInfoWidget)
|
|
|
|
|
public:
|
2020-09-18 04:49:51 -03:00
|
|
|
virtual ~DebugInfoWidget() override { }
|
2020-05-08 07:32:55 -03:00
|
|
|
|
2021-11-19 11:13:07 -03:00
|
|
|
void update_state(Debug::ProcessInspector&, PtraceRegisters const&);
|
2020-05-08 07:32:55 -03:00
|
|
|
void program_stopped();
|
2020-08-21 05:51:32 -03:00
|
|
|
void set_debug_actions_enabled(bool enabled);
|
2020-08-17 16:12:45 -03:00
|
|
|
|
2021-11-19 11:13:07 -03:00
|
|
|
Function<void(Debug::DebugInfo::SourcePosition const&)> on_backtrace_frame_selection;
|
|
|
|
|
|
2020-05-08 07:32:55 -03:00
|
|
|
private:
|
|
|
|
|
explicit DebugInfoWidget();
|
2020-08-17 16:12:45 -03:00
|
|
|
void init_toolbar();
|
2020-05-08 07:32:55 -03:00
|
|
|
|
2020-08-25 00:39:29 -03:00
|
|
|
NonnullRefPtr<GUI::Widget> build_variables_tab();
|
|
|
|
|
NonnullRefPtr<GUI::Widget> build_registers_tab();
|
2022-04-01 14:58:27 -03:00
|
|
|
bool does_variable_support_writing(Debug::DebugInfo::VariableInfo const*);
|
2021-04-15 13:43:55 -03:00
|
|
|
RefPtr<GUI::Menu> get_context_menu_for_variable(const GUI::ModelIndex&);
|
2020-08-25 00:39:29 -03:00
|
|
|
|
2020-05-08 08:20:06 -03:00
|
|
|
RefPtr<GUI::TreeView> m_variables_view;
|
2020-08-25 00:39:29 -03:00
|
|
|
RefPtr<GUI::TableView> m_registers_view;
|
2020-05-08 08:20:06 -03:00
|
|
|
RefPtr<GUI::ListView> m_backtrace_view;
|
2020-05-30 15:19:49 -03:00
|
|
|
RefPtr<GUI::Menu> m_variable_context_menu;
|
2021-04-13 11:18:20 -03:00
|
|
|
RefPtr<GUI::Toolbar> m_toolbar;
|
2020-08-17 16:12:45 -03:00
|
|
|
RefPtr<GUI::Action> m_continue_action;
|
|
|
|
|
RefPtr<GUI::Action> m_singlestep_action;
|
2020-08-21 05:51:32 -03:00
|
|
|
RefPtr<GUI::Action> m_step_in_action;
|
|
|
|
|
RefPtr<GUI::Action> m_step_out_action;
|
2020-05-08 07:32:55 -03:00
|
|
|
};
|
2020-08-17 10:22:30 -03:00
|
|
|
|
|
|
|
|
}
|