| 1678 | FastVector<unsigned> byteCodePos; |
| 1679 | |
| 1680 | unsigned int ConvertPositionToInstruction(unsigned int relPos, unsigned int infoSize, NULLCCodeInfo* codeInfo, unsigned int &sourceOffset) |
| 1681 | { |
| 1682 | breakPos.clear(); |
| 1683 | byteCodePos.clear(); |
| 1684 | // Find instruction... |
| 1685 | unsigned int lastDistance = ~0u; |
| 1686 | for(unsigned int infoID = 0; infoID < infoSize; infoID++) |
| 1687 | { |
| 1688 | if(codeInfo[infoID].sourceOffset >= relPos && (unsigned int)(codeInfo[infoID].sourceOffset - relPos) <= lastDistance) |
| 1689 | { |
| 1690 | breakPos.push_back(infoID); |
| 1691 | lastDistance = (unsigned int)(codeInfo[infoID].sourceOffset - relPos); |
| 1692 | } |
| 1693 | } |
| 1694 | // Filter results so that only the best matches remain |
| 1695 | for(unsigned int i = 0; i < breakPos.size(); i++) |
| 1696 | { |
| 1697 | if((unsigned int)(codeInfo[breakPos[i]].sourceOffset - relPos) <= lastDistance) |
| 1698 | { |
| 1699 | byteCodePos.push_back(codeInfo[breakPos[i]].byteCodePos); |
| 1700 | sourceOffset = codeInfo[breakPos[i]].sourceOffset; |
| 1701 | } |
| 1702 | } |
| 1703 | return byteCodePos.size(); |
| 1704 | } |
| 1705 | |
| 1706 | unsigned int ConvertLineToInstruction(const char *source, unsigned int line, const char* fullSource, unsigned int infoSize, NULLCCodeInfo *codeInfo, unsigned int moduleSize, ExternModuleInfo *modules) |
| 1707 | { |
no test coverage detected