src/sys/arm/arm/unwind.c
/* Performs the unwind of a function */
Performs the unwind of a function
Performs the unwind of a function
static int
unwind_tab(struct unwind_state *state)
{
	uint32_t entry;
	state->registers[PC] = 0;
	entry = *state->insn & ENTRY_MASK;
	if (entry == ENTRY_ARM_SU16) {
		state->byte = 2;
		state->entries = 1;
	} else if (entry == ENTRY_ARM_LU16) {
		state->byte = 1;
		state->entries = ((*state->insn >> 16) & 0xFF) + 1;
	} else {
#if 0
		db_printf("Unknown entry: %x\n", entry);
#endif
		return 1;
	}
	while (state->entries > 0) {
		if (unwind_exec_insn(state) != 0)
			return 1;
	}
	if (state->registers[PC] == 0) {
		state->registers[PC] = state->registers[LR];
		if (state->start_pc != state->registers[PC])
			state->update_mask |= 1 << PC;
	}
	return 0;
}
static int unwind_tab ( struct unwind_state * state ) { uint32_t entry ; state -> registers [ PC ] = 0 ; entry = * state -> insn & ENTRY_MASK ; if ( entry == ENTRY_ARM_SU16 ) { state -> byte = 2 ; state -> entries = 1 ; } else if ( entry == ENTRY_ARM_LU16 ) { state -> byte = 1 ; state -> entries = ( ( * state -> insn >> 16 ) & 0xFF ) + 1 ; } else { #if 0 db_printf ( " \n " , entry ) ; #endif return 1 ; } while ( state -> entries > 0 ) { if ( unwind_exec_insn ( state ) != 0 ) return 1 ; } if ( state -> registers [ PC ] == 0 ) { state -> registers [ PC ] = state -> registers [ LR ] ; if ( state -> start_pc != state -> registers [ PC ] ) state -> update_mask |= 1 << PC ; } return 0 ; }
Performs the unwind of a function
Performs the unwind of a function
/* Set PC to a known value */ /* Read the personality */ /*
	 * The program counter was not updated, load it from the link register.
	 */ /*
		 * If the program counter changed, flag it in the update mask.
		 */