1
0
Fork 0

portabilize the output of the debugger hint command

This commit is contained in:
Wilfried Goesgens 2017-04-25 15:31:10 +02:00
parent 2b4038953e
commit b0b919d9cc
1 changed files with 17 additions and 10 deletions

View File

@ -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);
}