Skip to content

Commit

Permalink
Properly set default platform/arch for the debugger view
Browse files Browse the repository at this point in the history
  • Loading branch information
xusheng6 committed Apr 11, 2023
1 parent 8fad6b7 commit 20ead9f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions core/debuggercontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,13 @@ void DebuggerController::HandleInitialBreakpoint()
if (!liveView)
return;

// The bvt does not set the arch and platform for the created binary view. We must set them explicitly.
// TODO: in the future, when we add support for using the debugger without a base binary view (i.e., the m_data in
// this code), we will need to either read these info from the adapter backends, or make a UI to allow the user to
// inform us the values.
liveView->SetDefaultArchitecture(m_data->GetDefaultArchitecture());
liveView->SetDefaultPlatform(m_data->GetDefaultPlatform());

SetLiveView(liveView);
DetectLoadedModule();
NotifyStopped(DebugStopReason::InitialBreakpoint);
Expand Down
2 changes: 1 addition & 1 deletion core/debuggerstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ void DebuggerState::UpdateCaches()

bool DebuggerState::GetRemoteBase(uint64_t& address)
{
return m_modules->GetModuleBase(GetExecutablePath());
return m_modules->GetModuleBase(GetExecutablePath(), address);
}


Expand Down
2 changes: 1 addition & 1 deletion ui/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ void DebuggerUI::updateUI(const DebuggerEvent& event)
if (newFrame)
{
m_context->closeTab(m_context->getTabForFile(fileContext));
navigateDebugger(address);
navigateToCurrentIP();
QCoreApplication::processEvents();
}
}
Expand Down

0 comments on commit 20ead9f

Please sign in to comment.