Changeset c8404d4 in mainline for uspace/app/trace/trace.c


Ignore:
Timestamp:
2009-07-22T18:31:10Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a5facfb
Parents:
9ad5b5cc
Message:

Cope with ipc_call_sync_slow() overwriting input argument with output argument. This fixes the tracer not understanding connect_to_me_blocking().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/trace/trace.c

    r9ad5b5cc rc8404d4  
    6969int next_thread_id;
    7070
     71ipc_call_t thread_ipc_req[THBUF_SIZE];
     72
    7173int phoneid;
    7274bool abort_trace;
     
    340342}
    341343
    342 static void sc_ipc_call_sync_slow(sysarg_t *sc_args)
     344static void sc_ipc_call_sync_slow_b(unsigned thread_id, sysarg_t *sc_args)
    343345{
    344346        ipc_call_t question, reply;
     
    347349        memset(&question, 0, sizeof(question));
    348350        rc = udebug_mem_read(phoneid, &question.args, sc_args[1], sizeof(question.args));
    349         printf("dmr->%d\n", rc);
    350         if (rc < 0) return;
     351        if (rc < 0) {
     352                printf("Error: mem_read->%d\n", rc);
     353                return;
     354        }
     355
     356        thread_ipc_req[thread_id] = question;
     357}
     358
     359static void sc_ipc_call_sync_slow_e(unsigned thread_id, sysarg_t *sc_args)
     360{
     361        ipc_call_t question, reply;
     362        int rc;
    351363
    352364        memset(&reply, 0, sizeof(reply));
    353365        rc = udebug_mem_read(phoneid, &reply.args, sc_args[2], sizeof(reply.args));
    354         printf("dmr->%d\n", rc);
    355         if (rc < 0) return;
    356 
    357         ipcp_call_sync(sc_args[0], &question, &reply);
     366        if (rc < 0) {
     367                printf("Error: mem_read->%d\n", rc);
     368                return;
     369        }
     370
     371        ipcp_call_sync(sc_args[0], &thread_ipc_req[thread_id], &reply);
    358372}
    359373
     
    400414        }
    401415
     416        switch (sc_id) {
     417        case SYS_IPC_CALL_SYNC_SLOW:
     418                sc_ipc_call_sync_slow_b(thread_id, sc_args);
     419                break;
     420        default:
     421                break;
     422        }
     423
    402424        async_serialize_end();
    403425}
     
    440462                break;
    441463        case SYS_IPC_CALL_SYNC_SLOW:
    442                 sc_ipc_call_sync_slow(sc_args);
     464                sc_ipc_call_sync_slow_e(thread_id, sc_args);
    443465                break;
    444466        case SYS_IPC_WAIT:
     
    471493        thread_hash = (uintptr_t)thread_hash_arg;
    472494        thread_id = next_thread_id++;
     495        if (thread_id >= THBUF_SIZE) {
     496                printf("Too many threads.\n");
     497                return ELIMIT;
     498        }
    473499
    474500        printf("Start tracing thread [%d] (hash 0x%lx).\n", thread_id, thread_hash);
Note: See TracChangeset for help on using the changeset viewer.