You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DR's application API (dr_app_*) allows an app to start and stop running under DR. We may want to statically link multiple clients with the application, and control which client to use at starting.
On Linux, we could use the weak symbol trick.
Each client has two symbols:
a global symbol dr****_client_main is the actual initialization function.
a weak symbol dr_client_main either be alias to the dr****_client_main or a function simply calls dr****_client_main.
By doing that, each client can run separately.
When linking with an application, we can implement a global symbol dr_client_main in the app to override all the other dr_client_main in the clients, and pick which client initialization function to run by calling the corresponding dr****_client_main.
We may be able to use command line linker option to add dr****_client_main as the alias of dr_client_main in the client to minimal the change (need more investigation).
On Windows, there is no weak symbol. We may need use __declspec(selectany) to achieve similar goal.
The text was updated successfully, but these errors were encountered:
DR's application API (
dr_app_*
) allows an app to start and stop running under DR. We may want to statically link multiple clients with the application, and control which client to use at starting.On Linux, we could use the weak symbol trick.
Each client has two symbols:
dr****_client_main
is the actual initialization function.dr_client_main
either be alias to thedr****_client_main
or a function simply callsdr****_client_main
.By doing that, each client can run separately.
When linking with an application, we can implement a global symbol
dr_client_main
in the app to override all the otherdr_client_main
in the clients, and pick which client initialization function to run by calling the correspondingdr****_client_main
.We may be able to use command line linker option to add
dr****_client_main
as the alias ofdr_client_main
in the client to minimal the change (need more investigation).On Windows, there is no weak symbol. We may need use
__declspec(selectany)
to achieve similar goal.The text was updated successfully, but these errors were encountered: