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

Method objdump

lib/compilers/pascal.ts:143–171  ·  view source on GitHub ↗
(
        outputFilename: string,
        result: any,
        maxSize: number,
        intelAsm: boolean,
        demangle: boolean,
        staticReloc: boolean,
        dynamicReloc: boolean,
        filters: ParseFiltersAndOutputOptions,
    )

Source from the content-addressed store, hash-verified

141 }
142
143 override async objdump(
144 outputFilename: string,
145 result: any,
146 maxSize: number,
147 intelAsm: boolean,
148 demangle: boolean,
149 staticReloc: boolean,
150 dynamicReloc: boolean,
151 filters: ParseFiltersAndOutputOptions,
152 ) {
153 const dirPath = path.dirname(outputFilename);
154
155 let execBinary = '';
156
157 const inputExt = path.extname(result.inputFilename);
158 if (inputExt.toLowerCase() === '.dpr') {
159 execBinary = path.join(dirPath, path.basename(result.inputFilename, inputExt));
160 } else if (result.executableFilename) {
161 execBinary = unwrap<string>(result.executableFilename);
162 } else {
163 execBinary = this.getExecutableFilename(dirPath, path.basename(result.inputFilename, inputExt));
164 }
165
166 if (await utils.fileExists(execBinary)) {
167 return super.objdump(execBinary, result, maxSize, intelAsm, demangle, staticReloc, dynamicReloc, filters);
168 }
169
170 return super.objdump(outputFilename, result, maxSize, intelAsm, demangle, staticReloc, dynamicReloc, filters);
171 }
172
173 static preProcessBinaryAsm(input: string) {
174 // todo: write some pascal logic into external asm-parser to only include user code,

Callers

nothing calls this directly

Calls 3

getExecutableFilenameMethod · 0.95
fileExistsMethod · 0.80
unwrapFunction · 0.50

Tested by

no test coverage detected