Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i#95 Linux detach: detaching via dr_app_stop_and_cleanup()
Modeled on Peter Goodman's code at https://codereview.appspot.com/13314047 but with many changes, including: + not including any of the re-takeover changes: global var resets, etc. + using a futex instead of sleeping and checking a volatile bool. This does retain the duplication of Windows detach code from the patch. That will be addressed in an upcoming CL. Adds a new app API routine dr_app_stop_and_cleanup() which triggers a detach that can assume it's on an app thread and app stack. Implements detach cleanup for Linux by splitting the portions that must be executed by each thread (mainly segment restoration) from the rest of the cleanup that the detaching thread can perform. The final go-native step is accomplished via sigreturn using a generalized dynamorio_futex_wake_and_exit/dynamorio_semaphore_signal_all routine, renamed to dynamorio_condvar_wake_and_jmp and taking in a target routine to jump to after the wake. This target is dynamorio_sigreturn for detach. Adds two app-detach tests. Review-URL: https://codereview.appspot.com/302710043
- Loading branch information
1 parent
18cf149
commit 9592116
Showing
24 changed files
with
908 additions
and
184 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.