OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifdef SK_BUILD_FOR_WIN32 | |
borenet
2013/03/08 23:13:21
Not needed with gyp guard.
| |
9 | |
10 #include "windows.h" | 8 #include "windows.h" |
11 #include "win_dbghelp.h" | 9 #include "win_dbghelp.h" |
12 #include <process.h> | 10 #include <process.h> |
13 #include <string.h> | 11 #include <string.h> |
14 #include <stdlib.h> | 12 #include <stdlib.h> |
15 #include <stdio.h> | 13 #include <stdio.h> |
16 | 14 |
17 // Remove prefix addresses. 18 = 2 * (8 digit hexa + 1 space). | 15 // Remove prefix addresses. 18 = 2 * (8 digit hexa + 1 space). |
18 // e.g. "abcd1234 abcd1234 render_pdf!processInput | 16 // e.g. "abcd1234 abcd1234 render_pdf!processInput |
19 #define CDB_CALLSTACK_PREFIX (18) | 17 #define CDB_CALLSTACK_PREFIX (18) |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 return EXCEPTION_EXECUTE_HANDLER; | 197 return EXCEPTION_EXECUTE_HANDLER; |
200 } | 198 } |
201 | 199 |
202 /** Sets the debugging variables. Input parameter is app location. | 200 /** Sets the debugging variables. Input parameter is app location. |
203 * e.g out\Debug\render_pdfs.exe | 201 * e.g out\Debug\render_pdfs.exe |
204 * This function expects the .pdb file to be in the same directory. | 202 * This function expects the .pdb file to be in the same directory. |
205 */ | 203 */ |
206 void setUpDebuggingFromArgs(const char* vargs0) { | 204 void setUpDebuggingFromArgs(const char* vargs0) { |
207 int i = strlen(vargs0); | 205 int i = strlen(vargs0); |
208 | 206 |
209 if (i >= 4 && stricmp(vargs0 - 4, ".exe") == 0) { | 207 if (i >= 4 && _stricmp(vargs0 - 4, ".exe") == 0) { |
210 // Ignore .exe | 208 // Ignore .exe |
211 i -= 4; | 209 i -= 4; |
212 } | 210 } |
213 | 211 |
214 int pos_period = i; | 212 int pos_period = i; |
215 | 213 |
216 // Find last \ in path - this is Windows! | 214 // Find last \ in path - this is Windows! |
217 while (i >= 0 && vargs0[i] != '\\') { | 215 while (i >= 0 && vargs0[i] != '\\') { |
218 i--; | 216 i--; |
219 } | 217 } |
(...skipping 17 matching lines...) Expand all Loading... | |
237 // cdb.exe is the app used to load the minidump which prints the callstack. | 235 // cdb.exe is the app used to load the minidump which prints the callstack. |
238 char cdbExePath[MAX_PATH]; | 236 char cdbExePath[MAX_PATH]; |
239 #ifdef _WIN64 | 237 #ifdef _WIN64 |
240 sprintf(cdbExePath, "%s\\x64\\cdb.exe", SK_CDB_PATH); | 238 sprintf(cdbExePath, "%s\\x64\\cdb.exe", SK_CDB_PATH); |
241 #else | 239 #else |
242 sprintf(cdbExePath, "%s\\cdb.exe", SK_CDB_PATH); | 240 sprintf(cdbExePath, "%s\\cdb.exe", SK_CDB_PATH); |
243 #endif | 241 #endif |
244 setCdbPath(cdbExePath); | 242 setCdbPath(cdbExePath); |
245 } | 243 } |
246 | 244 |
247 #endif // SK_BUILD_FOR_WIN32 | |
OLD | NEW |