Subversion Repositories HelenOS

Rev

Rev 610 | Rev 615 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 610 Rev 614
Line 37... Line 37...
37
#include <symtab.h>
37
#include <symtab.h>
38
#include <print.h>
38
#include <print.h>
39
#include <interrupt.h>
39
#include <interrupt.h>
40
#include <func.h>
40
#include <func.h>
41
#include <console/kconsole.h>
41
#include <console/kconsole.h>
-
 
42
#include <arch/debugger.h>
42
 
43
 
43
static char * exctable[] = {
44
static char * exctable[] = {
44
    "Interrupt","TLB Modified","TLB Invalid","TLB Invalid Store",
45
    "Interrupt","TLB Modified","TLB Invalid","TLB Invalid Store",
45
        "Address Error - load/instr. fetch",
46
        "Address Error - load/instr. fetch",
46
        "Address Error - store",
47
        "Address Error - store",
Line 85... Line 86...
85
}
86
}
86
 
87
 
87
static void breakpoint_exception(int n, void *data)
88
static void breakpoint_exception(int n, void *data)
88
{
89
{
89
    struct exception_regdump *pstate = (struct exception_regdump *)data;
90
    struct exception_regdump *pstate = (struct exception_regdump *)data;
90
    char *symbol = get_symtab_entry(pstate->epc);
-
 
91
 
-
 
92
#ifdef CONFIG_DEBUG 
-
 
93
    printf("***Breakpoint %p in %s.\n", pstate->epc, symbol);
-
 
94
    printf("***Type 'exit' to exit kconsole.\n");
-
 
95
    /* Umm..we should rather set some 'debugstate' here */
-
 
96
    haltstate = 1;
-
 
97
    kconsole("debug");
-
 
98
    haltstate = 0;
-
 
99
#endif
-
 
100
 
91
 
-
 
92
#ifdef CONFIG_DEBUG
-
 
93
    debugger_bpoint(pstate);
-
 
94
#else
101
    /* it is necessary to not re-execute BREAK instruction after
95
    /* it is necessary to not re-execute BREAK instruction after
102
       returning from Exception handler
96
       returning from Exception handler
103
       (see page 138 in R4000 Manual for more information) */
97
       (see page 138 in R4000 Manual for more information) */
104
    pstate->epc += 4;
98
    pstate->epc += 4;
-
 
99
#endif
105
}
100
}
106
 
101
 
107
static void tlbmod_exception(int n, void *data)
102
static void tlbmod_exception(int n, void *data)
108
{
103
{
109
    struct exception_regdump *pstate = (struct exception_regdump *)data;
104
    struct exception_regdump *pstate = (struct exception_regdump *)data;