fn print_backtrace(base: Address, compiled_callsite_table: &HashMap<Address, CompiledCallsite>) {
    if log::max_log_level() < log::LogLevelFilter::Debug {
        return;
    }

    debug!("BACKTRACE: ");
    let cur_thread = thread::MuThread::current();
    let ref vm = cur_thread.vm;
    // compiled_funcs: RwLock<HashMap<MuID, RwLock<CompiledFunction>>>;
    let compiled_funcs = vm.compiled_funcs().read().unwrap();
    let mut frame_pointer = base;
    let mut frame_count = 0;

    loop {
        let callsite = get_return_address(frame_pointer);
        frame_pointer = get_previous_frame_pointer(frame_pointer);
        if frame_pointer.is_zero() {
            return;
        }

        if compiled_callsite_table.contains_key(&callsite) {
            let function_version = compiled_callsite_table
                .get(&callsite)
                .unwrap()
                .function_version;
            let compiled_func = compiled_funcs
                .get(&function_version)
                .unwrap()
                .read()
                .unwrap();

            debug!(
                "\tframe {:2}: 0x{:x} - {} (fid: #{}, fvid: #{}) at 0x{:x} - {}",
                frame_count,
                compiled_func.start.to_address(),
                vm.get_name_for_func(compiled_func.func_id),
                compiled_func.func_id,
                compiled_func.func_ver_id,
                callsite,
                get_symbol_name(callsite)
            );
        } else {
            let (func_name, func_start) = get_function_info(callsite);
            debug!(
                "\tframe {:2}: 0x{:x} - {} at 0x{:x}",
                frame_count,
                func_start,
                func_name,
                callsite
            );
            debug!("\tother native frames...");
            break;
        }

        frame_count += 1;
    }
}
/// This function may segfault or panic when it reaches the bottom of the stack
//  TODO: Determine where the bottom is without segfaulting
This function may segfault or panic when it reaches the bottom of the stack
TODO: Determine where the bottom is without segfaulting
This function may segfault or panic when it reaches the bottom of the stack TODO : Determine where the bottom is without segfaulting
fn print_backtrace(base: Address, compiled_callsite_table: &HashMap<Address, CompiledCallsite>) {
    if log::max_log_level() < log::LogLevelFilter::Debug {
        return;
    }
    debug!("BACKTRACE: ");
    let cur_thread = thread::MuThread::current();
    let ref vm = cur_thread.vm;
    // compiled_funcs: RwLock<HashMap<MuID, RwLock<CompiledFunction>>>;
    let compiled_funcs = vm.compiled_funcs().read().unwrap();
    let mut frame_pointer = base;
    let mut frame_count = 0;
    loop {
        let callsite = get_return_address(frame_pointer);
        frame_pointer = get_previous_frame_pointer(frame_pointer);
        if frame_pointer.is_zero() {
            return;
        }
        if compiled_callsite_table.contains_key(&callsite) {
            let function_version = compiled_callsite_table
                .get(&callsite)
                .unwrap()
                .function_version;
            let compiled_func = compiled_funcs
                .get(&function_version)
                .unwrap()
                .read()
                .unwrap();
            debug!(
                "\tframe {:2}: 0x{:x} - {} (fid: #{}, fvid: #{}) at 0x{:x} - {}",
                frame_count,
                compiled_func.start.to_address(),
                vm.get_name_for_func(compiled_func.func_id),
                compiled_func.func_id,
                compiled_func.func_ver_id,
                callsite,
                get_symbol_name(callsite)
            );
        } else {
            let (func_name, func_start) = get_function_info(callsite);
            debug!(
                "\tframe {:2}: 0x{:x} - {} at 0x{:x}",
                frame_count,
                func_start,
                func_name,
                callsite
            );
            debug!("\tother native frames...");
            break;
        }
        frame_count += 1;
    }
}
fn print_backtrace ( base : Address , compiled_callsite_table : & HashMap < Address , CompiledCallsite > ) { if log :: max_log_level ( ) < log :: LogLevelFilter :: Debug { return ; } debug ! ( " " ) ; let cur_thread = thread :: MuThread :: current ( ) ; let ref vm = cur_thread . vm ; // compiled_funcs: RwLock<HashMap<MuID, RwLock<CompiledFunction>>>; let compiled_funcs = vm . compiled_funcs ( ) . read ( ) . unwrap ( ) ; let mut frame_pointer = base ; let mut frame_count = 0 ; loop { let callsite = get_return_address ( frame_pointer ) ; frame_pointer = get_previous_frame_pointer ( frame_pointer ) ; if frame_pointer . is_zero ( ) { return ; } if compiled_callsite_table . contains_key ( & callsite ) { let function_version = compiled_callsite_table . get ( & callsite ) . unwrap ( ) . function_version ; let compiled_func = compiled_funcs . get ( & function_version ) . unwrap ( ) . read ( ) . unwrap ( ) ; debug ! ( " \t " frame_count compiled_func start to_address ( ) vm get_name_for_func ( compiled_func func_id ) compiled_func func_id compiled_func func_ver_id callsite get_symbol_name ( callsite ) ) ; } else { let ( func_name , func_start ) = get_function_info ( callsite ) ; debug ! ( " \t " frame_count func_start func_name callsite ) ; debug ! ( " \t " ) ; break ; } frame_count += 1 ; } }
This function may segfault or panic when it reaches the bottom of the stack
TODO: Determine where the bottom is without segfaulting
This function may segfault or panic when it reaches the bottom of the stack TODO : Determine where the bottom is without segfaulting
base
Address
compiled_callsite_table
&HashMap<Address, CompiledCallsite>
base
Address
compiled_callsite_table
&HashMap<Address, CompiledCallsite>