Created
March 23, 2014 17:15
-
-
Save AlainODea/9726316 to your computer and use it in GitHub Desktop.
Using DTrace to stop (freeze, but not kill) a program when it runs ld (used to debug GHC issues)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/sbin/dtrace -s | |
#pragma D option destructive | |
syscall::exec*:entry | |
/copyinstr(arg0) == "/usr/bin/ld"/ | |
{ | |
trace(pid); | |
stop(); | |
system("pargs %d", pid); | |
exit(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment