Changeset 76fca31 in mainline for kernel/arch/mips32/src/debugger.c


Ignore:
Timestamp:
2008-12-16T19:02:07Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5ae4443
Parents:
8fe5980
Message:

kconsole is optional
kernel & uspace framebuffer rewrite with speedups (some things are slightly broken yet)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/src/debugger.c

    r8fe5980 r76fca31  
    4747bpinfo_t breakpoints[BKPOINTS_MAX];
    4848SPINLOCK_INITIALIZE(bkpoint_lock);
     49
     50#ifdef CONFIG_KCONSOLE
    4951
    5052static int cmd_print_breakpoints(cmd_arg_t *argv);
     
    124126};
    125127
     128
    126129/** Test, if the given instruction is a jump or branch instruction
    127130 *
    128131 * @param instr Instruction code
    129132 * @return true - it is jump instruction, false otherwise
     133 *
    130134 */
    131135static bool is_jump(unative_t instr)
     
    268272}
    269273
     274#endif
     275
    270276/** Initialize debugger */
    271277void debugger_init()
     
    275281        for (i = 0; i < BKPOINTS_MAX; i++)
    276282                breakpoints[i].address = NULL;
    277        
     283
     284#ifdef CONFIG_KCONSOLE
    278285        cmd_initialize(&bkpts_info);
    279286        if (!cmd_register(&bkpts_info))
    280                 panic("could not register command %s\n", bkpts_info.name);
     287                printf("Cannot register command %s\n", bkpts_info.name);
    281288
    282289        cmd_initialize(&delbkpt_info);
    283290        if (!cmd_register(&delbkpt_info))
    284                 panic("could not register command %s\n", delbkpt_info.name);
     291                printf("Cannot register command %s\n", delbkpt_info.name);
    285292
    286293        cmd_initialize(&addbkpt_info);
    287294        if (!cmd_register(&addbkpt_info))
    288                 panic("could not register command %s\n", addbkpt_info.name);
     295                printf("Cannot register command %s\n", addbkpt_info.name);
    289296
    290297        cmd_initialize(&addbkpte_info);
    291298        if (!cmd_register(&addbkpte_info))
    292                 panic("could not register command %s\n", addbkpte_info.name);
     299                printf("Cannot register command %s\n", addbkpte_info.name);
     300#endif
    293301}
    294302
     
    368376                        cur->bkfunc(cur, istate);
    369377        } else {
    370                 printf("***Type 'exit' to exit kconsole.\n");
     378#ifdef CONFIG_KCONSOLE
    371379                /* This disables all other processors - we are not SMP,
    372380                 * actually this gets us to cpu_halt, if scheduler() is run
     
    374382                 *   so this is a good idea
    375383                 */     
    376                 atomic_set(&haltstate,1);
     384                atomic_set(&haltstate, 1);
    377385                spinlock_unlock(&bkpoint_lock);
    378 
    379                 kconsole("debug");
    380 
     386               
     387                kconsole("debug", "Debug console ready (type 'exit' to continue)\n", false);
     388               
    381389                spinlock_lock(&bkpoint_lock);
    382                 atomic_set(&haltstate,0);
     390                atomic_set(&haltstate, 0);
     391#endif
    383392        }
    384393        if (cur && cur->address == fireaddr && (cur->flags & BKPOINT_INPROG)) {
Note: See TracChangeset for help on using the changeset viewer.