diff --git a/js/client/modules/@arangodb/crash-utils.js b/js/client/modules/@arangodb/crash-utils.js index 39b9385d7b..09cd099048 100644 --- a/js/client/modules/@arangodb/crash-utils.js +++ b/js/client/modules/@arangodb/crash-utils.js @@ -80,6 +80,15 @@ function analyzeCoreDump (instanceInfo, options, storeArangodPath, pid) { executeExternalAndWait('/bin/bash', args); GDB_OUTPUT = fs.read(gdbOutputFile); print(GDB_OUTPUT); + + command = 'gdb ' + storeArangodPath + ' '; + + if (options.coreDirectory === '') { + command += 'core'; + } else { + command += options.coreDirectory; + } + return command; } // ////////////////////////////////////////////////////////////////////////////// @@ -112,6 +121,7 @@ function analyzeCoreDumpMac (instanceInfo, options, storeArangodPath, pid) { executeExternalAndWait('/bin/bash', args); GDB_OUTPUT = fs.read(lldbOutputFile); print(GDB_OUTPUT); + return 'lldb ' + storeArangodPath + ' -c /cores/core.' + pid; } // ////////////////////////////////////////////////////////////////////////////// @@ -144,6 +154,8 @@ function analyzeCoreDumpWindows (instanceInfo) { print('running cdb ' + JSON.stringify(args)); executeExternalAndWait('cdb', args); + + return 'cdb ' + args.join(' '); } // ////////////////////////////////////////////////////////////////////////////// @@ -189,24 +201,19 @@ function analyzeCrash (binary, arangod, options, checkStr) { yaml.safeDump(arangod) + 'marking build as crashy.' + RESET); - let corePath = (options.coreDirectory === '') - ? 'core' - : options.coreDirectory; - - arangod.exitStatus.gdbHint = 'Run debugger with "gdb ' + - storeArangodPath + ' ' + corePath; - + let hint = ''; if (platform.substr(0, 3) === 'win') { // Windows: wait for procdump to do its job... statusExternal(arangod.monitor, true); - analyzeCoreDumpWindows(arangod); + hint = analyzeCoreDumpWindows(arangod); } else if (platform === 'darwin') { fs.copyFile(binary, storeArangodPath); - analyzeCoreDumpMac(arangod, options, storeArangodPath, arangod.pid); + hint = analyzeCoreDumpMac(arangod, options, storeArangodPath, arangod.pid); } else { fs.copyFile(binary, storeArangodPath); - analyzeCoreDump(arangod, options, storeArangodPath, arangod.pid); + hint = analyzeCoreDump(arangod, options, storeArangodPath, arangod.pid); } + arangod.exitStatus.gdbHint = 'Run debugger with "' + hint + '"'; print(RESET); }