summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2021-09-03 16:19:50 -0400
committerGlenn Smith <glenn@vector35.com>2021-09-23 15:55:57 -0400
commitf180f28fe96e7b5e069b56f0973faad64465fc75 (patch)
tree0bd26e8dc32cf3043409c00825904801d07fc84c
parent6bda03a2086e86d93be3d787d567990bcfd37865 (diff)
Cleanup tag list and tag rendering
-rw-r--r--python/binaryview.py2
-rw-r--r--suite/testcommon.py9
-rw-r--r--ui/render.h1
-rw-r--r--ui/tagtypelist.h1
4 files changed, 12 insertions, 1 deletions
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 "<tag {self.type.icon} {self.type.name}: {self.data}>"
+ return f"<tag {self.type.icon} {self.type.name}: {self.data}>"
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;