[Ups-cvs] ups/ups ao_ptrace.c, 1.9, 1.10 cg.c, 1.2, 1.3 ci.h, 1.2, 1.3 ci_compile_expr.c, 1.5, 1.6
Brought to you by:
ianedwards
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); |