Raymond Toy pushed to branch issue-97-define-ud2-inst at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/lisp/x86-arch.c
    ... ... @@ -501,13 +501,20 @@ sigtrap_handler(HANDLER_ARGS)
    501 501
                     (stderr, "* Maybe reinstall breakpoint for pc %p with single_stepping %p\n",
    
    502 502
                      (void*) SC_PC(os_context), single_stepping));
    
    503 503
             
    
    504
    -	if ((unsigned long) SC_PC(os_context) <= (unsigned long) single_stepping)
    
    505
    -	    fprintf(stderr, "* Breakpoint not re-install\n");
    
    506
    -	else {
    
    507
    -	    char *ptr = (char *) single_stepping;
    
    504
    +        /*
    
    505
    +         * Lose if single-stepping didn't move us past where the
    
    506
    +         * breakpoint instruction was inserted.
    
    507
    +         */
    
    508
    +        if ((unsigned long) SC_PC(os_context) <= (unsigned long) single_stepping) {
    
    509
    +            lose("Single-stepping did not advance past the breakpoint at %p\n",
    
    510
    +                 single_stepping);
    
    511
    +        }
    
    508 512
     
    
    509
    -	    ptr[0] = BREAKPOINT_INST;	/* x86 INT3 */
    
    510
    -	}
    
    513
    +        /*
    
    514
    +         * Put back the breakpoint since we skipped over it.
    
    515
    +         */
    
    516
    +        char *ptr = (char *) single_stepping;
    
    517
    +        ptr[0] = BREAKPOINT_INST;	/* x86 INT3 */
    
    511 518
     
    
    512 519
     	single_stepping = NULL;
    
    513 520
     	return;