-------------------------------------------------------------------------
| 59 | |
| 60 | //------------------------------------------------------------------------- |
| 61 | BreakPoint::InstructionCollection |
| 62 | BreakPoint::SetBreakPoints(HANDLE hProcess, Addresses&& addresses) const |
| 63 | { |
| 64 | InstructionCollection oldInstructions; |
| 65 | |
| 66 | std::sort(addresses.begin(), addresses.end()); |
| 67 | auto beginRange = addresses.cbegin(); |
| 68 | |
| 69 | for (auto it = beginRange; it < addresses.cend(); ++it) |
| 70 | { |
| 71 | if (*it - *beginRange > 4096) |
| 72 | { |
| 73 | SetBreakPointsRange(hProcess, beginRange, it, oldInstructions); |
| 74 | beginRange = it; |
| 75 | } |
| 76 | } |
| 77 | SetBreakPointsRange( |
| 78 | hProcess, beginRange, addresses.end(), oldInstructions); |
| 79 | |
| 80 | return oldInstructions; |
| 81 | } |
| 82 | |
| 83 | //------------------------------------------------------------------------- |
| 84 | void BreakPoint::RemoveBreakPoint(const Address& address, |