Changeset 76fca31 in mainline for kernel/arch/mips32/src/debugger.c
- Timestamp:
- 2008-12-16T19:02:07Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5ae4443
- Parents:
- 8fe5980
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/src/debugger.c
r8fe5980 r76fca31 47 47 bpinfo_t breakpoints[BKPOINTS_MAX]; 48 48 SPINLOCK_INITIALIZE(bkpoint_lock); 49 50 #ifdef CONFIG_KCONSOLE 49 51 50 52 static int cmd_print_breakpoints(cmd_arg_t *argv); … … 124 126 }; 125 127 128 126 129 /** Test, if the given instruction is a jump or branch instruction 127 130 * 128 131 * @param instr Instruction code 129 132 * @return true - it is jump instruction, false otherwise 133 * 130 134 */ 131 135 static bool is_jump(unative_t instr) … … 268 272 } 269 273 274 #endif 275 270 276 /** Initialize debugger */ 271 277 void debugger_init() … … 275 281 for (i = 0; i < BKPOINTS_MAX; i++) 276 282 breakpoints[i].address = NULL; 277 283 284 #ifdef CONFIG_KCONSOLE 278 285 cmd_initialize(&bkpts_info); 279 286 if (!cmd_register(&bkpts_info)) 280 p anic("couldnot register command %s\n", bkpts_info.name);287 printf("Cannot register command %s\n", bkpts_info.name); 281 288 282 289 cmd_initialize(&delbkpt_info); 283 290 if (!cmd_register(&delbkpt_info)) 284 p anic("couldnot register command %s\n", delbkpt_info.name);291 printf("Cannot register command %s\n", delbkpt_info.name); 285 292 286 293 cmd_initialize(&addbkpt_info); 287 294 if (!cmd_register(&addbkpt_info)) 288 p anic("couldnot register command %s\n", addbkpt_info.name);295 printf("Cannot register command %s\n", addbkpt_info.name); 289 296 290 297 cmd_initialize(&addbkpte_info); 291 298 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 293 301 } 294 302 … … 368 376 cur->bkfunc(cur, istate); 369 377 } else { 370 printf("***Type 'exit' to exit kconsole.\n"); 378 #ifdef CONFIG_KCONSOLE 371 379 /* This disables all other processors - we are not SMP, 372 380 * actually this gets us to cpu_halt, if scheduler() is run … … 374 382 * so this is a good idea 375 383 */ 376 atomic_set(&haltstate, 1);384 atomic_set(&haltstate, 1); 377 385 spinlock_unlock(&bkpoint_lock); 378 379 kconsole("debug" );380 386 387 kconsole("debug", "Debug console ready (type 'exit' to continue)\n", false); 388 381 389 spinlock_lock(&bkpoint_lock); 382 atomic_set(&haltstate,0); 390 atomic_set(&haltstate, 0); 391 #endif 383 392 } 384 393 if (cur && cur->address == fireaddr && (cur->flags & BKPOINT_INPROG)) {
Note:
See TracChangeset
for help on using the changeset viewer.