Breakpoints triggering.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <alloy/runtime/function.h>
|
||||
|
||||
#include <alloy/runtime/debugger.h>
|
||||
#include <alloy/runtime/symbol_info.h>
|
||||
#include <alloy/runtime/thread_state.h>
|
||||
|
||||
@@ -57,6 +58,20 @@ int Function::RemoveBreakpoint(Breakpoint* breakpoint) {
|
||||
return found ? 0 : 1;
|
||||
}
|
||||
|
||||
Breakpoint* Function::FindBreakpoint(uint64_t address) {
|
||||
LockMutex(lock_);
|
||||
Breakpoint* result = NULL;
|
||||
for (auto it = breakpoints_.begin(); it != breakpoints_.end(); ++it) {
|
||||
Breakpoint* breakpoint = *it;
|
||||
if (breakpoint->address() == address) {
|
||||
result = breakpoint;
|
||||
break;
|
||||
}
|
||||
}
|
||||
UnlockMutex(lock_);
|
||||
return result;
|
||||
}
|
||||
|
||||
int Function::Call(ThreadState* thread_state, uint64_t return_address) {
|
||||
ThreadState* original_thread_state = ThreadState::Get();
|
||||
if (original_thread_state != thread_state) {
|
||||
|
||||
Reference in New Issue
Block a user