tools/gdb: make it compatible with older gdb

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
xuxingliang
2024-08-16 10:45:08 +08:00
committed by Xiang Xiao
parent f53869f86f
commit 0f1e2cc7dc
+8 -3
View File
@@ -123,9 +123,14 @@ def get_symbol_value(name, locspec="nx_start", cacheable=True):
)
g_symbol_cache = {}
suppressed = "is on" in gdb.execute(
"show suppress-cli-notifications", to_string=True
)
try:
suppressed = "is on" in gdb.execute(
"show suppress-cli-notifications", to_string=True
)
except gdb.error:
# Treat as suppressed if the command is not available
suppressed = True
if not suppressed:
# Disable notifications
gdb.execute("set suppress-cli-notifications on")