예제 #1
0
파일: marks.py 프로젝트: dsiegler2000/Coeus
def read_jitlog_counter(ctx, trace, fileobj):
    addr = ctx.read_le_addr(fileobj)
    type = read_char(fileobj)
    count = read_le_u64(fileobj)
    # entry: gets the globally numbered addr of the loop
    # bridge: gets the addr of the fail descr
    # label: gets the addr of the loop token
    trace = ctx.forest.get_trace_by_id(addr)
    if trace:
        trace.add_up_enter_count(count)
        return True
    else:
        if type == 'e':
            # it can happen that jitlog counters are present,
            # even though there is no trace to be found.
            # vm starts up (bootstrapping creates 1-2 trace),
            # jitlog is enabled afterwards
            return False
        assert type == 'b' or type == 'l'
        point_in_trace = ctx.forest.get_point_in_trace_by_descr(addr)
        if point_in_trace:
            if type == 'b':
                point_in_trace.trace.add_up_enter_count(count)
            else:
                point_in_trace.add_up_enter_count(count)
            return True
    sys.stderr.write("trace with 0x%x (type '%c' was executed %d times" \
          " but was not recorded in the log\n" % (addr, type, count))
    return False
예제 #2
0
def read_jitlog_counter(ctx, trace, fileobj):
    addr = ctx.read_le_addr(fileobj)
    type = read_char(fileobj)
    count = read_le_u64(fileobj)
    # entry: gets the globally numbered addr of the loop
    # bridge: gets the addr of the fail descr
    # label: gets the addr of the loop token
    trace = ctx.forest.get_trace_by_id(addr)
    if trace:
        trace.add_up_enter_count(count)
        return True
    else:
        if type == "e":
            # it can happen that jitlog counters are present,
            # even though there is no trace to be found.
            # vm starts up (bootstrapping creates 1-2 trace),
            # jitlog is enabled afterwards
            return False
        assert type == "b" or type == "l"
        point_in_trace = ctx.forest.get_point_in_trace_by_descr(addr)
        if point_in_trace:
            if type == "b":
                point_in_trace.trace.add_up_enter_count(count)
            else:
                point_in_trace.add_up_enter_count(count)
            return True
    sys.stderr.write(
        "trace with 0x%x (type '%c' was executed %d times" " but was not recorded in the log\n" % (addr, type, count)
    )
    return False
예제 #3
0
파일: marks.py 프로젝트: dsiegler2000/Coeus
def read_tmp_callback(ctx, trace, fileobj):
    descr_nmr = ctx.read_le_addr(fileobj)
    uniqueid = read_le_u64(fileobj) # might be -1

    ctx.forest.add_tmp_callback(descr_nmr, uniqueid)
예제 #4
0
 def decode(self, fileobj):
     assert fileobj.read(1) == b'\x00'
     return read_le_u64(fileobj)
예제 #5
0
def read_tmp_callback(ctx, trace, fileobj):
    descr_nmr = ctx.read_le_addr(fileobj)
    uniqueid = read_le_u64(fileobj)  # might be -1

    ctx.forest.add_tmp_callback(descr_nmr, uniqueid)