mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 13:06:14 +01:00
Merge branch 'gdbplugin' into 'main'
gdb: Workaround optimized out quark_seq_id See merge request GNOME/glib!3559
This commit is contained in:
commit
37309f165e
@ -16,17 +16,28 @@ def g_quark_to_string(quark):
|
||||
quark = long(quark)
|
||||
if quark == 0:
|
||||
return None
|
||||
max_q = None
|
||||
try:
|
||||
val = read_global_var("quarks")
|
||||
max_q = long(read_global_var("quark_seq_id"))
|
||||
try:
|
||||
max_q = long(read_global_var("quark_seq_id"))
|
||||
# quark_seq_id gets optimized out in some builds so work around it
|
||||
except gdb.error:
|
||||
pass
|
||||
except Exception:
|
||||
try:
|
||||
val = read_global_var("g_quarks")
|
||||
max_q = long(read_global_var("g_quark_seq_id"))
|
||||
try:
|
||||
max_q = long(read_global_var("g_quark_seq_id"))
|
||||
except gdb.error:
|
||||
pass
|
||||
except Exception:
|
||||
return None
|
||||
if quark < max_q:
|
||||
return val[quark].string()
|
||||
if max_q is None or quark < max_q:
|
||||
try:
|
||||
return val[quark].string()
|
||||
except gdb.MemoryError:
|
||||
print(f"Invalid quark {quark}")
|
||||
return None
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user