Changeset 7f043c0 in mainline for kernel/arch/amd64/src/debugger.c
- Timestamp:
- 2007-05-31T21:39:13Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7bb0c32
- Parents:
- d8431986
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/debugger.c
rd8431986 r7f043c0 103 103 104 104 /** Print table of active breakpoints */ 105 int cmd_print_breakpoints(cmd_arg_t *argv )105 int cmd_print_breakpoints(cmd_arg_t *argv __attribute__((unused))) 106 106 { 107 107 int i; … … 112 112 if (breakpoints[i].address) { 113 113 symbol = get_symtab_entry(breakpoints[i].address); 114 printf("%d. % p in %s\n",i,114 printf("%d. %lx in %s\n", i, 115 115 breakpoints[i].address, symbol); 116 116 printf(" Count(%d) ", breakpoints[i].counter); … … 174 174 /** Enable hardware breakpoint 175 175 * 176 *177 176 * @param where Address of HW breakpoint 178 177 * @param flags Type of breakpoint (EXECUTE, WRITE) 179 178 * @return Debug slot on success, -1 - no available HW breakpoint 180 179 */ 181 int breakpoint_add( void * where,int flags, int curidx)180 int breakpoint_add(const void *where, const int flags, int curidx) 182 181 { 183 182 ipl_t ipl; … … 185 184 bpinfo_t *cur; 186 185 187 ASSERT( 186 ASSERT(flags & (BKPOINT_INSTR | BKPOINT_WRITE | BKPOINT_READ_WRITE)); 188 187 189 188 ipl = interrupts_disable(); … … 192 191 if (curidx == -1) { 193 192 /* Find free space in slots */ 194 for (i =0; i<BKPOINTS_MAX; i++)193 for (i = 0; i < BKPOINTS_MAX; i++) 195 194 if (!breakpoints[i].address) { 196 195 curidx = i; … … 224 223 225 224 #ifdef amd64 226 # define getip(x)((x)->rip)225 # define getip(x) ((x)->rip) 227 226 #else 228 # define getip(x)((x)->eip)227 # define getip(x) ((x)->eip) 229 228 #endif 230 229 … … 238 237 if (*((unative_t *) breakpoints[slot].address) != 0) 239 238 return; 240 printf("**** Found ZERO on address % p****\n",241 slot, breakpoints[slot].address);239 printf("**** Found ZERO on address %lx (slot %d) ****\n", 240 breakpoints[slot].address, slot); 242 241 } else { 243 printf("Data watchpoint - new data: % p\n",242 printf("Data watchpoint - new data: %lx\n", 244 243 *((unative_t *) breakpoints[slot].address)); 245 244 } 246 245 } 247 printf("Reached breakpoint %d:% p(%s)\n", slot, getip(istate),246 printf("Reached breakpoint %d:%lx(%s)\n", slot, getip(istate), 248 247 get_symtab_entry(getip(istate))); 249 248 printf("***Type 'exit' to exit kconsole.\n"); … … 314 313 #endif 315 314 316 static void debug_exception(int n , istate_t *istate)315 static void debug_exception(int n __attribute__((unused)), istate_t *istate) 317 316 { 318 317 unative_t dr6; … … 338 337 339 338 #ifdef CONFIG_SMP 340 static void debug_ipi(int n , istate_t *istate)339 static void debug_ipi(int n __attribute__((unused)), istate_t *istate __attribute__((unused))) 341 340 { 342 341 int i; 343 342 344 343 spinlock_lock(&bkpoint_lock); 345 for (i =0; i < BKPOINTS_MAX; i++)344 for (i = 0; i < BKPOINTS_MAX; i++) 346 345 setup_dr(i); 347 346 spinlock_unlock(&bkpoint_lock);
Note:
See TracChangeset
for help on using the changeset viewer.