forked from OSchip/llvm-project
Pass --default-arch flag to external symbolizer. Fix line lengths.
llvm-svn: 185144
This commit is contained in:
parent
601beb7afd
commit
28e68f9f2f
|
@ -1278,7 +1278,8 @@ INTERCEPTOR(__sanitizer_dirent *, readdir, void *dirp) {
|
|||
return res;
|
||||
}
|
||||
|
||||
INTERCEPTOR(int, readdir_r, void *dirp, __sanitizer_dirent *entry, __sanitizer_dirent **result) {
|
||||
INTERCEPTOR(int, readdir_r, void *dirp, __sanitizer_dirent *entry,
|
||||
__sanitizer_dirent **result) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_ENTER(ctx, readdir_r, dirp, entry, result);
|
||||
int res = REAL(readdir_r)(dirp, entry, result);
|
||||
|
@ -1308,7 +1309,8 @@ INTERCEPTOR(__sanitizer_dirent64 *, readdir64, void *dirp) {
|
|||
return res;
|
||||
}
|
||||
|
||||
INTERCEPTOR(int, readdir64_r, void *dirp, __sanitizer_dirent64 *entry, __sanitizer_dirent64 **result) {
|
||||
INTERCEPTOR(int, readdir64_r, void *dirp, __sanitizer_dirent64 *entry,
|
||||
__sanitizer_dirent64 **result) {
|
||||
void *ctx;
|
||||
COMMON_INTERCEPTOR_ENTER(ctx, readdir64_r, dirp, entry, result);
|
||||
int res = REAL(readdir64_r)(dirp, entry, result);
|
||||
|
|
|
@ -24,6 +24,14 @@
|
|||
|
||||
namespace __sanitizer {
|
||||
|
||||
#if defined(__x86_64__)
|
||||
static const char* const kSymbolizerArch = "--default-arch=x86_64";
|
||||
#elif defined(__i386__)
|
||||
static const char* const kSymbolizerArch = "--default-arch=i386";
|
||||
#else
|
||||
static const char* const kSymbolizerArch = "";
|
||||
#endif
|
||||
|
||||
bool StartSymbolizerSubprocess(const char *path_to_symbolizer,
|
||||
int *input_fd, int *output_fd) {
|
||||
if (!FileExists(path_to_symbolizer)) {
|
||||
|
@ -88,7 +96,7 @@ bool StartSymbolizerSubprocess(const char *path_to_symbolizer,
|
|||
internal_close(infd[1]);
|
||||
for (int fd = getdtablesize(); fd > 2; fd--)
|
||||
internal_close(fd);
|
||||
execl(path_to_symbolizer, path_to_symbolizer, (char*)0);
|
||||
execl(path_to_symbolizer, path_to_symbolizer, kSymbolizerArch, (char*)0);
|
||||
internal__exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue