Deleted Added
full compact
2c2
< Copyright (c) 2003 Hewlett-Packard Development Company, L.P.
---
> Copyright (c) 2003-2006 Hewlett-Packard Development Company, L.P.
69c69
< static
---
>
79a80
> uint64_t uinfop;
84a86,87
> env->ptr_size = DWORDSZ;
> env->code_start = 0;
87a91
> env->abi_context = 0;
173c177,179
< if (status == UWX_OK)
---
> if (status == UWX_OK) {
> env->ptr_size = uentry.ptr_size;
> env->code_start = uentry.code_start;
175c181,182
< else if (status == UWX_ERR_NOUENTRY)
---
> }
> if (status == UWX_ERR_NOUENTRY || status == UWX_ERR_NOUDESC)
184a192
> uentry.ptr_size = DWORDSZ;
192a201,202
> if (uentry.unwind_flags & UNWIND_TBL_32BIT)
> uentry.ptr_size = WORDSZ;
196a207,209
> case UWX_KEY_GP:
> uwx_set_reg(env, UWX_REG_GP, uvec[i+1]);
> break;
199c212
< uwx_alloc_str(env, (char *)(uvec[i+1]));
---
> uwx_alloc_str(env, (char *)(intptr_t)(uvec[i+1]));
203c216
< uwx_alloc_str(env, (char *)(uvec[i+1]));
---
> uwx_alloc_str(env, (char *)(intptr_t)(uvec[i+1]));
206a220
> env->code_start = uentry.code_start;
209a224
> env->ptr_size = uentry.ptr_size;
212a228,229
> if (status == UWX_ERR_NOUDESC)
> status = uwx_default_rstate(env, &rstate);
293a311,405
> /* uwx_get_module_info: Gets module name and text base for current frame */
>
> int uwx_get_module_info(
> struct uwx_env *env,
> char **modp,
> uint64_t *text_base)
> {
> int i;
> int status;
> int cbstatus;
> uint64_t ip;
> uint64_t *uvec;
> uint64_t uvecout[UVECSIZE];
>
> if (env == 0)
> return UWX_ERR_NOENV;
>
> /* If we haven't already obtained the frame info for the */
> /* current frame, get it now. */
>
> if (env->rstate == 0) {
> status = uwx_get_frame_info(env);
> if (status != UWX_OK)
> return status;
> }
>
> /* Get the module name from the lookup IP callback. */
> if (env->module_name == 0) {
> ip = env->remapped_ip;
> i = 0;
> if (env->function_offset >= 0) {
> uvecout[i++] = UWX_KEY_FUNCSTART;
> uvecout[i++] = ip - env->function_offset;
> }
> uvecout[i++] = UWX_KEY_END;
> uvecout[i++] = 0;
> uvec = uvecout;
> cbstatus = (*env->lookupip)(UWX_LKUP_MODULE, ip, env->cb_token, &uvec);
>
> if (cbstatus == UWX_LKUP_SYMINFO) {
> for (i = 0; uvec[i] != UWX_KEY_END; i += 2) {
> switch ((int)uvec[i]) {
> case UWX_KEY_TBASE:
> env->text_base = uvec[i+1];
> break;
> case UWX_KEY_MODULE:
> env->module_name =
> uwx_alloc_str(env, (char *)(intptr_t)(uvec[i+1]));
> break;
> case UWX_KEY_FUNC:
> env->function_name =
> uwx_alloc_str(env, (char *)(intptr_t)(uvec[i+1]));
> break;
> case UWX_KEY_FUNCSTART:
> env->function_offset = ip - uvec[i+1];
> break;
> }
> }
> (void) (*env->lookupip)(UWX_LKUP_FREE, 0, env->cb_token, &uvec);
> }
> }
>
> *modp = env->module_name;
> *text_base = env->text_base;
>
> return UWX_OK;
> }
>
> /* uwx_get_funcstart: Gets start address of function from current frame */
>
> int uwx_get_funcstart(
> struct uwx_env *env,
> uint64_t *funcstart)
> {
> int status;
> uint64_t *uvec;
> uint64_t uvecout[UVECSIZE];
>
> if (env == 0)
> return UWX_ERR_NOENV;
>
> /* If we haven't already obtained the frame info for the */
> /* current frame, get it now. */
>
> if (env->rstate == 0) {
> status = uwx_get_frame_info(env);
> if (status != UWX_OK)
> return status;
> }
>
> *funcstart = env->remapped_ip - env->function_offset;
>
> return UWX_OK;
> }
>
294a407,408
> /* (Will make a UWX_LKUP_SYMBOLS callback if info */
> /* was not provided by UWX_LKUP_LOOKUP callback) */
306c420
< uint64_t uvecout[2];
---
> uint64_t uvecout[UVECSIZE];
339c453
< uwx_alloc_str(env, (char *)(uvec[i+1]));
---
> uwx_alloc_str(env, (char *)(intptr_t)(uvec[i+1]));
343c457
< uwx_alloc_str(env, (char *)(uvec[i+1]));
---
> uwx_alloc_str(env, (char *)(intptr_t)(uvec[i+1]));
574a689,691
> case UWX_KEY_GP:
> uwx_set_reg(env, UWX_REG_GP, uvec[i+1]);
> break;
577c694
< uwx_alloc_str(env, (char *)(uvec[i+1]));
---
> uwx_alloc_str(env, (char *)(intptr_t)(uvec[i+1]));
581c698
< uwx_alloc_str(env, (char *)(uvec[i+1]));
---
> uwx_alloc_str(env, (char *)(intptr_t)(uvec[i+1]));
600c717,718
< (*(uint64_t *)(dest) = *(uint64_t *)(src), DWORDSZ) )
---
> (*(uint64_t *)(intptr_t)(dest) = \
> *(uint64_t *)(intptr_t)(src), DWORDSZ) )
647,649c765,768
< (*(uint64_t *)(dest) = *(uint64_t *)(src), \
< *(uint64_t *)((dest)+8) = *(uint64_t *)((src)+8), \
< 2*DWORDSZ) )
---
> (*(uint64_t *)(intptr_t)(dest) = *(uint64_t *)(intptr_t)(src), \
> *(uint64_t *)(intptr_t)((dest)+8) = \
> *(uint64_t *)(intptr_t)((src)+8), \
> 2*DWORDSZ) )