]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kdp/ml/arm/kdp_machdep.c
xnu-7195.101.1.tar.gz
[apple/xnu.git] / osfmk / kdp / ml / arm / kdp_machdep.c
index 42b7559005bce11f51f7e7fd78d51e65d057746e..2ef4d343dfb53e6fc1974f30e57803f9b30d4b27 100644 (file)
@@ -623,21 +623,30 @@ machine_trace_thread64(thread_t thread,
                pc = get_saved_state_pc(state);
                sp = get_saved_state_sp(state);
        } else {
-               /* kstackptr may not always be there, so recompute it */
-               struct arm_kernel_saved_state * state = &thread_get_kernel_state(thread)->machine.ss;
-               stacklimit = VM_MAX_KERNEL_ADDRESS;
-               stacklimit_bottom = VM_MIN_KERNEL_ADDRESS;
-               bt_vm_map = kernel_map;
+               struct arm_saved_state *state = thread->machine.kpcb;
+               if (state != NULL) {
+                       if (fp == 0) {
+                               fp = state->ss_64.fp;
+                       }
 
-               /* Get the frame pointer */
-               if (fp == 0) {
-                       fp = state->fp;
+                       prevlr = state->ss_64.lr;
+                       pc = state->ss_64.pc;
+                       sp = state->ss_64.sp;
+               } else {
+                       /* kstackptr may not always be there, so recompute it */
+                       arm_kernel_saved_state_t *kstate = &thread_get_kernel_state(thread)->machine.ss;
+
+                       if (fp == 0) {
+                               fp = kstate->fp;
+                       }
+                       prevlr = kstate->lr;
+                       pc = kstate->pc;
+                       sp = kstate->sp;
                }
 
-               /* Fill in the current link register */
-               prevlr = state->lr;
-               pc = state->pc;
-               sp = state->sp;
+               stacklimit = VM_MAX_KERNEL_ADDRESS;
+               stacklimit_bottom = VM_MIN_KERNEL_ADDRESS;
+               bt_vm_map = kernel_map;
        }
 
        if (!user_p && !prevlr && !fp && !sp && !pc) {