FreeBSD Bugzilla – Attachment 220079 Details for
Bug 251463
Write additional ARM registers in the gdb stub
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Write SP, LR and r0-r12 registers in addition to the PC one
write_arm_registers_in_gdb_stub.diff (text/plain), 1.21 KB, created by
Dmitry Salychev
on 2020-11-29 19:44:11 UTC
(
hide
)
Description:
Write SP, LR and r0-r12 registers in addition to the PC one
Filename:
MIME Type:
Creator:
Dmitry Salychev
Created:
2020-11-29 19:44:11 UTC
Size:
1.21 KB
patch
obsolete
>Index: sys/arm/include/gdb_machdep.h >=================================================================== >--- sys/arm/include/gdb_machdep.h (revision 368108) >+++ sys/arm/include/gdb_machdep.h (working copy) >@@ -33,6 +33,8 @@ > > #define GDB_BUFSZ 400 > #define GDB_NREGS 26 >+#define GDB_REG_SP 13 >+#define GDB_REG_LR 14 > #define GDB_REG_PC 15 > > static __inline size_t >Index: sys/arm/arm/gdb_machdep.c >=================================================================== >--- sys/arm/arm/gdb_machdep.c (revision 368108) >+++ sys/arm/arm/gdb_machdep.c (working copy) >@@ -97,11 +97,28 @@ > void > gdb_cpu_setreg(int regnum, void *val) > { >- > switch (regnum) { > case GDB_REG_PC: >- if (kdb_thread == curthread) >+ if (kdb_thread == curthread) { > kdb_frame->tf_pc = *(register_t *)val; >+ } >+ break; >+ case GDB_REG_SP: >+ if (kdb_thread == curthread) { >+ kdb_frame->tf_svc_sp = *(register_t *)val; >+ } >+ break; >+ case GDB_REG_LR: >+ if (kdb_thread == curthread) { >+ kdb_frame->tf_svc_lr = *(register_t *)val; >+ } >+ break; >+ default: >+ /* Write to the general purpose registers r0-r12. */ >+ if (kdb_thread == curthread && regnum >= 0 && regnum <= 12) { >+ *(&kdb_frame->tf_r0 + regnum) = *(register_t *)val; >+ } >+ break; > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 251463
:
220079
|
220115
|
220116
|
220181
|
220356