Commit 5b89b0ac authored by Gabriel Marin's avatar Gabriel Marin Committed by Commit Bot

tcmalloc: fixes for the windows addr2line wrapper

Fixes a few small format string bugs and makes the windows library
configuration #defines more friendly for chromium builds.

Based on original CL: https://codereview.chromium.org/2730473002

BUG=724399,b:70905156

Change-Id: If54c6cfc5c508744d2ee18f251677b2456acda72
Reviewed-on: https://chromium-review.googlesource.com/1145626
Commit-Queue: Will Harris <wfh@chromium.org>
Reviewed-by: default avatarAlbert J. Wong <ajwong@chromium.org>
Reviewed-by: default avatarWill Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577948}
parent 25a726dc
...@@ -35,9 +35,17 @@ ...@@ -35,9 +35,17 @@
* c:\websymbols without asking. * c:\websymbols without asking.
*/ */
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#endif
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#endif
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -93,7 +101,7 @@ int main(int argc, char *argv[]) { ...@@ -93,7 +101,7 @@ int main(int argc, char *argv[]) {
if (!SymInitialize(process, NULL, FALSE)) { if (!SymInitialize(process, NULL, FALSE)) {
error = GetLastError(); error = GetLastError();
fprintf(stderr, "SymInitialize returned error : %d\n", error); fprintf(stderr, "SymInitialize returned error : %lu\n", error);
return 1; return 1;
} }
...@@ -107,13 +115,13 @@ int main(int argc, char *argv[]) { ...@@ -107,13 +115,13 @@ int main(int argc, char *argv[]) {
strcat(search, ";" WEBSYM); strcat(search, ";" WEBSYM);
} else { } else {
error = GetLastError(); error = GetLastError();
fprintf(stderr, "SymGetSearchPath returned error : %d\n", error); fprintf(stderr, "SymGetSearchPath returned error : %lu\n", error);
rv = 1; /* An error, but not a fatal one */ rv = 1; /* An error, but not a fatal one */
strcpy(search, WEBSYM); /* Use a default value */ strcpy(search, WEBSYM); /* Use a default value */
} }
if (!SymSetSearchPath(process, search)) { if (!SymSetSearchPath(process, search)) {
error = GetLastError(); error = GetLastError();
fprintf(stderr, "SymSetSearchPath returned error : %d\n", error); fprintf(stderr, "SymSetSearchPath returned error : %lu\n", error);
rv = 1; /* An error, but not a fatal one */ rv = 1; /* An error, but not a fatal one */
} }
...@@ -122,7 +130,7 @@ int main(int argc, char *argv[]) { ...@@ -122,7 +130,7 @@ int main(int argc, char *argv[]) {
if (!module_base) { if (!module_base) {
/* SymLoadModuleEx failed */ /* SymLoadModuleEx failed */
error = GetLastError(); error = GetLastError();
fprintf(stderr, "SymLoadModuleEx returned error : %d for %s\n", fprintf(stderr, "SymLoadModuleEx returned error : %lu for %s\n",
error, filename); error, filename);
SymCleanup(process); SymCleanup(process);
return 1; return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment