Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/udebug/udebug_ops.c

    r6eef3c4 r87a2f9b  
    196196        /* Set udebug.active on all of the task's userspace threads. */
    197197       
    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) {
    201199                mutex_lock(&thread->udebug.lock);
    202200                if (thread->uspace) {
     
    377375        if (TASK->udebug.dt_state != UDEBUG_TS_ACTIVE) {
    378376                mutex_unlock(&TASK->udebug.lock);
     377                free(id_buffer);
    379378                return EINVAL;
    380379        }
     
    389388       
    390389        /* 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) {
    394391                irq_spinlock_lock(&thread->lock, false);
    395392                bool uspace = thread->uspace;
     
    460457int udebug_args_read(thread_t *thread, void **buffer)
    461458{
    462         /* Prepare a buffer to hold the arguments. */
    463         sysarg_t *arg_buffer = malloc(6 * sizeof(sysarg_t), 0);
    464        
    465459        /* On success, this will lock t->udebug.lock. */
    466460        int rc = _thread_op_begin(thread, false);
     
    475469        }
    476470       
     471        /* Prepare a buffer to hold the arguments. */
     472        sysarg_t *arg_buffer = malloc(6 * sizeof(sysarg_t), 0);
     473       
    477474        /* Copy to a local buffer before releasing the lock. */
    478475        memcpy(arg_buffer, thread->udebug.syscall_args, 6 * sizeof(sysarg_t));
     
    503500int udebug_regs_read(thread_t *thread, void **buffer)
    504501{
    505         /* Prepare a buffer to hold the data. */
    506         istate_t *state_buf = malloc(sizeof(istate_t), 0);
    507        
    508502        /* On success, this will lock t->udebug.lock */
    509503        int rc = _thread_op_begin(thread, false);
     
    516510                return EBUSY;
    517511        }
     512       
     513        /* Prepare a buffer to hold the data. */
     514        istate_t *state_buf = malloc(sizeof(istate_t), 0);
    518515       
    519516        /* Copy to the allocated buffer */
Note: See TracChangeset for help on using the changeset viewer.