Subversion Repositories HelenOS

Rev

Rev 2787 | Rev 3424 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2787 Rev 2921
Line 326... Line 326...
326
static void debug_exception(int n __attribute__((unused)), istate_t *istate)
326
static void debug_exception(int n __attribute__((unused)), istate_t *istate)
327
{
327
{
328
    unative_t dr6;
328
    unative_t dr6;
329
    int i;
329
    int i;
330
   
330
   
-
 
331
    dr6 = read_dr6();
-
 
332
 
-
 
333
    if (dr6 & DR6_BS) {
-
 
334
        if (THREAD && istate_from_uspace(istate)) {
-
 
335
            /*
-
 
336
             * The userspace thread has TF set and executed
-
 
337
             * an instruction
-
 
338
             */
-
 
339
            udebug_trap_event(istate->eip);
-
 
340
            return;
-
 
341
        }
-
 
342
    }
-
 
343
 
331
    /* Set RF to restart the instruction  */
344
    /* Set RF to restart the instruction  */
332
#ifdef amd64       
345
#ifdef amd64       
333
    istate->rflags |= RFLAGS_RF;
346
    istate->rflags |= RFLAGS_RF;
334
#else
347
#else
335
    istate->eflags |= EFLAGS_RF;
348
    istate->eflags |= EFLAGS_RF;
336
#endif
349
#endif
337
 
350
 
338
    dr6 = read_dr6();
-
 
339
    for (i=0; i < BKPOINTS_MAX; i++) {
351
    for (i=0; i < BKPOINTS_MAX; i++) {
340
        if (dr6 & (1 << i)) {
352
        if (dr6 & (1 << i)) {
341
            dr6 &= ~ (1 << i);
353
            dr6 &= ~ (1 << i);
342
            write_dr6(dr6);
354
            write_dr6(dr6);
343
           
355