Changeset 7779
- Timestamp:
- Nov 29, 2007, 1:27:23 PM (13 years ago)
- Location:
- trunk/ccl/lisp-kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/lisp-kernel/lisp-debug.c
r7282 r7779 503 503 } 504 504 505 debug_command_return 506 debug_thread_info(ExceptionInformation *xp, siginfo_t *info, int arg) 507 { 508 TCR * tcr = get_tcr(false); 509 510 if (tcr) { 511 area *vs_area = tcr->vs_area, *cs_area = tcr->cs_area; 512 513 fprintf(stderr, "Current Thread Context Record (tcr) = 0x%lx\n", tcr); 514 fprintf(stderr, "Control (C) stack area: low = 0x%lx, high = 0x%lx\n", 515 cs_area->low, cs_area->high); 516 fprintf(stderr, "Value (lisp) stack area: low = 0x%lx, high = 0x%lx\n", 517 vs_area->low, vs_area->high); 518 if (xp) { 519 fprintf(stderr, "Exception stack pointer = 0x%lx\n", 520 #ifdef PPC 521 xpGPR(xp,1) 522 #endif 523 #ifdef X86 524 xpGPR(xp,Isp) 525 #endif 526 ); 527 } 528 } 529 return debug_continue; 530 } 505 531 506 532 … … 719 745 NULL, 720 746 'B'}, 747 {debug_thread_info, 748 "Show info about current thread", 749 0, 750 NULL, 751 'T'}, 721 752 {debug_win, 722 753 "Exit from this debugger, asserting that any exception was handled", … … 817 848 siginfo_t *info, 818 849 int why, 850 Boolean in_foreign_code, 819 851 char *message, 820 852 ...) … … 822 854 va_list args; 823 855 debug_command_return state = debug_continue; 824 int in_foreign_code = (why & debug_foreign_exception);825 856 826 857 if (threads_initialized) { … … 834 865 if (in_foreign_code) { 835 866 fprintf(stderr, "Exception occurred while executing foreign code\n"); 836 why = (why & ~debug_foreign_exception);837 867 } 838 868 … … 876 906 vsnprintf(s, sizeof(s),format, args); 877 907 va_end(args); 878 lisp_Debugger(xp, NULL, debug_entry_bug, s);908 lisp_Debugger(xp, NULL, debug_entry_bug, false, s); 879 909 880 910 } … … 889 919 vsnprintf(s, sizeof(s),format, args); 890 920 va_end(args); 891 lisp_Debugger(xp, NULL, debug_entry_bug | debug_foreign_exception, s);921 lisp_Debugger(xp, NULL, debug_entry_bug, true, s); 892 922 893 923 } -
trunk/ccl/lisp-kernel/lisp-exceptions.h
r7282 r7779 42 42 43 43 OSStatus 44 lisp_Debugger(ExceptionInformation *, siginfo_t *, int, char *, ...);44 lisp_Debugger(ExceptionInformation *, siginfo_t *, int, Boolean, char *, ...); 45 45 46 46 OSStatus -
trunk/ccl/lisp-kernel/ppc-exceptions.c
r7137 r7779 1549 1549 message = "Lisp Breakpoint"; 1550 1550 } 1551 lisp_Debugger(xp, info, debug_entry_dbg, message);1551 lisp_Debugger(xp, info, debug_entry_dbg, false, message); 1552 1552 return noErr; 1553 1553 } 1554 1554 if (the_trap == QUIET_LISP_BREAK_INSTRUCTION) { 1555 1555 adjust_exception_pc(xp,4); 1556 lisp_Debugger(xp, info, debug_entry_dbg, "Lisp Breakpoint");1556 lisp_Debugger(xp, info, debug_entry_dbg, false, "Lisp Breakpoint"); 1557 1557 return noErr; 1558 1558 } … … 1762 1762 wait_for_exception_lock_in_handler(tcr, context, &xframe_link); 1763 1763 if ((noErr != PMCL_exception_handler(signum, context, tcr, info, old_valence))) { 1764 Boolean foreign = (old_valence != TCR_STATE_LISP); 1764 1765 char msg[512]; 1765 1766 snprintf(msg, sizeof(msg), "Unhandled exception %d at 0x%lx, context->regs at #x%lx", signum, xpPC(context), (natural)xpGPRvector(context)); 1766 if (lisp_Debugger(context, info, signum, msg)) {1767 if (lisp_Debugger(context, info, signum, foreign, msg)) { 1767 1768 SET_TCR_FLAG(tcr,TCR_FLAG_BIT_PROPAGATE_EXCEPTION); 1768 1769 } -
trunk/ccl/lisp-kernel/x86-exceptions.c
r7457 r7779 786 786 case UUO_DEBUG_TRAP: 787 787 xpPC(context) = (natural) (program_counter+1); 788 lisp_Debugger(context, info, debug_entry_dbg, "Lisp Breakpoint");788 lisp_Debugger(context, info, debug_entry_dbg, false, "Lisp Breakpoint"); 789 789 return true; 790 790 … … 795 795 796 796 get_lisp_string(xpGPR(context,Iarg_z),msg, sizeof(msg)-1); 797 lisp_Debugger(context, info, debug_entry_dbg, msg);797 lisp_Debugger(context, info, debug_entry_dbg, false, msg); 798 798 } 799 799 return true; … … 963 963 if (! handle_exception(signum, info, context, tcr, old_valence)) { 964 964 char msg[512]; 965 int foreign = (old_valence == TCR_STATE_LISP) ? 0 : debug_foreign_exception;965 Boolean foreign = (old_valence != TCR_STATE_LISP); 966 966 967 967 snprintf(msg, sizeof(msg), "Unhandled exception %d at 0x%lx, context->regs at #x%lx", signum, xpPC(context), (natural)xpGPRvector(context)); 968 968 969 if (lisp_Debugger(context, info, signum |foreign, msg)) {969 if (lisp_Debugger(context, info, signum, foreign, msg)) { 970 970 SET_TCR_FLAG(tcr,TCR_FLAG_BIT_PROPAGATE_EXCEPTION); 971 971 }
Note: See TracChangeset
for help on using the changeset viewer.