+ prev_frame = frp->save_fp;
+
+/*
+ * The check for interrupt generated frames is taken from adb with only
+ * partial understanding. If you're in "sub" and on a sigxxx "sigsub"
+ * gets control, then the stack does NOT look like <main, sub, sigsub>.
+ *
+ * As best I can make out it looks like:
+ *
+ * <main, (machine check exception block + sub), sysframe, sigsub>.
+ *
+ * When the signal occurs an exception block and a frame for the routine
+ * in which it occured are pushed on the user stack. Then another frame
+ * is pushed corresponding to a call from the kernel to sigsub.
+ *
+ * The addr in sub at which the exception occured is not in sub.save_pc
+ * but in the machine check exception block. It is at the magic address
+ * fp + 76.
+ *
+ * The current approach ignores the sys_frame (what adb reports as sigtramp)
+ * and takes the pc for sub from the exception block. This allows the
+ * "where" command to report <main, sub, sigsub>, which seems reasonable.
+ */
+
+nextf:
+ dread(&frame, prev_frame, sizeof(struct Frame));
+ if (ntramp == 1) {
+ dread(&callpc, prev_frame + 76, sizeof(callpc));
+ } else {
+ callpc = frame.save_pc;
+ }