69 void* ins = iarg->
ins;
71 void* next_addr =
nextInsn(iarg, xptr);
73 return (call_addr == next_addr);
105 #ifdef USE_CALL_LOOKAHEAD 106 next = call_lookahead(xptr, iarg->
current, iarg->
ins);
117 #undef USE_CALL_LOOKAHEAD 118 #ifdef USE_CALL_LOOKAHEAD 120 call_lookahead(xed_decoded_inst_t *call_xedd,
unwind_interval *current,
char *ins)
127 xed_error_enum_t xed_err;
128 int length = call_xedd->get_length();
129 xed_decoded_inst_t xeddobj;
130 xed_decoded_inst_t*
xedd = &xeddobj;
131 char *jmp_ins_addr = ins + length;
132 char *jmp_target =
NULL;
133 char *jmp_succ_addr =
NULL;
142 xed_decoded_inst_zero_set_mode(xptr, xed_machine_state_ptr);
143 xed_err = xed_decode(xptr, reinterpret_cast<const uint8_t*>(jmp_ins_addr), 15);
144 if (xed_err != XED_ERROR_NONE) {
150 if (xed_decoded_inst_number_of_memory_operands(xptr) == 0) {
151 const xed_immdis_t& disp = xptr->get_disp();
152 if (disp.is_present()) {
153 long long offset = disp.get_signed64();
154 jmp_succ_addr = jmp_ins_addr + xptr->get_length();
155 jmp_target = jmp_succ_addr + offset;
159 if (jmp_target ==
NULL) {
168 xed_decoded_inst_zero_set_mode(xptr, xed_machine_state_ptr);
169 xed_err = xed_decode(xptr, reinterpret_cast<const uint8_t*>(jmp_target), 15);
170 if (xed_err != XED_ERROR_NONE) {
175 const xed_operand_t* op0 = xed_inst_operand(xi,0);
176 if ((xed_operand_name(op0) == XED_OPERAND_REG)
177 && isReg_x86_SP(xed_operand_reg(op0))) {
178 const xed_immdis_t& immed = xptr->get_immed();
179 if (immed.is_present()) {
180 int sign = (
iclass_eq(xptr, XED_ICLASS_ADD)) ? -1 : 1;
181 long offset = sign * immed.get_signed64();
182 PMSG(INTV,
"newinterval from ADD/SUB immediate");
183 next = newinterval(jmp_succ_addr,
185 current->sp_ra_pos + offset,
188 current->sp_bp_pos + offset,
static bool call_is_push_next_addr_idiom(xed_decoded_inst_t *xptr, interval_arg_t *iarg)
#define UWI_RECIPE(btuwi)
unwind_interval * process_call(xed_decoded_inst_t *xptr, const xed_inst_t *xi, interval_arg_t *iarg)
#define iclass_eq(xptr, class)
static char * nextInsn(uint32_t *insn)
void * x86_get_branch_target(void *ins, xed_decoded_inst_t *xptr)
static xed_decoded_inst_t xedd
highwatermark_t highwatermark
unwind_interval * new_ui(char *startaddr, sp_ty_t sp_ty, ra_ty_t ra_ty, int sp_arg, int ra_arg)
bitree_uwi_t unwind_interval