Raymond Toy pushed to branch issue-97-define-ud2-inst at cmucl / cmucl
Commits: 7a5d8ab5 by Raymond Toy at 2021-03-20T09:12:14-07:00 Remove debugging prints and unused macro
- - - - - b972a606 by Raymond Toy at 2021-03-20T09:13:12-07:00 Replace INT3 with UD2
- - - - - ba580ebe by Raymond Toy at 2021-03-20T09:22:24-07:00 Disable debugging prints
Turn off the debugging prints and #if out the added prints.
At a later time we can remove the added prints, once single-stepping is working.
- - - - - d9cbe149 by Raymond Toy at 2021-03-20T09:24:56-07:00 Comment out debugging print
- - - - -
4 changed files:
- src/code/x86-vm.lisp - src/compiler/x86/insts.lisp - src/lisp/x86-arch.c - src/lisp/x86-assem.S
Changes:
===================================== src/code/x86-vm.lisp ===================================== @@ -247,13 +247,13 @@ (vector (make-array length :element-type '(unsigned-byte 8)))) (declare (type (unsigned-byte 8) length) (type (simple-array (unsigned-byte 8) (*)) vector)) + #+nil (format t "internal-error-args scp ~A: pc ~X len ~D~%" scp pc length) ;; Grab the bytes after length byte, which (copy-from-system-area pc (* vm:byte-bits 4) vector (* vm:word-bits vm:vector-data-offset) (* length vm:byte-bits)) - (format t " vector ~A~%" vector) (let* ((index 0) (error-number (c::read-var-integer vector index))) (collect ((sc-offsets))
===================================== src/compiler/x86/insts.lisp ===================================== @@ -2099,20 +2099,9 @@ (sc-offsets) (lengths))))))))
-#+nil -(defmacro break-cases (breaknum &body cases) - (let ((bn-temp (gensym))) - (collect ((clauses)) - (dolist (case cases) - (clauses `((= ,bn-temp ,(car case)) ,@(cdr case)))) - `(let ((,bn-temp ,breaknum)) - (cond ,@(clauses)))))) - (defun break-control (chunk inst stream dstate) - #+nil(declare (ignore inst)) + (declare (ignore inst)) (flet ((nt (x) (if stream (disassem:note x dstate)))) - (format t "break-control: inst = ~A code = ~A~%" inst (break-code chunk dstate)) - (describe inst) (case (break-code chunk dstate) (#.vm:error-trap (nt "Error trap")
===================================== src/lisp/x86-arch.c ===================================== @@ -142,7 +142,7 @@ arch_skip_instruction(os_context_t * context) { int vlen, code;
- DPRINTF(1, (stderr, "[arch_skip_inst at %lx>]\n", SC_PC(context))); + DPRINTF(0, (stderr, "[arch_skip_inst at %lx>]\n", SC_PC(context)));
/* Get and skip the lisp error code. */ char* pc = (char *) SC_PC(context); @@ -180,7 +180,7 @@ arch_skip_instruction(os_context_t * context) break; }
- DPRINTF(1, (stderr, "[arch_skip_inst resuming at %lx>]\n", SC_PC(context))); + DPRINTF(0, (stderr, "[arch_skip_inst resuming at %lx>]\n", SC_PC(context))); }
unsigned char * @@ -300,7 +300,7 @@ sigill_handler(HANDLER_ARGS) { unsigned int trap; os_context_t* os_context = (os_context_t *) context; -#if 1 +#if 0 #if 0 fprintf(stderr, "x86sigtrap: %8x %x\n", SC_PC(os_os_context), *(unsigned char *) (SC_PC(os_context) - 1)); @@ -374,14 +374,18 @@ sigill_handler(HANDLER_ARGS) * arguments to follow. */
+#if 0 fprintf(stderr, "pc %x\n", *(unsigned short *)SC_PC(context)); +#endif if (*(unsigned short *) SC_PC(context) == 0x0b0f) { trap = *(((char *)SC_PC(context)) + 2); } else { abort(); }
+#if 0 fprintf(stderr, "code = %x\n", trap); +#endif
switch (trap) { case trap_PendingInterrupt:
===================================== src/lisp/x86-assem.S ===================================== @@ -302,7 +302,7 @@ ENDFUNC(do_pending_interrupt) #ifdef trap_DynamicSpaceOverflowError FUNCDEF(do_dynamic_space_overflow_error) - INT3 + ud2 .byte trap_DynamicSpaceOverflowError ret ENDFUNC(do_dynamic_space_overflow_error) @@ -310,7 +310,7 @@ ENDFUNC(do_dynamic_space_overflow_error) #ifdef trap_DynamicSpaceOverflowWarning FUNCDEF(do_dynamic_space_overflow_warning) - INT3 + ud2 .byte trap_DynamicSpaceOverflowWarning ret ENDFUNC(do_dynamic_space_overflow_warning) @@ -493,7 +493,7 @@ FUNCDEF(undefined_foreign_symbol_trap) movl 8(%ebp),%eax
/* Now trap to Lisp */ - INT3 + ud2 .byte trap_Error /* Number of argument bytes */ .byte 2
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/73e864e8ddcef408af202f9...