From 93f91f8d2f1fef1866b3ee87042ec62f99a8d087 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Mon, 31 May 2021 15:46:57 +0800 Subject: Add TypeReferenceChanged notification --- suite/testcommon.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'suite/testcommon.py') diff --git a/suite/testcommon.py b/suite/testcommon.py index 451ff7a4..6941f8b3 100644 --- a/suite/testcommon.py +++ b/suite/testcommon.py @@ -968,6 +968,9 @@ class TestBuilder(Builder): def type_undefined(self, view, name, type): results.append("type undefined: {0}".format(name)) + def type_ref_changed(self, view, name, type): + results.append("type reference changed: {0}".format(name)) + test = NotifyTest() bv.register_notification(test) sacrificial_addr = 0x84fc @@ -1001,6 +1004,12 @@ class TestBuilder(Builder): bv.remove(sacrificial_addr, 4) bv.update_analysis_and_wait() + type, _ = bv.parse_type_string("struct { uint64_t bar; }") + bv.define_user_type('foo', type) + func = bv.get_function_at(0x8440) + func.return_type = binja.Type.named_type_from_type('foo', type) + bv.update_analysis_and_wait() + bv.unregister_notification(test) return fixOutput(sorted(results)) -- cgit v1.3.1