• Home
  • Raw
  • Download

Lines Matching refs:state

665 static int advance_loc(unsigned long delta, struct unwind_state *state)  in advance_loc()  argument
667 state->loc += delta * state->codeAlign; in advance_loc()
672 unw_debug("delta %3lu => loc 0x%lx: ", delta, state->loc); in advance_loc()
677 struct unwind_state *state) in set_rule() argument
679 if (reg < ARRAY_SIZE(state->regs)) { in set_rule()
680 state->regs[reg].where = where; in set_rule()
681 state->regs[reg].value = value; in set_rule()
706 signed ptrType, struct unwind_state *state) in processCFI() argument
716 if (start != state->cieStart) { in processCFI()
717 state->loc = state->org; in processCFI()
719 processCFI(state->cieStart, state->cieEnd, 0, ptrType, in processCFI()
720 state); in processCFI()
721 if (targetLoc == 0 && state->label == NULL) in processCFI()
736 state->loc = read_pointer(&ptr.p8, end, in processCFI()
738 if (state->loc == 0) in processCFI()
740 unw_debug("cfa_set_loc: 0x%lx ", state->loc); in processCFI()
745 && advance_loc(*ptr.p8++, state); in processCFI()
753 && advance_loc(value, state); in processCFI()
758 && advance_loc(*ptr.p32++, state); in processCFI()
764 get_uleb128(&ptr.p8, end), state); in processCFI()
769 get_uleb128(&ptr.p8, end), state); in processCFI()
774 get_sleb128(&ptr.p8, end), state); in processCFI()
779 get_sleb128(&ptr.p8, end), state); in processCFI()
788 state); in processCFI()
795 get_uleb128(&ptr.p8, end), state); in processCFI()
799 if (ptr.p8 == state->label) { in processCFI()
800 state->label = NULL; in processCFI()
803 if (state->stackDepth >= MAX_STACK_DEPTH) in processCFI()
805 state->stack[state->stackDepth++] = ptr.p8; in processCFI()
809 if (state->stackDepth) { in processCFI()
810 const uleb128_t loc = state->loc; in processCFI()
811 const u8 *label = state->label; in processCFI()
813 state->label = in processCFI()
814 state->stack[state->stackDepth - 1]; in processCFI()
815 memcpy(&state->cfa, &badCFA, in processCFI()
816 sizeof(state->cfa)); in processCFI()
817 memset(state->regs, 0, in processCFI()
818 sizeof(state->regs)); in processCFI()
819 state->stackDepth = 0; in processCFI()
822 state); in processCFI()
823 state->loc = loc; in processCFI()
824 state->label = label; in processCFI()
829 state->cfa.reg = get_uleb128(&ptr.p8, end); in processCFI()
830 unw_debug("cfa_def_cfa: r%lu ", state->cfa.reg); in processCFI()
833 state->cfa.offs = get_uleb128(&ptr.p8, end); in processCFI()
835 state->cfa.offs); in processCFI()
838 state->cfa.reg = get_uleb128(&ptr.p8, end); in processCFI()
841 state->cfa.offs = get_sleb128(&ptr.p8, end) in processCFI()
842 * state->dataAlign; in processCFI()
846 state->cfa.reg = get_uleb128(&ptr.p8, end); in processCFI()
860 state); in processCFI()
871 result = advance_loc(*ptr.p8++ & 0x3f, state); in processCFI()
877 state); in processCFI()
881 set_rule(*ptr.p8++ & 0x3f, Nowhere, 0, state); in processCFI()
887 if (result && targetLoc != 0 && targetLoc < state->loc) in processCFI()
895 targetLoc < state->loc && */ state->label == NULL)); in processCFI()
911 struct unwind_state state; in arc_unwind() local
1020 memset(&state, 0, sizeof(state)); in arc_unwind()
1021 state.cieEnd = ptr; /* keep here temporarily */ in arc_unwind()
1052 state.codeAlign = get_uleb128(&ptr, end); in arc_unwind()
1054 state.dataAlign = get_sleb128(&ptr, end); in arc_unwind()
1055 if (state.codeAlign == 0 || state.dataAlign == 0 || ptr >= end) in arc_unwind()
1059 state.version <= 1 ? *ptr++ : get_uleb128(&ptr, in arc_unwind()
1064 unw_debug("data Align: %ld\n", state.dataAlign); in arc_unwind()
1065 unw_debug("code Align: %lu\n", state.codeAlign); in arc_unwind()
1080 state.cieStart = ptr; in arc_unwind()
1081 ptr = state.cieEnd; in arc_unwind()
1082 state.cieEnd = end; in arc_unwind()
1136 state.org = startLoc; in arc_unwind()
1137 memcpy(&state.cfa, &badCFA, sizeof(state.cfa)); in arc_unwind()
1146 if (!processCFI(ptr, end, pc, ptrType, &state) in arc_unwind()
1147 || state.loc > endLoc in arc_unwind()
1149 || state.cfa.reg >= ARRAY_SIZE(reg_info) in arc_unwind()
1150 || reg_info[state.cfa.reg].width != sizeof(unsigned long) in arc_unwind()
1151 || state.cfa.offs % sizeof(unsigned long)) in arc_unwind()
1158 for (i = 0; i < ARRAY_SIZE(state.regs); ++i) { in arc_unwind()
1163 switch (state.regs[i].where) { in arc_unwind()
1167 unw_debug(" r%d: c(%lu),", i, state.regs[i].value); in arc_unwind()
1170 unw_debug(" r%d: r(%lu),", i, state.regs[i].value); in arc_unwind()
1173 unw_debug(" r%d: v(%lu),", i, state.regs[i].value); in arc_unwind()
1183 && !UNW_DEFAULT_RA(state.regs[retAddrReg], state.dataAlign)) in arc_unwind()
1185 cfa = FRAME_REG(state.cfa.reg, unsigned long) + state.cfa.offs; in arc_unwind()
1194 state.cfa.reg, state.cfa.offs, cfa); in arc_unwind()
1196 for (i = 0; i < ARRAY_SIZE(state.regs); ++i) { in arc_unwind()
1198 if (state.regs[i].where == Nowhere) in arc_unwind()
1202 switch (state.regs[i].where) { in arc_unwind()
1206 if (state.regs[i].value >= ARRAY_SIZE(reg_info) in arc_unwind()
1207 || REG_INVALID(state.regs[i].value) in arc_unwind()
1209 reg_info[state.regs[i].value].width) in arc_unwind()
1211 switch (reg_info[state.regs[i].value].width) { in arc_unwind()
1213 state.regs[i].value = in arc_unwind()
1214 FRAME_REG(state.regs[i].value, const u8); in arc_unwind()
1217 state.regs[i].value = in arc_unwind()
1218 FRAME_REG(state.regs[i].value, const u16); in arc_unwind()
1221 state.regs[i].value = in arc_unwind()
1222 FRAME_REG(state.regs[i].value, const u32); in arc_unwind()
1226 state.regs[i].value = in arc_unwind()
1227 FRAME_REG(state.regs[i].value, const u64); in arc_unwind()
1239 for (i = 0; i < ARRAY_SIZE(state.regs); ++i, fptr++) { in arc_unwind()
1243 switch (state.regs[i].where) { in arc_unwind()
1254 FRAME_REG(i, u8) = state.regs[i].value; in arc_unwind()
1257 FRAME_REG(i, u16) = state.regs[i].value; in arc_unwind()
1260 FRAME_REG(i, u32) = state.regs[i].value; in arc_unwind()
1264 FRAME_REG(i, u64) = state.regs[i].value; in arc_unwind()
1274 FRAME_REG(i, unsigned long) = cfa + state.regs[i].value in arc_unwind()
1275 * state.dataAlign; in arc_unwind()
1278 addr = cfa + state.regs[i].value * state.dataAlign; in arc_unwind()
1280 if ((state.regs[i].value * state.dataAlign) in arc_unwind()