Subversion Repositories HelenOS

Rev

Rev 4343 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4343 Rev 4346
Line 39... Line 39...
39
#include <arch/cp0.h>
39
#include <arch/cp0.h>
40
#include <arch/types.h>
40
#include <arch/types.h>
41
#include <arch.h>
41
#include <arch.h>
42
#include <debug.h>
42
#include <debug.h>
43
#include <proc/thread.h>
43
#include <proc/thread.h>
44
#include <symtab.h>
-
 
45
#include <print.h>
44
#include <print.h>
46
#include <interrupt.h>
45
#include <interrupt.h>
47
#include <func.h>
46
#include <func.h>
48
#include <ddi/irq.h>
47
#include <ddi/irq.h>
49
#include <arch/debugger.h>
48
#include <arch/debugger.h>
-
 
49
#include <symtab.h>
50
 
50
 
51
static char * exctable[] = {
51
static char * exctable[] = {
52
    "Interrupt",
52
    "Interrupt",
53
    "TLB Modified",
53
    "TLB Modified",
54
    "TLB Invalid",
54
    "TLB Invalid",
Line 71... Line 71...
71
    "Virtual Coherency - data",
71
    "Virtual Coherency - data",
72
};
72
};
73
 
73
 
74
static void print_regdump(istate_t *istate)
74
static void print_regdump(istate_t *istate)
75
{
75
{
76
    char *pcsymbol = "";
76
    char *pcsymbol, *rasymbol;
-
 
77
 
77
    char *rasymbol = "";
78
    pcsymbol = symtab_fmt_name_lookup(istate->epc);
-
 
79
    rasymbol = symtab_fmt_name_lookup(istate->ra);
78
 
80
 
79
    char *s = get_symtab_entry(istate->epc);
81
    printf("PC: %#x(%s) RA: %#x(%s), SP(%p)\n", istate->epc, pcsymbol,
80
    if (s)
-
 
81
        pcsymbol = s;
-
 
82
    s = get_symtab_entry(istate->ra);
82
        istate->ra, rasymbol, istate->sp);
83
    if (s)
-
 
84
        rasymbol = s;
-
 
85
   
-
 
86
    printf("PC: %#x(%s) RA: %#x(%s), SP(%p)\n", istate->epc, pcsymbol, istate->ra, rasymbol, istate->sp);
-
 
87
}
83
}
88
 
84
 
89
static void unhandled_exception(int n, istate_t *istate)
85
static void unhandled_exception(int n, istate_t *istate)
90
{
86
{
91
    fault_if_from_uspace(istate, "Unhandled exception %s.", exctable[n]);
87
    fault_if_from_uspace(istate, "Unhandled exception %s.", exctable[n]);