From 0f1e2cc7dc1909eaddc65dcdd8047f600f9b2971 Mon Sep 17 00:00:00 2001 From: xuxingliang Date: Fri, 16 Aug 2024 10:45:08 +0800 Subject: [PATCH] tools/gdb: make it compatible with older gdb Signed-off-by: xuxingliang --- tools/gdb/utils.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/gdb/utils.py b/tools/gdb/utils.py index 2dd2615ae24..11c17055564 100644 --- a/tools/gdb/utils.py +++ b/tools/gdb/utils.py @@ -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")