diff options
author | Bartosz Taudul <wolf.pld@gmail.com> | 2021-01-31 19:37:54 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf.pld@gmail.com> | 2021-01-31 19:37:54 +0300 |
commit | 2890f24c97b6ee0027d11c78f5e44514180c6ecf (patch) | |
tree | 760206ecf2f2544977a058233a4472fc5faac284 /client | |
parent | 6c728f6d23f3b6f9a324fbe71c5b22b22b55d850 (diff) |
Implement getting process executable path.
Diffstat (limited to 'client')
-rw-r--r-- | client/TracyProfiler.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 9ea3d12b..2f94eaef 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -278,6 +278,19 @@ static const char* GetProcessName() return processName; } +static const char* GetProcessExecutablePath() +{ +#ifdef _WIN32 + static char buf[_MAX_PATH]; + GetModuleFileNameA( nullptr, buf, _MAX_PATH ); + return buf; +#elif defined _GNU_SOURCE || defined __CYGWIN__ + return program_invocation_name; +#else + return nullptr; +#endif +} + #if defined __linux__ && defined __ARM_ARCH static uint32_t GetHex( char*& ptr, int skip ) { |