Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177668594
D16100.1794989143.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D16100.1794989143.diff
View Options
Index: head/sys/arm/arm/undefined.c
===================================================================
--- head/sys/arm/arm/undefined.c
+++ head/sys/arm/arm/undefined.c
@@ -144,6 +144,7 @@
{
struct thread *td;
ksiginfo_t ksi;
+ int error;
td = (curthread == NULL) ? &thread0 : curthread;
@@ -162,6 +163,27 @@
#endif
#endif
}
+
+ if (code == FAULT_USER) {
+ /* TODO: No support for ptrace from Thumb-2 */
+ if ((frame->tf_spsr & PSR_T) == 0 &&
+ insn == PTRACE_BREAKPOINT) {
+ PROC_LOCK(td->td_proc);
+ _PHOLD(td->td_proc);
+ error = ptrace_clear_single_step(td);
+ _PRELE(td->td_proc);
+ PROC_UNLOCK(td->td_proc);
+ if (error == 0) {
+ ksiginfo_init_trap(&ksi);
+ ksi.ksi_signo = SIGTRAP;
+ ksi.ksi_code = TRAP_TRACE;
+ ksi.ksi_addr = (u_int32_t *)addr;
+ trapsignal(td, &ksi);
+ return (0);
+ }
+ }
+ }
+
return 1;
}
@@ -191,7 +213,6 @@
int fault_code;
int coprocessor;
struct undefined_handler *uh;
- int error;
#ifdef VERBOSE_ARM32
int s;
#endif
@@ -304,26 +325,6 @@
if (uh->uh_handler(fault_pc, fault_instruction, frame,
fault_code) == 0)
break;
-
- if (fault_code & FAULT_USER) {
- /* TODO: No support for ptrace from Thumb-2 */
- if ((frame->tf_spsr & PSR_T) == 0 &&
- fault_instruction == PTRACE_BREAKPOINT) {
- PROC_LOCK(td->td_proc);
- _PHOLD(td->td_proc);
- error = ptrace_clear_single_step(td);
- _PRELE(td->td_proc);
- PROC_UNLOCK(td->td_proc);
- if (error != 0) {
- ksiginfo_init_trap(&ksi);
- ksi.ksi_signo = SIGILL;
- ksi.ksi_code = ILL_ILLOPC;
- ksi.ksi_addr = (u_int32_t *)(intptr_t) fault_pc;
- trapsignal(td, &ksi);
- }
- return;
- }
- }
if (uh == NULL && (fault_code & FAULT_USER)) {
/* Fault has not been handled */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 18, 8:05 AM (21 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41819521
Default Alt Text
D16100.1794989143.diff (1 KB)
Attached To
Mode
D16100: Raise a proper SIGTRAP / TRAP_TRACE signal for a PT_STEP step on arm.
Attached
Detach File
Event Timeline