mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:08:12 +00:00
HackStudio: Add icons for "step in" and "step out"
This commit is contained in:
parent
ebab512c03
commit
cb432ffe8c
6 changed files with 21 additions and 20 deletions
|
@ -56,11 +56,19 @@ void DebugInfoWidget::init_toolbar()
|
|||
pthread_cond_signal(Debugger::the().continue_cond());
|
||||
pthread_mutex_unlock(Debugger::the().continue_mutex());
|
||||
});
|
||||
m_continue_action->set_enabled(false);
|
||||
m_singlestep_action->set_enabled(false);
|
||||
|
||||
m_step_in_action = GUI::Action::create("Step In", Gfx::Bitmap::load_from_file("/res/icons/16x16/debug-step-in.png"), [&](auto&) {
|
||||
});
|
||||
|
||||
m_step_out_action = GUI::Action::create("Step Out", Gfx::Bitmap::load_from_file("/res/icons/16x16/debug-step-out.png"), [&](auto&) {
|
||||
});
|
||||
|
||||
m_toolbar->add_action(*m_continue_action);
|
||||
m_toolbar->add_action(*m_singlestep_action);
|
||||
m_toolbar->add_action(*m_step_in_action);
|
||||
m_toolbar->add_action(*m_step_out_action);
|
||||
|
||||
set_debug_actions_enabled(false);
|
||||
}
|
||||
|
||||
DebugInfoWidget::DebugInfoWidget()
|
||||
|
@ -140,16 +148,11 @@ void DebugInfoWidget::program_stopped()
|
|||
m_variables_view->set_model({});
|
||||
}
|
||||
|
||||
GUI::Action& DebugInfoWidget::continue_action()
|
||||
void DebugInfoWidget::set_debug_actions_enabled(bool enabled)
|
||||
{
|
||||
ASSERT(m_continue_action);
|
||||
return *m_continue_action;
|
||||
m_continue_action->set_enabled(enabled);
|
||||
m_singlestep_action->set_enabled(enabled);
|
||||
m_step_in_action->set_enabled(enabled);
|
||||
m_step_out_action->set_enabled(enabled);
|
||||
}
|
||||
|
||||
GUI::Action& DebugInfoWidget::singlestep_action()
|
||||
{
|
||||
ASSERT(m_singlestep_action);
|
||||
return *m_singlestep_action;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -45,9 +45,7 @@ public:
|
|||
|
||||
void update_state(const DebugSession&, const PtraceRegisters&);
|
||||
void program_stopped();
|
||||
|
||||
GUI::Action& continue_action();
|
||||
GUI::Action& singlestep_action();
|
||||
void set_debug_actions_enabled(bool enabled);
|
||||
|
||||
private:
|
||||
explicit DebugInfoWidget();
|
||||
|
@ -59,6 +57,8 @@ private:
|
|||
RefPtr<GUI::ToolBar> m_toolbar;
|
||||
RefPtr<GUI::Action> m_continue_action;
|
||||
RefPtr<GUI::Action> m_singlestep_action;
|
||||
RefPtr<GUI::Action> m_step_in_action;
|
||||
RefPtr<GUI::Action> m_step_out_action;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ void Debugger::on_breakpoint_change(const String& file, size_t line, BreakpointC
|
|||
auto address = session->debug_info().get_instruction_from_source(position.file_path, position.line_number);
|
||||
if (!address.has_value()) {
|
||||
dbg() << "Warning: couldn't get instruction address from source";
|
||||
// TODO: Currently, the GUI will indicate that a breakpoint was inserted/remove at this line,
|
||||
// TODO: Currently, the GUI will indicate that a breakpoint was inserted/removed at this line,
|
||||
// regardless of whether we actually succeeded to insert it. (For example a breakpoint on a comment, or an include statemanet).
|
||||
// We should indicate failure via a return value from this function, and not update the breakpoint GUI if we fail.
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue