Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Side by Side Diff: base/debug_on_start.h

Issue 270062: Use ASCII strings for switch names. (Closed)
Patch Set: victory Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/command_line_unittest.cc ('k') | base/debug_on_start.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Define the necessary code and global data to look for kDebugOnStart command 5 // Define the necessary code and global data to look for kDebugOnStart command
6 // line argument. When the command line argument is detected, it invokes the 6 // line argument. When the command line argument is detected, it invokes the
7 // debugger, if no system-wide debugger is registered, a debug break is done. 7 // debugger, if no system-wide debugger is registered, a debug break is done.
8 8
9 #ifndef BASE_DEBUG_ON_START_H_ 9 #ifndef BASE_DEBUG_ON_START_H_
10 #define BASE_DEBUG_ON_START_H_ 10 #define BASE_DEBUG_ON_START_H_
(...skipping 13 matching lines...) Expand all
24 // Expected function type in the .CRT$XI* section. 24 // Expected function type in the .CRT$XI* section.
25 // Note: See VC\crt\src\internal.h for reference. 25 // Note: See VC\crt\src\internal.h for reference.
26 typedef int (__cdecl *PIFV)(void); 26 typedef int (__cdecl *PIFV)(void);
27 27
28 // Looks at the command line for kDebugOnStart argument. If found, it invokes 28 // Looks at the command line for kDebugOnStart argument. If found, it invokes
29 // the debugger, if this fails, it crashes. 29 // the debugger, if this fails, it crashes.
30 static int __cdecl Init(); 30 static int __cdecl Init();
31 31
32 // Returns true if the 'argument' is present in the 'command_line'. It does 32 // Returns true if the 'argument' is present in the 'command_line'. It does
33 // not use the CRT, only Kernel32 functions. 33 // not use the CRT, only Kernel32 functions.
34 static bool FindArgument(wchar_t* command_line, const wchar_t* argument); 34 static bool FindArgument(wchar_t* command_line, const char* argument);
35 }; 35 };
36 36
37 // Set the function pointer to our function to look for a crash on start. The 37 // Set the function pointer to our function to look for a crash on start. The
38 // XIB section is started pretty early in the program initialization so in 38 // XIB section is started pretty early in the program initialization so in
39 // theory it should be called before any user created global variable 39 // theory it should be called before any user created global variable
40 // initialization code and CRT initialization code. 40 // initialization code and CRT initialization code.
41 // Note: See VC\crt\src\defsects.inc and VC\crt\src\crt0.c for reference. 41 // Note: See VC\crt\src\defsects.inc and VC\crt\src\crt0.c for reference.
42 #ifdef _WIN64 42 #ifdef _WIN64
43 43
44 // "Fix" the segment. On x64, the .CRT segment is merged into the .rdata segment 44 // "Fix" the segment. On x64, the .CRT segment is merged into the .rdata segment
(...skipping 13 matching lines...) Expand all
58 #pragma data_seg(push, ".CRT$XIB") 58 #pragma data_seg(push, ".CRT$XIB")
59 // Declare the pointer so the CRT will find it. 59 // Declare the pointer so the CRT will find it.
60 DECLSPEC_SELECTANY DebugOnStart::PIFV debug_on_start = &DebugOnStart::Init; 60 DECLSPEC_SELECTANY DebugOnStart::PIFV debug_on_start = &DebugOnStart::Init;
61 // Fix back the segment. 61 // Fix back the segment.
62 #pragma data_seg(pop) 62 #pragma data_seg(pop)
63 63
64 #endif // _WIN64 64 #endif // _WIN64
65 #endif // defined(OS_WIN) 65 #endif // defined(OS_WIN)
66 66
67 #endif // BASE_DEBUG_ON_START_H_ 67 #endif // BASE_DEBUG_ON_START_H_
OLDNEW
« no previous file with comments | « base/command_line_unittest.cc ('k') | base/debug_on_start.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698