| 350 | |
| 351 | |
| 352 | DebugModule DebuggerModules::GetModuleForAddress(uint64_t remoteAddress) |
| 353 | { |
| 354 | if (IsDirty()) |
| 355 | Update(); |
| 356 | |
| 357 | // lldb does not properly return the size of a module, so we have to find the nearest module base that is smaller |
| 358 | // than the remoteAddress |
| 359 | uint64_t closestAddress = 0; |
| 360 | DebugModule result {}; |
| 361 | |
| 362 | for (const DebugModule& module : m_modules) |
| 363 | { |
| 364 | // This is slighlty different from the Python implementation, which finds the largest module start that is |
| 365 | // smaller than the remoteAddress. |
| 366 | // if ((module.m_address <= remoteAddress) && (remoteAddress < module.m_address + module.m_size)) |
| 367 | // return module; |
| 368 | if ((module.m_address <= remoteAddress) && (module.m_address > closestAddress)) |
| 369 | { |
| 370 | closestAddress = module.m_address; |
| 371 | result = module; |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | return result; |
| 376 | } |
| 377 | |
| 378 | |
| 379 | ModuleNameAndOffset DebuggerModules::AbsoluteAddressToRelative(uint64_t absoluteAddress) |
nothing calls this directly
no outgoing calls
no test coverage detected