Setup memory data structures for file debugging. TO RUN: setup debugFileRegions map with the regions of the file you wish to track. Keys of the map are offsets in the file, and values are the lengths of the region
| 32 | // TO RUN: setup debugFileRegions map with the regions of the file you wish to track. Keys of the map are offsets in |
| 33 | // the file, and values are the lengths of the region |
| 34 | void debugFileSetup() { |
| 35 | debugFileRegions[0] = 1e8; |
| 36 | for (auto itr = debugFileRegions.begin(); itr != debugFileRegions.end(); ++itr) { |
| 37 | debugFileData[itr->first] = (uint8_t*)malloc(itr->second); |
| 38 | memset(debugFileData[itr->first], 0, itr->second); |
| 39 | |
| 40 | debugFileMask[itr->first] = (uint8_t*)malloc(itr->second); |
| 41 | memset(debugFileMask[itr->first], 0, itr->second); |
| 42 | } |
| 43 | |
| 44 | debugFileSetPage = (uint8_t*)malloc(4096); |
| 45 | memset(debugFileSetPage, 1, 4096); |
| 46 | } |
| 47 | |
| 48 | // Trim a file path to the file name |
| 49 | std::string debugFileTrim(std::string filename) { |
no test coverage detected