board_inspector: add conversion to hex string from buffer fields

Occasionally buffer fields (which are typically integers) are converted to
hexadecimal strings for debugging purposes. This patch adds the conversion
to suppress interpretation errors of these debugging calls.

This patch is added in v3 of the series.

Tracked-On: #6287
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Junjie Mao 2021-08-05 10:59:06 +08:00 committed by wenlingz
parent d66c62aad1
commit 5d44640515
1 changed files with 3 additions and 0 deletions

View File

@ -221,6 +221,9 @@ class BufferField(Object):
def to_string(self): def to_string(self):
return f"BufferField({self.__field})" return f"BufferField({self.__field})"
def to_hex_string(self):
return String(hex(self.get())[2:])
# DebugObject # DebugObject
class Device(Object): class Device(Object):