aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/assembly.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compilers/assembly.js')
-rw-r--r--lib/compilers/assembly.js28
1 files changed, 15 insertions, 13 deletions
diff --git a/lib/compilers/assembly.js b/lib/compilers/assembly.js
index 4382a94f6..86b1e5ee2 100644
--- a/lib/compilers/assembly.js
+++ b/lib/compilers/assembly.js
@@ -79,19 +79,21 @@ class AssemblyCompiler extends BaseCompiler {
}
objdump(outputFilename, result, maxSize, intelAsm, demangle) {
- return this.getGeneratedOutputfilename(outputFilename).then((realOutputFilename) => {
- let args = ["-d", realOutputFilename, "-l", "--insn-width=16"];
- if (demangle) args = args.concat("-C");
- if (intelAsm) args = args.concat(["-M", "intel"]);
- return this.exec(this.compiler.objdumper, args, {maxOutput: maxSize})
- .then(objResult => {
- result.asm = objResult.stdout;
- if (objResult.code !== 0) {
- result.asm = "<No output: objdump returned " + objResult.code + ">";
- }
- return result;
- });
- });
+ return this.getGeneratedOutputfilename(outputFilename)
+ .then((realOutputFilename) => {
+ const dirPath = path.dirname(realOutputFilename);
+ let args = ["-d", realOutputFilename, "-l", "--insn-width=16"];
+ if (demangle) args = args.concat("-C");
+ if (intelAsm) args = args.concat(["-M", "intel"]);
+ return this.exec(this.compiler.objdumper, args, {maxOutput: maxSize, customCwd: dirPath})
+ .then(objResult => {
+ result.asm = objResult.stdout;
+ if (objResult.code !== 0) {
+ result.asm = "<No output: objdump returned " + objResult.code + ">";
+ }
+ return result;
+ });
+ });
}
}