From 364e53c7da36decc15e6462fbd25b48e1af21566 Mon Sep 17 00:00:00 2001 From: Coldwings Date: Thu, 10 Apr 2025 12:01:49 +0800 Subject: [PATCH] gdb eval with return type since debugger may not have source code to resolve --- tools/photongdb.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/photongdb.py b/tools/photongdb.py index d4d3e76b..d4f1ee9b 100644 --- a/tools/photongdb.py +++ b/tools/photongdb.py @@ -52,6 +52,7 @@ def cprint(stat, *args): def get_next_ready(p): +<<<<<<< HEAD return gdb.parse_and_eval("(photon::thread*)%s" % p.dereference()['__next_ptr']) @@ -66,6 +67,20 @@ def get_vcpu(p): def get_sleepq(vcpu): return vcpu['sleepq']['q'] +======= + return gdb.parse_and_eval("(void*)gdb_get_next_thread((void*){})".format(p)) + + +def get_current(): + return gdb.parse_and_eval("(void*)gdb_get_current_thread()") + + +def get_vcpu(p): + return gdb.parse_and_eval("(void*)gdb_get_vcpu((void*){})".format(p)) + +def get_thread_stack_ptr(p): + return gdb.parse_and_eval("(void*)gdb_get_thread_stack_ptr((void*){})".format(p)) +>>>>>>> 1dcabe0 (gdb eval with return type since debugger may not have source code to resolve) def in_sleep(q): size = q['_M_impl']['_M_finish'] - q['_M_impl']['_M_start']