From: Le Chaud Lapin on
On May 24, 4:42 pm, "m" <m...(a)b.c> wrote:
> Different debuggers use different techniques depending on their design and
> the capabilities of the architecture they target.  The method you describe
> is consistent with a simple source mode debugger.  One significant
> limitation of this method is the possibility of missing breaks because a
> thread executed the instruction while is was restored for another thread.
>
> But as Don has said, unless you are writing a new debugger, this problem
> should not keep you up at night

Ah...I just re-read the OP. I completely missed the point.

To the OP:

I guess you know by now that you can avoid the sync problem on IA-??
by using trap flag (TF) in EFLAGS register. Single-step only the
thread that INT 3'ed, restore byte, let all threads run.

-Le Chaud Lapin-
From: G�nter Prossliner on
Hello NG!

> One significant limitation of this method is the possibility of
> missing breaks because a thread executed the instruction while is was
> restored for another thread.

This synchronization issue was the point of my original post.

One possible implementation would be to change thread affinities so that
only the thread that hit the breakpoint will run in the process, and enable
Single-Step-Mode, resume the thread, wait for EXCEPTION_SINGLE_STEP, restore
the breakpoint and thread affinities. So there will be no possiblity of
missing a break.


GP