* Christoph Hellwig h...@infradead.org wrote:
+ if (n NR_REGPARMS) {
+ switch (n) {
+ case 0: return regs-ax;
+ case 1: return regs-dx;
+ case 2: return regs-cx;
+ }
Normal kernel style would be
switch (n) {
You might want to run this past linux-arch to make sure this is suitable
for other architectures.
--- a/arch/x86/include/asm/ptrace.h
+++ b/arch/x86/include/asm/ptrace.h
@@ -7,6 +7,7 @@
#ifdef __KERNEL__
#include asm/segment.h
+#include asm/page_types.h
#endif
I really wonder if we
Hi Christoph,
Thank you for review.
Christoph Hellwig wrote:
You might want to run this past linux-arch to make sure this is suitable
for other architectures.
Frankly, I'm not sure about linux-arch, could you explain it?
Anyway, I'm interested in that idea.
---
Add following APIs for accessing registers and stack entries from pt_regs.
- query_register_offset(const char *name)
Query the offset of name register.
- query_register_name(unsigned offset)
Query the name of register by its offset.
- get_register(struct pt_regs *regs, unsigned offset)