当我尝试使用:
class MyPrinter:
def __init__(self, val):
self.val = val
def to_string(self):
return str(self.val['fData'][0]) + ":" + "%016x" % (self.val['fData'][0]).cast(gdb.lookup_type("uint64_t"))
打印2929725441843584891:28a879c45a82df7b
但也9918728419520062851:-7659990ddaef5a7d
当为val
设置最高有效位时,它被解释为有符号的。你知道吗
fData[]
是uint64_t
。你知道吗
我怎样才能避免呢?我所有的值都应该是无符号的。你知道吗
至少作为一种解决方法,这对我来说是可行的:
相关问题 更多 >
编程相关推荐