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 #include "windows.h" | 8 #include "windows.h" |
9 #include "win_dbghelp.h" | 9 #include "win_dbghelp.h" |
10 #include <process.h> | 10 #include <process.h> |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 } | 195 } |
196 | 196 |
197 return EXCEPTION_EXECUTE_HANDLER; | 197 return EXCEPTION_EXECUTE_HANDLER; |
198 } | 198 } |
199 | 199 |
200 /** Sets the debugging variables. Input parameter is app location. | 200 /** Sets the debugging variables. Input parameter is app location. |
201 * e.g out\Debug\render_pdfs.exe | 201 * e.g out\Debug\render_pdfs.exe |
202 * 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. |
203 */ | 203 */ |
204 void setUpDebuggingFromArgs(const char* vargs0) { | 204 void setUpDebuggingFromArgs(const char* vargs0) { |
205 int i = strlen(vargs0); | 205 size_t i = strlen(vargs0); |
206 | 206 |
207 if (i >= 4 && _stricmp(vargs0 - 4, ".exe") == 0) { | 207 if (i >= 4 && _stricmp(vargs0 - 4, ".exe") == 0) { |
208 // Ignore .exe | 208 // Ignore .exe |
209 i -= 4; | 209 i -= 4; |
210 } | 210 } |
211 | 211 |
212 int pos_period = i; | 212 int pos_period = i; |
213 | 213 |
214 // Find last \ in path - this is Windows! | 214 // Find last \ in path - this is Windows! |
215 while (i >= 0 && vargs0[i] != '\\') { | 215 while (i >= 0 && vargs0[i] != '\\') { |
(...skipping 18 matching lines...) Expand all Loading... |
234 | 234 |
235 // 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. |
236 char cdbExePath[MAX_PATH]; | 236 char cdbExePath[MAX_PATH]; |
237 #ifdef _WIN64 | 237 #ifdef _WIN64 |
238 sprintf(cdbExePath, "%s\\x64\\cdb.exe", SK_CDB_PATH); | 238 sprintf(cdbExePath, "%s\\x64\\cdb.exe", SK_CDB_PATH); |
239 #else | 239 #else |
240 sprintf(cdbExePath, "%s\\cdb.exe", SK_CDB_PATH); | 240 sprintf(cdbExePath, "%s\\cdb.exe", SK_CDB_PATH); |
241 #endif | 241 #endif |
242 setCdbPath(cdbExePath); | 242 setCdbPath(cdbExePath); |
243 } | 243 } |
OLD | NEW |