summaryrefslogtreecommitdiff
path: root/python/binaryview.py
diff options
context:
space:
mode:
authorXusheng <xusheng@vector35.com>2021-09-28 14:19:23 +0800
committerXusheng <xusheng@vector35.com>2022-04-29 11:21:47 +0800
commit87a8a04db5c0a80c06819ec6caf1568b7202cf51 (patch)
tree8850056e2ade5dd60262b20a76e035658136b965 /python/binaryview.py
parentdbb5c9d47b3db0a478aab57b9ef43d0dd3f6d4b5 (diff)
Check in the debugger
Diffstat (limited to 'python/binaryview.py')
-rw-r--r--python/binaryview.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index 625a22a4..cdda228f 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -900,7 +900,7 @@ class BinaryViewType(metaclass=_BinaryViewTypeMetaclass):
if available.name == "Universal":
universal_bvt = available
continue
- if bvt is None and available.name != "Raw":
+ if bvt is None and available.name not in ["Raw", "Debugger"]:
bvt = available
if bvt is None:
@@ -1935,6 +1935,7 @@ class BinaryView:
cls._registered_cb.create = cls._registered_cb.create.__class__(cls._create)
cls._registered_cb.parse = cls._registered_cb.parse.__class__(cls._parse)
cls._registered_cb.isValidForData = cls._registered_cb.isValidForData.__class__(cls._is_valid_for_data)
+ cls._registered_cb.isDeprecated = cls._registered_cb.isDeprecated.__class__(cls._is_deprecated)
cls._registered_cb.getLoadSettingsForData = cls._registered_cb.getLoadSettingsForData.__class__(
cls._get_load_settings_for_data
)
@@ -1991,6 +1992,19 @@ class BinaryView:
return False
@classmethod
+ def _is_deprecated(cls, ctxt):
+ # Since the is_deprecated() method is newly added, existing code may not have it at all
+ # So here we do not consider it as an error
+ if not callable(getattr(cls, 'is_deprecated', None)):
+ return False
+
+ try:
+ return cls.is_deprecated() # type: ignore
+ except:
+ log_error(traceback.format_exc())
+ return False
+
+ @classmethod
def _get_load_settings_for_data(cls, ctxt, data):
try:
attr = getattr(cls, "get_load_settings_for_data", None)