Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(554)

Side by Side Diff: syzygy/agent/asan/rtl_impl.h

Issue 2576003002: Add the ability to defer the initialization of the SyzyAsan crash reporter. (Closed)
Patch Set: Add comments. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « syzygy/agent/asan/gen/system_interceptors.def ('k') | syzygy/agent/asan/rtl_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 Google Inc. All Rights Reserved. 1 // Copyright 2012 Google Inc. All Rights Reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 // @name Experiment state enumerator, used to expose SyzyASAN experiments to 99 // @name Experiment state enumerator, used to expose SyzyASAN experiments to
100 // the client and from there to e.g. finch. 100 // the client and from there to e.g. finch.
101 // @{ 101 // @{
102 // Called once for each experiment. 102 // Called once for each experiment.
103 // @param experiment_name the name of the experiement. 103 // @param experiment_name the name of the experiement.
104 // @param experiment_group the selected group for this instance of this 104 // @param experiment_group the selected group for this instance of this
105 // experiement. 105 // experiement.
106 typedef void(WINAPI* AsanExperimentCallback)(const char* experiment_name, 106 typedef void(WINAPI* AsanExperimentCallback)(const char* experiment_name,
107 const char* experiment_group); 107 const char* experiment_group);
108 // Calls @p callback once for each experiement this runtime is performing. 108 // Calls @p callback once for each experiment this runtime is performing.
109 // @param callback a function that will be invoked recursively zero or more 109 // @param callback a function that will be invoked recursively zero or more
110 // times to enumerate the experiments and their state. 110 // times to enumerate the experiments and their state.
111 void WINAPI asan_EnumExperiments(AsanExperimentCallback callback); 111 void WINAPI asan_EnumExperiments(AsanExperimentCallback callback);
112 // @} 112 // @}
113 113
114 int asan_CrashForException(EXCEPTION_POINTERS* exception); 114 int asan_CrashForException(EXCEPTION_POINTERS* exception);
115 115
116 // This functions allows to manually initialize the crash reporter used by the
chrisha 2017/01/13 18:16:26 allows manually initializing* and* is* used
Sébastien Marchand 2017/01/13 20:56:02 Done.
117 // runtime.
118 //
119 // It should only be used if the deferred initialization flag has been used by
120 // the instrumented image (via the corresponding environment variable or at
121 // instrumentation time) and should only be called once, trying to initialize
chrisha 2017/01/13 18:16:26 once. Trying to initialize the crash handler a sec
Sébastien Marchand 2017/01/13 20:56:02 Done.
122 // the crash handler will result in a crash of the runtime library.
123 //
124 // Manually controlling the initialization of the crash reporter is useful when
125 // there's no crash reporter available at initialization time (i.e. the
126 // instrumented process hasn't initialized it yet). E.g. the instrumented image
127 // should do something like this (additionally to using the deferred
128 // initialization flag):
chrisha 2017/01/13 18:16:26 In addition to instrumenting with the deferred ini
Sébastien Marchand 2017/01/13 20:56:02 Done.
129 //
130 // InitializeCrashReporter();
131 // typedef VOID(WINAPI* SyzyAsanInitializeCrashHandlerFn)();
132 // HMODULE handle = ::GetModuleHandle(L"syzyasan_rtl.dll");
133 // SyzyAsanInitializeCrashHandlerFn syzyasan_init_crash_handler =
134 // reinterpret_cast<SyzyAsanInitializeCrashHandlerFn>(
135 // ::GetProcAddress(handle, "asan_InitializeCrashHandler"));
136 // syzyasan_init_crash_handler();
137 void WINAPI asan_InitializeCrashReporter();
138
116 } // extern "C" 139 } // extern "C"
117 140
118 #endif // SYZYGY_AGENT_ASAN_RTL_IMPL_H_ 141 #endif // SYZYGY_AGENT_ASAN_RTL_IMPL_H_
OLDNEW
« no previous file with comments | « syzygy/agent/asan/gen/system_interceptors.def ('k') | syzygy/agent/asan/rtl_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698