Changeset 7f1c620 in mainline for arch/mips32/src/debugger.c
- Timestamp:
- 2006-07-04T17:17:56Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0ffa3ef5
- Parents:
- 991779c5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/mips32/src/debugger.c
r991779c5 r7f1c620 92 92 93 93 static struct { 94 __u32andmask;95 __u32value;94 uint32_t andmask; 95 uint32_t value; 96 96 }jmpinstr[] = { 97 97 {0xf3ff0000, 0x41000000}, /* BCzF */ … … 126 126 * @return true - it is jump instruction, false otherwise 127 127 */ 128 static bool is_jump( __nativeinstr)128 static bool is_jump(unative_t instr) 129 129 { 130 130 int i; … … 154 154 /* Check, that the breakpoints do not conflict */ 155 155 for (i=0; i<BKPOINTS_MAX; i++) { 156 if (breakpoints[i].address == ( __address)argv->intval) {156 if (breakpoints[i].address == (uintptr_t)argv->intval) { 157 157 printf("Duplicate breakpoint %d.\n", i); 158 158 spinlock_unlock(&bkpoints_lock); 159 159 return 0; 160 } else if (breakpoints[i].address == ( __address)argv->intval + sizeof(__native) || \161 breakpoints[i].address == ( __address)argv->intval - sizeof(__native)) {160 } else if (breakpoints[i].address == (uintptr_t)argv->intval + sizeof(unative_t) || \ 161 breakpoints[i].address == (uintptr_t)argv->intval - sizeof(unative_t)) { 162 162 printf("Adjacent breakpoints not supported, conflict with %d.\n", i); 163 163 spinlock_unlock(&bkpoints_lock); … … 178 178 return 0; 179 179 } 180 cur->address = ( __address) argv->intval;180 cur->address = (uintptr_t) argv->intval; 181 181 printf("Adding breakpoint on address: %p\n", argv->intval); 182 cur->instruction = (( __native*)cur->address)[0];183 cur->nextinstruction = (( __native*)cur->address)[1];182 cur->instruction = ((unative_t *)cur->address)[0]; 183 cur->nextinstruction = ((unative_t *)cur->address)[1]; 184 184 if (argv == &add_argv) { 185 185 cur->flags = 0; … … 193 193 194 194 /* Set breakpoint */ 195 *(( __native*)cur->address) = 0x0d;195 *((unative_t *)cur->address) = 0x0d; 196 196 197 197 spinlock_unlock(&bkpoint_lock); … … 229 229 return 0; 230 230 } 231 (( __u32*)cur->address)[0] = cur->instruction;232 (( __u32*)cur->address)[1] = cur->nextinstruction;231 ((uint32_t *)cur->address)[0] = cur->instruction; 232 ((uint32_t *)cur->address)[1] = cur->nextinstruction; 233 233 234 234 cur->address = NULL; … … 299 299 { 300 300 bpinfo_t *cur = NULL; 301 __addressfireaddr = istate->epc;301 uintptr_t fireaddr = istate->epc; 302 302 int i; 303 303 … … 316 316 /* Reinst only breakpoint */ 317 317 if ((breakpoints[i].flags & BKPOINT_REINST) \ 318 && (fireaddr ==breakpoints[i].address+sizeof( __native))) {318 && (fireaddr ==breakpoints[i].address+sizeof(unative_t))) { 319 319 cur = &breakpoints[i]; 320 320 break; … … 324 324 if (cur->flags & BKPOINT_REINST) { 325 325 /* Set breakpoint on first instruction */ 326 (( __u32*)cur->address)[0] = 0x0d;326 ((uint32_t *)cur->address)[0] = 0x0d; 327 327 /* Return back the second */ 328 (( __u32*)cur->address)[1] = cur->nextinstruction;328 ((uint32_t *)cur->address)[1] = cur->nextinstruction; 329 329 cur->flags &= ~BKPOINT_REINST; 330 330 spinlock_unlock(&bkpoint_lock); … … 339 339 340 340 /* Return first instruction back */ 341 (( __u32*)cur->address)[0] = cur->instruction;341 ((uint32_t *)cur->address)[0] = cur->instruction; 342 342 343 343 if (! (cur->flags & BKPOINT_ONESHOT)) { 344 344 /* Set Breakpoint on next instruction */ 345 (( __u32*)cur->address)[1] = 0x0d;345 ((uint32_t *)cur->address)[1] = 0x0d; 346 346 cur->flags |= BKPOINT_REINST; 347 347 }
Note:
See TracChangeset
for help on using the changeset viewer.