From f180f28fe96e7b5e069b56f0973faad64465fc75 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Fri, 3 Sep 2021 16:19:50 -0400 Subject: Cleanup tag list and tag rendering --- python/binaryview.py | 2 +- suite/testcommon.py | 9 +++++++++ ui/render.h | 1 + ui/tagtypelist.h | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/python/binaryview.py b/python/binaryview.py index aaf9e413..28634f83 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -1203,7 +1203,7 @@ class Tag: core.BNFreeTag(self.handle) def __repr__(self): - return "" + return f"" def __eq__(self, other): if not isinstance(other, self.__class__): diff --git a/suite/testcommon.py b/suite/testcommon.py index 83407eb6..e952d4a8 100644 --- a/suite/testcommon.py +++ b/suite/testcommon.py @@ -395,6 +395,11 @@ class BinaryViewTestBuilder(Builder): for var in func.vars: funcinfo.append("Function {} var: ".format(func.name) + str(var)) + for (arch, addr, tag) in func.address_tags: + funcinfo.append("Function {} tag at ({}, {:x}): ".format(func.name, arch.name, addr) + str(tag)) + for tag in func.function_tags: + funcinfo.append("Function {} tag: ".format(func.name) + str(tag)) + for branch in func.indirect_branches: funcinfo.append("Function {} indirect branch: ".format(func.name) + str(branch)) funcinfo.append("Function {} session data: ".format(func.name) + str(func.session_data)) @@ -438,6 +443,10 @@ class BinaryViewTestBuilder(Builder): for allrange in self.bv.allocated_ranges: retinfo.append(f"BV allocated range: {allrange}") retinfo.append(f"Session Data: {self.bv.session_data}") + for (addr, tag) in self.bv.data_tags: + retinfo.append(f"BV tag: {addr:x} {repr(tag)}") + for tag_type in self.bv.tag_types: + retinfo.append(f"BV tag type: {repr(tag_type)}") for addr in sorted(self.bv.data_vars.keys()): retinfo.append(f"BV data var: {self.bv.data_vars[addr]}") retinfo.append(f"BV Entry function: {repr(self.bv.entry_function)}") diff --git a/ui/render.h b/ui/render.h index 5464f684..e23173bf 100644 --- a/ui/render.h +++ b/ui/render.h @@ -97,5 +97,6 @@ public: BinaryViewRef view, uint64_t lineStartAddr, size_t cols, size_t firstCol, size_t count, bool cursorVisible, bool cursorAscii, size_t cursorPos, bool byteCursor); QFont getFont() { return m_fontParams.getFont(); } + QFont getEmojiFont() { return m_fontParams.getEmojiFont(); } void setFont(const QFont& font); }; diff --git a/ui/tagtypelist.h b/ui/tagtypelist.h index 43267c21..d28dd5e8 100644 --- a/ui/tagtypelist.h +++ b/ui/tagtypelist.h @@ -53,6 +53,7 @@ class BINARYNINJAUIAPI TagTypeItemDelegate: public QItemDelegate Q_OBJECT QFont m_font; + QFont m_monospaceFont; QFont m_emojiFont; int m_baseline, m_charWidth, m_charHeight, m_charOffset; -- cgit v1.3.1