Skip to content

Commit

Permalink
Fail the debugger view creation if the input view does not have an ar…
Browse files Browse the repository at this point in the history
…chitecture and platform
  • Loading branch information
xusheng6 committed Jan 12, 2024
1 parent 42d4237 commit f5118a7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/debuggercontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,10 +712,11 @@ bool DebuggerController::CreateDebuggerBinaryView()
if (!liveView)
return false;

// 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.
if (!m_data->GetDefaultArchitecture() || !m_data->GetDefaultPlatform())
{
LogWarn("Fail to create debugger view. The input view must have an architecture and platform");
return false;
}
liveView->SetDefaultArchitecture(m_data->GetDefaultArchitecture());
liveView->SetDefaultPlatform(m_data->GetDefaultPlatform());
SetLiveView(liveView);
Expand Down

0 comments on commit f5118a7

Please sign in to comment.