Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debugger: Implement remainder of #12729.
UserInterfaceListener: - Add request hook for writing a core file. Implement in TeamDebugger. Jobs/WriteCoreFileJob: - Add new job to actually dispatch the core file request via the debugger interface. Team{::Listener} - Add listener event + hook for notifications when a core file gets written. Implement in CLI. CliContext: - Add event flag for core file changed. CommandLineUserInterface: - Add 'write-core' command. This optionally takes a path to write the core to, otherwise one is automatically generated by, similarly to debug reports. As such, one can now generate cores for things like app_server and registrar crashes if desired, in addition to reports.
- Loading branch information
Showing
16 changed files
with
284 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright 2016, Rene Gollent, rene@gollent.com. | ||
* Distributed under the terms of the MIT License. | ||
*/ | ||
|
||
#include "Jobs.h" | ||
|
||
#include <Path.h> | ||
|
||
#include <AutoLocker.h> | ||
|
||
#include "DebuggerInterface.h" | ||
#include "Team.h" | ||
|
||
|
||
|
||
WriteCoreFileJob::WriteCoreFileJob(Team* team, | ||
DebuggerInterface* interface, const entry_ref& path) | ||
: | ||
fKey(&path, JOB_TYPE_WRITE_CORE_FILE), | ||
fTeam(team), | ||
fDebuggerInterface(interface), | ||
fTargetPath(path) | ||
{ | ||
fDebuggerInterface->AcquireReference(); | ||
} | ||
|
||
|
||
WriteCoreFileJob::~WriteCoreFileJob() | ||
{ | ||
fDebuggerInterface->AcquireReference(); | ||
} | ||
|
||
|
||
const JobKey& | ||
WriteCoreFileJob::Key() const | ||
{ | ||
return fKey; | ||
} | ||
|
||
|
||
status_t | ||
WriteCoreFileJob::Do() | ||
{ | ||
BPath path(&fTargetPath); | ||
status_t error = path.InitCheck(); | ||
if (error != B_OK) | ||
return error; | ||
|
||
error = fDebuggerInterface->WriteCoreFile(path.Path()); | ||
if (error != B_OK) | ||
return error; | ||
|
||
AutoLocker< ::Team> teamLocker(fTeam); | ||
fTeam->NotifyCoreFileChanged(path.Path()); | ||
|
||
return B_OK; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.