• Home
  • Raw
  • Download

Lines Matching refs:state

664 static int advance_loc(unsigned long delta, struct unwind_state *state)  in advance_loc()  argument
666 state->loc += delta * state->codeAlign; in advance_loc()
671 unw_debug("delta %3lu => loc 0x%lx: ", delta, state->loc); in advance_loc()
676 struct unwind_state *state) in set_rule() argument
678 if (reg < ARRAY_SIZE(state->regs)) { in set_rule()
679 state->regs[reg].where = where; in set_rule()
680 state->regs[reg].value = value; in set_rule()
705 signed ptrType, struct unwind_state *state) in processCFI() argument
715 if (start != state->cieStart) { in processCFI()
716 state->loc = state->org; in processCFI()
718 processCFI(state->cieStart, state->cieEnd, 0, ptrType, in processCFI()
719 state); in processCFI()
720 if (targetLoc == 0 && state->label == NULL) in processCFI()
735 state->loc = read_pointer(&ptr.p8, end, in processCFI()
737 if (state->loc == 0) in processCFI()
739 unw_debug("cfa_set_loc: 0x%lx ", state->loc); in processCFI()
744 && advance_loc(*ptr.p8++, state); in processCFI()
752 && advance_loc(value, state); in processCFI()
757 && advance_loc(*ptr.p32++, state); in processCFI()
763 get_uleb128(&ptr.p8, end), state); in processCFI()
768 get_uleb128(&ptr.p8, end), state); in processCFI()
773 get_sleb128(&ptr.p8, end), state); in processCFI()
778 get_sleb128(&ptr.p8, end), state); in processCFI()
787 state); in processCFI()
794 get_uleb128(&ptr.p8, end), state); in processCFI()
798 if (ptr.p8 == state->label) { in processCFI()
799 state->label = NULL; in processCFI()
802 if (state->stackDepth >= MAX_STACK_DEPTH) in processCFI()
804 state->stack[state->stackDepth++] = ptr.p8; in processCFI()
808 if (state->stackDepth) { in processCFI()
809 const uleb128_t loc = state->loc; in processCFI()
810 const u8 *label = state->label; in processCFI()
812 state->label = in processCFI()
813 state->stack[state->stackDepth - 1]; in processCFI()
814 memcpy(&state->cfa, &badCFA, in processCFI()
815 sizeof(state->cfa)); in processCFI()
816 memset(state->regs, 0, in processCFI()
817 sizeof(state->regs)); in processCFI()
818 state->stackDepth = 0; in processCFI()
821 state); in processCFI()
822 state->loc = loc; in processCFI()
823 state->label = label; in processCFI()
828 state->cfa.reg = get_uleb128(&ptr.p8, end); in processCFI()
829 unw_debug("cfa_def_cfa: r%lu ", state->cfa.reg); in processCFI()
832 state->cfa.offs = get_uleb128(&ptr.p8, end); in processCFI()
834 state->cfa.offs); in processCFI()
837 state->cfa.reg = get_uleb128(&ptr.p8, end); in processCFI()
840 state->cfa.offs = get_sleb128(&ptr.p8, end) in processCFI()
841 * state->dataAlign; in processCFI()
845 state->cfa.reg = get_uleb128(&ptr.p8, end); in processCFI()
859 state); in processCFI()
870 result = advance_loc(*ptr.p8++ & 0x3f, state); in processCFI()
876 state); in processCFI()
880 set_rule(*ptr.p8++ & 0x3f, Nowhere, 0, state); in processCFI()
886 if (result && targetLoc != 0 && targetLoc < state->loc) in processCFI()
894 targetLoc < state->loc && */ state->label == NULL)); in processCFI()
910 struct unwind_state state; in arc_unwind() local
1019 memset(&state, 0, sizeof(state)); in arc_unwind()
1020 state.cieEnd = ptr; /* keep here temporarily */ in arc_unwind()
1051 state.codeAlign = get_uleb128(&ptr, end); in arc_unwind()
1053 state.dataAlign = get_sleb128(&ptr, end); in arc_unwind()
1054 if (state.codeAlign == 0 || state.dataAlign == 0 || ptr >= end) in arc_unwind()
1058 state.version <= 1 ? *ptr++ : get_uleb128(&ptr, in arc_unwind()
1063 unw_debug("data Align: %ld\n", state.dataAlign); in arc_unwind()
1064 unw_debug("code Align: %lu\n", state.codeAlign); in arc_unwind()
1079 state.cieStart = ptr; in arc_unwind()
1080 ptr = state.cieEnd; in arc_unwind()
1081 state.cieEnd = end; in arc_unwind()
1135 state.org = startLoc; in arc_unwind()
1136 memcpy(&state.cfa, &badCFA, sizeof(state.cfa)); in arc_unwind()
1145 if (!processCFI(ptr, end, pc, ptrType, &state) in arc_unwind()
1146 || state.loc > endLoc in arc_unwind()
1148 || state.cfa.reg >= ARRAY_SIZE(reg_info) in arc_unwind()
1149 || reg_info[state.cfa.reg].width != sizeof(unsigned long) in arc_unwind()
1150 || state.cfa.offs % sizeof(unsigned long)) in arc_unwind()
1157 for (i = 0; i < ARRAY_SIZE(state.regs); ++i) { in arc_unwind()
1162 switch (state.regs[i].where) { in arc_unwind()
1166 unw_debug(" r%d: c(%lu),", i, state.regs[i].value); in arc_unwind()
1169 unw_debug(" r%d: r(%lu),", i, state.regs[i].value); in arc_unwind()
1172 unw_debug(" r%d: v(%lu),", i, state.regs[i].value); in arc_unwind()
1182 && !UNW_DEFAULT_RA(state.regs[retAddrReg], state.dataAlign)) in arc_unwind()
1184 cfa = FRAME_REG(state.cfa.reg, unsigned long) + state.cfa.offs; in arc_unwind()
1193 state.cfa.reg, state.cfa.offs, cfa); in arc_unwind()
1195 for (i = 0; i < ARRAY_SIZE(state.regs); ++i) { in arc_unwind()
1197 if (state.regs[i].where == Nowhere) in arc_unwind()
1201 switch (state.regs[i].where) { in arc_unwind()
1205 if (state.regs[i].value >= ARRAY_SIZE(reg_info) in arc_unwind()
1206 || REG_INVALID(state.regs[i].value) in arc_unwind()
1208 reg_info[state.regs[i].value].width) in arc_unwind()
1210 switch (reg_info[state.regs[i].value].width) { in arc_unwind()
1212 state.regs[i].value = in arc_unwind()
1213 FRAME_REG(state.regs[i].value, const u8); in arc_unwind()
1216 state.regs[i].value = in arc_unwind()
1217 FRAME_REG(state.regs[i].value, const u16); in arc_unwind()
1220 state.regs[i].value = in arc_unwind()
1221 FRAME_REG(state.regs[i].value, const u32); in arc_unwind()
1225 state.regs[i].value = in arc_unwind()
1226 FRAME_REG(state.regs[i].value, const u64); in arc_unwind()
1238 for (i = 0; i < ARRAY_SIZE(state.regs); ++i, fptr++) { in arc_unwind()
1242 switch (state.regs[i].where) { in arc_unwind()
1253 FRAME_REG(i, u8) = state.regs[i].value; in arc_unwind()
1256 FRAME_REG(i, u16) = state.regs[i].value; in arc_unwind()
1259 FRAME_REG(i, u32) = state.regs[i].value; in arc_unwind()
1263 FRAME_REG(i, u64) = state.regs[i].value; in arc_unwind()
1273 FRAME_REG(i, unsigned long) = cfa + state.regs[i].value in arc_unwind()
1274 * state.dataAlign; in arc_unwind()
1277 addr = cfa + state.regs[i].value * state.dataAlign; in arc_unwind()
1279 if ((state.regs[i].value * state.dataAlign) in arc_unwind()