| View previous topic :: View next topic |
| Author |
Message |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Mon Oct 01, 2007 5:08 pm Post subject: DebugActiveProcess for a single thread? |
|
|
Two problems:
1) I need to be able to debug a single thread inside of the process debugging it (1 thread is the debugger/1 thread is the debuggee). I haven't been able to find a way to achieve this (If only DebugActiveThread() existed. ). Looked through the React OS source and pages of google searches and no luck. I would think this is possible though because of the fact that it is the threads that run everything separately.
2) Building off of the last question: Is there anyway to fool the processor into single-stepping a single thread instead of the whole process?
I suppose if I can't get it to work I can just create a dummy process for this, but that is just messy.
Ring 0 or Ring 3 answers accepted.
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25821 Location: The netherlands
|
Posted: Mon Oct 01, 2007 5:26 pm Post subject: |
|
|
1: DebugActiveProcess suspends all threads of the process. Including the debugger. Also, each time a even happens, all threads suspended....
2: That is by default. You are only setting the single step flag in the debugger thread context. Of course, each time it's paused, all other threads will be paused as well.
I recommend a dummy process, or write your own int1 handler, and on breakpoint let the thread that causes it go into a waitforevent state
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Mon Oct 01, 2007 5:39 pm Post subject: |
|
|
| Dark Byte wrote: | | 1: DebugActiveProcess suspends all threads of the process. Including the debugger. Also, each time a even happens, all threads suspended.... |
Dang, I was hoping there was a way to stop all the other threads pausing each time there was an exception generated.
| Dark Byte wrote: | | 2: That is by default. You are only setting the single step flag in the debugger thread context. Of course, each time it's paused, all other threads will be paused as well. |
I suppose I should have been clearer as to that aspect. I knew that the exception caused all of the threads to pause. A different way of phrasing it would be: How do I stop the other threads from pausing when I set the trap flag? I suppose my answer to that though would be writing my own int1 handler like you said. I think I am going to use a dumby process first and in a later build I will add the int1 handler.
Thanks for the reply.
Edit: After reading an article on hooking int1 it seems easier than I thought. I am just going to do that.
|
|
| Back to top |
|
 |
|