Renamed CLion process check function
This commit is contained in:
@@ -24,7 +24,7 @@ namespace Bloom::DebugServer::Gdb::CommandPackets
|
|||||||
Logger::debug("Handling Detach packet");
|
Logger::debug("Handling Detach packet");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (Process::isProcessManagedByClion(Process::getParentProcessId())) {
|
if (Process::isManagedByClion(Process::getParentProcessId())) {
|
||||||
targetControllerConsole.suspendTargetController();
|
targetControllerConsole.suspendTargetController();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ namespace Bloom::DebugServer::Gdb
|
|||||||
std::bind(&GdbRspDebugServer::onTargetExecutionStopped, this, std::placeholders::_1)
|
std::bind(&GdbRspDebugServer::onTargetExecutionStopped, this, std::placeholders::_1)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (Process::isProcessManagedByClion(Process::getParentProcessId())) {
|
if (Process::isManagedByClion(Process::getParentProcessId())) {
|
||||||
Logger::warning(
|
Logger::warning(
|
||||||
"Bloom's process is being managed by CLion - Bloom will automatically shutdown upon detaching from GDB."
|
"Bloom's process is being managed by CLion - Bloom will automatically shutdown upon detaching from GDB."
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Bloom
|
|||||||
return getppid();
|
return getppid();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Process::isProcessManagedByClion(::pid_t processId) {
|
bool Process::isManagedByClion(::pid_t processId) {
|
||||||
static auto cachedResult = std::optional<bool>();
|
static auto cachedResult = std::optional<bool>();
|
||||||
|
|
||||||
if (cachedResult.has_value()) {
|
if (cachedResult.has_value()) {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace Bloom
|
|||||||
* @param processId
|
* @param processId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
static bool isProcessManagedByClion(::pid_t processId);
|
static bool isManagedByClion(::pid_t processId);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::optional<::proc_t*> getProcessInfo(::pid_t processId);
|
static std::optional<::proc_t*> getProcessInfo(::pid_t processId);
|
||||||
|
|||||||
Reference in New Issue
Block a user