Skip to content

Commit

Permalink
lldb pretty print fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Dec 7, 2024
1 parent 4e07c51 commit c22b035
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit c22b035

Please sign in to comment.