MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / objdump

Method objdump

lib/compilers/cerberus.ts:67–90  ·  view source on GitHub ↗
(outputFilename: string, result: any, maxSize: number)

Source from the content-addressed store, hash-verified

65 }
66
67 override async objdump(outputFilename: string, result: any, maxSize: number) {
68 if (!(await utils.fileExists(outputFilename))) {
69 result.asm = '<No output file ' + outputFilename + '>';
70 return result;
71 }
72
73 const execOptions: ExecutionOptions = {
74 maxOutput: maxSize,
75 customCwd: (result.dirPath as string) || path.dirname(outputFilename),
76 };
77
78 const args = ['--pp=core', outputFilename];
79
80 const objResult = await this.exec(this.compiler.objdumper, args, execOptions);
81 if (objResult.code === 0) {
82 result.objdumpTime = objResult.execTime;
83 result.asm = this.postProcessObjdumpOutput(objResult.stdout);
84 } else {
85 logger.error(`Error executing objdump ${this.compiler.objdumper}`, objResult);
86 result.asm = `<No output: objdump returned ${objResult.code}>`;
87 }
88
89 return result;
90 }
91
92 override async handleInterpreting(key: CacheKey, executeParameters: ExecutableExecutionOptions) {
93 const executionPackageHash = this.env.getExecutableHash(key);

Callers

nothing calls this directly

Calls 4

fileExistsMethod · 0.80
errorMethod · 0.80
execMethod · 0.45

Tested by

no test coverage detected