site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=af/dFHeyUIwRtNUOB9eRfFPnuoXar8EZO3tCxFHvH/Q=; b=suGh/loaa2iew0D7FAzliJgHj72Qqd750VY8W8LR3VnmIkMHaZHtA1PCvo1/+nmNnq XJs1lADdH8udl9wXC4poNpDIfL7yMdearKsR4ilb5TTGFECqyhcS8dmWWSyqPFTU40LE Yf8mkHY4dvpY5IV54UygZ7gT7YydDSzRTkgHs= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=d06jmY80hhkR8/uw+1LvwldRgvNfVpwWvddTqROPgPvcXZx+89ggmHswviFZ7EZkS2 jmlpKQmBW/MvpkeclyIPTIlqWrZWSow6MQ9bRN9BKqmXZriZM/jKOCkWzATOo+Bni0I1 /8Nx8Y2VUhK0dCxGhjSgF14tHea5gV18yNcEA=
A harder solution is to leave the INT3 in place, and set EIP to an instruction buffer of your own on the side that says `syscall ; int3`. That way you can run a syscall instruction on that thread without interfering with any new thread.
Clever - that sounds like the answer I was looking for.
(Of course, that new thread might stumble over one of your other breakpoints or mutate memory. If you want to handle that, you'd need a breakpoint on the first instruction for new threads, so you can catch the thread there and keep it halted until you're ready to resume threads.)
Is that necessary? With this instruction buffer technique, when Thread A hits Breakpoint A: 1. Suspend every thread 2. Let user handle breakpoint 3. Cache Thread A's EIP 4. Set EIP of Thread A to detached instruction buffer filled with 'syscall; int 3' 5. Resume every thread 6. When Thread A hits the INT3 from step #4, set Thread A's EIP to the instruction after the cached EIP (from step #3) and resume Since Thread B won't be spawned until step #5 -- after the user has handled the breakpoint and chosen to continue -- I don't see Thread B's actions as being an issue. Thanks, David _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com