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

Side by Side Diff: base/debug/debugger_posix.cc

Issue 10834234: [MIPS] Add DEBUG_BREAK() for MIPS architecture. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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 | « no previous file | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "base/debug/debugger.h" 5 #include "base/debug/debugger.h"
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 7
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 volatile int go = 0; \ 215 volatile int go = 0; \
216 while (!go) { \ 216 while (!go) { \
217 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100)); \ 217 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100)); \
218 } \ 218 } \
219 } \ 219 } \
220 } while (0) 220 } while (0)
221 #else 221 #else
222 // ARM && !ANDROID 222 // ARM && !ANDROID
223 #define DEBUG_BREAK() asm("bkpt 0") 223 #define DEBUG_BREAK() asm("bkpt 0")
224 #endif 224 #endif
225 #elif defined(ARCH_CPU_MIPS_FAMILY)
226 #define DEBUG_BREAK() asm("break 2")
225 #else 227 #else
226 #define DEBUG_BREAK() asm("int3") 228 #define DEBUG_BREAK() asm("int3")
227 #endif 229 #endif
228 230
229 void BreakDebugger() { 231 void BreakDebugger() {
230 DEBUG_BREAK(); 232 DEBUG_BREAK();
231 #if defined(OS_ANDROID) && !defined(OFFICIAL_BUILD) 233 #if defined(OS_ANDROID) && !defined(OFFICIAL_BUILD)
232 // For Android development we always build release (debug builds are 234 // For Android development we always build release (debug builds are
233 // unmanageably large), so the unofficial build is used for debugging. It is 235 // unmanageably large), so the unofficial build is used for debugging. It is
234 // helpful to be able to insert BreakDebugger() statements in the source, 236 // helpful to be able to insert BreakDebugger() statements in the source,
235 // attach the debugger, inspect the state of the program and then resume it by 237 // attach the debugger, inspect the state of the program and then resume it by
236 // setting the 'go' variable above. 238 // setting the 'go' variable above.
237 #elif defined(NDEBUG) 239 #elif defined(NDEBUG)
238 // Terminate the program after signaling the debug break. 240 // Terminate the program after signaling the debug break.
239 _exit(1); 241 _exit(1);
240 #endif 242 #endif
241 } 243 }
242 244
243 } // namespace debug 245 } // namespace debug
244 } // namespace base 246 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698