[Ups-cvs] ups/ups ao_dwftext.c,1.8,1.9 ao_dwftext.h,1.4,1.5 ao_dwftype.c,1.11,1.12 ao_dwfutil.c,1.14
Brought to you by:
ianedwards
From: Tom H. <th...@us...> - 2005-12-20 12:43:32
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11179 Modified Files: ao_dwftext.c ao_dwftext.h ao_dwftype.c ao_dwfutil.c ao_dwfutil.h ao_stack.c ao_symload.c ao_symload.h ao_syms.h ci_util.c obj_stack.c obj_stack.h st.h symtab.h target.c target.h va_expr.c va_format.c va_menu.c xc_text.c Log Message: Initial work on better support of DWARF location expressions to cope with recent gcc versions. Variables can now have a vaddr_t object attached to them which is used in preference to guessing the location from the class. We also now track the CFA for each stack frame as it does not necessarily have to match the FP or SP values. Index: ao_dwftext.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwftext.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ao_dwftext.c 29 Jul 2005 12:56:59 -0000 1.8 --- ao_dwftext.c 20 Dec 2005 12:43:12 -0000 1.9 *************** *** 379,383 **** */ bool ! dw_unwind(xp, st, fp, sp, pc) target_t *xp; symtab_t *st; --- 379,383 ---- */ bool ! dw_unwind(xp, st, fp, sp, pc, cfa) target_t *xp; symtab_t *st; *************** *** 385,393 **** taddr_t *sp; taddr_t *pc; { ao_stdata_t *ast = AO_STDATA(st); taddr_t adjusted_pc = *pc - ast->st_dw_base_address; ! if (dwf_unwind(ast->st_dw_dbg, xp, fp, sp, &adjusted_pc)) { *pc = adjusted_pc; return TRUE; --- 385,394 ---- taddr_t *sp; taddr_t *pc; + taddr_t *cfa; { ao_stdata_t *ast = AO_STDATA(st); taddr_t adjusted_pc = *pc - ast->st_dw_base_address; ! if (dwf_unwind(ast->st_dw_dbg, xp, fp, sp, &adjusted_pc, cfa)) { *pc = adjusted_pc; return TRUE; Index: va_expr.c =================================================================== RCS file: /cvsroot/ups/ups/ups/va_expr.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** va_expr.c 18 Feb 2004 10:56:29 -0000 1.5 --- va_expr.c 20 Dec 2005 12:43:12 -0000 1.6 *************** *** 399,403 **** { objid_t par; ! taddr_t fp, ap; fil_t *fil; int lnum; --- 399,403 ---- { objid_t par; ! taddr_t junk; fil_t *fil; int lnum; *************** *** 410,414 **** fil = (fil_t *)par; else ! fil = get_stack_func(par, &fp, &ap)->fu_fil; lnum = de->de_block->bl_start_lnum; --- 410,414 ---- fil = (fil_t *)par; else ! fil = get_stack_func(par, &junk, &junk, &junk, &junk)->fu_fil; lnum = de->de_block->bl_start_lnum; *************** *** 917,921 **** bool change_caused_by_edit; { ! taddr_t fp, ap; dexpr_t *de; bool lose_descendents; --- 917,921 ---- bool change_caused_by_edit; { ! taddr_t fp, ap, junk; dexpr_t *de; bool lose_descendents; *************** *** 943,947 **** fp = ap = 0; else ! get_stack_func(par, &fp, &ap); Expr_type = NULL; --- 943,947 ---- fp = ap = 0; else ! get_stack_func(par, &fp, &ap, &junk, &junk); Expr_type = NULL; *************** *** 1307,1311 **** { objid_t par; ! taddr_t fp, ap; fil_t *fil; int lnum; --- 1307,1311 ---- { objid_t par; ! taddr_t fp, ap, junk; fil_t *fil; int lnum; *************** *** 1325,1329 **** fil = (fil_t *)par; else ! fil = get_stack_func(par, &fp, &ap)->fu_fil; lnum = de->de_block->bl_start_lnum; --- 1325,1329 ---- fil = (fil_t *)par; else ! fil = get_stack_func(par, &fp, &ap, &junk, &junk)->fu_fil; lnum = de->de_block->bl_start_lnum; *************** *** 1341,1345 **** if (cr->cr_machine != NULL && cr->cr_parse_id != NULL) { ! taddr_t fp, ap; ci_exec_result_t res; objid_t par; --- 1341,1345 ---- if (cr->cr_machine != NULL && cr->cr_parse_id != NULL) { ! taddr_t fp, ap, junk; ci_exec_result_t res; objid_t par; *************** *** 1349,1353 **** fp = ap = 0; else ! get_stack_func(par, &fp, &ap); Expr_type = NULL; --- 1349,1353 ---- fp = ap = 0; else ! get_stack_func(par, &fp, &ap, &junk, &junk); Expr_type = NULL; *************** *** 1388,1392 **** { objid_t par; ! taddr_t fp, ap; fil_t *fil; int lnum; --- 1388,1392 ---- { objid_t par; ! taddr_t fp, ap, junk; fil_t *fil; int lnum; *************** *** 1401,1405 **** fil = (fil_t *)par; else ! fil = get_stack_func(par, &fp, &ap)->fu_fil; lnum = de->de_block->bl_start_lnum; --- 1401,1405 ---- fil = (fil_t *)par; else ! fil = get_stack_func(par, &fp, &ap, &junk, &junk)->fu_fil; lnum = de->de_block->bl_start_lnum; *************** *** 1424,1428 **** if (cr->cr_machine != NULL && cr->cr_parse_id != NULL) { ! taddr_t fp, ap; ci_exec_result_t res; objid_t par; --- 1424,1428 ---- if (cr->cr_machine != NULL && cr->cr_parse_id != NULL) { ! taddr_t fp, ap, junk; ci_exec_result_t res; objid_t par; *************** *** 1432,1436 **** fp = ap = 0; else ! get_stack_func(par, &fp, &ap); Expr_type = NULL; --- 1432,1436 ---- fp = ap = 0; else ! get_stack_func(par, &fp, &ap, &junk, &junk); Expr_type = NULL; Index: ci_util.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ci_util.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ci_util.c 4 Nov 2002 15:28:32 -0000 1.3 --- ci_util.c 20 Dec 2005 12:43:12 -0000 1.4 *************** *** 360,363 **** --- 360,364 ---- v->va_next = NULL; v->va_lexinfo = NULL; + v->va_location = NULL; return v; } Index: va_format.c =================================================================== RCS file: /cvsroot/ups/ups/ups/va_format.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** va_format.c 26 Oct 2002 13:05:40 -0000 1.1.1.1 --- va_format.c 20 Dec 2005 12:43:12 -0000 1.2 *************** *** 517,521 **** case OT_FUNC: case OT_BLOCK: ! func = get_stack_func(par, &junk, &junk); fil = func->fu_fil; break; --- 517,521 ---- case OT_FUNC: case OT_BLOCK: ! func = get_stack_func(par, &junk, &junk, &junk, &junk); fil = func->fu_fil; break; Index: ao_stack.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_stack.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ao_stack.c 21 Feb 2005 12:18:02 -0000 1.13 --- ao_stack.c 20 Dec 2005 12:43:12 -0000 1.14 *************** *** 486,490 **** */ ! if (f->fu_symtab && st_unwind(xp, f->fu_symtab, &fp, &sp, &prevpc)) { pc = prevpc; } --- 486,490 ---- */ ! if (f->fu_symtab && st_unwind(xp, f->fu_symtab, &fp, &sp, &prevpc, &stk->stk_cfa)) { pc = prevpc; } Index: xc_text.c =================================================================== RCS file: /cvsroot/ups/ups/ups/xc_text.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** xc_text.c 21 Feb 2004 17:00:01 -0000 1.8 --- xc_text.c 20 Dec 2005 12:43:12 -0000 1.9 *************** *** 107,111 **** static macro_t *xc_get_fi_macros PROTO((fil_t *fil)); static bool xc_unwind PROTO((target_t *xp, symtab_t *st, taddr_t *fp, ! taddr_t *sp, taddr_t *pc)); static func_t *xc_ensure_fu PROTO((func_t *f)); static fil_t *xc_get_fi PROTO((symtab_t *st)); --- 107,111 ---- static macro_t *xc_get_fi_macros PROTO((fil_t *fil)); static bool xc_unwind PROTO((target_t *xp, symtab_t *st, taddr_t *fp, ! taddr_t *sp, taddr_t *pc, taddr_t *cfa)); static func_t *xc_ensure_fu PROTO((func_t *f)); static fil_t *xc_get_fi PROTO((symtab_t *st)); *************** *** 1340,1344 **** static bool ! xc_unwind(xp, st, fp, sp, pc) target_t *xp; symtab_t *st; --- 1340,1344 ---- static bool ! xc_unwind(xp, st, fp, sp, pc, cfa) target_t *xp; symtab_t *st; *************** *** 1346,1349 **** --- 1346,1350 ---- taddr_t *sp; taddr_t *pc; + taddr_t *cfa; { return FALSE; Index: ao_dwftext.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwftext.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ao_dwftext.h 21 Feb 2004 17:00:00 -0000 1.4 --- ao_dwftext.h 20 Dec 2005 12:43:12 -0000 1.5 *************** *** 43,47 **** bool dw_unwind PROTO((target_t *xp, symtab_t *st, taddr_t *fp, ! taddr_t *sp, taddr_t *pc)); #endif /* WANT_DWARF */ --- 43,47 ---- bool dw_unwind PROTO((target_t *xp, symtab_t *st, taddr_t *fp, ! taddr_t *sp, taddr_t *pc, taddr_t *cfa)); #endif /* WANT_DWARF */ Index: va_menu.c =================================================================== RCS file: /cvsroot/ups/ups/ups/va_menu.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** va_menu.c 15 Jul 2003 18:13:32 -0000 1.5 --- va_menu.c 20 Dec 2005 12:43:12 -0000 1.6 *************** *** 601,667 **** int *p_decl_may_have_changed; { ! taddr_t addr, fp, ap; target_t *xp; xp = get_current_target(); ! switch (v->va_class) { ! case CL_REF: ! (void) get_stack_func(par, &fp, &ap); ! if (dread(xp, ap+v->va_addr, (char *)&addr, sizeof(addr)) != 0) ! addr = BAD_ADDR; ! break; ! case CL_ARG: ! (void) get_stack_func(par, &fp, &ap); ! addr = ap + v->va_addr; ! break; ! case CL_AUTO: ! get_stack_func(par, &fp, &ap); ! addr = fp + v->va_addr; - break; - case CL_MOS: - case CL_MOU: - addr = var_or_expr_addr(par); - if ( v->va_flags & VA_VTBLBASED) - { - /* SC5 virtual base class. True offset - ** is in the vtable. - */ - type_t* type = 0; - switch (get_object_type(par)) - { - case OT_VAR: - type = deref_aggr((dvar_t*)par); break; ! case OT_EXPR: ! type = get_expr_type(par); ! if ( type->ty_code == DT_PTR_TO) ! type = type->ty_base; break; ! default: ! panic("bad parent type in get_dv_addr"); ! } ! addr = get_vtbl_based_addr(addr, type, v->va_addr); ! } ! else ! { ! addr = addr + v->va_addr; } - break; - case CL_EXT: - case CL_STAT: - case CL_LSTAT: - addr = v->va_addr; - break; - case CL_REG: - addr = get_reg_addr(xp, par, (int)v->va_addr, - (size_t)dynamic_type_size(v->va_type, - ilist)); - break; - default: - panic("unknown class in gda"); } --- 601,694 ---- int *p_decl_may_have_changed; { ! taddr_t addr, fp, ap, sp, cfa; target_t *xp; xp = get_current_target(); ! if (v->va_location) { ! switch (v->va_location->v_op) { ! case OP_ADDR: ! addr = v->va_location->v_addr; ! break; ! case OP_REGISTER: ! addr = get_reg_addr(xp, par, (int)v->va_location->v_register, ! (size_t)dynamic_type_size(v->va_type, ! ilist)); ! break; ! case OP_CFA_RELATIVE: ! (void)get_stack_func(par, &fp, &ap, &sp, &cfa); ! addr = cfa + v->va_location->v_offset; ! break; ! case OP_FP_RELATIVE: ! (void)get_stack_func(par, &fp, &ap, &sp, &cfa); ! addr = fp + v->va_location->v_offset; ! break; ! case OP_SP_RELATIVE: ! (void)get_stack_func(par, &fp, &ap, &sp, &cfa); ! addr = sp + v->va_location->v_offset; ! break; ! default: ! panic("unknown op in gda"); ! } ! } else { ! switch (v->va_class) { ! case CL_REF: ! (void) get_stack_func(par, &fp, &ap, &sp, &cfa); ! if (dread(xp, ap+v->va_addr, (char *)&addr, sizeof(addr)) != 0) ! addr = BAD_ADDR; ! break; ! case CL_ARG: ! (void) get_stack_func(par, &fp, &ap, &sp, &cfa); ! addr = ap + v->va_addr; ! break; ! case CL_AUTO: ! get_stack_func(par, &fp, &ap, &sp, &cfa); ! addr = fp + v->va_addr; break; ! case CL_MOS: ! case CL_MOU: ! addr = var_or_expr_addr(par); ! if ( v->va_flags & VA_VTBLBASED) ! { ! /* SC5 virtual base class. True offset ! ** is in the vtable. ! */ ! type_t* type = 0; ! switch (get_object_type(par)) ! { ! case OT_VAR: ! type = deref_aggr((dvar_t*)par); ! break; ! case OT_EXPR: ! type = get_expr_type(par); ! if ( type->ty_code == DT_PTR_TO) ! type = type->ty_base; ! break; ! default: ! panic("bad parent type in get_dv_addr"); ! } ! addr = get_vtbl_based_addr(addr, type, v->va_addr); ! } ! else ! { ! addr = addr + v->va_addr; ! } break; ! case CL_EXT: ! case CL_STAT: ! case CL_LSTAT: ! addr = v->va_addr; ! break; ! case CL_REG: ! addr = get_reg_addr(xp, par, (int)v->va_addr, ! (size_t)dynamic_type_size(v->va_type, ! ilist)); ! break; ! default: ! panic("unknown class in gda"); } } Index: ao_dwftype.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwftype.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ao_dwftype.c 30 Nov 2004 10:53:51 -0000 1.11 --- ao_dwftype.c 20 Dec 2005 12:43:12 -0000 1.12 *************** *** 460,464 **** addr = 0; ! } else if (vaddr->v_op == OP_FRAME_BASE) { if (class_hint == CL_ARG) --- 460,466 ---- addr = 0; ! } else if (vaddr->v_op == OP_CFA_RELATIVE || ! vaddr->v_op == OP_FP_RELATIVE || ! vaddr->v_op == OP_SP_RELATIVE ) { if (class_hint == CL_ARG) *************** *** 466,470 **** else if (class_hint == CL_AUTO) class = CL_AUTO; ! addr = vaddr->v_frame_offset; } else if (vaddr->v_op == OP_REGISTER) { --- 468,472 ---- else if (class_hint == CL_AUTO) class = CL_AUTO; ! addr = vaddr->v_offset; } else if (vaddr->v_op == OP_REGISTER) { *************** *** 489,492 **** --- 491,495 ---- class = CL_NOCLASS; addr = vaddr->v_u_offset; + vaddr = NULL; } *************** *** 499,502 **** --- 502,506 ---- v->va_language = stf->stf_language; v->va_lexinfo = dwf_make_lexinfo(dbg, spec_die, ap, stf); + v->va_location = vaddr; v->va_next = *p_vars; *p_vars = v; Index: symtab.h =================================================================== RCS file: /cvsroot/ups/ups/ups/symtab.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** symtab.h 16 Feb 2004 13:02:00 -0000 1.3 --- symtab.h 20 Dec 2005 12:43:12 -0000 1.4 *************** *** 299,302 **** --- 299,331 ---- } class_t; + /* + * Extended address description, abstracted from DWARF location description. + * + * dwarfTODO: this was a quick kludge to get things working; the proper + * solution is probably to use what is in the 'C' interpreter. + */ + typedef enum { + OP_ADDR, /* Address. */ + OP_REGISTER, /* Register number. */ + OP_U_OFFSET, /* Unsigned offset. */ + OP_CFA_RELATIVE, /* Relative to canonical frame address. */ + OP_FP_RELATIVE, /* Relative to frame pointer. */ + OP_SP_RELATIVE, /* Relative to stack pointer. */ + } vaddr_op_t; + typedef struct vaddr_s { + vaddr_op_t v_op; /* Operation. */ + struct vaddr_s *v_next; + union { + taddr_t vu_addr; /* Address or unsigned offset. */ + long vu_const; /* Constant. */ + unsigned char vu_byte; /* e.g. register number */ + } v_u; + } vaddr_t; + #define v_addr v_u.vu_addr + #define v_register v_u.vu_byte + #define v_u_offset v_u.vu_addr + #define v_const v_u.vu_const + #define v_offset v_u.vu_const + /* Variable, also used for struct/union members and function parameters. */ *************** *** 309,313 **** taddr_t va_addr; /* variable address */ struct var_s *va_next; /* next variable */ ! lexinfo_t *va_lexinfo; } var_t; --- 338,343 ---- taddr_t va_addr; /* variable address */ struct var_s *va_next; /* next variable */ ! lexinfo_t *va_lexinfo; /* lexical information */ ! vaddr_t *va_location; /* variable location */ } var_t; Index: ao_symload.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_symload.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ao_symload.h 21 Feb 2004 17:00:01 -0000 1.5 --- ao_symload.h 20 Dec 2005 12:43:12 -0000 1.6 *************** *** 31,35 **** macro_t *ao_get_fi_macros PROTO((fil_t *fil)); bool ao_unwind PROTO((target_t *xp, symtab_t *st, taddr_t *fp, ! taddr_t *sp, taddr_t *pc)); block_t *ao_get_fu_blocks PROTO((func_t *f)); func_t *ao_ensure_fu PROTO((func_t *f)); --- 31,35 ---- macro_t *ao_get_fi_macros PROTO((fil_t *fil)); bool ao_unwind PROTO((target_t *xp, symtab_t *st, taddr_t *fp, ! taddr_t *sp, taddr_t *pc, taddr_t *cfa)); block_t *ao_get_fu_blocks PROTO((func_t *f)); func_t *ao_ensure_fu PROTO((func_t *f)); Index: obj_stack.h =================================================================== RCS file: /cvsroot/ups/ups/ups/obj_stack.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** obj_stack.h 16 Feb 2004 13:02:00 -0000 1.2 --- obj_stack.h 20 Dec 2005 12:43:12 -0000 1.3 *************** *** 70,74 **** #ifdef SYMTAB_H_INCLUDED block_t *obj_to_block PROTO((objid_t obj)); ! func_t *get_stack_func PROTO((objid_t obj, taddr_t *p_fp, taddr_t *p_ap)); objid_t find_block PROTO((objid_t par, block_t *block)); objid_t add_block_object PROTO((objid_t par, block_t *block)); --- 70,75 ---- #ifdef SYMTAB_H_INCLUDED block_t *obj_to_block PROTO((objid_t obj)); ! func_t *get_stack_func PROTO((objid_t obj, taddr_t *p_fp, taddr_t *p_ap, ! taddr_t *p_sp, taddr_t *p_cfa)); objid_t find_block PROTO((objid_t par, block_t *block)); objid_t add_block_object PROTO((objid_t par, block_t *block)); Index: ao_syms.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_syms.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ao_syms.h 21 Feb 2005 12:21:05 -0000 1.5 --- ao_syms.h 20 Dec 2005 12:43:12 -0000 1.6 *************** *** 239,271 **** } typename_t; - #if WANT_DWARF - /* - * Extended address description, abstracted from DWARF location description. - * - * dwarfTODO: this was a quick kludge to get things working; the proper - * solution is probably to use what is in the 'C' interpreter. - */ - typedef enum { - OP_ADDR, /* Address. */ - OP_REGISTER, /* Register number. */ - OP_U_OFFSET, /* Unsigned offset. */ - OP_FRAME_BASE, /* Relative to frame base. */ - } vaddr_op_t; - typedef struct vaddr_s { - vaddr_op_t v_op; /* Operation. */ - struct vaddr_s *v_next; - union { - taddr_t vu_addr; /* Address or unsigned offset. */ - long vu_const; /* Constant. */ - unsigned char vu_byte; /* e.g. register number */ - } v_u; - } vaddr_t; - #define v_addr v_u.vu_addr - #define v_register v_u.vu_byte - #define v_u_offset v_u.vu_addr - #define v_const v_u.vu_const - #define v_frame_offset v_u.vu_const - #endif - /* * Symbol table information dependent on symbol table types being supported. --- 239,242 ---- Index: target.h =================================================================== RCS file: /cvsroot/ups/ups/ups/target.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** target.h 21 Feb 2004 17:00:01 -0000 1.4 --- target.h 20 Dec 2005 12:43:12 -0000 1.5 *************** *** 118,121 **** --- 118,122 ---- taddr_t stk_sp; /* stack pointer (only for $sp) */ taddr_t stk_ap; /* argument pointer (VAX a.out only) */ + taddr_t stk_cfa; /* canonical frame address (DWARF only) */ fil_t *stk_fil; int stk_lnum; /* source lnum matching stk_pc */ Index: st.h =================================================================== RCS file: /cvsroot/ups/ups/ups/st.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** st.h 21 Feb 2004 17:00:01 -0000 1.5 --- st.h 20 Dec 2005 12:43:12 -0000 1.6 *************** *** 78,82 **** bool (*so_unwind)PROTO((target_t *xp, symtab_t *st, taddr_t *fp, ! taddr_t *sp, taddr_t *pc)); const char *(*so_disassemble_instruction)PROTO((func_t *f, taddr_t addr, --- 78,82 ---- bool (*so_unwind)PROTO((target_t *xp, symtab_t *st, taddr_t *fp, ! taddr_t *sp, taddr_t *pc, taddr_t *cfa)); const char *(*so_disassemble_instruction)PROTO((func_t *f, taddr_t addr, *************** *** 130,135 **** (fil->fi_symtab->st_ops->so_get_fi_macros)(fil) ! #define st_unwind(xp, st, fp, sp, pc) \ ! (st->st_ops->so_unwind)(xp, st, fp, sp, pc) #define st_disassemble_instruction(f, addr, text, len) \ --- 130,135 ---- (fil->fi_symtab->st_ops->so_get_fi_macros)(fil) ! #define st_unwind(xp, st, fp, sp, pc, cfa) \ ! (st->st_ops->so_unwind)(xp, st, fp, sp, pc, cfa) #define st_disassemble_instruction(f, addr, text, len) \ Index: obj_stack.c =================================================================== RCS file: /cvsroot/ups/ups/ups/obj_stack.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** obj_stack.c 21 Feb 2004 17:00:01 -0000 1.5 --- obj_stack.c 20 Dec 2005 12:43:12 -0000 1.6 *************** *** 1209,1213 **** taddr_t junk; ! f = get_stack_func(par, &junk, &junk); #ifdef ARCH_MIPS if (!(f->fu_language == LANG_C || f->fu_language == LANG_CC)) { --- 1209,1213 ---- taddr_t junk; ! f = get_stack_func(par, &junk, &junk, &junk, &junk); #ifdef ARCH_MIPS if (!(f->fu_language == LANG_C || f->fu_language == LANG_CC)) { *************** *** 1274,1280 **** func_t * ! get_stack_func(obj, p_fp, p_ap) objid_t obj; ! taddr_t *p_fp, *p_ap; { Stack *stk; --- 1274,1280 ---- func_t * ! get_stack_func(obj, p_fp, p_ap, p_sp, p_cfa) objid_t obj; ! taddr_t *p_fp, *p_ap, *p_sp, *p_cfa; { Stack *stk; *************** *** 1283,1286 **** --- 1283,1288 ---- *p_fp = stk->stk_fp; *p_ap = stk->stk_ap; + *p_sp = stk->stk_sp; + *p_cfa = stk->stk_cfa; return stk->stk_func; } *************** *** 1461,1465 **** if (!par) return found; ! f = get_stack_func(par, &junk, &junk); #ifdef ARCH_MIPS --- 1463,1467 ---- if (!par) return found; ! f = get_stack_func(par, &junk, &junk, &junk, &junk); #ifdef ARCH_MIPS Index: ao_symload.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_symload.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ao_symload.c 21 Feb 2004 17:00:00 -0000 1.7 --- ao_symload.c 20 Dec 2005 12:43:12 -0000 1.8 *************** *** 811,815 **** bool ! ao_unwind(xp, st, fp, sp, pc) target_t *xp; symtab_t *st; --- 811,815 ---- bool ! ao_unwind(xp, st, fp, sp, pc, cfa) target_t *xp; symtab_t *st; *************** *** 817,820 **** --- 817,821 ---- taddr_t *sp; taddr_t *pc; + taddr_t *cfa; { return FALSE; Index: ao_dwfutil.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwfutil.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ao_dwfutil.h 21 Feb 2004 17:00:00 -0000 1.4 --- ao_dwfutil.h 20 Dec 2005 12:43:12 -0000 1.5 *************** *** 49,53 **** bool dwf_unwind PROTO((Dwarf_Debug dbg, target_t *xp, taddr_t *fp, ! taddr_t *sp, taddr_t *pc)); #endif /* WANT_DWARF */ --- 49,53 ---- bool dwf_unwind PROTO((Dwarf_Debug dbg, target_t *xp, taddr_t *fp, ! taddr_t *sp, taddr_t *pc, taddr_t *cfa)); #endif /* WANT_DWARF */ Index: target.c =================================================================== RCS file: /cvsroot/ups/ups/ups/target.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** target.c 5 Nov 2002 12:30:34 -0000 1.3 --- target.c 20 Dec 2005 12:43:12 -0000 1.4 *************** *** 376,379 **** --- 376,380 ---- /* sp */ /* ap */ + stk->stk_cfa = 0; stk->stk_fil = fil; stk->stk_lnum = lnum; Index: ao_dwfutil.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwfutil.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ao_dwfutil.c 27 Apr 2005 07:59:51 -0000 1.14 --- ao_dwfutil.c 20 Dec 2005 12:43:12 -0000 1.15 *************** *** 496,500 **** Dwarf_Small op; vaddr_t *head = NULL, *vaddr; ! unsigned char fb_regop; if ((loclist = dwf_get_locdesc(dbg, die, id, &count)) == NULL) --- 496,501 ---- Dwarf_Small op; vaddr_t *head = NULL, *vaddr; ! unsigned char fp_regop; ! unsigned char sp_regop; if ((loclist = dwf_get_locdesc(dbg, die, id, &count)) == NULL) *************** *** 504,511 **** { case 32: ! fb_regop = DW_OP_breg5; break; case 64: ! fb_regop = DW_OP_breg6; break; default: --- 505,514 ---- { case 32: ! fp_regop = DW_OP_breg5; ! sp_regop = DW_OP_breg4; break; case 64: ! fp_regop = DW_OP_breg6; ! sp_regop = DW_OP_breg7; break; default: *************** *** 546,555 **** vaddr->v_op = OP_U_OFFSET; vaddr->v_u_offset = loclist[i].ld_s->lr_number; ! } else if (op == DW_OP_fbreg || op == fb_regop) { /* ! * Relative to frame base. */ ! vaddr->v_op = OP_FRAME_BASE; ! vaddr->v_frame_offset = (Dwarf_Signed)loclist[i].ld_s->lr_number; } --- 549,570 ---- vaddr->v_op = OP_U_OFFSET; vaddr->v_u_offset = loclist[i].ld_s->lr_number; ! } else if (op == DW_OP_fbreg) { /* ! * Relative to canonical frame address. */ ! vaddr->v_op = OP_CFA_RELATIVE; ! vaddr->v_offset = (Dwarf_Signed)loclist[i].ld_s->lr_number; ! } else if (op == fp_regop) { ! /* ! * Relative to frame pointer. ! */ ! vaddr->v_op = OP_FP_RELATIVE; ! vaddr->v_offset = (Dwarf_Signed)loclist[i].ld_s->lr_number; ! } else if (op == sp_regop) { ! /* ! * Relative to stack pointer. ! */ ! vaddr->v_op = OP_SP_RELATIVE; ! vaddr->v_offset = (Dwarf_Signed)loclist[i].ld_s->lr_number; } *************** *** 622,626 **** */ bool ! dwf_unwind(Dwarf_Debug dbg, target_t *xp, taddr_t *fp, taddr_t *sp, taddr_t *pc) { int rv; --- 637,641 ---- */ bool ! dwf_unwind(Dwarf_Debug dbg, target_t *xp, taddr_t *fp, taddr_t *sp, taddr_t *pc, taddr_t *cfa) { int rv; *************** *** 656,671 **** if ((rv = dwarf_get_fde_at_pc(fde_data, *pc, &fde, NULL, NULL, &err)) == DW_DLV_OK) { - taddr_t cfa; taddr_t new_fp; taddr_t new_sp; taddr_t new_pc; ! if (dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, DW_FRAME_CFA_COL, &cfa) && ! dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, ra_col, &new_pc)) { ! if (!dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, fp_col, &new_fp)) new_fp = 0; ! if (!dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, sp_col, &new_sp)) ! new_sp = cfa; *fp = new_fp; --- 671,685 ---- if ((rv = dwarf_get_fde_at_pc(fde_data, *pc, &fde, NULL, NULL, &err)) == DW_DLV_OK) { taddr_t new_fp; taddr_t new_sp; taddr_t new_pc; ! if (dwf_unwind_reg(fde, xp, *cfa, *fp, *sp, *pc, DW_FRAME_CFA_COL, cfa) && ! dwf_unwind_reg(fde, xp, *cfa, *fp, *sp, *pc, ra_col, &new_pc)) { ! if (!dwf_unwind_reg(fde, xp, *cfa, *fp, *sp, *pc, fp_col, &new_fp)) new_fp = 0; ! if (!dwf_unwind_reg(fde, xp, *cfa, *fp, *sp, *pc, sp_col, &new_sp)) ! new_sp = *cfa; *fp = new_fp; |