summaryrefslogtreecommitdiff
path: root/DevTools/HackStudio/Debugger
diff options
context:
space:
mode:
Diffstat (limited to 'DevTools/HackStudio/Debugger')
-rw-r--r--DevTools/HackStudio/Debugger/BacktraceModel.cpp7
-rw-r--r--DevTools/HackStudio/Debugger/BacktraceModel.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/DevTools/HackStudio/Debugger/BacktraceModel.cpp b/DevTools/HackStudio/Debugger/BacktraceModel.cpp
index 1e1c86c6a0..8cbd82627c 100644
--- a/DevTools/HackStudio/Debugger/BacktraceModel.cpp
+++ b/DevTools/HackStudio/Debugger/BacktraceModel.cpp
@@ -41,6 +41,13 @@ GUI::Variant BacktraceModel::data(const GUI::ModelIndex& index, Role role) const
return {};
}
+GUI::ModelIndex BacktraceModel::index(int row, int column, const GUI::ModelIndex&) const
+{
+ if (row < 0 || row >= static_cast<int>(m_frames.size()))
+ return {};
+ return create_index(row, column, &m_frames.at(row));
+}
+
Vector<BacktraceModel::FrameInfo> BacktraceModel::create_backtrace(const DebugSession& debug_session, const PtraceRegisters& regs)
{
u32 current_ebp = regs.ebp;
diff --git a/DevTools/HackStudio/Debugger/BacktraceModel.h b/DevTools/HackStudio/Debugger/BacktraceModel.h
index bc54c758d3..e55bfd0bc1 100644
--- a/DevTools/HackStudio/Debugger/BacktraceModel.h
+++ b/DevTools/HackStudio/Debugger/BacktraceModel.h
@@ -47,7 +47,7 @@ public:
virtual GUI::Variant data(const GUI::ModelIndex& index, Role role = Role::Display) const override;
virtual void update() override {}
- virtual GUI::ModelIndex index(int row, int column = 0, const GUI::ModelIndex& = GUI::ModelIndex()) const override { return create_index(row, column, &m_frames.at(row)); }
+ virtual GUI::ModelIndex index(int row, int column, const GUI::ModelIndex&) const override;
struct FrameInfo {
String function_name;