Checks if there is sufficient space and writes code at the chosen offset
| 272 | |
| 273 | // Checks if there is sufficient space and writes code at the chosen offset |
| 274 | void TinyDBR::WriteCodeAtOffset(ModuleInfo* module, size_t offset, void* data, size_t size) |
| 275 | { |
| 276 | if (offset + size > module->instrumented_code_size) |
| 277 | { |
| 278 | FATAL("Insufficient memory allocated for instrumented code"); |
| 279 | } |
| 280 | |
| 281 | memcpy(module->instrumented_code_local + offset, data, size); |
| 282 | |
| 283 | if (offset + size > module->instrumented_code_allocated) |
| 284 | { |
| 285 | module->instrumented_code_allocated = offset + size; |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | // writes a pointer to the instrumented code |
| 290 | void TinyDBR::WritePointer(ModuleInfo* module, size_t value) |
no outgoing calls
no test coverage detected