1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +00:00

HackStudio: Move everything into the HackStudio namespace

This commit is contained in:
Andreas Kling 2020-08-17 15:22:30 +02:00
parent ce48de9845
commit c0462c65cf
40 changed files with 184 additions and 18 deletions

View file

@ -27,6 +27,8 @@
#include "BacktraceModel.h"
#include "Debugger.h"
namespace HackStudio {
NonnullRefPtr<BacktraceModel> BacktraceModel::create(const DebugSession& debug_session, const PtraceRegisters& regs)
{
return adopt(*new BacktraceModel(create_backtrace(debug_session, regs)));
@ -66,3 +68,5 @@ Vector<BacktraceModel::FrameInfo> BacktraceModel::create_backtrace(const DebugSe
} while (current_ebp && current_instruction);
return frames;
}
}

View file

@ -33,6 +33,8 @@
class DebugSession;
namespace HackStudio {
class BacktraceModel final : public GUI::Model {
public:
static NonnullRefPtr<BacktraceModel> create(const DebugSession&, const PtraceRegisters& regs);
@ -47,7 +49,7 @@ public:
virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override;
virtual void update() override {}
virtual void update() override { }
virtual GUI::ModelIndex index(int row, int column, const GUI::ModelIndex&) const override;
struct FrameInfo {
@ -68,3 +70,5 @@ private:
Vector<FrameInfo> m_frames;
};
}

View file

@ -30,9 +30,13 @@
#include <AK/String.h>
#include <AK/Types.h>
namespace HackStudio {
enum class BreakpointChange {
Added,
Removed,
};
typedef Function<void(const String& file, size_t line, BreakpointChange)> BreakpointChangeCallback;
}

View file

@ -38,6 +38,8 @@
#include <LibGUI/Splitter.h>
#include <LibGUI/TreeView.h>
namespace HackStudio {
DebugInfoWidget::DebugInfoWidget()
{
set_layout<GUI::HorizontalBoxLayout>();
@ -108,3 +110,5 @@ void DebugInfoWidget::program_stopped()
{
m_variables_view->set_model({});
}
}

View file

@ -27,16 +27,18 @@
#pragma once
#include "Debugger.h"
#include "LibGUI/ListView.h"
#include <AK/NonnullOwnPtr.h>
#include <LibGUI/ListView.h>
#include <LibGUI/Model.h>
#include <LibGUI/Widget.h>
#include <sys/arch/i386/regs.h>
namespace HackStudio {
class DebugInfoWidget final : public GUI::Widget {
C_OBJECT(DebugInfoWidget)
public:
virtual ~DebugInfoWidget() override {}
virtual ~DebugInfoWidget() override { }
void update_state(const DebugSession&, const PtraceRegisters&);
void program_stopped();
@ -48,3 +50,5 @@ private:
RefPtr<GUI::ListView> m_backtrace_view;
RefPtr<GUI::Menu> m_variable_context_menu;
};
}

View file

@ -26,6 +26,8 @@
#include "Debugger.h"
namespace HackStudio {
static Debugger* s_the;
Debugger& Debugger::the()
@ -183,8 +185,11 @@ void Debugger::DebuggingState::set_single_stepping(DebugInfo::SourcePosition ori
m_state = State::SingleStepping;
m_original_source_position = original_source_position;
}
bool Debugger::DebuggingState::should_stop_single_stepping(const DebugInfo::SourcePosition& current_source_position) const
{
ASSERT(m_state == State::SingleStepping);
return m_original_source_position.value() != current_source_position;
}
}

View file

@ -33,6 +33,8 @@
#include <LibThread/Lock.h>
#include <LibThread/Thread.h>
namespace HackStudio {
class Debugger {
public:
static Debugger& the();
@ -110,3 +112,5 @@ private:
ContinueType m_continue_type { ContinueType::Continue };
};
}

View file

@ -28,6 +28,8 @@
#include <LibGUI/Application.h>
#include <LibGUI/MessageBox.h>
namespace HackStudio {
GUI::ModelIndex VariablesModel::index(int row, int column, const GUI::ModelIndex& parent_index) const
{
if (!parent_index.is_valid())
@ -184,3 +186,5 @@ RefPtr<VariablesModel> VariablesModel::create(const PtraceRegisters& regs)
auto variables = Debugger::the().session()->debug_info().get_variables_in_current_scope(regs);
return adopt(*new VariablesModel(move(variables), regs));
}
}

View file

@ -32,6 +32,8 @@
#include <LibGUI/TreeView.h>
#include <sys/arch/i386/regs.h>
namespace HackStudio {
class VariablesModel final : public GUI::Model {
public:
static RefPtr<VariablesModel> create(const PtraceRegisters& regs);
@ -57,3 +59,5 @@ private:
GUI::Icon m_variable_icon;
};
}