Fix gdb script for new quark variable names

... and don't spam stderr with exceptions if someone renames things
again.

Last but not least, keep the old names as a fallback, so that LD_PRELOAD
with an older libglib still works.
This commit is contained in:
Benjamin Otte 2012-09-27 15:31:46 +02:00
parent 3d45854a58
commit 685259dfea

View File

@ -10,8 +10,15 @@ def g_quark_to_string (quark):
quark = long(quark)
if quark == 0:
return None
val = read_global_var ("g_quarks")
max_q = long(read_global_var ("g_quark_seq_id"))
try:
val = read_global_var ("quarks")
max_q = long(read_global_var ("quark_seq_id"))
except:
try:
val = read_global_var ("g_quarks")
max_q = long(read_global_var ("g_quark_seq_id"))
except:
return None;
if quark < max_q:
return val[quark].string()
return None