Since we only leave one gdb thread, or 1 cpu thread, and can use cmd "set" to switch task context by reusing the thread. So the word "get_cpu_reg", which stands for "fetch registers' value for cpu thread x", is no longer appropriate, better using "get_current_task_reg", which stands for "fetch registers' value for the current task", and makes more sense. Co-developed-by: Aditya Gupta <adityag@xxxxxxxxxxxxx> Co-developed-by: Alexey Makhalov <alexey.makhalov@xxxxxxxxxxxx> Co-developed-by: Tao Liu <ltao@xxxxxxxxxx> Signed-off-by: Tao Liu <ltao@xxxxxxxxxx> --- crash_target.c | 4 ++-- defs.h | 2 +- gdb_interface.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crash_target.c b/crash_target.c index 11134a7..52966f7 100644 --- a/crash_target.c +++ b/crash_target.c @@ -26,7 +26,7 @@ void crash_target_init (void); extern "C" int gdb_readmem_callback(unsigned long, void *, int, int); -extern "C" int crash_get_cpu_reg (int cpu, int regno, const char *regname, +extern "C" int crash_get_current_task_reg (int regno, const char *regname, int regsize, void *val); extern "C" int gdb_change_thread_context (); @@ -83,7 +83,7 @@ onetime: if (regsize > sizeof (regval)) error (_("fatal error: buffer size is not enough to fit register value")); - if (crash_get_cpu_reg (cpu, r, regname, regsize, (void *)®val)) + if (crash_get_current_task_reg (r, regname, regsize, (void *)®val)) regcache->raw_supply (r, regval); else regcache->raw_supply (r, NULL); diff --git a/defs.h b/defs.h index 24f682b..6c47154 100644 --- a/defs.h +++ b/defs.h @@ -1080,7 +1080,7 @@ struct machdep_table { void (*get_irq_affinity)(int); void (*show_interrupts)(int, ulong *); int (*is_page_ptr)(ulong, physaddr_t *); - int (*get_cpu_reg)(int, int, const char *, int, void *); + int (*get_current_task_reg)(int, const char *, int, void *); int (*is_cpu_prstatus_valid)(int cpu); }; diff --git a/gdb_interface.c b/gdb_interface.c index ab1bd52..b13d5fd 100644 --- a/gdb_interface.c +++ b/gdb_interface.c @@ -1067,11 +1067,11 @@ unsigned long crash_get_kaslr_offset(void) } /* Callbacks for crash_target */ -int crash_get_cpu_reg (int cpu, int regno, const char *regname, +int crash_get_current_task_reg (int regno, const char *regname, int regsize, void *value) { - if (!machdep->get_cpu_reg) + if (!machdep->get_current_task_reg) return FALSE; - return machdep->get_cpu_reg(cpu, regno, regname, regsize, value); + return machdep->get_current_task_reg(regno, regname, regsize, value); } -- 2.40.1 -- Crash-utility mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxxxxxx https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/ Contribution Guidelines: https://github.com/crash-utility/crash/wiki