@@ -6247,6 +6247,30 @@ GetCPUTypesFromHost(nub_process_t pid) {
62476247 return {cputype, cpusubtype};
62486248}
62496249
6250+ #if !__has_include(<os/security_config.h>) // macOS 26.1
6251+ extern " C" {
6252+ using os_security_config_t = uint64_t ;
6253+ #define OS_SECURITY_CONFIG_MTE 0x4
6254+
6255+ API_AVAILABLE (macos(26.0 ), ios(26.0 ), tvos(26.0 ), watchos(26.0 ), visionos(26.0 ),
6256+ driverkit(25.0 ))
6257+ OS_EXPORT OS_NOTHROW OS_NONNULL_ALL int
6258+ os_security_config_get_for_proc(pid_t pid, os_security_config_t *config);
6259+ }
6260+ #endif
6261+ static bool ProcessRunningWithMemoryTagging (pid_t pid) {
6262+ if (__builtin_available (macOS 26.0 , iOS 26.0 , tvOS 26.0 , watchOS 26.0 ,
6263+ visionOS 26.0 , driverkit 25.0 , *)) {
6264+ os_security_config_t config;
6265+ int ret = ::os_security_config_get_for_proc (pid, &config);
6266+ if (ret != 0 )
6267+ return false ;
6268+
6269+ return (config & OS_SECURITY_CONFIG_MTE);
6270+ }
6271+ return false ;
6272+ }
6273+
62506274// Note that all numeric values returned by qProcessInfo are hex encoded,
62516275// including the pid and the cpu type.
62526276
@@ -6423,6 +6447,9 @@ rnb_err_t RNBRemote::HandlePacket_qProcessInfo(const char *p) {
64236447
64246448 rep << " vendor:apple;" ;
64256449
6450+ if (ProcessRunningWithMemoryTagging (pid))
6451+ rep << " mte:enabled;" ;
6452+
64266453#if defined(__LITTLE_ENDIAN__)
64276454 rep << " endian:little;" ;
64286455#elif defined(__BIG_ENDIAN__)
0 commit comments