tools/gdb:add get_symbol_value api

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao 2024-06-27 14:14:36 +08:00 committed by Xiang Xiao
parent dbdeaa2ada
commit 9478f5b6d4

View File

@ -179,3 +179,10 @@ def is_target_smp():
return True
else:
return False
def get_symbol_value(name):
"""Return the value of a symbol value etc: Variable, Marco"""
gdb.execute("set $_%s = %s" % (name, name))
return gdb.parse_and_eval("$_%s" % name)