def trace_to_bb_addrs(trace, project: Project, trace_base):
    """
    convert the trace object to a list of basic blocks, using the given angr project
    """
    bbl_addrs = trace["bb_addrs"]

    mapping: list[ObjectAndBase] | None = None
    if "map" in trace:
        map_dict: dict[str, int] = trace["map"]
        mapping = [
            ObjectAndBase(name, base_addr, _find_object_base_in_project(name, project.am_obj))
            for name, base_addr in map_dict.items()
        ]
        mapping = sorted(mapping, key=lambda o: o.base_addr)  # sort it based on base addresses

    # only used if self.mapping is not available
    project_baddr = None if project.am_none else project.loader.main_object.mapped_base
    runtime_baddr = trace_base  # this will not be used if self.mapping is available

    # convert over all the trace adders using info from the trace
    to_return = filter(
        lambda a: _valid_addr(a, project),
        [_apply_trace_offset(addr, mapping, project_baddr, runtime_baddr) for addr in bbl_addrs],
    )
    return list(to_return)

    convert the trace object to a list of basic blocks, using the given angr project
    
angrmanagement/plugins/coverage/parse_trace.py