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

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

Issue 2576003002: Add the ability to defer the initialization of the SyzyAsan crash reporter. (Closed)
Patch Set: Add an entry point to reinitialize the crash reporter. Created 4 years 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
OLDNEW
1 // Copyright 2013 Google Inc. All Rights Reserved. 1 // Copyright 2013 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 F(WINAPI, BOOL, ReadFile, \ 220 F(WINAPI, BOOL, ReadFile, \
221 (HANDLE file_handle, LPVOID buffer, DWORD bytes_to_read, \ 221 (HANDLE file_handle, LPVOID buffer, DWORD bytes_to_read, \
222 LPDWORD bytes_read, LPOVERLAPPED overlapped), \ 222 LPDWORD bytes_read, LPOVERLAPPED overlapped), \
223 (file_handle, buffer, bytes_to_read, bytes_read, overlapped)) \ 223 (file_handle, buffer, bytes_to_read, bytes_read, overlapped)) \
224 F(WINAPI, BOOL, WriteFile, \ 224 F(WINAPI, BOOL, WriteFile, \
225 (HANDLE file_handle, LPCVOID buffer, DWORD bytes_to_write, \ 225 (HANDLE file_handle, LPCVOID buffer, DWORD bytes_to_write, \
226 LPDWORD bytes_written, LPOVERLAPPED overlapped), \ 226 LPDWORD bytes_written, LPOVERLAPPED overlapped), \
227 (file_handle, buffer, bytes_to_write, bytes_written, overlapped)) \ 227 (file_handle, buffer, bytes_to_write, bytes_written, overlapped)) \
228 F(_cdecl, void, SetInterceptorCallback, (void (*callback)()), (callback)) \ 228 F(_cdecl, void, SetInterceptorCallback, (void (*callback)()), (callback)) \
229 F(WINAPI, agent::asan::AsanRuntime*, GetActiveRuntime, (), ()) \ 229 F(WINAPI, agent::asan::AsanRuntime*, GetActiveRuntime, (), ()) \
230 F(WINAPI, void, ReinitializeCrashHandler, (), ()) \
230 F(WINAPI, void, SetAllocationFilterFlag, (), ()) \ 231 F(WINAPI, void, SetAllocationFilterFlag, (), ()) \
231 F(WINAPI, void, ClearAllocationFilterFlag, (), ()) 232 F(WINAPI, void, ClearAllocationFilterFlag, (), ())
232 #else 233 #else
233 // A copy of the previous block minus {Set,Clear}AllocationFilterFlag functions, 234 // A copy of the previous block minus {Set,Clear}AllocationFilterFlag functions,
234 // as they're not implemented on win64. 235 // as they're not implemented on win64.
235 // TODO: remove this once {Set,Clear}AllocationFilterFlag are implemented. 236 // TODO: remove this once {Set,Clear}AllocationFilterFlag are implemented.
236 #define ASAN_RTL_FUNCTIONS(F) \ 237 #define ASAN_RTL_FUNCTIONS(F) \
237 F(WINAPI, HANDLE, GetProcessHeap, (), ()) \ 238 F(WINAPI, HANDLE, GetProcessHeap, (), ()) \
238 F(WINAPI, HANDLE, HeapCreate, \ 239 F(WINAPI, HANDLE, HeapCreate, \
239 (DWORD options, SIZE_T initial_size, SIZE_T maximum_size), \ 240 (DWORD options, SIZE_T initial_size, SIZE_T maximum_size), \
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 (destination, source, num)) \ 310 (destination, source, num)) \
310 F(WINAPI, BOOL, ReadFile, \ 311 F(WINAPI, BOOL, ReadFile, \
311 (HANDLE file_handle, LPVOID buffer, DWORD bytes_to_read, \ 312 (HANDLE file_handle, LPVOID buffer, DWORD bytes_to_read, \
312 LPDWORD bytes_read, LPOVERLAPPED overlapped), \ 313 LPDWORD bytes_read, LPOVERLAPPED overlapped), \
313 (file_handle, buffer, bytes_to_read, bytes_read, overlapped)) \ 314 (file_handle, buffer, bytes_to_read, bytes_read, overlapped)) \
314 F(WINAPI, BOOL, WriteFile, \ 315 F(WINAPI, BOOL, WriteFile, \
315 (HANDLE file_handle, LPCVOID buffer, DWORD bytes_to_write, \ 316 (HANDLE file_handle, LPCVOID buffer, DWORD bytes_to_write, \
316 LPDWORD bytes_written, LPOVERLAPPED overlapped), \ 317 LPDWORD bytes_written, LPOVERLAPPED overlapped), \
317 (file_handle, buffer, bytes_to_write, bytes_written, overlapped)) \ 318 (file_handle, buffer, bytes_to_write, bytes_written, overlapped)) \
318 F(_cdecl, void, SetInterceptorCallback, (void (*callback)()), (callback)) \ 319 F(_cdecl, void, SetInterceptorCallback, (void (*callback)()), (callback)) \
319 F(WINAPI, agent::asan::AsanRuntime*, GetActiveRuntime, (), ()) 320 F(WINAPI, agent::asan::AsanRuntime*, GetActiveRuntime, (), ()) \
321 F(WINAPI, void, ReinitializeCrashHandler, (), ())
320 #endif 322 #endif
321 323
322 // Declare pointer types for the intercepted functions. 324 // Declare pointer types for the intercepted functions.
323 #define DECLARE_ASAN_FUNCTION_PTR(convention, ret, name, args, argnames) \ 325 #define DECLARE_ASAN_FUNCTION_PTR(convention, ret, name, args, argnames) \
324 typedef ret (convention* name##FunctionPtr)args; 326 typedef ret (convention* name##FunctionPtr)args;
325 ASAN_RTL_FUNCTIONS(DECLARE_ASAN_FUNCTION_PTR) 327 ASAN_RTL_FUNCTIONS(DECLARE_ASAN_FUNCTION_PTR)
326 #undef DECLARE_ASAN_FUNCTION_PTR 328 #undef DECLARE_ASAN_FUNCTION_PTR
327 329
328 class TestAsanRtl : public testing::TestWithAsanLogger { 330 class TestAsanRtl : public testing::TestWithAsanLogger {
329 public: 331 public:
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 void ClearIntersection(const void* addr, size_t size); 946 void ClearIntersection(const void* addr, size_t size);
945 947
946 // An alternative view of shadow memory. Accessible regions are not 948 // An alternative view of shadow memory. Accessible regions are not
947 // displayed. Neighboring regions of the same type are merged. 949 // displayed. Neighboring regions of the same type are merged.
948 ShadowAddressSpace shadow_address_space_; 950 ShadowAddressSpace shadow_address_space_;
949 }; 951 };
950 952
951 } // namespace testing 953 } // namespace testing
952 954
953 #endif // SYZYGY_AGENT_ASAN_UNITTEST_UTIL_H_ 955 #endif // SYZYGY_AGENT_ASAN_UNITTEST_UTIL_H_
OLDNEW
« syzygy/agent/asan/rtl_impl_unittest.cc ('K') | « syzygy/agent/asan/syzyasan_rtl.def.template ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698