def determineException(vm, m):
    """
    Returns try-catch handler inside the method.

    :param vm: a :class:`~DalvikVMFormat`
    :param m: a :class:`~EncodedMethod`
    :return:
    """
    if m.get_code().get_tries_size() <= 0:
        return []
    h_off = {}
    handler_catch_list = m.get_code().get_handlers()
    for try_item in m.get_code().get_tries():
        offset_handler = try_item.get_handler_off(
            ) + handler_catch_list.get_off()
        if offset_handler in h_off:
            h_off[offset_handler].append([try_item])
        else:
            h_off[offset_handler] = []
            h_off[offset_handler].append([try_item])
    for handler_catch in handler_catch_list.get_list():
        if handler_catch.get_off() not in h_off:
            continue
        for i in h_off[handler_catch.get_off()]:
            i.append(handler_catch)
    exceptions = []
    for i in h_off:
        for value in h_off[i]:
            try_value = value[0]
            z = [try_value.get_start_addr() * 2, try_value.get_start_addr() *
                2 + try_value.get_insn_count() * 2 - 1]
            handler_catch = value[1]
            if handler_catch.get_size() <= 0:
                z.append(['Ljava/lang/Throwable;', handler_catch.
                    get_catch_all_addr() * 2])
            for handler in handler_catch.get_handlers():
                z.append([vm.get_cm_type(handler.get_type_idx()), handler.
                    get_addr() * 2])
            exceptions.append(z)
    return exceptions
