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