mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 21:16:15 +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)
|
quark = long(quark)
|
||||||
if quark == 0:
|
if quark == 0:
|
||||||
return None
|
return None
|
||||||
|
max_q = None
|
||||||
try:
|
try:
|
||||||
val = read_global_var("quarks")
|
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:
|
except Exception:
|
||||||
try:
|
try:
|
||||||
val = read_global_var("g_quarks")
|
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:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
if quark < max_q:
|
if max_q is None or quark < max_q:
|
||||||
return val[quark].string()
|
try:
|
||||||
|
return val[quark].string()
|
||||||
|
except gdb.MemoryError:
|
||||||
|
print(f"Invalid quark {quark}")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user