Apple: support for Output_DebugMon log channel

This commit is contained in:
Jake Turner
2022-05-20 13:36:23 +01:00
committed by Baldur Karlsson
parent 39cdfeb138
commit 1d9be38380
2 changed files with 14 additions and 0 deletions
@@ -29,6 +29,7 @@
#include <unistd.h>
#include "common/common.h"
#include "common/formatting.h"
#include "core/core.h"
#include "os/os_specific.h"
char **GetCurrentEnvironment()
@@ -200,3 +201,10 @@ uint64_t Process::GetMemoryUsage()
return taskInfo.resident_size;
}
// Helper method to avoid #include file conflicts between
// <Carbon/Carbon.h> and "core/core.h"
bool ShouldOutputDebugMon()
{
return OSUtility::DebuggerPresent() && RenderDoc::Inst().IsReplayApp();
}
@@ -318,6 +318,10 @@ rdcwstr UTF82Wide(const rdcstr &s)
}
};
// Helper method to avoid #include file conflicts between
// <Carbon/Carbon.h> and "core/core.h"
bool ShouldOutputDebugMon();
namespace OSUtility
{
void WriteOutput(int channel, const char *str)
@@ -326,6 +330,8 @@ void WriteOutput(int channel, const char *str)
fprintf(stdout, "%s", str);
else if(channel == OSUtility::Output_StdErr)
fprintf(stderr, "%s", str);
else if(channel == OSUtility::Output_DebugMon && ShouldOutputDebugMon())
fprintf(stdout, "%s", str);
}
uint64_t GetMachineIdent()