Breakpoint Implementation
Breakpoint Implementation
- Subject: Breakpoint Implementation
- From: Dave Keck <email@hidden>
- Date: Mon, 4 Oct 2010 04:20:29 -0400
Hey list,
I'm implementing breakpoint functionality in a hobby i386 debugger
using the INT3 instruction. Let's say Thread 1 hits Breakpoint A:
1. Suspend every thread
2. Restore original instruction that was replaced by INT3
3. In Thread 1, EIP--, let Thread 1 single-step (using EFL_TF flag)
4. Revert instruction back to INT3
5. Resume every thread
This technique appears to work as expected, but let's say:
1. Breakpoint A is at the very 'syscall' instruction within
pthread_create() that causes Thread B to spawn
2. Thread B will hit Breakpoint A
Due to the race between Thread B executing and step #4 completing,
couldn't Thread B bypass Breakpoint A? Is there a way to fix this?
Thanks very much!
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden