Subversion Repositories HelenOS

Rev

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

Rev 4101 Rev 4132
Line 35... Line 35...
35
#include <arch/debugger.h>
35
#include <arch/debugger.h>
36
#include <arch/barrier.h>
36
#include <arch/barrier.h>
37
#include <memstr.h>
37
#include <memstr.h>
38
#include <console/kconsole.h>
38
#include <console/kconsole.h>
39
#include <console/cmd.h>
39
#include <console/cmd.h>
40
#include <symtab.h>
-
 
41
#include <print.h>
40
#include <print.h>
42
#include <panic.h>
41
#include <panic.h>
43
#include <arch.h>
42
#include <arch.h>
44
#include <arch/cp0.h>
43
#include <arch/cp0.h>
45
#include <func.h>
44
#include <func.h>
46
 
45
 
-
 
46
#ifdef CONFIG_SYMTAB
-
 
47
#include <symtab.h>
-
 
48
#endif
-
 
49
 
47
bpinfo_t breakpoints[BKPOINTS_MAX];
50
bpinfo_t breakpoints[BKPOINTS_MAX];
48
SPINLOCK_INITIALIZE(bkpoint_lock);
51
SPINLOCK_INITIALIZE(bkpoint_lock);
49
 
52
 
50
#ifdef CONFIG_KCONSOLE
53
#ifdef CONFIG_KCONSOLE
51
 
54
 
Line 257... Line 260...
257
    printf("#  Count Address    INPROG ONESHOT FUNCCALL In symbol\n");
260
    printf("#  Count Address    INPROG ONESHOT FUNCCALL In symbol\n");
258
    printf("-- ----- ---------- ------ ------- -------- ---------\n");
261
    printf("-- ----- ---------- ------ ------- -------- ---------\n");
259
   
262
   
260
    for (i = 0; i < BKPOINTS_MAX; i++)
263
    for (i = 0; i < BKPOINTS_MAX; i++)
261
        if (breakpoints[i].address) {
264
        if (breakpoints[i].address) {
-
 
265
#ifdef CONFIG_SYMTAB
262
            symbol = get_symtab_entry(breakpoints[i].address);
266
            symbol = get_symtab_entry(breakpoints[i].address);
-
 
267
#else
-
 
268
            symbol = "n/a";
-
 
269
#endif
263
           
270
           
264
            printf("%-2u %-5d %#10zx %-6s %-7s %-8s %s\n", i,
271
            printf("%-2u %-5d %#10zx %-6s %-7s %-8s %s\n", i,
265
                breakpoints[i].counter, breakpoints[i].address,
272
                breakpoints[i].counter, breakpoints[i].address,
266
                ((breakpoints[i].flags & BKPOINT_INPROG) ? "true" :
273
                ((breakpoints[i].flags & BKPOINT_INPROG) ? "true" :
267
                "false"), ((breakpoints[i].flags & BKPOINT_ONESHOT)
274
                "false"), ((breakpoints[i].flags & BKPOINT_ONESHOT)
Line 346... Line 353...
346
            return;
353
            return;
347
        }
354
        }
348
        if (cur->flags & BKPOINT_INPROG)
355
        if (cur->flags & BKPOINT_INPROG)
349
            printf("Warning: breakpoint recursion\n");
356
            printf("Warning: breakpoint recursion\n");
350
       
357
       
351
        if (!(cur->flags & BKPOINT_FUNCCALL))
358
        if (!(cur->flags & BKPOINT_FUNCCALL)) {
-
 
359
#ifdef CONFIG_SYMTAB
352
            printf("***Breakpoint %d: %p in %s.\n", i, fireaddr,
360
            printf("***Breakpoint %d: %p in %s.\n", i, fireaddr,
353
                get_symtab_entry(istate->epc));
361
                get_symtab_entry(istate->epc));
-
 
362
#else
-
 
363
            printf("***Breakpoint %d: %p.\n", i, fireaddr);
-
 
364
#endif
-
 
365
        }
354
 
366
 
355
        /* Return first instruction back */
367
        /* Return first instruction back */
356
        ((uint32_t *)cur->address)[0] = cur->instruction;
368
        ((uint32_t *)cur->address)[0] = cur->instruction;
357
        smc_coherence(cur->address);
369
        smc_coherence(cur->address);
358
 
370
 
Line 361... Line 373...
361
            ((uint32_t *)cur->address)[1] = 0x0d;
373
            ((uint32_t *)cur->address)[1] = 0x0d;
362
            cur->flags |= BKPOINT_REINST;
374
            cur->flags |= BKPOINT_REINST;
363
        }
375
        }
364
        cur->flags |= BKPOINT_INPROG;
376
        cur->flags |= BKPOINT_INPROG;
365
    } else {
377
    } else {
-
 
378
#ifdef CONFIG_SYMTAB
366
        printf("***Breakpoint %p in %s.\n", fireaddr,
379
        printf("***Breakpoint %p in %s.\n", fireaddr,
367
               get_symtab_entry(fireaddr));
380
               get_symtab_entry(fireaddr));
-
 
381
#else
-
 
382
        printf("***Breakpoint %p.\n", fireaddr);   
-
 
383
#endif
368
        /* Move on to next instruction */
384
        /* Move on to next instruction */
369
        istate->epc += 4;
385
        istate->epc += 4;
370
    }
386
    }
371
    if (cur)
387
    if (cur)
372
        cur->counter++;
388
        cur->counter++;