| 61 | } |
| 62 | |
| 63 | async executeObjdump( |
| 64 | objdumperPath: string, |
| 65 | args: string[], |
| 66 | execOptions: ExecutionOptions, |
| 67 | exec: (filepath: string, args: string[], options: ExecutionOptions) => Promise<UnprocessedExecResult>, |
| 68 | ): Promise<ObjdumpResult> { |
| 69 | const objResult = await exec(objdumperPath, args, execOptions); |
| 70 | |
| 71 | if (objResult.code === 0) { |
| 72 | return { |
| 73 | code: 0, |
| 74 | objdumpTime: objResult.execTime.toString(), |
| 75 | asm: objResult.stdout, |
| 76 | }; |
| 77 | } |
| 78 | return { |
| 79 | code: objResult.code, |
| 80 | stderr: objResult.stderr, |
| 81 | }; |
| 82 | } |
| 83 | |
| 84 | // There's no way in TS to do an abstract static members and interfaces don't allow "static" at all. |
| 85 | // There's apparently a hack with InstanceType but I couldn't get it working. I think this is the best solution. |