[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 11 Nov 2022 11:59:38 -0800
From: debug@...osinc.com
To: palmer@...belt.com
Cc: jan.kiszka@...mens.com, kbingham@...nel.org,
paul.walmsley@...ive.com, aou@...s.berkeley.edu,
debug@...osinc.com, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org, linux@...osinc.com
Subject: [PATCH] gdb-script: updated lx_current for riscv
From: Deepak Gupta <debug@...osinc.com>
lx_current python gdb command defined in scripts/gdb/cpus.py updated
to support riscv architecture.
Signed-off-by: Deepak Gupta <debug@...osinc.com>
---
scripts/gdb/linux/cpus.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/scripts/gdb/linux/cpus.py b/scripts/gdb/linux/cpus.py
index 15fc4626d236..ce6703f1e35a 100644
--- a/scripts/gdb/linux/cpus.py
+++ b/scripts/gdb/linux/cpus.py
@@ -173,6 +173,14 @@ def get_current_task(cpu):
else:
raise gdb.GdbError("Sorry, obtaining the current task is not allowed "
"while running in userspace(EL0)")
+ elif utils.is_target_arch("riscv"):
+ current_task_addr = gdb.parse_and_eval("$tp")
+ if((current_task_addr.cast(utils.get_long_type()) >> 63) != 0):
+ current_task = current_task_addr.cast(task_ptr_type)
+ return current_task.dereference()
+ else:
+ raise gdb.GdbError("Sorry, obtaining the current task is not allowed "
+ "while running in userspace")
else:
raise gdb.GdbError("Sorry, obtaining the current task is not yet "
"supported with this arch")
--
2.25.1
Powered by blists - more mailing lists