Ignore:
File:
1 edited

Legend:

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

    r87a2f9b r6eef3c4  
    196196        /* Set udebug.active on all of the task's userspace threads. */
    197197       
    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               
    199201                mutex_lock(&thread->udebug.lock);
    200202                if (thread->uspace) {
     
    375377        if (TASK->udebug.dt_state != UDEBUG_TS_ACTIVE) {
    376378                mutex_unlock(&TASK->udebug.lock);
    377                 free(id_buffer);
    378379                return EINVAL;
    379380        }
     
    388389       
    389390        /* 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               
    391394                irq_spinlock_lock(&thread->lock, false);
    392395                bool uspace = thread->uspace;
     
    457460int udebug_args_read(thread_t *thread, void **buffer)
    458461{
     462        /* Prepare a buffer to hold the arguments. */
     463        sysarg_t *arg_buffer = malloc(6 * sizeof(sysarg_t), 0);
     464       
    459465        /* On success, this will lock t->udebug.lock. */
    460466        int rc = _thread_op_begin(thread, false);
     
    469475        }
    470476       
    471         /* Prepare a buffer to hold the arguments. */
    472         sysarg_t *arg_buffer = malloc(6 * sizeof(sysarg_t), 0);
    473        
    474477        /* Copy to a local buffer before releasing the lock. */
    475478        memcpy(arg_buffer, thread->udebug.syscall_args, 6 * sizeof(sysarg_t));
     
    500503int udebug_regs_read(thread_t *thread, void **buffer)
    501504{
     505        /* Prepare a buffer to hold the data. */
     506        istate_t *state_buf = malloc(sizeof(istate_t), 0);
     507       
    502508        /* On success, this will lock t->udebug.lock */
    503509        int rc = _thread_op_begin(thread, false);
     
    510516                return EBUSY;
    511517        }
    512        
    513         /* Prepare a buffer to hold the data. */
    514         istate_t *state_buf = malloc(sizeof(istate_t), 0);
    515518       
    516519        /* Copy to the allocated buffer */
Note: See TracChangeset for help on using the changeset viewer.