Fork us on GitHub Follow us on Facebook Follow us on Twitter

Ignore:
Timestamp:
2010-01-26T22:46:29Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
196a1439, 2314381
Parents:
e515b21a
Message:

Add ability to determine task name and load symbol table from the binary executable. Resolve symbol names in stack traces when dumping.

File:
1 edited

Legend:

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

    re515b21a r3698e44  
    198198        IPC_SET_ARG3(call->data, needed);
    199199        call->buffer = buffer;
     200
     201        ipc_answer(&TASK->kb.box, call);
     202}
     203
     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)
     211{
     212        unative_t uspace_addr;
     213        unative_t to_copy;
     214        size_t data_size;
     215        size_t buf_size;
     216        void *data;
     217
     218        uspace_addr = IPC_GET_ARG2(call->data); /* Destination address */
     219        buf_size = IPC_GET_ARG3(call->data);    /* Dest. buffer size */
     220
     221        /*
     222         * Read task name.
     223         */
     224        udebug_name_read((char **) &data, &data_size);
     225
     226        /* Copy MAX(buf_size, data_size) bytes */
     227
     228        if (buf_size > data_size)
     229                to_copy = data_size;
     230        else
     231                to_copy = buf_size;
     232
     233        /*
     234         * Make use of call->buffer to transfer data to caller's userspace
     235         */
     236
     237        IPC_SET_RETVAL(call->data, 0);
     238        /* ARG1=dest, ARG2=size as in IPC_M_DATA_READ so that
     239           same code in process_answer() can be used
     240           (no way to distinguish method in answer) */
     241        IPC_SET_ARG1(call->data, uspace_addr);
     242        IPC_SET_ARG2(call->data, to_copy);
     243
     244        IPC_SET_ARG3(call->data, data_size);
     245        call->buffer = data;
    200246
    201247        ipc_answer(&TASK->kb.box, call);
     
    409455                udebug_receive_thread_read(call);
    410456                break;
     457        case UDEBUG_M_NAME_READ:
     458                udebug_receive_name_read(call);
     459                break;
    411460        case UDEBUG_M_AREAS_READ:
    412461                udebug_receive_areas_read(call);
Note: See TracChangeset for help on using the changeset viewer.