From c22b035c3338284a1f136df55bfbbfdcb7d7ea58 Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Sat, 7 Dec 2024 03:09:19 +0200 Subject: [PATCH] lldb pretty print fix --- .../multiversx_sc_lldb_pretty_printers.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/rust-debugger/pretty-printers/multiversx_sc_lldb_pretty_printers.py b/tools/rust-debugger/pretty-printers/multiversx_sc_lldb_pretty_printers.py index 297c4c50be..6b397868cd 100644 --- a/tools/rust-debugger/pretty-printers/multiversx_sc_lldb_pretty_printers.py +++ b/tools/rust-debugger/pretty-printers/multiversx_sc_lldb_pretty_printers.py @@ -331,7 +331,7 @@ def value_summary(self, big_uint: lldb.value, context: lldb.value, type_info: ll class TokenIdentifier(PlainManagedVecItem, ManagedType): def lookup(self, token_identifier: lldb.value) -> lldb.value: - return token_identifier.buffer + return token_identifier.data.buffer def value_summary(self, buffer: lldb.value, context: lldb.value, type_info: lldb.SBType) -> str: return buffer_as_string(buffer) @@ -417,14 +417,13 @@ def to_string(self, token_id: str, nonce: int, amount: str) -> str: class EgldOrEsdtTokenIdentifier(PlainManagedVecItem, ManagedType): def lookup(self, egld_or_esdt_token_identifier: lldb.value) -> lldb.value: - return egld_or_esdt_token_identifier.data + return egld_or_esdt_token_identifier.buffer - @check_invalid_handle - def summary_from_raw_handle(self, raw_handle: int, context: lldb.value, type_info: lldb.SBType) -> str: - if raw_handle == MANAGED_OPTION_NONE_HANDLE: + def value_summary(self, buffer: lldb.value, context: lldb.value, type_info: lldb.SBType) -> str: + token_id = buffer_as_string(buffer) + if token_id == '"EGLD-000000"': return "EgldOrEsdtTokenIdentifier::egld()" - token_summary = TokenIdentifier().summary_from_raw_handle(raw_handle, context, None) - return f"EgldOrEsdtTokenIdentifier::esdt({token_summary})" + return f"EgldOrEsdtTokenIdentifier::esdt({token_id})" class ManagedVec(PlainManagedVecItem, ManagedType):