Better debugging for user faults
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 23 Dec 2014 18:34:57 +0000 (10:34 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 31 Dec 2014 18:03:09 +0000 (13:03 -0500)
commita26f4ae74f92ae2fe98d11031b8d8367d7d5806b
treeb65bafc5057a32218e229a22a9e361dd72bddd76
parent46cbb34072a6f7b6ef8a037f85a2de14cd77211f
Better debugging for user faults

Whenever userspace has an unhandled fault, we print out more
information, including the 'physical' location of the faulting
instruction pointer (meaning the relative location in a file-backed
VMR).

For example:

Unhandled SCP trap
HW TRAP frame at 0xffffffffc58777b8 on core 0
  rax  0x00007f7fffbfdc38
  rbx  0x0000400000353dc0
  rcx  0x00000000fbad240c
  rdx  0x0000000000000063
  rbp  0x0000400000121348
  rsi  0x0000000000000000
  rdi  0x0000400000121348
  r8   0x0000000000000000
  r9   0x0000000000000000
  r10  0x0000000000320888
  r11  0x0000400000075990
  r12  0x0000000000000000
  r13  0x0000000000000000
  r14  0x0000000000000000
  r15  0x0000000000000000
  trap 0x0000000e Page Fault
  gsbs 0x0000000000000000
  fsbs 0x0000400000354fc0
  err  0x--------00000004
  rip  0x00004000000e0105
  cs   0x------------0023
  flag 0x0000000000010202
  rsp  0x00007f7fffbfdc20
  ss   0x------------001b
err 0x4, aux 0x00000000000000c7
Addr 0x00004000000e0105 is in libc-2.19.so at offset 0x00000000000df105
kern/include/kdebug.h
kern/src/kdebug.c
kern/src/trap.c