Add command line option to ask Debugger to save a report.
- When invoked, starts up the CLI such that it bypasses waiting for input and instead save a crash report of the running team, then exits. Mainly intended to be used by debug_server.
This commit is contained in:
@@ -88,9 +88,12 @@ private:
|
||||
// #pragma mark - CommandLineUserInterface
|
||||
|
||||
|
||||
CommandLineUserInterface::CommandLineUserInterface()
|
||||
CommandLineUserInterface::CommandLineUserInterface(bool saveReport,
|
||||
const char* reportPath)
|
||||
:
|
||||
fCommands(20, true),
|
||||
fReportPath(reportPath),
|
||||
fSaveReport(saveReport),
|
||||
fShowSemaphore(-1),
|
||||
fShown(false),
|
||||
fTerminating(false)
|
||||
@@ -202,7 +205,18 @@ CommandLineUserInterface::Run()
|
||||
if (error != B_OK)
|
||||
return;
|
||||
|
||||
_InputLoop();
|
||||
if (!fSaveReport)
|
||||
_InputLoop();
|
||||
else {
|
||||
ArgumentVector args;
|
||||
char buffer[256];
|
||||
const char* parseErrorLocation;
|
||||
snprintf(buffer, sizeof(buffer), "save-report %s",
|
||||
fReportPath != NULL ? fReportPath : "");
|
||||
args.Parse(buffer, &parseErrorLocation);
|
||||
_ExecuteCommand(args.ArgumentCount(), args.Arguments());
|
||||
fContext.QuitSession(true);
|
||||
}
|
||||
|
||||
// Release the Show() semaphore to signal Terminate().
|
||||
release_sem(fShowSemaphore);
|
||||
|
||||
Reference in New Issue
Block a user