'dtrace errors out with incorrect type for thread_t on macOS 12.2.1

The following dtrace invocation used to work on MacOS 11.6.2 but after upgrading to MacOS 12.2.1 it stopped working

sudo --non-interactive  dtrace -l -b 16m -x mangled -x disallow_dsym -x strip -x evaltime=preinit -x preallocate=256m  -n 'oneshot$target:a.out::entry { hdr_vm_addr = ((thread_t)curthread)->task->mach_header_vm_address; }' -w -p 4557 

dtrace: invalid probe specifier oneshot$target:a.out::entry { hdr_vm_addr = ((thread_t)curthread)->task->mach_header_vm_address; }: in action list: task is not a member of struct thread

How do I get task from thread_t now?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source