[PATCH] Add process name to Asan logfile name and report message

Alexey Samsonov vonosmas at gmail.com
Tue Dec 2 17:34:50 PST 2014


>>! In D5724#35, @ygribov wrote:
> Something like this seems to work
>   +#define DEFINE_LINKER_INITIALIZED_OBJECT(type, name) \
>   +  static uptr __ ## name ## _bytes [(sizeof(type) + sizeof(u64) - 1) / sizeof(u64)]; \
>   +  static type & name = reinterpret_cast<type &>(__ ## name ## _bytes[0]);
>   ...
>   -static BlockingMutex binary_name_cache_lock(LINKER_INITIALIZED);
>   +DEFINE_LINKER_INITIALIZED_OBJECT(BlockingMutex, binary_name_cache_lock);
>    static char binary_name_cache_str[kMaxPathLength];
>    static bool binary_name_cache_initialized = false;
> Does this approach make sense?

Can we enforce the correct alignment of the array of uptr's?

http://reviews.llvm.org/D5724






More information about the llvm-commits mailing list