Changes in kernel/generic/src/udebug/udebug_ops.c [87a2f9b:6eef3c4] in mainline
- File:
-
- 1 edited
-
kernel/generic/src/udebug/udebug_ops.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/udebug/udebug_ops.c
r87a2f9b r6eef3c4 196 196 /* Set udebug.active on all of the task's userspace threads. */ 197 197 198 list_foreach(TASK->threads, th_link, thread_t, thread) { 198 list_foreach(TASK->threads, cur) { 199 thread_t *thread = list_get_instance(cur, thread_t, th_link); 200 199 201 mutex_lock(&thread->udebug.lock); 200 202 if (thread->uspace) { … … 375 377 if (TASK->udebug.dt_state != UDEBUG_TS_ACTIVE) { 376 378 mutex_unlock(&TASK->udebug.lock); 377 free(id_buffer);378 379 return EINVAL; 379 380 } … … 388 389 389 390 /* FIXME: make sure the thread isn't past debug shutdown... */ 390 list_foreach(TASK->threads, th_link, thread_t, thread) { 391 list_foreach(TASK->threads, cur) { 392 thread_t *thread = list_get_instance(cur, thread_t, th_link); 393 391 394 irq_spinlock_lock(&thread->lock, false); 392 395 bool uspace = thread->uspace; … … 457 460 int udebug_args_read(thread_t *thread, void **buffer) 458 461 { 462 /* Prepare a buffer to hold the arguments. */ 463 sysarg_t *arg_buffer = malloc(6 * sizeof(sysarg_t), 0); 464 459 465 /* On success, this will lock t->udebug.lock. */ 460 466 int rc = _thread_op_begin(thread, false); … … 469 475 } 470 476 471 /* Prepare a buffer to hold the arguments. */472 sysarg_t *arg_buffer = malloc(6 * sizeof(sysarg_t), 0);473 474 477 /* Copy to a local buffer before releasing the lock. */ 475 478 memcpy(arg_buffer, thread->udebug.syscall_args, 6 * sizeof(sysarg_t)); … … 500 503 int udebug_regs_read(thread_t *thread, void **buffer) 501 504 { 505 /* Prepare a buffer to hold the data. */ 506 istate_t *state_buf = malloc(sizeof(istate_t), 0); 507 502 508 /* On success, this will lock t->udebug.lock */ 503 509 int rc = _thread_op_begin(thread, false); … … 510 516 return EBUSY; 511 517 } 512 513 /* Prepare a buffer to hold the data. */514 istate_t *state_buf = malloc(sizeof(istate_t), 0);515 518 516 519 /* Copy to the allocated buffer */
Note:
See TracChangeset
for help on using the changeset viewer.
