wuhailinjerry / edb-debugger

Automatically exported from code.google.com/p/edb-debugger
GNU General Public License v2.0
0 stars 0 forks source link

Thread Support #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
EDB currently has no support for debugging multi-threaded applications. When 
you attach to a process, it simple attaches to the primary thread.

Original issue reported on code.google.com by evan.teran on 3 Oct 2012 at 3:20

GoogleCodeExporter commented 9 years ago
There should be changes in the underlying functions to allow plugins and even 
the debugger to get the state of a specific thread.
This is needed for example when setting hardware breakpoints.

Original comment by evan.teran on 3 Oct 2012 at 3:31

GoogleCodeExporter commented 9 years ago
What you suggest is actually implemented to a certain degree. Basically, the 
debugging core has a concept of an "active" thread.

When you ask it to set/get the state, it will act upon the active thread. By 
default, after any given event, this will be the thread which triggered the 
event. However, plugins can choose to set it manually to another thread ID. So 
for example, you could do the following:

    State state;
    edb::tid_t t = edb::v1::debugger_core->active_thread();
    edb::v1::debugger_core->;set_active_thread(1234);
    edb::v1::debugger_core->get_state(state);     // get the state of thread 1234
    state.eip = 0x41414141; 
    edb::v1::debugger_core->set_state(state);
    edb::v1::debugger_core->set_active_thread(t); // reset the active thread to what it was

that will set the EIP of thread 1234 to 0x41414141 without effecting the other 
threads.

Original comment by evan.teran on 3 Oct 2012 at 3:32

GoogleCodeExporter commented 9 years ago

Original comment by evan.teran on 4 Apr 2014 at 3:47