DynamoRIO / DynamoRIO/dynamorio
add method to set app exit code during client exit event
- Dominant language
- C
- Stars
- 3.2k
- Forks
- 629
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 31
Description
_From [bruen...@google.com](https://code.google.com/u/109494838902877177630/) on March 24, 2014 18:03:45_
Today the only way a client can set the app exit code is via
dr_exit_process(int exit_code)
But we can't call that when already exiting, right? It will recurse -- I
think it will fail.
Can we possibly request exit code earlier, at 1st error, and DR applies
when sees app exit? But that won't work for DrMem who wants to set the
code based not only on finding earlier errors but also leaks, which are
during exit event.
Thus we need to set the code that's often sitting in
cleanup_and_terminate's stack. Is it's in different places:
- linux: arg1 to syscall => sitting on stack during dynamo_process_exit
- win32: os_terminate_static_arguments
- win64: arg2 to syscall => sitting on stack during dynamo_process_exit
It's going to be hacky. Should cleanup_and_terminate write to some global
to point where arg1+arg2 are? Or pass arg to dynamo_process_exit()?
_Original issue: http://code.google.com/p/dynamorio/issues/detail?id=1400_
Contributor guide
Assessment
This issue has not been assessed yet.