From 1944fc84ee2c9799ab6d0932b5b3684ec40e9e53 Mon Sep 17 00:00:00 2001 From: Jens Georg Date: Mon, 11 Dec 2023 15:07:44 +0100 Subject: [PATCH] gobject_gdb.py: Do not break bt on optimized build Symptom: 20 0x00007ffff756337b in gtk_widget_size_allocate_with_baseline (widget=0xd7a0c0 [DirectWindow], allocation=, baseline=) at gdb.error: value has been optimized out --- gobject/gobject_gdb.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gobject/gobject_gdb.py b/gobject/gobject_gdb.py index ee554f502..55ad40607 100644 --- a/gobject/gobject_gdb.py +++ b/gobject/gobject_gdb.py @@ -148,11 +148,16 @@ def get_signal_name(id): id = long(id) if id == 0: return None - val = read_global_var("g_signal_nodes") - max_s = read_global_var("g_n_signal_nodes") - max_s = long(max_s) - if id < max_s: - return val[id]["name"].string() + + try: + val = read_global_var("g_signal_nodes") + max_s = read_global_var("g_n_signal_nodes") + max_s = long(max_s) + if id < max_s: + return val[id]["name"].string() + except gdb.error: + return None + return None