Debugger: Add core file request to DebuggerInterface.

{CoreFile,Local}DebuggerInterface:
- Add virtual hook for requesting a core dump of the current team. Implement
  accordingly in LocalDebuggerInterface, and add a no-op stub in
  CoreFileDebuggerInterface.
This commit is contained in:
Rene Gollent 2016-04-26 21:48:44 -04:00
parent 42f9500235
commit bac2e686dc
5 changed files with 34 additions and 0 deletions

View File

@ -89,6 +89,8 @@ public:
virtual status_t GetCpuFeatures(uint32& flags) = 0;
virtual status_t WriteCoreFile(const char* path) = 0;
// TeamMemory
virtual status_t GetMemoryProperties(target_addr_t address,
uint32& protection, uint32& locking) = 0;

View File

@ -304,6 +304,13 @@ CoreFileDebuggerInterface::GetCpuFeatures(uint32& flags)
}
status_t
CoreFileDebuggerInterface::WriteCoreFile(const char* path)
{
return B_NOT_SUPPORTED;
}
status_t
CoreFileDebuggerInterface::GetMemoryProperties(target_addr_t address,
uint32& protection, uint32& locking)

View File

@ -68,6 +68,8 @@ public:
virtual status_t GetCpuFeatures(uint32& flags);
virtual status_t WriteCoreFile(const char* path);
// TeamMemory
virtual status_t GetMemoryProperties(target_addr_t address,
uint32& protection, uint32& locking);

View File

@ -733,6 +733,27 @@ LocalDebuggerInterface::GetCpuFeatures(uint32& flags)
}
status_t
LocalDebuggerInterface::WriteCoreFile(const char* path)
{
DebugContextGetter contextGetter(fDebugContextPool);
debug_nub_write_core_file_reply reply;
debug_nub_write_core_file message;
message.reply_port = contextGetter.Context()->reply_port;
strlcpy(message.path, path, sizeof(message.path));
status_t error = send_debug_message(contextGetter.Context(),
B_DEBUG_WRITE_CORE_FILE, &message, sizeof(message), &reply,
sizeof(reply));
if (error == B_OK)
error = reply.error;
return error;
}
status_t
LocalDebuggerInterface::GetMemoryProperties(target_addr_t address,
uint32& protection, uint32& locking)

View File

@ -61,6 +61,8 @@ public:
virtual status_t GetCpuFeatures(uint32& flags);
virtual status_t WriteCoreFile(const char* path);
// TeamMemory
virtual status_t GetMemoryProperties(target_addr_t address,
uint32& protection, uint32& locking);