ups-cvs Mailing List for UPS debugger (Page 4)
Brought to you by:
ianedwards
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
(49) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(1) |
Feb
|
Mar
(10) |
Apr
(5) |
May
|
Jun
(5) |
Jul
(19) |
Aug
(29) |
Sep
(3) |
Oct
(1) |
Nov
(8) |
Dec
|
2004 |
Jan
|
Feb
(20) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2005 |
Jan
(1) |
Feb
(10) |
Mar
(5) |
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2006 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(11) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2012 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
(34) |
Feb
(3) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Tom H. <th...@us...> - 2007-11-22 10:53:49
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv1539/ups Modified Files: ao_target.c exec.c Log Message: Improve error reporting for indirect function calls. Index: exec.c =================================================================== RCS file: /cvsroot/ups/ups/ups/exec.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** exec.c 16 Feb 2004 13:02:00 -0000 1.4 --- exec.c 22 Nov 2007 10:53:46 -0000 1.5 *************** *** 805,811 **** args, argsizes_buf, nwords, p_res, restype, &mesg); ! if (mesg != NULL) ! errf("Call of function %s failed: %s: %s", ! addr_to_func(addr)->fu_demangled_name, mesg, get_errno_str()); return (retval == 0) ? CI_ER_CONTINUE : CI_ER_INDIRECT_CALL_FAILED; --- 805,818 ---- args, argsizes_buf, nwords, p_res, restype, &mesg); ! if (mesg != NULL) { ! func_t *f = addr_to_func(addr); ! ! if (f) ! errf("Call of function %s failed: %s: %s", ! f->fu_demangled_name, mesg, get_errno_str()); ! else ! errf("Call of function at address 0x%lx failed: %s: %s", ! addr, mesg, get_errno_str()); ! } return (retval == 0) ? CI_ER_CONTINUE : CI_ER_INDIRECT_CALL_FAILED; Index: ao_target.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_target.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ao_target.c 3 Aug 2005 23:12:18 -0000 1.13 --- ao_target.c 22 Nov 2007 10:53:46 -0000 1.14 *************** *** 1422,1425 **** --- 1422,1426 ---- if (ip->ip_stopres != SR_DIED && bp != NULL) { if (dx_remove_breakpoint(xp, bp) != 0) + *p_mesg = "Can't remove breakpoint at return address"; return -1; } *************** *** 1427,1432 **** /* If we didn't get back to where we expected, stop now. */ ! if (ip->ip_stopres != SR_BPT || ip->ip_restart_pc != retpc) return -1; *p_res = xp_getreg(xp, RETURN_REGNO); --- 1428,1435 ---- /* If we didn't get back to where we expected, stop now. */ ! if (ip->ip_stopres != SR_BPT || ip->ip_restart_pc != retpc) { ! *p_mesg = "Call failed before reaching breakpoint"; return -1; + } *p_res = xp_getreg(xp, RETURN_REGNO); |
From: Tom H. <th...@us...> - 2007-11-22 10:17:59
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15279/ups Modified Files: xc_machine.c Log Message: Check the address that we're actually about to try and dereference rather than some other random value... Index: xc_machine.c =================================================================== RCS file: /cvsroot/ups/ups/ups/xc_machine.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** xc_machine.c 22 Jun 2006 09:08:40 -0000 1.6 --- xc_machine.c 22 Nov 2007 10:17:52 -0000 1.7 *************** *** 1889,1893 **** addr = POP(sp); ! if (IS_CI_ADDR(*sp)) { GET_LONGLONG(d0, (stackword_t *)addr); } --- 1889,1893 ---- addr = POP(sp); ! if (IS_CI_ADDR(addr)) { GET_LONGLONG(d0, (stackword_t *)addr); } *************** *** 1938,1942 **** addr = POP(sp); ! if (IS_CI_ADDR(*sp)) { GET_FLOAT(d0, (stackword_t *)addr); } --- 1938,1942 ---- addr = POP(sp); ! if (IS_CI_ADDR(addr)) { GET_FLOAT(d0, (stackword_t *)addr); } *************** *** 1953,1957 **** addr = POP(sp); ! if (IS_CI_ADDR(*sp)) { GET_DOUBLE(d0, (stackword_t *)addr); } --- 1953,1957 ---- addr = POP(sp); ! if (IS_CI_ADDR(addr)) { GET_DOUBLE(d0, (stackword_t *)addr); } *************** *** 1969,1973 **** addr = POP(sp); ! if (IS_CI_ADDR(*sp)) { GET_LDOUBLE(d0, (stackword_t *)addr); } --- 1969,1973 ---- addr = POP(sp); ! if (IS_CI_ADDR(addr)) { GET_LDOUBLE(d0, (stackword_t *)addr); } *************** *** 1987,1991 **** addr = POP(sp); ! if (IS_CI_ADDR(*sp)) { GET_LONGLONG(d0, (stackword_t *)addr); } --- 1987,1991 ---- addr = POP(sp); ! if (IS_CI_ADDR(addr)) { GET_LONGLONG(d0, (stackword_t *)addr); } |
From: Tom H. <th...@us...> - 2007-11-16 17:03:13
|
Update of /cvsroot/ups/ups/lib/libx11wn In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv28480/lib/libx11wn Modified Files: wn_event.c Log Message: When enabling/disabling the ASYNC flag on the X socket, don't piss around with the other flags! The X library might be relying on the socket being marked as non-blocking... Index: wn_event.c =================================================================== RCS file: /cvsroot/ups/ups/lib/libx11wn/wn_event.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wn_event.c 4 Nov 2002 14:56:18 -0000 1.3 --- wn_event.c 16 Nov 2007 17:02:55 -0000 1.4 *************** *** 1267,1270 **** --- 1267,1271 ---- int fd; swin_t *w; + int flags; W_CHECK(wn); *************** *** 1291,1296 **** } #else ! if (fcntl(fd, F_SETFL, FASYNC) != 0) ! wn__panic("FASYNC on botch"); #endif #endif /* __hp9000s800 */ --- 1292,1300 ---- } #else ! if ((flags = fcntl(fd, F_GETFL, 0)) != -1) { ! flags |= FASYNC; ! if (fcntl(fd, F_SETFL, flags) != 0) ! wn__panic("FASYNC on botch"); ! } #endif #endif /* __hp9000s800 */ *************** *** 1306,1311 **** } #else ! if (fcntl(fd, F_SETFL, 0) != 0) ! wn__panic("FASYNC off botch"); #endif #endif /* __hp9000s800 */ --- 1310,1318 ---- } #else ! if ((flags = fcntl(fd, F_GETFL, 0)) != -1) { ! flags &= ~FASYNC; ! if (fcntl(fd, F_SETFL, flags) != 0) ! wn__panic("FASYNC off botch"); ! } #endif #endif /* __hp9000s800 */ |
From: Tom H. <th...@us...> - 2006-06-22 09:08:44
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23025 Modified Files: ci_compile.c ci_opcodes.c xc_machine.c xc_machine.h xc_text.c Log Message: Make interpreter opcodes two bytes as we now have more than 255 of them. Index: xc_machine.c =================================================================== RCS file: /cvsroot/ups/ups/ups/xc_machine.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** xc_machine.c 21 Jun 2006 16:25:28 -0000 1.5 --- xc_machine.c 22 Jun 2006 09:08:40 -0000 1.6 *************** *** 630,634 **** cf = ma->ma_entry_codefile; ! if ((opcode_t)*cf->cf_text_and_data != OC_TRAP) panic("missing OC_TRAP"); --- 630,634 ---- cf = ma->ma_entry_codefile; ! if (GETOPCODE(cf->cf_text_and_data) != OC_TRAP) panic("missing OC_TRAP"); *************** *** 879,893 **** int nargs; { ! static textword_t text[5]; ci_exec_result_t res; ! int i = 0; ! text[i++] = (int)OC_CALL_INDIRECT; ! text[i++] = nargs; #if WANT_TYPE_PUSHED ! text[i++] = TY_INT_ASSUMED; #endif ! text[i++] = (int)OC_PUSH_WORD_RETVAL; ! text[i] = (int)OC_TRAP; *--sp = func; --- 879,895 ---- int nargs; { ! static textword_t text[8]; ci_exec_result_t res; ! textword_t *textptr = text; ! textword_t *trapptr; ! WRITEOPCODE(textptr, OC_CALL_INDIRECT); ! *textptr++ = nargs; #if WANT_TYPE_PUSHED ! *textptr++ = TY_INT_ASSUMED; #endif ! WRITEOPCODE(textptr, OC_PUSH_WORD_RETVAL); ! trapptr = textptr; ! WRITEOPCODE(textptr, OC_TRAP); *--sp = func; *************** *** 899,903 **** (ci_indirect_call_proc_t)NULL); ! if (res != CI_ER_TRAP || ma->ma_pc != &text[i]) panic("bad callback"); } --- 901,905 ---- (ci_indirect_call_proc_t)NULL); ! if (res != CI_ER_TRAP || ma->ma_pc != trapptr) panic("bad callback"); } *************** *** 930,944 **** #endif ! #define PUSH_DOUBLE(d, sp) (PUSH(d.d_words[1], sp), PUSH(d.d_words[0], sp)) ! #define POP_DOUBLE(d, sp) (d.d_words[0] = POP(sp), d.d_words[1] = POP(sp)) ! ! #define GET_FLOAT(d, p) (d.d_word = *(p)) ! #define GET_DOUBLE(d, p) (d.d_words[0] = (p)[0], d.d_words[1] = (p)[1]) ! ! #define PUT_FLOAT(d, p) (*(p) = d.d_word) ! #define PUT_DOUBLE(d, p) ((p)[0] = d.d_words[0], (p)[1] = d.d_words[1]) #define PUSH_FLOAT(d, sp) PUSH(d.d_word, sp) #define POP_FLOAT(d, sp) (d.d_word = POP(sp)) ci_exec_result_t --- 932,948 ---- #endif ! #define PUSH_DOUBLE(d, sp) \ ! { int i; for (i=DOUBLE_NSLOTS-1; i>=0; i--) PUSH(d.d_words[i], sp);} ! #define POP_DOUBLE(d, sp) \ ! { int i; for (i=0; i<DOUBLE_NSLOTS; i++) d.d_words[i] = POP(sp);} ! #define PUT_DOUBLE(d, p) \ ! { int i; for (i=DOUBLE_NSLOTS-1; i>=0; i--) (p)[i] = d.d_words[i];} ! #define GET_DOUBLE(d, p) \ ! { int i; for (i=0; i<DOUBLE_NSLOTS; i++) d.d_words[i] = (p)[i];} #define PUSH_FLOAT(d, sp) PUSH(d.d_word, sp) #define POP_FLOAT(d, sp) (d.d_word = POP(sp)) + #define PUT_FLOAT(d, p) (*(p) = d.d_word) + #define GET_FLOAT(d, p) (d.d_word = *(p)) ci_exec_result_t *************** *** 957,961 **** register void **jtab; #define SWITCH(n) goto *jtab[n]; ! #define BREAK goto *jtab[*pc++] #define CASE #else --- 961,965 ---- register void **jtab; #define SWITCH(n) goto *jtab[n]; ! #define BREAK goto *jtab[READOPCODE(pc)] #define CASE #else *************** *** 1040,1047 **** for (;;) { ! SWITCH (*pc++) { #if WANT_JUMPTAB ! update_count: ++ma->ma_opcounts[pc[-1]]; ! goto *jumptab[pc[-1]]; #endif --- 1044,1051 ---- for (;;) { ! SWITCH (READOPCODE(pc)) { #if WANT_JUMPTAB ! update_count: ++ma->ma_opcounts[PREVOPCODE(pc)]; ! goto *jumptab[PREVOPCODE(pc)]; #endif Index: ci_opcodes.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ci_opcodes.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ci_opcodes.c 18 Feb 2004 11:10:34 -0000 1.7 --- ci_opcodes.c 22 Jun 2006 09:08:40 -0000 1.8 *************** *** 204,208 **** tx->tx_max_sp = tx->tx_sp + tmpspace; ! ci_code_byte(tx, (int)opcode); } --- 204,208 ---- tx->tx_max_sp = tx->tx_sp + tmpspace; ! ci_code_word(tx, (int)opcode); } Index: xc_machine.h =================================================================== RCS file: /cvsroot/ups/ups/ups/xc_machine.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** xc_machine.h 22 Jun 2006 09:03:51 -0000 1.6 --- xc_machine.h 22 Jun 2006 09:08:40 -0000 1.7 *************** *** 215,218 **** --- 215,228 ---- #define GETQUAD(pc) (0UL) #endif + #define GETOPCODE(pc) ((opcode_t)GETWORD(pc)) + #define PREVOPCODE(pc) (GETOPCODE((pc) - 2)) + #define READOPCODE(pc) ((pc) += 2, PREVOPCODE(pc)) + + #define PUTOPCODE(pc, op) \ + (pc)[0] = ((unsigned long)(op) & 0xff); \ + (pc)[1] = (((unsigned long)(op) >> 8 ) & 0xff); + #define WRITEOPCODE(pc, op) \ + *(pc)++ = ((unsigned long)(op) & 0xff); \ + *(pc)++ = (((unsigned long)(op) >> 8 ) & 0xff); typedef struct { Index: ci_compile.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ci_compile.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ci_compile.c 18 Feb 2004 10:56:27 -0000 1.3 --- ci_compile.c 22 Jun 2006 09:08:40 -0000 1.4 *************** *** 1304,1311 **** long location; { ! int res; ! res = ma->ma_codefile->cf_text_and_data[location]; ! ma->ma_codefile->cf_text_and_data[location] = (int)OC_TRAP; return res; } --- 1304,1311 ---- long location; { ! ci_opcode_t res; ! res = GETOPCODE(ma->ma_codefile->cf_text_and_data + location); ! PUTOPCODE(ma->ma_codefile->cf_text_and_data + location, OC_TRAP); return res; } *************** *** 1320,1327 **** ci_panic("opcode botch in cuti"); ! if (ma->ma_codefile->cf_text_and_data[location] != (int)OC_TRAP) ci_panic("missing bpt in cuti"); ! ma->ma_codefile->cf_text_and_data[location] = (int)opcode; } --- 1320,1327 ---- ci_panic("opcode botch in cuti"); ! if (GETOPCODE(ma->ma_codefile->cf_text_and_data + location) != OC_TRAP) ci_panic("missing bpt in cuti"); ! PUTOPCODE(ma->ma_codefile->cf_text_and_data + location, opcode); } Index: xc_text.c =================================================================== RCS file: /cvsroot/ups/ups/ups/xc_text.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** xc_text.c 21 Jun 2006 16:25:28 -0000 1.10 --- xc_text.c 22 Jun 2006 09:08:40 -0000 1.11 *************** *** 580,585 **** ci_get_next_pc_and_cf(ma, &ncf, &npc); ! saved_opcode = *npc; ! *npc = (textword_t)OC_TRAP; res = ci_execute_machine(ma, --- 580,585 ---- ci_get_next_pc_and_cf(ma, &ncf, &npc); ! saved_opcode = GETOPCODE(npc); ! PUTOPCODE(npc, OC_TRAP); res = ci_execute_machine(ma, *************** *** 588,592 **** (ci_indirect_call_proc_t)NULL); ! *npc = saved_opcode; return res; --- 588,592 ---- (ci_indirect_call_proc_t)NULL); ! PUTOPCODE(npc, saved_opcode); return res; *************** *** 950,955 **** opcode = (p_old_opcode != NULL) ? OC_TRAP : (opcode_t)xp_opcode; ! old_opcode = (opcode_t)*pc; ! *pc = (textword_t)opcode; if ((opcode == OC_TRAP) == (old_opcode == OC_TRAP)) { --- 950,955 ---- opcode = (p_old_opcode != NULL) ? OC_TRAP : (opcode_t)xp_opcode; ! old_opcode = GETOPCODE(pc); ! PUTOPCODE(pc, opcode); if ((opcode == OC_TRAP) == (old_opcode == OC_TRAP)) { *************** *** 1617,1621 **** opcode_t opcode; ! opcode = (opcode_t)*text++; switch (opcode) { --- 1617,1621 ---- opcode_t opcode; ! opcode = READOPCODE(text); switch (opcode) { |
From: Tom H. <th...@us...> - 2006-06-22 09:03:58
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19622 Modified Files: ci_compile_expr.c xc_machine.h Log Message: Treat LONG as meaning a 32 bit type in the C expression evaluator even on 64 bit systems and map incoming variable types to LONG or LONG_LONG as appropriate to their size. Index: ci_compile_expr.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ci_compile_expr.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ci_compile_expr.c 21 Jun 2006 16:25:27 -0000 1.6 --- ci_compile_expr.c 22 Jun 2006 09:03:51 -0000 1.7 *************** *** 71,76 **** optype_t op, expr_context_t context)); ! static int opcode_offset PROTO((typecode_t typecode)); ! static void code_deref PROTO((text_t *tx, typecode_t typecode, addrtype_t addrtype)); static opcode_t operator_to_opcode PROTO((text_t *tx, optype_t op, type_t *ltype, type_t *rtype)); static bool is_aggregate PROTO((type_t *type)); --- 71,76 ---- optype_t op, expr_context_t context)); ! static int opcode_offset PROTO((typecode_t typecode, long typesize)); ! static void code_deref PROTO((text_t *tx, typecode_t typecode, long typesize, addrtype_t addrtype)); static opcode_t operator_to_opcode PROTO((text_t *tx, optype_t op, type_t *ltype, type_t *rtype)); static bool is_aggregate PROTO((type_t *type)); *************** *** 575,580 **** static int ! opcode_offset(typecode) typecode_t typecode; { switch (ci_effective_typecode(typecode)) { --- 575,581 ---- static int ! opcode_offset(typecode, typesize) typecode_t typecode; + long typesize; { switch (ci_effective_typecode(typecode)) { *************** *** 592,596 **** case TY_BOOLEAN: case DT_PTR_TO: ! return LONG_FORM_OFFSET; case TY_FLOAT: return FLOAT_FORM_OFFSET; --- 593,605 ---- case TY_BOOLEAN: case DT_PTR_TO: ! switch (typesize) { ! case 4: ! return LONG_FORM_OFFSET; ! case 8: ! return LONGLONG_FORM_OFFSET; ! default: ! ci_panic("bad size in oo"); ! return 0; /* to satisfy gcc */ ! } case TY_FLOAT: return FLOAT_FORM_OFFSET; *************** *** 621,627 **** static void ! code_deref(tx, typecode, addrtype) text_t *tx; typecode_t typecode; addrtype_t addrtype; { --- 630,637 ---- static void ! code_deref(tx, typecode, typesize, addrtype) text_t *tx; typecode_t typecode; + long typesize; addrtype_t addrtype; { *************** *** 635,639 **** : OC_DEREF_UNSIGNED_BYTE; ! ci_code_opcode(tx, (opcode_t)((int)opcode + opcode_offset(typecode))); } --- 645,649 ---- : OC_DEREF_UNSIGNED_BYTE; ! ci_code_opcode(tx, (opcode_t)((int)opcode + opcode_offset(typecode, typesize))); } *************** *** 686,690 **** opcode = want_value ? OC_ASSIGN_AND_PUSH_BYTE : OC_ASSIGN_BYTE; ! ci_code_opcode(tx, (opcode_t)((int)opcode + opcode_offset(typecode))); if (want_value && type->ty_code == TY_BITFIELD) --- 696,700 ---- opcode = want_value ? OC_ASSIGN_AND_PUSH_BYTE : OC_ASSIGN_BYTE; ! ci_code_opcode(tx, (opcode_t)((int)opcode + opcode_offset(typecode, type->ty_size))); if (want_value && type->ty_code == TY_BITFIELD) *************** *** 757,761 **** generic_opcode = (opcode_t)((int)generic_byte_opcode + N_OPCODE_SIZES * ! opcode_offset(v->va_type->ty_code)); } else { --- 767,771 ---- generic_opcode = (opcode_t)((int)generic_byte_opcode + N_OPCODE_SIZES * ! opcode_offset(v->va_type->ty_code, v->va_type->ty_size)); } else { *************** *** 823,827 **** if (need_deref) ! code_deref(tx, v->va_type->ty_code, AT_PROC_ADDR); return addrtype; --- 833,837 ---- if (need_deref) ! code_deref(tx, v->va_type->ty_code, v->va_type->ty_size, AT_PROC_ADDR); return addrtype; *************** *** 1086,1089 **** --- 1096,1100 ---- bf = v->va_type->ty_bitfield; code_deref(tx, bf->bf_type->ty_code, + bf->bf_type->ty_size, expr_addrtype); code_bitfield_op(tx, bf, *************** *** 1091,1095 **** } else ! code_deref(tx, v->va_type->ty_code, expr_addrtype); addrtype = unknown_addrtype(tx); } --- 1102,1108 ---- } else ! code_deref(tx, v->va_type->ty_code, ! v->va_type->ty_size, ! expr_addrtype); addrtype = unknown_addrtype(tx); } *************** *** 1272,1276 **** } else ! code_deref(tx, addrleft->ex_type->ty_code, left_at); if (left != addrleft) { --- 1285,1290 ---- } else ! code_deref(tx, addrleft->ex_type->ty_code, ! addrleft->ex_type->ty_size, left_at); if (left != addrleft) { *************** *** 1395,1399 **** if (context == EC_VALUE && !is_aggregate(base) && base->ty_code != DT_FUNC_RETURNING) { ! code_deref(tx, base->ty_code, expr_addrtype); addrtype = unknown_addrtype(tx); } --- 1409,1413 ---- if (context == EC_VALUE && !is_aggregate(base) && base->ty_code != DT_FUNC_RETURNING) { ! code_deref(tx, base->ty_code, base->ty_size, expr_addrtype); addrtype = unknown_addrtype(tx); } *************** *** 1420,1424 **** } else ! code_deref(tx, expr->ex_type->ty_code, expr_addrtype); if (context == EC_VALUE && !is_preop) --- 1434,1439 ---- } else ! code_deref(tx, expr->ex_type->ty_code, ! expr->ex_type->ty_size, expr_addrtype); if (context == EC_VALUE && !is_preop) Index: xc_machine.h =================================================================== RCS file: /cvsroot/ups/ups/ups/xc_machine.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** xc_machine.h 18 Feb 2004 11:23:07 -0000 1.5 --- xc_machine.h 22 Jun 2006 09:03:51 -0000 1.6 *************** *** 85,90 **** unsigned short d_ushort; short d_short; ! unsigned long d_ulong; ! long d_long; float d_float; stackword_t d_word; --- 85,90 ---- unsigned short d_ushort; short d_short; ! unsigned int d_ulong; ! int d_long; float d_float; stackword_t d_word; |
From: Tom H. <th...@us...> - 2006-06-21 16:34:41
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26962 Modified Files: ao_ptrace.c Log Message: Backout accidental commit. Index: ao_ptrace.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_ptrace.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ao_ptrace.c 21 Jun 2006 16:25:27 -0000 1.10 --- ao_ptrace.c 21 Jun 2006 16:34:37 -0000 1.11 *************** *** 441,454 **** - static void - abort_cleanup(int signo) - { - target_t *xp = get_current_target(); - iproc_t *ip = GET_IPROC(xp); - - kill(ip->ip_pid, SIGTRAP); - } - - /* Kill off the target process */ --- 441,444 ---- *************** *** 457,461 **** target_t *xp; { - struct sigaction sa; wait_arg_t status; iproc_t *ip; --- 447,450 ---- *************** *** 464,492 **** uninstall_all_breakpoints(xp); ! ! sa.sa_handler = abort_cleanup; ! sigemptyset(&sa.sa_mask); ! sa.sa_flags = SA_ONESHOT; ! sa.sa_restorer = NULL; ! ! sigaction(SIGALRM, &sa, &sa); ! ! alarm(5); ! ! std_ptrace(PTRACE_CONT, ip->ip_pid, (char *)NULL, SIGTERM); ptrace_wait_for_target(xp); ! while (ip->ip_stopres == SR_SIG) { ! std_ptrace(PTRACE_CONT, ip->ip_pid, (char *)NULL, ip->ip_lastsig); ! ptrace_wait_for_target(xp); ! } ! ! alarm(0); ! ! sigaction(SIGALRM, &sa, NULL); if (ip->ip_stopres != SR_DIED) { - std_ptrace(PTRACE_KILL, ip->ip_pid, (char *)NULL, 0); - if (ip->ip_attached) { /* wait() hangs on a PTRACE_ATTACH process which --- 453,462 ---- uninstall_all_breakpoints(xp); ! std_ptrace(PTRACE_SINGLESTEP, ip->ip_pid, (char *)NULL, SIGTERM); ptrace_wait_for_target(xp); ! std_ptrace(PTRACE_KILL, ip->ip_pid, (char *)NULL, 0); if (ip->ip_stopres != SR_DIED) { if (ip->ip_attached) { /* wait() hangs on a PTRACE_ATTACH process which |
From: Tom H. <th...@us...> - 2006-06-21 16:25:34
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23546 Modified Files: ao_ptrace.c cg.c ci.h ci_compile_expr.c obj_bpt.c obj_bpt.h target.c target.h trun_j.c trun_ss.c va_expr.c xc.c xc_machine.c xc_opcodes.h xc_text.c Log Message: Handle CFA relative variable locations in expression evaluation. Index: cg.c =================================================================== RCS file: /cvsroot/ups/ups/ups/cg.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cg.c 27 Nov 2002 16:06:46 -0000 1.2 --- cg.c 21 Jun 2006 16:25:27 -0000 1.3 *************** *** 131,136 **** ci_initialise_machine(ma, FALSE, FALSE, argv, envp); ! res = ci_execute_machine(ma, (taddr_t)0, (taddr_t)0, noread, nowrite, ! (ci_indirect_call_proc_t)NULL); if (res != CI_ER_EXITED && res != CI_ER_TRAP) { --- 131,136 ---- ci_initialise_machine(ma, FALSE, FALSE, argv, envp); ! res = ci_execute_machine(ma, (taddr_t)0, (taddr_t)0, (taddr_t)0, ! noread, nowrite, (ci_indirect_call_proc_t)NULL); if (res != CI_ER_EXITED && res != CI_ER_TRAP) { Index: ci.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ci.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ci.h 28 Oct 2002 10:04:24 -0000 1.2 --- ci.h 21 Jun 2006 16:25:27 -0000 1.3 *************** *** 246,249 **** --- 246,250 ---- ci_exec_result_t ci_execute_machine PROTO((machine_t *machine, unsigned long procfp, unsigned long procap, + unsigned long proccfa, ci_readproc_t readproc, ci_writeproc_t writeproc, ci_indirect_call_proc_t indirect_call_proc)); Index: xc_text.c =================================================================== RCS file: /cvsroot/ups/ups/ups/xc_text.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** xc_text.c 20 Dec 2005 12:43:12 -0000 1.9 --- xc_text.c 21 Jun 2006 16:25:28 -0000 1.10 *************** *** 535,539 **** case CT_CONT: res = ci_execute_machine(ma, ! (textaddr_t)0, (textaddr_t)0, (ci_readproc_t)NULL, (ci_writeproc_t)NULL, (ci_indirect_call_proc_t)NULL); --- 535,539 ---- case CT_CONT: res = ci_execute_machine(ma, ! (textaddr_t)0, (textaddr_t)0, (textaddr_t)0, (ci_readproc_t)NULL, (ci_writeproc_t)NULL, (ci_indirect_call_proc_t)NULL); *************** *** 584,588 **** res = ci_execute_machine(ma, ! (textaddr_t)0, (textaddr_t)0, (ci_readproc_t)NULL, (ci_writeproc_t)NULL, (ci_indirect_call_proc_t)NULL); --- 584,588 ---- res = ci_execute_machine(ma, ! (textaddr_t)0, (textaddr_t)0, (textaddr_t)0, (ci_readproc_t)NULL, (ci_writeproc_t)NULL, (ci_indirect_call_proc_t)NULL); *************** *** 1057,1061 **** ma->ma_codefile = fcf; ! ci_execute_machine(ma, (textaddr_t)NULL, (textaddr_t)NULL, (ci_readproc_t)NULL, (ci_writeproc_t)NULL, (ci_indirect_call_proc_t)NULL); --- 1057,1061 ---- ma->ma_codefile = fcf; ! ci_execute_machine(ma, (textaddr_t)NULL, (textaddr_t)NULL, (textaddr_t)NULL, (ci_readproc_t)NULL, (ci_writeproc_t)NULL, (ci_indirect_call_proc_t)NULL); Index: ci_compile_expr.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ci_compile_expr.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ci_compile_expr.c 16 Mar 2005 10:03:55 -0000 1.5 --- ci_compile_expr.c 21 Jun 2006 16:25:27 -0000 1.6 *************** *** 717,721 **** if (is_civar) generic_opcode = OC_PUSH_STACKADDR_B; ! else { generic_opcode = (v->va_class == CL_ARG) ? OC_PROC_PUSH_AP_ADDR_B --- 717,732 ---- if (is_civar) generic_opcode = OC_PUSH_STACKADDR_B; ! else if (v->va_location) { ! switch (v->va_location->v_op) { ! case OP_CFA_RELATIVE: ! generic_opcode = OC_PROC_PUSH_CFA_ADDR_B; ! break; ! case OP_FP_RELATIVE: ! generic_opcode = OC_PROC_PUSH_FP_ADDR_B; ! break; ! default: ! panic("unhandled op in cvr"); ! } ! } else { generic_opcode = (v->va_class == CL_ARG) ? OC_PROC_PUSH_AP_ADDR_B *************** *** 749,757 **** } else { ! if (IS_LOCAL_CLASS(v->va_class)) ! generic_opcode = (v->va_class == CL_ARG) ! ? OC_PROC_PUSH_AP_ADDR_B ! : OC_PROC_PUSH_FP_ADDR_B; ! else generic_opcode = OC_CONSTPUSH_B; need_deref = TRUE; --- 760,781 ---- } else { ! if (IS_LOCAL_CLASS(v->va_class)) { ! if (v->va_location) { ! switch (v->va_location->v_op) { ! case OP_CFA_RELATIVE: ! generic_opcode = OC_PROC_PUSH_CFA_ADDR_B; ! break; ! case OP_FP_RELATIVE: ! generic_opcode = OC_PROC_PUSH_FP_ADDR_B; ! break; ! default: ! panic("unhandled op in cvr"); ! } ! } else { ! generic_opcode = (v->va_class == CL_ARG) ! ? OC_PROC_PUSH_AP_ADDR_B ! : OC_PROC_PUSH_FP_ADDR_B; ! } ! } else generic_opcode = OC_CONSTPUSH_B; need_deref = TRUE; Index: xc.c =================================================================== RCS file: /cvsroot/ups/ups/ups/xc.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xc.c 27 Nov 2002 16:06:47 -0000 1.2 --- xc.c 21 Jun 2006 16:25:27 -0000 1.3 *************** *** 127,131 **** exit(1); ! res = ci_execute_machine(ma, (taddr_t)0, (taddr_t)0, noread, nowrite, (ci_indirect_call_proc_t)NULL); --- 127,132 ---- exit(1); ! res = ci_execute_machine(ma, (taddr_t)0, (taddr_t)0, (taddr_t)0, ! noread, nowrite, (ci_indirect_call_proc_t)NULL); Index: va_expr.c =================================================================== RCS file: /cvsroot/ups/ups/ups/va_expr.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** va_expr.c 20 Dec 2005 12:43:12 -0000 1.6 --- va_expr.c 21 Jun 2006 16:25:27 -0000 1.7 *************** *** 917,921 **** bool change_caused_by_edit; { ! taddr_t fp, ap, junk; dexpr_t *de; bool lose_descendents; --- 917,921 ---- bool change_caused_by_edit; { ! taddr_t fp, ap, cfa, junk; dexpr_t *de; bool lose_descendents; *************** *** 943,947 **** fp = ap = 0; else ! get_stack_func(par, &fp, &ap, &junk, &junk); Expr_type = NULL; --- 943,947 ---- fp = ap = 0; else ! get_stack_func(par, &fp, &ap, &junk, &cfa); Expr_type = NULL; *************** *** 949,953 **** (char **)NULL, (char **)NULL); ! res = ci_execute_machine(de->de_machine, fp, ap, read_data, nowrite, set_expr_result); --- 949,953 ---- (char **)NULL, (char **)NULL); ! res = ci_execute_machine(de->de_machine, fp, ap, cfa, read_data, nowrite, set_expr_result); *************** *** 1307,1311 **** { objid_t par; ! taddr_t fp, ap, junk; fil_t *fil; int lnum; --- 1307,1311 ---- { objid_t par; ! taddr_t fp, ap, cfa, junk; fil_t *fil; int 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; --- 1325,1329 ---- fil = (fil_t *)par; else ! fil = get_stack_func(par, &fp, &ap, &junk, &cfa)->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, junk; ci_exec_result_t res; objid_t par; --- 1341,1345 ---- if (cr->cr_machine != NULL && cr->cr_parse_id != NULL) { ! taddr_t fp, ap, cfa, junk; ci_exec_result_t res; objid_t par; *************** *** 1349,1353 **** fp = ap = 0; else ! get_stack_func(par, &fp, &ap, &junk, &junk); Expr_type = NULL; --- 1349,1353 ---- fp = ap = 0; else ! get_stack_func(par, &fp, &ap, &junk, &cfa); Expr_type = NULL; *************** *** 1355,1359 **** (char **)NULL, (char **)NULL); ! res = ci_execute_machine(cr->cr_machine, fp, ap, read_data, nowrite, set_expr_result); --- 1355,1359 ---- (char **)NULL, (char **)NULL); ! res = ci_execute_machine(cr->cr_machine, fp, ap, cfa, read_data, nowrite, set_expr_result); *************** *** 1388,1392 **** { objid_t par; ! taddr_t fp, ap, junk; fil_t *fil; int lnum; --- 1388,1392 ---- { objid_t par; ! taddr_t fp, ap, cfa, junk; fil_t *fil; int 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; --- 1401,1405 ---- fil = (fil_t *)par; else ! fil = get_stack_func(par, &fp, &ap, &junk, &cfa)->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, junk; ci_exec_result_t res; objid_t par; --- 1424,1428 ---- if (cr->cr_machine != NULL && cr->cr_parse_id != NULL) { ! taddr_t fp, ap, jcfa, unk; ci_exec_result_t res; objid_t par; *************** *** 1432,1436 **** fp = ap = 0; else ! get_stack_func(par, &fp, &ap, &junk, &junk); Expr_type = NULL; --- 1432,1436 ---- fp = ap = 0; else ! get_stack_func(par, &fp, &ap, &junk, &cfa); Expr_type = NULL; *************** *** 1438,1442 **** (char **)NULL, (char **)NULL); ! res = ci_execute_machine(cr->cr_machine, fp, ap, read_data, nowrite, set_expr_result); --- 1438,1442 ---- (char **)NULL, (char **)NULL); ! res = ci_execute_machine(cr->cr_machine, fp, ap, cfa, read_data, nowrite, set_expr_result); Index: ao_ptrace.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_ptrace.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ao_ptrace.c 29 Jul 2005 08:59:16 -0000 1.9 --- ao_ptrace.c 21 Jun 2006 16:25:27 -0000 1.10 *************** *** 441,444 **** --- 441,454 ---- + static void + abort_cleanup(int signo) + { + target_t *xp = get_current_target(); + iproc_t *ip = GET_IPROC(xp); + + kill(ip->ip_pid, SIGTRAP); + } + + /* Kill off the target process */ *************** *** 447,450 **** --- 457,461 ---- target_t *xp; { + struct sigaction sa; wait_arg_t status; iproc_t *ip; *************** *** 453,462 **** uninstall_all_breakpoints(xp); ! std_ptrace(PTRACE_SINGLESTEP, ip->ip_pid, (char *)NULL, SIGTERM); ptrace_wait_for_target(xp); ! std_ptrace(PTRACE_KILL, ip->ip_pid, (char *)NULL, 0); if (ip->ip_stopres != SR_DIED) { if (ip->ip_attached) { /* wait() hangs on a PTRACE_ATTACH process which --- 464,492 ---- uninstall_all_breakpoints(xp); ! ! sa.sa_handler = abort_cleanup; ! sigemptyset(&sa.sa_mask); ! sa.sa_flags = SA_ONESHOT; ! sa.sa_restorer = NULL; ! ! sigaction(SIGALRM, &sa, &sa); ! ! alarm(5); ! ! std_ptrace(PTRACE_CONT, ip->ip_pid, (char *)NULL, SIGTERM); ptrace_wait_for_target(xp); ! while (ip->ip_stopres == SR_SIG) { ! std_ptrace(PTRACE_CONT, ip->ip_pid, (char *)NULL, ip->ip_lastsig); ! ptrace_wait_for_target(xp); ! } ! ! alarm(0); ! ! sigaction(SIGALRM, &sa, NULL); if (ip->ip_stopres != SR_DIED) { + std_ptrace(PTRACE_KILL, ip->ip_pid, (char *)NULL, 0); + if (ip->ip_attached) { /* wait() hangs on a PTRACE_ATTACH process which Index: trun_ss.c =================================================================== RCS file: /cvsroot/ups/ups/ups/trun_ss.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** trun_ss.c 16 Feb 2004 13:02:00 -0000 1.5 --- trun_ss.c 21 Jun 2006 16:25:27 -0000 1.6 *************** *** 210,215 **** if (bp != NULL) { bp_wants_stop = execute_bp_code(bp, ! xp_getreg(xp, UPSREG_FP), ! xp_getreg(xp, UPSREG_AP)); stopres = xp_get_stopres(xp); if (breakpoint_is_solib_event(bp)) --- 210,216 ---- if (bp != NULL) { bp_wants_stop = execute_bp_code(bp, ! xp_getreg(xp, UPSREG_FP), ! xp_getreg(xp, UPSREG_AP), ! xp_getcfa(xp)); stopres = xp_get_stopres(xp); if (breakpoint_is_solib_event(bp)) *************** *** 252,256 **** bp_wants_stop = execute_bp_code(bp, xp_getreg(xp, UPSREG_FP), ! xp_getreg(xp, UPSREG_AP)); stopres = xp_get_stopres(xp); if (breakpoint_is_solib_event(bp)) --- 253,258 ---- bp_wants_stop = execute_bp_code(bp, xp_getreg(xp, UPSREG_FP), ! xp_getreg(xp, UPSREG_AP), ! xp_getcfa(xp)); stopres = xp_get_stopres(xp); if (breakpoint_is_solib_event(bp)) Index: obj_bpt.c =================================================================== RCS file: /cvsroot/ups/ups/ups/obj_bpt.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** obj_bpt.c 16 Jul 2003 10:00:29 -0000 1.5 --- obj_bpt.c 21 Jun 2006 16:25:27 -0000 1.6 *************** *** 133,137 **** bpdesc_t *bd)); static bool execute_bp_code_internal PROTO((breakpoint_t *bp, ! taddr_t fp, taddr_t ap, int button)); static void set_bpt_location PROTO((fval_t *fields, func_t *f, int lnum)); --- 133,137 ---- bpdesc_t *bd)); static bool execute_bp_code_internal PROTO((breakpoint_t *bp, ! taddr_t fp, taddr_t ap, taddr_t cfa, int button)); static void set_bpt_location PROTO((fval_t *fields, func_t *f, int lnum)); *************** *** 1602,1608 **** static bool ! execute_bp_code_internal(bp, fp, ap, button) breakpoint_t *bp; ! taddr_t fp, ap; int button; { --- 1602,1608 ---- static bool ! execute_bp_code_internal(bp, fp, ap, cfa, button) breakpoint_t *bp; ! taddr_t fp, ap, cfa; int button; { *************** *** 1642,1646 **** } ! res = ci_execute_machine(bd->machine, fp, ap, read_data, write_data, call_target_function); --- 1642,1646 ---- } ! res = ci_execute_machine(bd->machine, fp, ap, cfa, read_data, write_data, call_target_function); *************** *** 1652,1658 **** bool ! execute_bp_code(bp, fp, ap) breakpoint_t *bp; ! taddr_t fp, ap; { if (!global_bp_enabled(0, 0)) --- 1652,1658 ---- bool ! execute_bp_code(bp, fp, ap, cfa) breakpoint_t *bp; ! taddr_t fp, ap, cfa; { if (!global_bp_enabled(0, 0)) *************** *** 1662,1666 **** return TRUE; ! return (execute_bp_code_internal(bp, fp, ap, 0)); } --- 1662,1666 ---- return TRUE; ! return (execute_bp_code_internal(bp, fp, ap, cfa, 0)); } *************** *** 1943,1947 **** execute_bp_code_internal(bd->breakpoint, xp_getreg(xp, UPSREG_FP), ! xp_getreg(xp, UPSREG_AP), 1); update_variable_values(); } --- 1943,1948 ---- execute_bp_code_internal(bd->breakpoint, xp_getreg(xp, UPSREG_FP), ! xp_getreg(xp, UPSREG_AP), ! xp_getcfa(xp), 1); update_variable_values(); } Index: target.h =================================================================== RCS file: /cvsroot/ups/ups/ups/target.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** target.h 20 Dec 2005 12:43:12 -0000 1.5 --- target.h 21 Jun 2006 16:25:27 -0000 1.6 *************** *** 443,446 **** --- 443,447 ---- taddr_t xp_getreg PROTO((target_t *xp, int regno)); + taddr_t xp_getcfa PROTO((target_t *xp)); taddr_t xp_get_entryaddr PROTO((target_t *xp)); Index: xc_machine.c =================================================================== RCS file: /cvsroot/ups/ups/ups/xc_machine.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** xc_machine.c 18 Feb 2004 10:56:29 -0000 1.4 --- xc_machine.c 21 Jun 2006 16:25:28 -0000 1.5 *************** *** 895,899 **** ma->ma_sp = sp; ma->ma_pc = text; ! res = ci_execute_machine(ma, (textaddr_t)0, (textaddr_t)0, (ci_readproc_t)NULL, (ci_writeproc_t)NULL, (ci_indirect_call_proc_t)NULL); --- 895,899 ---- ma->ma_sp = sp; ma->ma_pc = text; ! res = ci_execute_machine(ma, (textaddr_t)0, (textaddr_t)0, (textaddr_t)0, (ci_readproc_t)NULL, (ci_writeproc_t)NULL, (ci_indirect_call_proc_t)NULL); *************** *** 943,949 **** ci_exec_result_t ! ci_execute_machine(ma, procfp, procap, readproc, writeproc, indirect_call_proc) machine_t *ma; ! textaddr_t procfp, procap; ci_readproc_t readproc; ci_writeproc_t writeproc; --- 943,949 ---- ci_exec_result_t ! ci_execute_machine(ma, procfp, procap, proccfa, readproc, writeproc, indirect_call_proc) machine_t *ma; ! textaddr_t procfp, procap, proccfa; ci_readproc_t readproc; ci_writeproc_t writeproc; *************** *** 2233,2236 **** --- 2233,2252 ---- BREAK; + CASE OC_PROC_PUSH_CFA_ADDR_B: + PUSH((stackword_t)(proccfa + *pc++), sp); + BREAK; + CASE OC_PROC_PUSH_CFA_ADDR_W: + PUSH((stackword_t)(proccfa + GETWORD(pc)), sp); + pc += 2; + BREAK; + CASE OC_PROC_PUSH_CFA_ADDR_L: + PUSH((stackword_t)(proccfa + GETLONG(pc)), sp); + pc += 4; + BREAK; + CASE OC_PROC_PUSH_CFA_ADDR_Q: + PUSH((stackword_t)(proccfa + GETQUAD(pc)), sp); + pc += 8; + BREAK; + CASE OC_PUSH_STACKADDR_B: PUSH((stackword_t)((char *)fp + *pc++), sp); Index: trun_j.c =================================================================== RCS file: /cvsroot/ups/ups/ups/trun_j.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** trun_j.c 16 Feb 2004 13:02:00 -0000 1.5 --- trun_j.c 21 Jun 2006 16:25:27 -0000 1.6 *************** *** 187,191 **** { stop = execute_bp_code(bp, xp_getreg(xp, UPSREG_FP), ! xp_getreg(xp, UPSREG_AP)); stopres = xp_get_stopres(xp); if (stopres != SR_BPT) --- 187,192 ---- { stop = execute_bp_code(bp, xp_getreg(xp, UPSREG_FP), ! xp_getreg(xp, UPSREG_AP), ! xp_getcfa(xp)); stopres = xp_get_stopres(xp); if (stopres != SR_BPT) *************** *** 653,657 **** if (bp_at_nextline != NULL) { execute_bp_code(bp_at_nextline, fp, ! xp_getreg(xp, UPSREG_AP)); stopres = xp_get_stopres(xp); } --- 654,659 ---- if (bp_at_nextline != NULL) { execute_bp_code(bp_at_nextline, fp, ! xp_getreg(xp, UPSREG_AP), ! xp_getcfa(xp)); stopres = xp_get_stopres(xp); } *************** *** 783,788 **** if (bp_at_start_of_func != NULL) { execute_bp_code(bp_at_start_of_func, ! xp_getreg(xp, UPSREG_FP), ! xp_getreg(xp, UPSREG_AP)); stopres = xp_get_stopres(xp); } --- 785,791 ---- if (bp_at_start_of_func != NULL) { execute_bp_code(bp_at_start_of_func, ! xp_getreg(xp, UPSREG_FP), ! xp_getreg(xp, UPSREG_AP), ! xp_getcfa(xp)); stopres = xp_get_stopres(xp); } *************** *** 1116,1120 **** if (bp_at_nextline != NULL) { execute_bp_code(bp_at_nextline, fp, ! xp_getreg(xp, UPSREG_AP)); stopres = xp_get_stopres(xp); } --- 1119,1124 ---- if (bp_at_nextline != NULL) { execute_bp_code(bp_at_nextline, fp, ! xp_getreg(xp, UPSREG_AP), ! xp_getcfa(xp)); stopres = xp_get_stopres(xp); } *************** *** 1277,1282 **** if (bp_at_start_of_func != NULL) { execute_bp_code(bp_at_start_of_func, ! xp_getreg(xp, UPSREG_FP), ! xp_getreg(xp, UPSREG_AP)); stopres = xp_get_stopres(xp); } --- 1281,1287 ---- if (bp_at_start_of_func != NULL) { execute_bp_code(bp_at_start_of_func, ! xp_getreg(xp, UPSREG_FP), ! xp_getreg(xp, UPSREG_AP), ! xp_getcfa(xp)); stopres = xp_get_stopres(xp); } Index: obj_bpt.h =================================================================== RCS file: /cvsroot/ups/ups/ups/obj_bpt.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** obj_bpt.h 4 Nov 2002 14:56:20 -0000 1.2 --- obj_bpt.h 21 Jun 2006 16:25:27 -0000 1.3 *************** *** 30,34 **** bool remove_vars, bool append)); void recalculate_bpt_addrs PROTO((target_t *xp)); ! bool execute_bp_code PROTO((breakpoint_t *bp, taddr_t fp, taddr_t ap)); #endif --- 30,34 ---- bool remove_vars, bool append)); void recalculate_bpt_addrs PROTO((target_t *xp)); ! bool execute_bp_code PROTO((breakpoint_t *bp, taddr_t fp, taddr_t ap, taddr_t cfa)); #endif Index: xc_opcodes.h =================================================================== RCS file: /cvsroot/ups/ups/ups/xc_opcodes.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** xc_opcodes.h 18 Feb 2004 10:56:29 -0000 1.3 --- xc_opcodes.h 21 Jun 2006 16:25:28 -0000 1.4 *************** *** 194,197 **** --- 194,202 ---- x(OC_PROC_PUSH_AP_ADDR_Q, STACKW_SIZE, OS_QUAD), /* ----------------------- */ + x(OC_PROC_PUSH_CFA_ADDR_B, STACKW_SIZE, OS_BYTE), + x(OC_PROC_PUSH_CFA_ADDR_W, STACKW_SIZE, OS_WORD), + x(OC_PROC_PUSH_CFA_ADDR_L, STACKW_SIZE, OS_LONG), + x(OC_PROC_PUSH_CFA_ADDR_Q, STACKW_SIZE, OS_QUAD), + /* ----------------------- */ x(OC_PUSH_STACKADDR_B, STACKW_SIZE, OS_BYTE), x(OC_PUSH_STACKADDR_W, STACKW_SIZE, OS_WORD), Index: target.c =================================================================== RCS file: /cvsroot/ups/ups/ups/target.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** target.c 20 Dec 2005 12:43:12 -0000 1.4 --- target.c 21 Jun 2006 16:25:27 -0000 1.5 *************** *** 134,138 **** return 0; } ! int initialise_target_drivers(usage_eb, argv) --- 134,138 ---- return 0; } ! int initialise_target_drivers(usage_eb, argv) *************** *** 153,157 **** return 0; } ! void show_target_driver_info(name_only) --- 153,157 ---- return 0; } ! void show_target_driver_info(name_only) *************** *** 162,170 **** drivers = get_target_drivers(); ! for (i = 0; drivers[i] != NULL; ++i) (*drivers[i]->xo_show_target_driver_info)(name_only); } ! bool extract_bool_arg(usage_eb, argv, flag) --- 162,170 ---- drivers = get_target_drivers(); ! for (i = 0; drivers[i] != NULL; ++i) (*drivers[i]->xo_show_target_driver_info)(name_only); } ! bool extract_bool_arg(usage_eb, argv, flag) *************** *** 175,179 **** bool seen_flag; char **iptr, **optr; ! optr = argv; seen_flag = FALSE; --- 175,179 ---- bool seen_flag; char **iptr, **optr; ! optr = argv; seen_flag = FALSE; *************** *** 359,362 **** --- 359,380 ---- } + taddr_t + xp_getcfa(xp) + target_t *xp; + { + taddr_t pc = xp_getreg(xp, UPSREG_PC); + taddr_t fp = xp_getreg(xp, UPSREG_FP); + taddr_t sp = xp_getreg(xp, UPSREG_SP); + taddr_t cfa = 0; + func_t *f; + + if ((f = addr_to_func(pc)) != NULL && f->fu_symtab) + { + st_unwind(xp, f->fu_symtab, &fp, &sp, &pc, &cfa); + } + + return cfa; + } + Stack * make_stk(f, pc, fil, lnum, last) *************** *** 393,397 **** { static func_t badfunc; ! if (badfunc.fu_flags == 0) { badfunc.fu_flags = FU_NOSYM | FU_DONE_LNOS | --- 411,415 ---- { static func_t badfunc; ! if (badfunc.fu_flags == 0) { badfunc.fu_flags = FU_NOSYM | FU_DONE_LNOS | *************** *** 410,414 **** return &badfunc; } ! void destroy_stk(stk) --- 428,432 ---- return &badfunc; } ! void destroy_stk(stk) *************** *** 461,468 **** if (!td_have_window()) return; ! if (Old_cursor == 0) panic("dup call of its"); ! wn_define_cursor(WN_STDWIN, Old_cursor); update_target_menu_state(tstate, xp_is_attached(get_current_target())); --- 479,486 ---- if (!td_have_window()) return; ! if (Old_cursor == 0) panic("dup call of its"); ! wn_define_cursor(WN_STDWIN, Old_cursor); update_target_menu_state(tstate, xp_is_attached(get_current_target())); *************** *** 547,551 **** errf("\bFreeing old data...done"); wn_do_flush(); ! if (make_target(textpath, pid_str, user_gave_core, &xp, &args, restore_bpts, target_updated) == -1) --- 565,569 ---- errf("\bFreeing old data...done"); wn_do_flush(); ! if (make_target(textpath, pid_str, user_gave_core, &xp, &args, restore_bpts, target_updated) == -1) *************** *** 564,568 **** } errf_set_ofunc(oldf); ! xp_set_mainfunc(xp, f); } --- 582,586 ---- } errf_set_ofunc(oldf); ! xp_set_mainfunc(xp, f); } *************** *** 632,636 **** break; } ! if (drivers[i] == NULL) { errf("%s: File format unrecognised", textpath); --- 650,654 ---- break; } ! if (drivers[i] == NULL) { errf("%s: File format unrecognised", textpath); |
From: Tom H. <th...@us...> - 2006-01-09 10:23:07
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19653 Modified Files: ao_dwftype.c ao_symscan.c Log Message: Take the symbol table base address into account for an OP_ADDR in a location description so that we can find static variables in shared libraries correctly. Index: ao_symscan.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_symscan.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ao_symscan.c 21 Feb 2005 16:38:16 -0000 1.7 --- ao_symscan.c 9 Jan 2006 10:22:54 -0000 1.8 *************** *** 1954,1959 **** for (v = fil->fi_block->bl_vars; v != NULL; ! v = v->va_next) v->va_addr += delta; } } --- 1954,1963 ---- for (v = fil->fi_block->bl_vars; v != NULL; ! v = v->va_next) { v->va_addr += delta; + if (v->va_location && + v->va_location->v_op == OP_ADDR) + v->va_location->v_addr += delta; + } } } Index: ao_dwftype.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwftype.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ao_dwftype.c 20 Dec 2005 12:43:12 -0000 1.12 --- ao_dwftype.c 9 Jan 2006 10:22:54 -0000 1.13 *************** *** 485,489 **** else class = CL_LSTAT; ! addr = vaddr->v_addr + stf->stf_addr; } else if (vaddr->v_op == OP_U_OFFSET) { --- 485,489 ---- else class = CL_LSTAT; ! addr = vaddr->v_addr = vaddr->v_addr + stf->stf_addr; } else if (vaddr->v_op == OP_U_OFFSET) { |
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; |
From: Tom H. <th...@us...> - 2005-08-23 09:35:30
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12290 Modified Files: obj_wpt.c Log Message: Allow for longer addresses on 64 bit machines. Index: obj_wpt.c =================================================================== RCS file: /cvsroot/ups/ups/ups/obj_wpt.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** obj_wpt.c 16 Feb 2004 13:02:00 -0000 1.3 --- obj_wpt.c 23 Aug 2005 09:35:20 -0000 1.4 *************** *** 135,139 **** struct drawst *dets; { ! char buf[12]; buf[0] = 0; --- 135,139 ---- struct drawst *dets; { ! char buf[20]; buf[0] = 0; |
From: Tom H. <th...@us...> - 2005-08-15 10:23:23
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23290 Modified Files: elfstab.h Log Message: Make the nlist structure work on 64 bit platforms. Index: elfstab.h =================================================================== RCS file: /cvsroot/ups/ups/ups/elfstab.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** elfstab.h 26 Oct 2002 13:06:36 -0000 1.1.1.1 --- elfstab.h 15 Aug 2005 10:23:01 -0000 1.2 *************** *** 27,35 **** */ struct nlist { ! long n_offset; unsigned char n_type; char n_other; short n_desc; ! unsigned long n_value; }; --- 27,35 ---- */ struct nlist { ! int n_offset; unsigned char n_type; char n_other; short n_desc; ! unsigned int n_value; }; |
From: Tom H. <th...@us...> - 2005-08-03 23:12:31
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16402 Modified Files: ao_target.c Log Message: Don't restart after signal marked to be continued if the signal is being caught as we want the higher level code to handle it and let the signal handler run before stopping. Index: ao_target.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_target.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ao_target.c 18 Feb 2004 15:34:20 -0000 1.12 --- ao_target.c 3 Aug 2005 23:12:18 -0000 1.13 *************** *** 438,442 **** } while (ip->ip_stopres == SR_SIG && ! !sig_stops_target(last_sig)); #ifdef AO_ELF --- 438,443 ---- } while (ip->ip_stopres == SR_SIG && ! !sig_stops_target(last_sig) && ! xp_get_sigstate(xp, last_sig) != SGH_CAUGHT); #ifdef AO_ELF |
From: Tom H. <th...@us...> - 2005-07-29 12:57:11
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22891 Modified Files: ao_dwfsyms.c ao_dwftext.c ao_elfpriv.h ao_elfread.c ao_elfsym.c Log Message: If a file with DWARF debugging has been stripped then scan the debug information straight away instead of trying to defer it as the symbol table will not be complete. Index: ao_dwfsyms.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwfsyms.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ao_dwfsyms.c 21 Feb 2005 12:20:59 -0000 1.24 --- ao_dwfsyms.c 29 Jul 2005 12:56:59 -0000 1.25 *************** *** 287,291 **** addr = fs->fs_low_pc; ! if (addr_and_functab_to_func(st->st_functab, addr, &f) && f->fu_addr == addr) { if (strcmp(f->fu_name, name) != 0) f->fu_name = name; --- 287,291 ---- addr = fs->fs_low_pc; ! if (st->st_functab && addr_and_functab_to_func(st->st_functab, addr, &f) && f->fu_addr == addr) { if (strcmp(f->fu_name, name) != 0) f->fu_name = name; *************** *** 1280,1283 **** --- 1280,1288 ---- /* + * Give up if we have already scanned this symbol table + */ + if (ast->st_dw_scanned) return TRUE; + + /* * Enable checking for user stop requests */ *************** *** 1370,1373 **** --- 1375,1380 ---- *p_flist = flist; + ast->st_dw_scanned = TRUE; + return TRUE; } Index: ao_dwftext.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwftext.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ao_dwftext.c 21 Feb 2005 12:20:59 -0000 1.7 --- ao_dwftext.c 29 Jul 2005 12:56:59 -0000 1.8 *************** *** 131,144 **** symtab_t *st = f->fu_symtab; ao_stdata_t *ast = AO_STDATA(st); ! if (!ast->st_dw_scanned) { ! Dwarf_Debug dbg = ast->st_dw_dbg; ! func_t *flist; ! ! dwf_scan_symtab(st, NULL, NULL, &flist, NULL, dbg); - ast->st_dw_scanned = TRUE; - } - return f; } --- 131,138 ---- symtab_t *st = f->fu_symtab; ao_stdata_t *ast = AO_STDATA(st); + func_t *flist; ! dwf_scan_symtab(st, NULL, NULL, &flist, NULL, ast->st_dw_dbg); return f; } *************** *** 149,162 **** { ao_stdata_t *ast = AO_STDATA(st); ! if (!ast->st_dw_scanned) { ! Dwarf_Debug dbg = ast->st_dw_dbg; ! func_t *flist; ! ! dwf_scan_symtab(st, NULL, NULL, &flist, NULL, dbg); - ast->st_dw_scanned = TRUE; - } - return st->st_sfiles; } --- 143,150 ---- { ao_stdata_t *ast = AO_STDATA(st); + func_t *flist; ! dwf_scan_symtab(st, NULL, NULL, &flist, NULL, ast->st_dw_dbg); return st->st_sfiles; } Index: ao_elfread.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elfread.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ao_elfread.c 21 Feb 2005 16:38:16 -0000 1.6 --- ao_elfread.c 29 Jul 2005 12:56:59 -0000 1.7 *************** *** 468,471 **** --- 468,472 ---- if (elf_lookup_section(el, ".symtab", &el->symtab_sh)) { + el->stripped = FALSE; symtab_secname = ".symtab"; } *************** *** 483,486 **** --- 484,488 ---- errf("Warning: no .symtab section in %s - " "using .dynsym instead", el->path); + el->stripped = TRUE; symtab_secname = ".dynsym"; } Index: ao_elfsym.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elfsym.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ao_elfsym.c 19 Feb 2004 12:48:39 -0000 1.12 --- ao_elfsym.c 29 Jul 2005 12:56:59 -0000 1.13 *************** *** 67,70 **** --- 67,71 ---- #include "ao_elfread.h" #include "ao_elflib.h" + #include "ao_dwfsyms.h" #include "elfstab.h" #include "srcpath.h" *************** *** 1019,1022 **** --- 1020,1025 ---- * the DWARF info. */ + if (el->stripped) + dwf_scan_symtab(st, NULL, NULL, &flist, p_mainfunc_name, dw_dbg); set_function_addresses(el, st, &flist); } else { Index: ao_elfpriv.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elfpriv.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ao_elfpriv.h 21 Feb 2005 17:01:21 -0000 1.5 --- ao_elfpriv.h 29 Jul 2005 12:56:59 -0000 1.6 *************** *** 72,75 **** --- 72,76 ---- Elf_Shdr *symtab_sh; + bool stripped; Elf_Shdr *indexsh; |
From: Tom H. <th...@us...> - 2005-07-29 08:59:24
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14155 Modified Files: ao_ptrace.c Log Message: Use long not int where we want a host word. Index: ao_ptrace.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_ptrace.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ao_ptrace.c 18 Feb 2004 15:06:39 -0000 1.8 --- ao_ptrace.c 29 Jul 2005 08:59:16 -0000 1.9 *************** *** 781,785 **** const char *iptr; taddr_t lim; ! int word, trailing_nbytes; int pid; --- 781,786 ---- const char *iptr; taddr_t lim; ! long word; ! int trailing_nbytes; int pid; |
From: Tom H. <th...@us...> - 2005-04-27 08:00:07
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30610 Modified Files: ao_dwfutil.c Log Message: Cope with gcc4 which seems to name the frame pointer register explicitly when describing variable locations instead of just using DW_OP_fbreg. Index: ao_dwfutil.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwfutil.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ao_dwfutil.c 25 Feb 2005 10:12:42 -0000 1.13 --- ao_dwfutil.c 27 Apr 2005 07:59:51 -0000 1.14 *************** *** 43,47 **** #include "ao_symscan.h" #include "ao_dwfutil.h" ! /* --- 43,47 ---- #include "ao_symscan.h" #include "ao_dwfutil.h" ! #include "state.h" /* *************** *** 496,503 **** --- 496,516 ---- Dwarf_Small op; vaddr_t *head = NULL, *vaddr; + unsigned char fb_regop; if ((loclist = dwf_get_locdesc(dbg, die, id, &count)) == NULL) return (vaddr_t *)NULL; + switch (xp_get_addrsize(get_current_target())) + { + case 32: + fb_regop = DW_OP_breg5; + break; + case 64: + fb_regop = DW_OP_breg6; + break; + default: + panic("Unsupported address size"); + } + for (i = 0; i < count; i++) { *************** *** 533,537 **** vaddr->v_op = OP_U_OFFSET; vaddr->v_u_offset = loclist[i].ld_s->lr_number; ! } else if (op == DW_OP_fbreg) { /* * Relative to frame base. --- 546,550 ---- 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. |
From: Tom H. <th...@us...> - 2005-03-16 10:04:06
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30234 Modified Files: ci_compile_expr.c Log Message: Change explicit 4 to sizeof(stackword_t) in code that decides whether to use OC_POP or one of the OC_POPMANY variants. Index: ci_compile_expr.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ci_compile_expr.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ci_compile_expr.c 16 Mar 2005 10:01:55 -0000 1.4 --- ci_compile_expr.c 16 Mar 2005 10:03:55 -0000 1.5 *************** *** 978,982 **** if (bytes_to_pop != 0) { ! if (bytes_to_pop == 4) ci_code_opcode(tx, OC_POP); else { --- 978,982 ---- if (bytes_to_pop != 0) { ! if (bytes_to_pop == sizeof(stackword_t)) ci_code_opcode(tx, OC_POP); else { |
From: Tom H. <th...@us...> - 2005-03-16 10:02:08
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29828 Modified Files: ci_compile_expr.c Log Message: Backout bogus change of CALL_B to CALL_L as I had misunderstood what was going on. There is no opcode that supports more than 255 argument words. Index: ci_compile_expr.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ci_compile_expr.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ci_compile_expr.c 15 Mar 2005 15:43:15 -0000 1.3 --- ci_compile_expr.c 16 Mar 2005 10:01:55 -0000 1.4 *************** *** 963,975 **** ci_panic("args botch in cfc"); ! if (is_direct_call) { ! ci_code_generic_opcode(tx, OC_CALL_L, (stackword_t)func_index); ! ci_code_long(tx, nargs + excess_slots); ! } else { ci_compile_expression(tx, fce->fce_func, EC_VALUE); ci_code_opcode(tx, OC_CALL_INDIRECT); - ci_code_byte(tx, nargs + excess_slots); } #if WANT_TYPE_PUSHED --- 963,973 ---- ci_panic("args botch in cfc"); ! if (is_direct_call) ! ci_code_generic_opcode(tx, OC_CALL_B, (stackword_t)func_index); else { ci_compile_expression(tx, fce->fce_func, EC_VALUE); ci_code_opcode(tx, OC_CALL_INDIRECT); } + ci_code_byte(tx, nargs + excess_slots); #if WANT_TYPE_PUSHED |
From: Tom H. <th...@us...> - 2005-03-15 15:43:25
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31491 Modified Files: ci_compile_expr.c Log Message: Round to the size of a stack word when working out how much stack space is needed instead of assuming the stack uses four byte words. Also use CALL_L instead of CALL_B for direct calls so we can cope with returning more than 255 bytes. Index: ci_compile_expr.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ci_compile_expr.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ci_compile_expr.c 25 Feb 2005 10:31:02 -0000 1.2 --- ci_compile_expr.c 15 Mar 2005 15:43:15 -0000 1.3 *************** *** 887,891 **** /* DUBIOUS: we round the type size up to a multiple ! * of four (the size of a stack slot). * This means we copy some extra bytes. * If we had memory protection at byte rather --- 887,891 ---- /* DUBIOUS: we round the type size up to a multiple ! * of four or eight (the size of a stack slot). * This means we copy some extra bytes. * If we had memory protection at byte rather *************** *** 893,903 **** */ nbytes = ci_typesize(expr->ex_lexinfo, type); ! if ((nbytes % 4) != 0) ! nbytes += 4 - nbytes % 4; if (expr->ex_exprtype == ET_FUNC_CALL) { ci_code_opcode(tx, OC_RESERVE_BYTES); ci_code_long(tx, nbytes); ! tx->tx_sp += nbytes + 4; ci_compile_expression(tx, expr, EC_ADDRESS); ci_code_opcode(tx, OC_POP); /* lose address */ --- 893,903 ---- */ nbytes = ci_typesize(expr->ex_lexinfo, type); ! if ((nbytes % sizeof(stackword_t)) != 0) ! nbytes += sizeof(stackword_t) - nbytes % sizeof(stackword_t); if (expr->ex_exprtype == ET_FUNC_CALL) { ci_code_opcode(tx, OC_RESERVE_BYTES); ci_code_long(tx, nbytes); ! tx->tx_sp += nbytes + sizeof(stackword_t); ci_compile_expression(tx, expr, EC_ADDRESS); ci_code_opcode(tx, OC_POP); /* lose address */ *************** *** 914,920 **** ci_code_long(tx, nbytes); ! tx->tx_sp += nbytes - 4; } ! excess_slots += nbytes / 4 - 1; } else { --- 914,920 ---- ci_code_long(tx, nbytes); ! tx->tx_sp += nbytes - sizeof(stackword_t); } ! excess_slots += nbytes / sizeof(stackword_t) - 1; } else { *************** *** 963,973 **** ci_panic("args botch in cfc"); ! if (is_direct_call) ! ci_code_generic_opcode(tx, OC_CALL_B, (stackword_t)func_index); else { ci_compile_expression(tx, fce->fce_func, EC_VALUE); ci_code_opcode(tx, OC_CALL_INDIRECT); } - ci_code_byte(tx, nargs + excess_slots); #if WANT_TYPE_PUSHED --- 963,975 ---- ci_panic("args botch in cfc"); ! if (is_direct_call) { ! ci_code_generic_opcode(tx, OC_CALL_L, (stackword_t)func_index); ! ci_code_long(tx, nargs + excess_slots); ! } else { ci_compile_expression(tx, fce->fce_func, EC_VALUE); ci_code_opcode(tx, OC_CALL_INDIRECT); + ci_code_byte(tx, nargs + excess_slots); } #if WANT_TYPE_PUSHED |
From: Tom H. <th...@us...> - 2005-03-15 15:24:46
|
Update of /cvsroot/ups/ups/lib/libdwarf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27202 Modified Files: dwarf_macro.c Log Message: Initialise depth correctly so we get all the macros. Index: dwarf_macro.c =================================================================== RCS file: /cvsroot/ups/ups/lib/libdwarf/dwarf_macro.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dwarf_macro.c 15 Mar 2005 15:20:44 -0000 1.5 --- dwarf_macro.c 15 Mar 2005 15:24:28 -0000 1.6 *************** *** 165,169 **** Dwarf_Unsigned endloc; unsigned char uc; ! unsigned long depth = 0; int res; --- 165,169 ---- Dwarf_Unsigned endloc; unsigned char uc; ! unsigned long depth = 1; int res; |
From: Tom H. <th...@us...> - 2005-03-15 15:21:09
|
Update of /cvsroot/ups/ups/lib/libdwarf/cmplrs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26293/cmplrs Modified Files: dwarf_addr_finder.h Log Message: Update to 2005-02-16 release of libdwarf. |
From: Tom H. <th...@us...> - 2005-02-25 10:31:11
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27763/ups Modified Files: ci_compile_expr.c Log Message: Cope with 64 bit constants on 64 bit machines when interpreting code. Index: ci_compile_expr.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ci_compile_expr.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ci_compile_expr.c 26 Oct 2002 13:06:23 -0000 1.1.1.1 --- ci_compile_expr.c 25 Feb 2005 10:31:02 -0000 1.2 *************** *** 1801,1806 **** --- 1801,1810 ---- case TY_LONGLONG: case TY_ULONGLONG: + #if HAVE_LONG_LONG ci_code_constpush(tx, ((long *)&val.cv_long_long)[1]); ci_code_constpush(tx, ((long *)&val.cv_long_long)[0]); + #else + ci_code_constpush(tx, val.cv_long_long); + #endif break; #endif |
From: Tom H. <th...@us...> - 2005-02-25 10:12:55
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22395 Modified Files: ao_dwfutil.c Log Message: Make DWARF unwind processing work when a 32 bit executable is being debugged on a 64 bit machine. Index: ao_dwfutil.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwfutil.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ao_dwfutil.c 18 Feb 2005 12:14:11 -0000 1.12 --- ao_dwfutil.c 25 Feb 2005 10:12:42 -0000 1.13 *************** *** 35,38 **** --- 35,39 ---- #include "ups.h" #include "symtab.h" + #include "target.h" #include "ci.h" #include "st.h" *************** *** 547,562 **** } - #if defined(ARCH_386_64) - #define CFA_COL DW_FRAME_CFA_COL - #define FP_COL 6 - #define SP_COL 7 - #define RA_COL 16 - #elif defined(ARCH_386) - #define CFA_COL DW_FRAME_CFA_COL - #define FP_COL 5 - #define SP_COL 4 - #define RA_COL 8 - #endif - #if defined(ARCH_386) --- 548,551 ---- *************** *** 573,589 **** Dwarf_Signed register_num; Dwarf_Signed offset; if ((rv = dwarf_get_fde_info_for_reg(fde, regnum, pc, &offset_relevant, ®ister_num, &offset, NULL, &err)) == DW_DLV_OK) { ! if (register_num == CFA_COL) *regval = cfa; ! else if (register_num == FP_COL) *regval = fp; ! else if (register_num == SP_COL) *regval = sp; ! else if (register_num == DW_FRAME_SAME_VAL && regnum == FP_COL) *regval = fp; ! else if (register_num == DW_FRAME_SAME_VAL && regnum == SP_COL) *regval = cfa; else --- 562,594 ---- Dwarf_Signed register_num; Dwarf_Signed offset; + int fp_col; + int sp_col; + + switch (xp_get_addrsize(xp)) + { + case 32: + fp_col = 5; + sp_col = 4; + break; + case 64: + fp_col = 6; + sp_col = 7; + break; + default: + panic("Unsupported address size"); + } if ((rv = dwarf_get_fde_info_for_reg(fde, regnum, pc, &offset_relevant, ®ister_num, &offset, NULL, &err)) == DW_DLV_OK) { ! if (register_num == DW_FRAME_CFA_COL) *regval = cfa; ! else if (register_num == fp_col) *regval = fp; ! else if (register_num == sp_col) *regval = sp; ! else if (register_num == DW_FRAME_SAME_VAL && regnum == fp_col) *regval = fp; ! else if (register_num == DW_FRAME_SAME_VAL && regnum == sp_col) *regval = cfa; else *************** *** 593,597 **** *regval += offset; ! if (rv == DW_DLV_OK && register_num == CFA_COL) dread_addrval(xp, *regval, regval); } --- 598,602 ---- *regval += offset; ! if (rv == DW_DLV_OK && register_num == DW_FRAME_CFA_COL) dread_addrval(xp, *regval, regval); } *************** *** 612,615 **** --- 617,639 ---- Dwarf_Fde *fde_data; Dwarf_Signed fde_count; + int fp_col; + int sp_col; + int ra_col; + + switch (xp_get_addrsize(xp)) + { + case 32: + fp_col = 5; + sp_col = 4; + ra_col = 8; + break; + case 64: + fp_col = 6; + sp_col = 7; + ra_col = 16; + break; + default: + panic("Unsupported address size"); + } if ((rv = dwarf_get_fde_list(dbg, &cie_data, &cie_count, &fde_data, &fde_count, &err)) == DW_DLV_OK) { *************** *** 624,633 **** taddr_t new_pc; ! if (dwf_unwind_reg(fde, xp, cfa, *fp, *sp, *pc, 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; --- 648,657 ---- 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; |
From: Tom H. <th...@us...> - 2005-02-21 17:02:05
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31849 Modified Files: ao_elflib.c ao_elfpriv.h ao_elfread.h ao_elfreadbase.c Log Message: Fix PLT decoding for x86_64 systems - the value pushed on the stack is the index of the relocation rather than the offset as it is on 32 bit systems so we need to multiply it by the size of the relocation to get the real offset. Index: ao_elfreadbase.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elfreadbase.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ao_elfreadbase.c 30 Nov 2004 09:08:37 -0000 1.2 --- ao_elfreadbase.c 21 Feb 2005 17:01:22 -0000 1.3 *************** *** 334,337 **** --- 334,348 ---- } + static size_t + ELF(relocation_size)(int rel_type) + { + if (rel_type == DT_REL) + return sizeof(Elf_Rel); + else if (rel_type == DT_RELA) + return sizeof(Elf_Rela); + else + return 0; + } + static bool ELF(resolve_relocation)(target_t *xp, taddr_t st_base_address, *************** *** 472,475 **** --- 483,487 ---- ELF(dynamic_ptr), ELF(dynamic_ptr_address), + ELF(relocation_size), ELF(resolve_relocation), ELF(read_r_debug), Index: ao_elfread.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elfread.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ao_elfread.h 16 Feb 2004 13:02:00 -0000 1.2 --- ao_elfread.h 21 Feb 2005 17:01:22 -0000 1.3 *************** *** 132,135 **** --- 132,137 ---- (el)->ops->dynamic_ptr_address(dynsh, dyntab, dyn) + #define elf_relocation_size(elops, rel) \ + (elops)->relocation_size(rel) #define elf_resolve_relocation(elops, xp, ast, symtab, strtab, rel, off, name) \ (elops)->resolve_relocation(xp, ast, symtab, strtab, rel, off, name) Index: ao_elfpriv.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elfpriv.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ao_elfpriv.h 30 Nov 2004 09:08:37 -0000 1.4 --- ao_elfpriv.h 21 Feb 2005 17:01:21 -0000 1.5 *************** *** 134,137 **** --- 134,138 ---- Elf_Dyn *dyn)); + size_t (*relocation_size)PROTO((int rel_type)); bool (*resolve_relocation)PROTO((target_t *xp, taddr_t st_base_address, taddr_t symtab_vaddr, Index: ao_elflib.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elflib.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ao_elflib.c 21 Feb 2005 16:38:15 -0000 1.17 --- ao_elflib.c 21 Feb 2005 17:01:00 -0000 1.18 *************** *** 1821,1830 **** panic("Unexpected opcode in procedure linkage table"); ! off = *((int *)(push + 1)) + solib->plt_rel_vaddr; if (!elf_resolve_relocation(solib->elops, xp, ast->st_base_address, solib->dyn_symtab_vaddr, solib->dyn_strtab_vaddr, ! solib->plt_rel_type, off, func_name)) { panic("Unexpected relocation type in procedure linkage table"); } --- 1821,1834 ---- panic("Unexpected opcode in procedure linkage table"); ! off = *((int *)(push + 1)); ! ! if (xp_get_addrsize(xp) == 64) ! off = off * elf_relocation_size(solib->elops, solib->plt_rel_type); if (!elf_resolve_relocation(solib->elops, xp, ast->st_base_address, solib->dyn_symtab_vaddr, solib->dyn_strtab_vaddr, ! solib->plt_rel_type, ! solib->plt_rel_vaddr + off, func_name)) { panic("Unexpected relocation type in procedure linkage table"); } |
From: Tom H. <th...@us...> - 2005-02-21 16:38:48
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24507 Modified Files: ao_elflib.c ao_elfread.c ao_execinfo.h ao_symscan.c ao_text.c Log Message: More fixes to try and handle prelinked libraries correctly. It turns out that the real problem is that when a prelinked library has separate debug information, that is not prelinked to the same address which is why the debug symbols have a different base. This patch works out the difference between the base address of the real library and of the debug image for it and applies that delta to the normal symbol table base address to get the DWARF symbol table base address. Index: ao_symscan.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_symscan.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ao_symscan.c 26 Mar 2004 15:25:08 -0000 1.6 --- ao_symscan.c 21 Feb 2005 16:38:16 -0000 1.7 *************** *** 2014,2017 **** --- 2014,2020 ---- adjust_funcs_addr_base(st->st_funclist, delta); ast->st_base_address = new_addr; + #if WANT_DWARF + ast->st_dw_base_address = ast->st_dw_base_address + delta; + #endif } } Index: ao_execinfo.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_execinfo.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ao_execinfo.h 26 Oct 2002 13:06:31 -0000 1.1.1.1 --- ao_execinfo.h 21 Feb 2005 16:38:16 -0000 1.2 *************** *** 30,34 **** size_t text_size; /* #bytes of text */ off_t text_addr_delta; /* What to add to fu_addr etc to get mem addr */ ! off_t addr_to_fpos_offset; /* Delta from mem addr to file offset */ --- 30,35 ---- size_t text_size; /* #bytes of text */ off_t text_addr_delta; /* What to add to fu_addr etc to get mem addr */ ! off_t debug_addr_delta; /* Delta from debug addresses to real addresses */ ! off_t addr_to_fpos_offset; /* Delta from mem addr to file offset */ Index: ao_elfread.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elfread.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ao_elfread.c 19 Feb 2004 12:48:38 -0000 1.5 --- ao_elfread.c 21 Feb 2005 16:38:16 -0000 1.6 *************** *** 394,398 **** --- 394,402 ---- const Elfops *elops; Elf_Ehdr *hdr; + Elf_Phdr *phtab; Elfinfo *el; + taddr_t text_mem_addr; + size_t text_size; + off_t addr_to_fpos_offset; if ((fd = open(debugpath, O_RDONLY)) < 0) *************** *** 410,413 **** --- 414,432 ---- } + phtab = e_malloc(elf_header_phsize(elops, hdr)); + if (!read_chunk(debugpath, Elfwhat, fd, "debug program header table", + elf_header_phoff(elops, hdr), + phtab, elf_header_phsize(elops, hdr)) || + !get_load_addrs(debugpath, elops, phtab, elf_header_phnum(elops, hdr), + &text_mem_addr, &text_size, + &addr_to_fpos_offset, + &el->min_file_vaddr)) { + free(phtab); + free(hdr); + free_elfinfo(el); + return FALSE; + } + free(phtab); + free(hdr); *************** *** 562,565 **** --- 581,585 ---- ex->text_addr_delta = 0; + ex->debug_addr_delta = el->min_file_vaddr - el->debugel->min_file_vaddr; ex->dynamic = FALSE; ex->entry_addr = elf_header_entry(elops, hdr); Index: ao_elflib.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elflib.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ao_elflib.c 21 Feb 2005 12:20:59 -0000 1.16 --- ao_elflib.c 21 Feb 2005 16:38:15 -0000 1.17 *************** *** 396,407 **** change_base_address(so->symtab, base_address); - - #if WANT_DWARF - if (base_address != 0) { - ao_stdata_t *ast = AO_STDATA(so->symtab); - - ast->st_dw_base_address = base_address; - } - #endif } --- 396,399 ---- Index: ao_text.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_text.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ao_text.c 21 Feb 2005 12:21:05 -0000 1.10 --- ao_text.c 21 Feb 2005 16:38:18 -0000 1.11 *************** *** 256,260 **** ast->st_dw_dbg = 0; ast->st_dw_scanned = FALSE; ! ast->st_dw_base_address = ei->text_mem_addr; if (st_is == ST_DWARF) { ast->st_dw_dbg = dw_dbg; --- 256,260 ---- ast->st_dw_dbg = 0; ast->st_dw_scanned = FALSE; ! ast->st_dw_base_address = base_address + ei->debug_addr_delta; if (st_is == ST_DWARF) { ast->st_dw_dbg = dw_dbg; |
From: Tom H. <th...@us...> - 2005-02-21 12:21:20
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21543 Modified Files: ao_dwfsyms.c ao_dwftext.c ao_elflib.c ao_syms.h ao_text.c Log Message: Maintain a separate symbol base address for DWARF symbols as prelinked libraries on linux systems have the normal base address as zero because prelinking modifies the ELF symbols to have absolute addresses. The entries in the DWARF symbol table are still relative to the load address though so we need a different base address for them. Index: ao_dwftext.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwftext.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ao_dwftext.c 21 Feb 2004 17:00:00 -0000 1.6 --- ao_dwftext.c 21 Feb 2005 12:20:59 -0000 1.7 *************** *** 399,403 **** { ao_stdata_t *ast = AO_STDATA(st); ! taddr_t adjusted_pc = *pc - ast->st_base_address; if (dwf_unwind(ast->st_dw_dbg, xp, fp, sp, &adjusted_pc)) { --- 399,403 ---- { 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)) { Index: ao_syms.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_syms.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ao_syms.h 24 Nov 2003 13:21:50 -0000 1.4 --- ao_syms.h 21 Feb 2005 12:21:05 -0000 1.5 *************** *** 147,150 **** --- 147,151 ---- Dwarf_Debug st_dw_dbg; /* Handle for libdwarf calls */ bool st_dw_scanned; /* Dwarf symbols scanned? */ + taddr_t st_dw_base_address; /* Addr shlib mapped rel to Dwarf sym addrs */ #endif Index: ao_elflib.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elflib.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ao_elflib.c 18 Feb 2005 10:18:03 -0000 1.15 --- ao_elflib.c 21 Feb 2005 12:20:59 -0000 1.16 *************** *** 396,399 **** --- 396,407 ---- change_base_address(so->symtab, base_address); + + #if WANT_DWARF + if (base_address != 0) { + ao_stdata_t *ast = AO_STDATA(so->symtab); + + ast->st_dw_base_address = base_address; + } + #endif } Index: ao_text.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_text.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ao_text.c 21 Feb 2004 16:34:40 -0000 1.9 --- ao_text.c 21 Feb 2005 12:21:05 -0000 1.10 *************** *** 256,259 **** --- 256,260 ---- ast->st_dw_dbg = 0; ast->st_dw_scanned = FALSE; + ast->st_dw_base_address = ei->text_mem_addr; if (st_is == ST_DWARF) { ast->st_dw_dbg = dw_dbg; Index: ao_dwfsyms.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwfsyms.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ao_dwfsyms.c 23 Nov 2004 16:26:57 -0000 1.23 --- ao_dwfsyms.c 21 Feb 2005 12:20:59 -0000 1.24 *************** *** 1324,1328 **** * Start a new 'stf'. */ ! stf = make_stf(ap, cu_name, st, 0, lang, ast->st_base_address); stf->stf_symlim = -1; stf->stf_fnum = -1; --- 1324,1328 ---- * Start a new 'stf'. */ ! stf = make_stf(ap, cu_name, st, 0, lang, ast->st_dw_base_address); stf->stf_symlim = -1; stf->stf_fnum = -1; |