diff options
author | Itamar <itamar8910@gmail.com> | 2021-11-19 16:13:07 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-11-20 21:22:24 +0000 |
commit | 94d68583fb6daa25ad7d912f487e006e5f161718 (patch) | |
tree | 775106fc842e814f6ce82ab3e2e00894c5ea896d /Userland/DevTools/HackStudio/Debugger/BacktraceModel.cpp | |
parent | 7950f5cb51549dc304e51616597b96dc4c273b51 (diff) | |
download | serenity-94d68583fb6daa25ad7d912f487e006e5f161718.zip |
HackStudio: Use ProcessInspector instead of DebugSession where possible
Diffstat (limited to 'Userland/DevTools/HackStudio/Debugger/BacktraceModel.cpp')
-rw-r--r-- | Userland/DevTools/HackStudio/Debugger/BacktraceModel.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/DevTools/HackStudio/Debugger/BacktraceModel.cpp b/Userland/DevTools/HackStudio/Debugger/BacktraceModel.cpp index 6191a81fa4..0440fc028e 100644 --- a/Userland/DevTools/HackStudio/Debugger/BacktraceModel.cpp +++ b/Userland/DevTools/HackStudio/Debugger/BacktraceModel.cpp @@ -10,9 +10,9 @@ namespace HackStudio { -NonnullRefPtr<BacktraceModel> BacktraceModel::create(const Debug::DebugSession& debug_session, const PtraceRegisters& regs) +NonnullRefPtr<BacktraceModel> BacktraceModel::create(Debug::ProcessInspector const& inspector, const PtraceRegisters& regs) { - return adopt_ref(*new BacktraceModel(create_backtrace(debug_session, regs))); + return adopt_ref(*new BacktraceModel(create_backtrace(inspector, regs))); } GUI::Variant BacktraceModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const @@ -31,13 +31,13 @@ GUI::ModelIndex BacktraceModel::index(int row, int column, const GUI::ModelIndex return create_index(row, column, &m_frames.at(row)); } -Vector<BacktraceModel::FrameInfo> BacktraceModel::create_backtrace(const Debug::DebugSession& debug_session, const PtraceRegisters& regs) +Vector<BacktraceModel::FrameInfo> BacktraceModel::create_backtrace(Debug::ProcessInspector const& inspector, PtraceRegisters const& regs) { FlatPtr current_ebp = regs.bp(); FlatPtr current_instruction = regs.ip(); Vector<BacktraceModel::FrameInfo> frames; do { - auto lib = debug_session.library_at(regs.ip()); + auto lib = inspector.library_at(regs.ip()); if (!lib) continue; String name = lib->debug_info->name_of_containing_function(current_instruction - lib->base_address); @@ -47,7 +47,7 @@ Vector<BacktraceModel::FrameInfo> BacktraceModel::create_backtrace(const Debug:: } frames.append({ name, current_instruction, current_ebp }); - auto frame_info = Debug::StackFrameUtils::get_info(*Debugger::the().session(), current_ebp); + auto frame_info = Debug::StackFrameUtils::get_info(inspector, current_ebp); VERIFY(frame_info.has_value()); current_instruction = frame_info.value().return_address; current_ebp = frame_info.value().next_ebp; |