| 27 | import {BaseTool} from './base-tool.js'; |
| 28 | |
| 29 | export class LLVMPDBUtilTool extends BaseTool { |
| 30 | static get key() { |
| 31 | return 'llvm-pdbutil-tool'; |
| 32 | } |
| 33 | |
| 34 | override async runTool(compilationInfo: CompilationInfo, inputFilepath?: string, args?: string[]) { |
| 35 | if (!compilationInfo.filters.binary) { |
| 36 | return this.createErrorResponse(`${this.tool.name ?? 'llvm-pdbutil'} requires an executable`); |
| 37 | } |
| 38 | |
| 39 | let filename = compilationInfo.executableFilename; |
| 40 | if (!(await fileExists(filename))) { |
| 41 | filename = compilationInfo.outputFilename; |
| 42 | } |
| 43 | |
| 44 | // If a PDB is generated, it will be named after the executable. |
| 45 | const dotIdx = filename.lastIndexOf('.'); |
| 46 | if (dotIdx >= 0) { |
| 47 | filename = filename.slice(0, dotIdx) + '.pdb'; |
| 48 | } |
| 49 | |
| 50 | return super.runTool(compilationInfo, filename, args); |
| 51 | } |
| 52 | } |
nothing calls this directly
no outgoing calls
no test coverage detected