Subversion Repositories HelenOS

Rev

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

Rev 3093 Rev 3108
Line 44... Line 44...
44
#include "../../../main.h"
44
#include "../../../main.h"
45
#include "../../../include/arch.h"
45
#include "../../../include/arch.h"
46
 
46
 
47
#define OPCODE_INT3     0xCC
47
#define OPCODE_INT3     0xCC
48
 
48
 
-
 
49
void arch_dthread_initialize(dthread_t *dt)
-
 
50
{
-
 
51
    dt->arch.singlestep = false;
-
 
52
}
-
 
53
 
49
static int _set_trap_flag(dthread_t *dt, bool enable)
54
static int _set_trap_flag(dthread_t *dt, bool enable)
50
{
55
{
51
    static istate_t istate;
56
    static istate_t istate;
52
    int rc;
57
    int rc;
53
 
58
 
54
    rc = udebug_regs_read(app_phone, dt->hash, &istate);
59
    rc = udebug_regs_read(app_phone, dt->hash, &istate);
55
    if (rc < 0) { printf("regs read failed\n"); return; }
60
    if (rc < 0) { printf("regs read failed\n"); return -1; }
56
 
61
 
57
    if (enable) istate.eflags |= 0x0100; /* trap flag */
62
    if (enable) istate.eflags |= 0x0100; /* trap flag */
58
    else if (!active_bkpt) istate.eflags &= ~0x0100; /* trap flag */
63
    else if (!active_bkpt) istate.eflags &= ~0x0100; /* trap flag */
59
 
64
 
60
    rc = udebug_regs_write(app_phone, dt->hash, &istate);  
65
    rc = udebug_regs_write(app_phone, dt->hash, &istate);  
61
    if (rc < 0) { printf("regs write failed\n"); return; }
66
    if (rc < 0) { printf("regs write failed\n"); return -1; }
62
 
67
 
63
    return 0;
68
    return 0;
64
}
69
}
65
 
70
 
66
int arch_breakpoint_set(breakpoint_t *b)
71
int arch_breakpoint_set(breakpoint_t *b)