From 74355283078e6b7b4e4ebe50e4f2130b4580e4a8 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Thu, 22 Aug 2024 12:56:02 -0600 Subject: [PATCH] Allow multiple high level representations for display --- ui/codedatarenderer.cpp | 3 ++- ui/codedatarenderer.h | 2 +- ui/controlswidget.cpp | 8 ++++---- ui/debuggerinfowidget.cpp | 3 ++- ui/ui.cpp | 8 ++++---- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/ui/codedatarenderer.cpp b/ui/codedatarenderer.cpp index 251d245..310fd8c 100644 --- a/ui/codedatarenderer.cpp +++ b/ui/codedatarenderer.cpp @@ -37,7 +37,8 @@ bool CodeDataRenderer::IsValidForData( std::vector CodeDataRenderer::GetLinesForData(BinaryView* data, uint64_t addr, Type* type, - const std::vector& prefix, size_t width, std::vector>& context) + const std::vector& prefix, size_t width, std::vector>& context, + const std::string&) { std::vector result; DisassemblyTextLine contents; diff --git a/ui/codedatarenderer.h b/ui/codedatarenderer.h index 067e266..201ddb8 100644 --- a/ui/codedatarenderer.h +++ b/ui/codedatarenderer.h @@ -26,5 +26,5 @@ class CodeDataRenderer : public BinaryNinja::DataRenderer std::vector>& context) override; virtual std::vector GetLinesForData(BinaryNinja::BinaryView* data, uint64_t addr, BinaryNinja::Type* type, const std::vector& prefix, size_t width, - std::vector>& context) override; + std::vector>& context, const std::string& language) override; }; \ No newline at end of file diff --git a/ui/controlswidget.cpp b/ui/controlswidget.cpp index 27f3be7..3da78f6 100644 --- a/ui/controlswidget.cpp +++ b/ui/controlswidget.cpp @@ -306,7 +306,7 @@ void DebugControlsWidget::performStepInto() BNFunctionGraphType graphType = NormalFunctionGraph; UIContext* context = UIContext::contextForWidget(this); if (context && context->getCurrentView()) - graphType = context->getCurrentView()->getILViewType(); + graphType = context->getCurrentView()->getILViewType().type; if (graphType == InvalidILViewType) graphType = NormalFunctionGraph; @@ -320,7 +320,7 @@ void DebugControlsWidget::performStepIntoReverse() BNFunctionGraphType graphType = NormalFunctionGraph; UIContext* context = UIContext::contextForWidget(this); if (context && context->getCurrentView()) - graphType = context->getCurrentView()->getILViewType(); + graphType = context->getCurrentView()->getILViewType().type; if (graphType == InvalidILViewType) graphType = NormalFunctionGraph; @@ -333,7 +333,7 @@ void DebugControlsWidget::performStepOver() BNFunctionGraphType graphType = NormalFunctionGraph; UIContext* context = UIContext::contextForWidget(this); if (context && context->getCurrentView()) - graphType = context->getCurrentView()->getILViewType(); + graphType = context->getCurrentView()->getILViewType().type; if (graphType == InvalidILViewType) graphType = NormalFunctionGraph; @@ -347,7 +347,7 @@ void DebugControlsWidget::performStepOverReverse() BNFunctionGraphType graphType = NormalFunctionGraph; UIContext* context = UIContext::contextForWidget(this); if (context && context->getCurrentView()) - graphType = context->getCurrentView()->getILViewType(); + graphType = context->getCurrentView()->getILViewType().type; if (graphType == InvalidILViewType) graphType = NormalFunctionGraph; diff --git a/ui/debuggerinfowidget.cpp b/ui/debuggerinfowidget.cpp index 2c7e3c4..70f0103 100644 --- a/ui/debuggerinfowidget.cpp +++ b/ui/debuggerinfowidget.cpp @@ -557,7 +557,7 @@ vector DebuggerInfoTable::getILInfoEntries(const ViewLocation if (!m_debugger->IsConnected()) return result; - switch (location.getILViewType()) + switch (location.getILViewType().type) { case NormalFunctionGraph: { @@ -608,6 +608,7 @@ vector DebuggerInfoTable::getILInfoEntries(const ViewLocation break; } case HighLevelILFunctionGraph: + case HighLevelLanguageRepresentationFunctionGraph: { auto func = location.getFunction(); if (!func) diff --git a/ui/ui.cpp b/ui/ui.cpp index c6ea92f..411910f 100644 --- a/ui/ui.cpp +++ b/ui/ui.cpp @@ -429,7 +429,7 @@ void GlobalDebuggerUI::SetupMenu(UIContext* context) BNFunctionGraphType graphType = NormalFunctionGraph; if (ctxt.context && ctxt.context->getCurrentView()) - graphType = ctxt.context->getCurrentView()->getILViewType(); + graphType = ctxt.context->getCurrentView()->getILViewType().type; controller->StepInto(graphType); }, connectedAndStopped)); @@ -447,7 +447,7 @@ void GlobalDebuggerUI::SetupMenu(UIContext* context) BNFunctionGraphType graphType = NormalFunctionGraph; if (ctxt.context && ctxt.context->getCurrentView()) - graphType = ctxt.context->getCurrentView()->getILViewType(); + graphType = ctxt.context->getCurrentView()->getILViewType().type; controller->StepIntoReverse(graphType); }, connectedAndStoppedWithTTD)); @@ -464,7 +464,7 @@ void GlobalDebuggerUI::SetupMenu(UIContext* context) BNFunctionGraphType graphType = NormalFunctionGraph; if (ctxt.context && ctxt.context->getCurrentView()) - graphType = ctxt.context->getCurrentView()->getILViewType(); + graphType = ctxt.context->getCurrentView()->getILViewType().type; controller->StepOver(graphType); }, connectedAndStopped)); @@ -482,7 +482,7 @@ void GlobalDebuggerUI::SetupMenu(UIContext* context) BNFunctionGraphType graphType = NormalFunctionGraph; if (ctxt.context && ctxt.context->getCurrentView()) - graphType = ctxt.context->getCurrentView()->getILViewType(); + graphType = ctxt.context->getCurrentView()->getILViewType().type; controller->StepOverReverse(graphType); }, connectedAndStoppedWithTTD));