Changes in kernel/arch/amd64/src/debugger.c [49ace23:96b02eb9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/debugger.c
r49ace23 r96b02eb9 125 125 126 126 /* Disable breakpoint in DR7 */ 127 unative_t dr7 = read_dr7();128 dr7 &= ~(0x 2<< (curidx * 2));127 sysarg_t dr7 = read_dr7(); 128 dr7 &= ~(0x02U << (curidx * 2)); 129 129 130 130 /* Setup DR register */ … … 147 147 148 148 /* Set type to requested breakpoint & length*/ 149 dr7 &= ~(0x 3<< (16 + 4 * curidx));150 dr7 &= ~(0x 3<< (18 + 4 * curidx));149 dr7 &= ~(0x03U << (16 + 4 * curidx)); 150 dr7 &= ~(0x03U << (18 + 4 * curidx)); 151 151 152 152 if (!(flags & BKPOINT_INSTR)) { 153 153 #ifdef __32_BITS__ 154 dr7 |= (( unative_t) 0x3) << (18 + 4 * curidx);154 dr7 |= ((sysarg_t) 0x03U) << (18 + 4 * curidx); 155 155 #endif 156 156 157 157 #ifdef __64_BITS__ 158 dr7 |= (( unative_t) 0x2) << (18 + 4 * curidx);158 dr7 |= ((sysarg_t) 0x02U) << (18 + 4 * curidx); 159 159 #endif 160 160 161 161 if ((flags & BKPOINT_WRITE)) 162 dr7 |= (( unative_t) 0x1) << (16 + 4 * curidx);162 dr7 |= ((sysarg_t) 0x01U) << (16 + 4 * curidx); 163 163 else if ((flags & BKPOINT_READ_WRITE)) 164 dr7 |= (( unative_t) 0x3) << (16 + 4 * curidx);164 dr7 |= ((sysarg_t) 0x03U) << (16 + 4 * curidx); 165 165 } 166 166 167 167 /* Enable global breakpoint */ 168 dr7 |= 0x 2<< (curidx * 2);168 dr7 |= 0x02U << (curidx * 2); 169 169 170 170 write_dr7(dr7); … … 227 227 if (!(breakpoints[slot].flags & BKPOINT_INSTR)) { 228 228 if ((breakpoints[slot].flags & BKPOINT_CHECK_ZERO)) { 229 if (*(( unative_t *) breakpoints[slot].address) != 0)229 if (*((sysarg_t *) breakpoints[slot].address) != 0) 230 230 return; 231 231 232 printf("*** Found ZERO on address % " PRIp "(slot %d) ***\n",233 breakpoints[slot].address, slot);232 printf("*** Found ZERO on address %p (slot %d) ***\n", 233 (void *) breakpoints[slot].address, slot); 234 234 } else { 235 printf("Data watchpoint - new data: % " PRIp"\n",236 *(( unative_t *) breakpoints[slot].address));237 } 238 } 239 240 printf("Reached breakpoint %d:% " PRIp " (%s)\n", slot, getip(istate),241 symtab_fmt_name_lookup(getip(istate)));235 printf("Data watchpoint - new data: %#" PRIxn "\n", 236 *((sysarg_t *) breakpoints[slot].address)); 237 } 238 } 239 240 printf("Reached breakpoint %d:%p (%s)\n", slot, 241 (void *) getip(istate), symtab_fmt_name_lookup(getip(istate))); 242 242 243 243 #ifdef CONFIG_KCONSOLE … … 260 260 } 261 261 262 cur->address = NULL;262 cur->address = (uintptr_t) NULL; 263 263 264 264 setup_dr(slot); … … 279 279 #endif 280 280 281 unative_t dr6 = read_dr6();281 sysarg_t dr6 = read_dr6(); 282 282 283 283 unsigned int i; … … 313 313 unsigned int i; 314 314 for (i = 0; i < BKPOINTS_MAX; i++) 315 breakpoints[i].address = NULL;315 breakpoints[i].address = (uintptr_t) NULL; 316 316 317 317 #ifdef CONFIG_KCONSOLE … … 363 363 364 364 #ifdef __32_BITS__ 365 printf("%-4u %7 " PRIs "%p %s\n", i,366 breakpoints[i].counter, breakpoints[i].address,365 printf("%-4u %7zu %p %s\n", i, 366 breakpoints[i].counter, (void *) breakpoints[i].address, 367 367 symbol); 368 368 #endif 369 369 370 370 #ifdef __64_BITS__ 371 printf("%-4u %7 " PRIs "%p %s\n", i,372 breakpoints[i].counter, breakpoints[i].address,371 printf("%-4u %7zu %p %s\n", i, 372 breakpoints[i].counter, (void *) breakpoints[i].address, 373 373 symbol); 374 374 #endif … … 384 384 int cmd_del_breakpoint(cmd_arg_t *argv) 385 385 { 386 unative_t bpno = argv->intval;386 sysarg_t bpno = argv->intval; 387 387 if (bpno > BKPOINTS_MAX) { 388 388 printf("Invalid breakpoint number.\n"); … … 405 405 flags = BKPOINT_WRITE; 406 406 407 printf("Adding breakpoint on address: %p\n", argv->intval); 408 409 int id = breakpoint_add((void *)argv->intval, flags, -1); 407 printf("Adding breakpoint on address: %p\n", 408 (void *) argv->intval); 409 410 int id = breakpoint_add((void *) argv->intval, flags, -1); 410 411 if (id < 0) 411 412 printf("Add breakpoint failed.\n");
Note:
See TracChangeset
for help on using the changeset viewer.