mirror of https://gitee.com/bigwinds/arangodb
portabilize the output of the debugger hint command
This commit is contained in:
parent
2b4038953e
commit
b0b919d9cc
|
@ -80,6 +80,15 @@ function analyzeCoreDump (instanceInfo, options, storeArangodPath, pid) {
|
||||||
executeExternalAndWait('/bin/bash', args);
|
executeExternalAndWait('/bin/bash', args);
|
||||||
GDB_OUTPUT = fs.read(gdbOutputFile);
|
GDB_OUTPUT = fs.read(gdbOutputFile);
|
||||||
print(GDB_OUTPUT);
|
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);
|
executeExternalAndWait('/bin/bash', args);
|
||||||
GDB_OUTPUT = fs.read(lldbOutputFile);
|
GDB_OUTPUT = fs.read(lldbOutputFile);
|
||||||
print(GDB_OUTPUT);
|
print(GDB_OUTPUT);
|
||||||
|
return 'lldb ' + storeArangodPath + ' -c /cores/core.' + pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
// //////////////////////////////////////////////////////////////////////////////
|
// //////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -144,6 +154,8 @@ function analyzeCoreDumpWindows (instanceInfo) {
|
||||||
|
|
||||||
print('running cdb ' + JSON.stringify(args));
|
print('running cdb ' + JSON.stringify(args));
|
||||||
executeExternalAndWait('cdb', args);
|
executeExternalAndWait('cdb', args);
|
||||||
|
|
||||||
|
return 'cdb ' + args.join(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
// //////////////////////////////////////////////////////////////////////////////
|
// //////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -189,24 +201,19 @@ function analyzeCrash (binary, arangod, options, checkStr) {
|
||||||
yaml.safeDump(arangod) +
|
yaml.safeDump(arangod) +
|
||||||
'marking build as crashy.' + RESET);
|
'marking build as crashy.' + RESET);
|
||||||
|
|
||||||
let corePath = (options.coreDirectory === '')
|
let hint = '';
|
||||||
? 'core'
|
|
||||||
: options.coreDirectory;
|
|
||||||
|
|
||||||
arangod.exitStatus.gdbHint = 'Run debugger with "gdb ' +
|
|
||||||
storeArangodPath + ' ' + corePath;
|
|
||||||
|
|
||||||
if (platform.substr(0, 3) === 'win') {
|
if (platform.substr(0, 3) === 'win') {
|
||||||
// Windows: wait for procdump to do its job...
|
// Windows: wait for procdump to do its job...
|
||||||
statusExternal(arangod.monitor, true);
|
statusExternal(arangod.monitor, true);
|
||||||
analyzeCoreDumpWindows(arangod);
|
hint = analyzeCoreDumpWindows(arangod);
|
||||||
} else if (platform === 'darwin') {
|
} else if (platform === 'darwin') {
|
||||||
fs.copyFile(binary, storeArangodPath);
|
fs.copyFile(binary, storeArangodPath);
|
||||||
analyzeCoreDumpMac(arangod, options, storeArangodPath, arangod.pid);
|
hint = analyzeCoreDumpMac(arangod, options, storeArangodPath, arangod.pid);
|
||||||
} else {
|
} else {
|
||||||
fs.copyFile(binary, storeArangodPath);
|
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);
|
print(RESET);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue