Lines Matching refs:context

47 context_init(struct fetch_context *context, struct process *proc)  in context_init()  argument
49 if (aarch64_read_gregs(proc, &context->gregs) < 0 in context_init()
50 || aarch64_read_fregs(proc, &context->fpregs) < 0) in context_init()
53 context->ngrn = 0; in context_init()
54 context->nsrn = 0; in context_init()
56 context->nsaa = (arch_addr_t) (uintptr_t) context->gregs.sp; in context_init()
57 context->x8 = 0; in context_init()
63 arch_fetch_arg_clone(struct process *proc, struct fetch_context *context) in arch_fetch_arg_clone() argument
68 return memcpy(ret, context, sizeof(*ret)); in arch_fetch_arg_clone()
72 fetch_next_gpr(struct fetch_context *context, unsigned char *buf) in fetch_next_gpr() argument
74 uint64_t u = context->gregs.regs[context->ngrn++]; in fetch_next_gpr()
79 fetch_gpr(struct fetch_context *context, struct value *value, size_t sz) in fetch_gpr() argument
90 fetch_next_gpr(context, buf + i); in fetch_gpr()
96 fetch_next_sse(struct fetch_context *context, unsigned char *buf, size_t sz) in fetch_next_sse() argument
98 __int128 u = context->fpregs.vregs[context->nsrn++]; in fetch_next_sse()
103 fetch_sse(struct fetch_context *context, struct value *value, size_t sz) in fetch_sse() argument
109 fetch_next_sse(context, buf, sz); in fetch_sse()
114 fetch_hfa(struct fetch_context *context, in fetch_hfa() argument
124 fetch_next_sse(context, buf, sz); in fetch_hfa()
131 fetch_stack(struct fetch_context *context, struct value *value, in fetch_stack() argument
139 uintptr_t sp = (uintptr_t) context->nsaa; in fetch_stack()
145 context->nsaa = (arch_addr_t) sp; in fetch_stack()
173 pass_arg(struct fetch_context const *context, in pass_arg() argument
191 if (context->nsrn + count <= 8) in pass_arg()
200 if (context->ngrn + count <= 8) in pass_arg()
217 if (context->ngrn < 8 && sz <= 8) in pass_arg()
227 if (context->nsrn < 8) { in pass_arg()
257 fetch_arg(struct fetch_context *context, in fetch_arg() argument
270 context->nsrn = 8; in fetch_arg()
271 return fetch_stack(context, value, in fetch_arg()
275 return fetch_gpr(context, value, how.sz); in fetch_arg()
278 return fetch_sse(context, value, how.sz); in fetch_arg()
281 return fetch_hfa(context, value, how.hfa_t, how.count); in fetch_arg()
292 struct fetch_context *context = malloc(sizeof *context); in arch_fetch_arg_init() local
293 if (context == NULL || context_init(context, proc) < 0) { in arch_fetch_arg_init()
295 free(context); in arch_fetch_arg_init()
309 struct fetch_script how = pass_arg(context, proc, ret_info); in arch_fetch_arg_init()
314 context->x8 = (arch_addr_t) (uintptr_t) context->gregs.regs[8]; in arch_fetch_arg_init()
320 return context; in arch_fetch_arg_init()
324 arch_fetch_arg_next(struct fetch_context *context, enum tof type, in arch_fetch_arg_next() argument
328 return fetch_arg(context, proc, info, value, in arch_fetch_arg_next()
329 pass_arg(context, proc, info)); in arch_fetch_arg_next()
333 arch_fetch_retval(struct fetch_context *context, enum tof type, in arch_fetch_retval() argument
337 if (context->x8 != 0) { in arch_fetch_retval()
338 value_in_inferior(value, context->x8); in arch_fetch_retval()
342 if (context_init(context, proc) < 0) in arch_fetch_retval()
345 return fetch_arg(context, proc, info, value, in arch_fetch_retval()
346 pass_arg(context, proc, info)); in arch_fetch_retval()
350 arch_fetch_arg_done(struct fetch_context *context) in arch_fetch_arg_done() argument
352 if (context != NULL) in arch_fetch_arg_done()
353 free(context); in arch_fetch_arg_done()