Пример #1
0
Call *Parser::parse_leave(Mode mode) {
    unsigned call_no = read_uint();
    Call *call = NULL;
    for (CallList::iterator it = calls.begin(); it != calls.end(); ++it) {
        if ((*it)->no == call_no) {
            call = *it;
            calls.erase(it);
            break;
        }
    }
    if (!call) {
        /* This might happen on random access, when an asynchronous call is stranded
         * between two frames.  We won't return this call, but we still need to skip 
         * over its data.
         */
        const FunctionSig sig = {0, NULL, 0, NULL};
        call = new Call(&sig, 0, 0);
        parse_call_details(call, SCAN);
        delete call;
        return NULL;
    }

    if (parse_call_details(call, mode)) {
        return call;
    } else {
        delete call;
        return NULL;
    }
}
Пример #2
0
void Parser::parse_enter(void) {
    size_t id = read_uint();

    FunctionSig *sig = lookup(functions, id);
    if (!sig) {
        sig = new FunctionSig;
        sig->id = id;
        sig->name = read_string();
        sig->num_args = read_uint();
        const char **arg_names = new const char *[sig->num_args];
        for (unsigned i = 0; i < sig->num_args; ++i) {
            arg_names[i] = read_string();
        }
        sig->arg_names = arg_names;
        functions[id] = sig;
    }
    assert(sig);

    Call *call = new Call(sig);
    call->no = next_call_no++;

    if (parse_call_details(call)) {
        calls.push_back(call);
    } else {
        delete call;
    }
}
Пример #3
0
Call *Parser::parse_leave(Mode mode) {
    unsigned call_no = read_uint();
    Call *call = NULL;
    for (CallList::iterator it = calls.begin(); it != calls.end(); ++it) {
        if ((*it)->no == call_no) {
            call = *it;
            calls.erase(it);
            break;
        }
    }
    if (!call) {
        return NULL;
    }

    if (parse_call_details(call, mode)) {
        return call;
    } else {
        delete call;
        return NULL;
    }
}
Пример #4
0
void Parser::parse_enter(Mode mode) {
    unsigned thread_id;

    if (version >= 4) {
        thread_id = read_uint();
    } else {
        thread_id = 0;
    }

    FunctionSigFlags *sig = parse_function_sig();

    Call *call = new Call(sig, sig->flags, thread_id);

    call->no = next_call_no++;

    if (parse_call_details(call, mode)) {
        calls.push_back(call);
    } else {
        delete call;
    }
}