Lines Matching refs:context
46 fetch_register_banks(struct process *proc, struct fetch_context *context, in fetch_register_banks() argument
49 if (ptrace(PTRACE_GETREGS, proc->pid, 0, &context->regs) < 0) in fetch_register_banks()
53 && ptrace(PTRACE_GETFPREGS, proc->pid, 0, &context->fpregs) < 0) in fetch_register_banks()
63 struct fetch_context *context = malloc(sizeof(*context)); in arch_fetch_arg_init() local
64 if (context == NULL) in arch_fetch_arg_init()
68 if (fetch_register_banks(proc, context, type == LT_TOF_FUNCTION) < 0) { in arch_fetch_arg_init()
70 free(context); in arch_fetch_arg_init()
74 context->arg_num = 0; in arch_fetch_arg_init()
75 context->stack_pointer = (arch_addr_t)context->regs[PT_USP] + 4; in arch_fetch_arg_init()
82 value_init(&context->retval, proc, NULL, ret_info, 0); in arch_fetch_arg_init()
84 if (value_pass_by_reference(&context->retval) < 0) in arch_fetch_arg_init()
86 value_set_word(&context->retval, context->regs[PT_A1]); in arch_fetch_arg_init()
88 value_init_detached(&context->retval, NULL, NULL, 0); in arch_fetch_arg_init()
91 return context; in arch_fetch_arg_init()
95 arch_fetch_arg_clone(struct process *proc, struct fetch_context *context) in arch_fetch_arg_clone() argument
100 *ret = *context; in arch_fetch_arg_clone()
105 arch_fetch_arg_next(struct fetch_context *context, enum tof type, in arch_fetch_arg_next() argument
116 switch (context->arg_num++) { in arch_fetch_arg_next()
127 value_set_word(valuep, context->regs[reg]); in arch_fetch_arg_next()
132 context->stack_pointer = (arch_addr_t) in arch_fetch_arg_next()
133 align((unsigned long)context->stack_pointer, a); in arch_fetch_arg_next()
135 context->stack_pointer += 4 - sz; in arch_fetch_arg_next()
137 value_in_inferior(valuep, context->stack_pointer); in arch_fetch_arg_next()
138 context->stack_pointer += sz; in arch_fetch_arg_next()
145 arch_fetch_retval(struct fetch_context *context, enum tof type, in arch_fetch_retval() argument
149 if (fetch_register_banks(proc, context, type == LT_TOF_FUNCTIONR) < 0) in arch_fetch_retval()
152 if (context->retval.type != NULL) { in arch_fetch_retval()
155 *valuep = context->retval; in arch_fetch_retval()
181 = (unsigned char *)&context->regs[reg]; in arch_fetch_retval()
197 unsigned long *reg = &context->fpregs.fpregs[0]; in arch_fetch_retval()
216 = (unsigned char *)&context->regs[PT_D0]; in arch_fetch_retval()
222 memcpy(buf + 4, &context->regs[PT_D1], 4); in arch_fetch_retval()
235 arch_fetch_arg_done(struct fetch_context *context) in arch_fetch_arg_done() argument
237 if (context != NULL) in arch_fetch_arg_done()
238 free(context); in arch_fetch_arg_done()