diff --git a/src/apps/debugger/debugger_interface/DebuggerInterface.h b/src/apps/debugger/debugger_interface/DebuggerInterface.h index 10a1fc7d5b..5d02279e3d 100644 --- a/src/apps/debugger/debugger_interface/DebuggerInterface.h +++ b/src/apps/debugger/debugger_interface/DebuggerInterface.h @@ -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; diff --git a/src/apps/debugger/debugger_interface/interfaces/CoreFileDebuggerInterface.cpp b/src/apps/debugger/debugger_interface/interfaces/CoreFileDebuggerInterface.cpp index 68d18007ff..0444797eaf 100644 --- a/src/apps/debugger/debugger_interface/interfaces/CoreFileDebuggerInterface.cpp +++ b/src/apps/debugger/debugger_interface/interfaces/CoreFileDebuggerInterface.cpp @@ -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) diff --git a/src/apps/debugger/debugger_interface/interfaces/CoreFileDebuggerInterface.h b/src/apps/debugger/debugger_interface/interfaces/CoreFileDebuggerInterface.h index d688abb311..a18b38770f 100644 --- a/src/apps/debugger/debugger_interface/interfaces/CoreFileDebuggerInterface.h +++ b/src/apps/debugger/debugger_interface/interfaces/CoreFileDebuggerInterface.h @@ -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); diff --git a/src/apps/debugger/debugger_interface/interfaces/LocalDebuggerInterface.cpp b/src/apps/debugger/debugger_interface/interfaces/LocalDebuggerInterface.cpp index c90b950dba..7fa0ea8f31 100644 --- a/src/apps/debugger/debugger_interface/interfaces/LocalDebuggerInterface.cpp +++ b/src/apps/debugger/debugger_interface/interfaces/LocalDebuggerInterface.cpp @@ -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) diff --git a/src/apps/debugger/debugger_interface/interfaces/LocalDebuggerInterface.h b/src/apps/debugger/debugger_interface/interfaces/LocalDebuggerInterface.h index 6e44bc741e..468d4e2bd9 100644 --- a/src/apps/debugger/debugger_interface/interfaces/LocalDebuggerInterface.h +++ b/src/apps/debugger/debugger_interface/interfaces/LocalDebuggerInterface.h @@ -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);