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

Method objdump

lib/compilers/pascal-win.ts:93–113  ·  view source on GitHub ↗
(outputFilename: string, result, maxSize: number, intelAsm: boolean)

Source from the content-addressed store, hash-verified

91 }
92
93 override async objdump(outputFilename: string, result, maxSize: number, intelAsm: boolean) {
94 const dirPath = path.dirname(outputFilename);
95 const execBinary = this.getExecutableFilename(dirPath);
96 if (await utils.fileExists(execBinary)) {
97 outputFilename = execBinary;
98 } else {
99 outputFilename = this.getOutputFilename(path.dirname(outputFilename));
100 }
101
102 let args = [...this.compiler.objdumperArgs, '-d', outputFilename];
103 if (intelAsm) args = args.concat(['-M', 'intel']);
104 return this.exec(this.compiler.objdumper, args, {maxOutput: 1024 * 1024 * 1024}).then(objResult => {
105 if (objResult.code === 0) {
106 result.asm = objResult.stdout;
107 } else {
108 result.asm = '<No output: objdump returned ' + objResult.code + '>';
109 }
110
111 return result;
112 });
113 }
114
115 async saveDummyProjectFile(filename: string, unitName: string, unitPath: string) {
116 // biome-ignore format: keep as-is for readability

Callers

nothing calls this directly

Calls 4

getExecutableFilenameMethod · 0.95
getOutputFilenameMethod · 0.95
execMethod · 0.95
fileExistsMethod · 0.80

Tested by

no test coverage detected