Skip to content

Commit

Permalink
Allow multiple high level representations for display
Browse files Browse the repository at this point in the history
  • Loading branch information
D0ntPanic committed Oct 21, 2024
1 parent 885e23c commit 7435528
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
3 changes: 2 additions & 1 deletion ui/codedatarenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ bool CodeDataRenderer::IsValidForData(


std::vector<DisassemblyTextLine> CodeDataRenderer::GetLinesForData(BinaryView* data, uint64_t addr, Type* type,
const std::vector<InstructionTextToken>& prefix, size_t width, std::vector<std::pair<Type*, size_t>>& context)
const std::vector<InstructionTextToken>& prefix, size_t width, std::vector<std::pair<Type*, size_t>>& context,
const std::string&)
{
std::vector<DisassemblyTextLine> result;
DisassemblyTextLine contents;
Expand Down
2 changes: 1 addition & 1 deletion ui/codedatarenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ class CodeDataRenderer : public BinaryNinja::DataRenderer
std::vector<std::pair<BinaryNinja::Type*, size_t>>& context) override;
virtual std::vector<BinaryNinja::DisassemblyTextLine> GetLinesForData(BinaryNinja::BinaryView* data, uint64_t addr,
BinaryNinja::Type* type, const std::vector<BinaryNinja::InstructionTextToken>& prefix, size_t width,
std::vector<std::pair<BinaryNinja::Type*, size_t>>& context) override;
std::vector<std::pair<BinaryNinja::Type*, size_t>>& context, const std::string& language) override;
};
8 changes: 4 additions & 4 deletions ui/controlswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion ui/debuggerinfowidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ vector<DebuggerInfoEntry> DebuggerInfoTable::getILInfoEntries(const ViewLocation
if (!m_debugger->IsConnected())
return result;

switch (location.getILViewType())
switch (location.getILViewType().type)
{
case NormalFunctionGraph:
{
Expand Down Expand Up @@ -608,6 +608,7 @@ vector<DebuggerInfoEntry> DebuggerInfoTable::getILInfoEntries(const ViewLocation
break;
}
case HighLevelILFunctionGraph:
case HighLevelLanguageRepresentationFunctionGraph:
{
auto func = location.getFunction();
if (!func)
Expand Down
8 changes: 4 additions & 4 deletions ui/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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));
Expand All @@ -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));
Expand All @@ -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));
Expand Down

0 comments on commit 7435528

Please sign in to comment.