In commit adf78de4, I noticed that to access values of an enum class, we needed to add the class's name, which we previously didn't. I speculated that is only needed with newer gdb. I just confirmed that indeed, if one tries to debug OSv on an old distro (but still new enough to compile OSv), the new names do not work and we need to use the old ones from before commit adf78de4 - otherwise we get errors on "connect".
So in this patch we try both names, trying the new names first, and if they fail, the old names. Signed-off-by: Nadav Har'El <n...@scylladb.com> --- scripts/loader.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/loader.py b/scripts/loader.py index 1ec4e4e..b16538c 100644 --- a/scripts/loader.py +++ b/scripts/loader.py @@ -138,10 +138,16 @@ class Connect(gdb.Command): host_port = arg.split()[0] gdb.execute('target remote %s' % host_port) global status_enum - status_enum.running = gdb.parse_and_eval('sched::thread::status::running') - status_enum.waiting = gdb.parse_and_eval('sched::thread::status::waiting') - status_enum.queued = gdb.parse_and_eval('sched::thread::status::queued') - status_enum.waking = gdb.parse_and_eval('sched::thread::status::waking') + try: + status_enum.running = gdb.parse_and_eval('sched::thread::status::running') + status_enum.waiting = gdb.parse_and_eval('sched::thread::status::waiting') + status_enum.queued = gdb.parse_and_eval('sched::thread::status::queued') + status_enum.waking = gdb.parse_and_eval('sched::thread::status::waking') + except: + status_enum.running = gdb.parse_and_eval('sched::thread::running') + status_enum.waiting = gdb.parse_and_eval('sched::thread::waiting') + status_enum.queued = gdb.parse_and_eval('sched::thread::queued') + status_enum.waking = gdb.parse_and_eval('sched::thread::waking') Connect() -- 2.9.3 -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.