Ignore:
Timestamp:
2010-01-26T22:49:26Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bca408b
Parents:
bb0d3d24 (diff), 3698e44 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge jsvoboda/helenos/taskdump: Taskdump now prints stack traces, even with symbolic names.

File:
1 edited

Legend:

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

    rbb0d3d24 r2314381  
    202202}
    203203
    204 /** Process an AREAS_READ call.
    205  *
    206  * Returns a list of address space areas in the current task, as an array
    207  * of as_area_info_t structures.
    208  *
    209  * @param call  The call structure.
    210  */
    211 static void udebug_receive_areas_read(call_t *call)
     204/** Process a NAME_READ call.
     205 *
     206 * Returns a string containing the name of the task.
     207 *
     208 * @param call  The call structure.
     209 */
     210static void udebug_receive_name_read(call_t *call)
    212211{
    213212        unative_t uspace_addr;
     
    221220
    222221        /*
    223          * Read area list.
    224          */
    225         as_get_area_info(AS, (as_area_info_t **) &data, &data_size);
     222         * Read task name.
     223         */
     224        udebug_name_read((char **) &data, &data_size);
    226225
    227226        /* Copy MAX(buf_size, data_size) bytes */
     
    249248}
    250249
     250/** Process an AREAS_READ call.
     251 *
     252 * Returns a list of address space areas in the current task, as an array
     253 * of as_area_info_t structures.
     254 *
     255 * @param call  The call structure.
     256 */
     257static void udebug_receive_areas_read(call_t *call)
     258{
     259        unative_t uspace_addr;
     260        unative_t to_copy;
     261        size_t data_size;
     262        size_t buf_size;
     263        void *data;
     264
     265        uspace_addr = IPC_GET_ARG2(call->data); /* Destination address */
     266        buf_size = IPC_GET_ARG3(call->data);    /* Dest. buffer size */
     267
     268        /*
     269         * Read area list.
     270         */
     271        as_get_area_info(AS, (as_area_info_t **) &data, &data_size);
     272
     273        /* Copy MAX(buf_size, data_size) bytes */
     274
     275        if (buf_size > data_size)
     276                to_copy = data_size;
     277        else
     278                to_copy = buf_size;
     279
     280        /*
     281         * Make use of call->buffer to transfer data to caller's userspace
     282         */
     283
     284        IPC_SET_RETVAL(call->data, 0);
     285        /* ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
     286           same code in process_answer() can be used
     287           (no way to distinguish method in answer) */
     288        IPC_SET_ARG1(call->data, uspace_addr);
     289        IPC_SET_ARG2(call->data, to_copy);
     290
     291        IPC_SET_ARG3(call->data, data_size);
     292        call->buffer = data;
     293
     294        ipc_answer(&TASK->kb.box, call);
     295}
     296
    251297
    252298/** Process an ARGS_READ call.
     
    287333        ipc_answer(&TASK->kb.box, call);
    288334}
     335
     336/** Receive a REGS_READ call.
     337 *
     338 * Reads the thread's register state (istate structure).
     339 */
     340static void udebug_receive_regs_read(call_t *call)
     341{
     342        thread_t *t;
     343        unative_t uspace_addr;
     344        unative_t to_copy;
     345        void *buffer;
     346        int rc;
     347
     348        t = (thread_t *) IPC_GET_ARG2(call->data);
     349
     350        rc = udebug_regs_read(t, &buffer);
     351        if (rc < 0) {
     352                IPC_SET_RETVAL(call->data, rc);
     353                ipc_answer(&TASK->kb.box, call);
     354                return;
     355        }
     356
     357        /*
     358         * Make use of call->buffer to transfer data to caller's userspace
     359         */
     360
     361        uspace_addr = IPC_GET_ARG3(call->data);
     362        to_copy = sizeof(istate_t);
     363
     364        IPC_SET_RETVAL(call->data, 0);
     365        /* ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
     366           same code in process_answer() can be used
     367           (no way to distinguish method in answer) */
     368        IPC_SET_ARG1(call->data, uspace_addr);
     369        IPC_SET_ARG2(call->data, to_copy);
     370
     371        call->buffer = buffer;
     372
     373        ipc_answer(&TASK->kb.box, call);
     374}
     375
    289376
    290377/** Process an MEM_READ call.
     
    368455                udebug_receive_thread_read(call);
    369456                break;
     457        case UDEBUG_M_NAME_READ:
     458                udebug_receive_name_read(call);
     459                break;
    370460        case UDEBUG_M_AREAS_READ:
    371461                udebug_receive_areas_read(call);
     
    374464                udebug_receive_args_read(call);
    375465                break;
     466        case UDEBUG_M_REGS_READ:
     467                udebug_receive_regs_read(call);
     468                break;
    376469        case UDEBUG_M_MEM_READ:
    377470                udebug_receive_mem_read(call);
Note: See TracChangeset for help on using the changeset viewer.