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

Side by Side Diff: src/platform-win32.cc

Issue 11522: Change the handling of OS::Abort on Windows to enter the debugger if the proc... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years, 1 month 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 | Annotate | Revision Log
« 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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 30 matching lines...) Expand all
41 #endif 41 #endif
42 #ifndef NOSERVICE 42 #ifndef NOSERVICE
43 #define NOSERVICE 43 #define NOSERVICE
44 #endif 44 #endif
45 #ifndef NOSOUND 45 #ifndef NOSOUND
46 #define NOSOUND 46 #define NOSOUND
47 #endif 47 #endif
48 #ifndef NOMCX 48 #ifndef NOMCX
49 #define NOMCX 49 #define NOMCX
50 #endif 50 #endif
51 // Require Windows 2000 or higher (this is required for the IsDebuggerPresent
52 // function to be present).
53 #ifndef _WIN32_WINNT
54 #define _WIN32_WINNT 0x500
55 #endif
51 56
52 #include <windows.h> 57 #include <windows.h>
53 58
54 #include <mmsystem.h> // For timeGetTime(). 59 #include <mmsystem.h> // For timeGetTime().
55 #include <dbghelp.h> // For SymLoadModule64 and al. 60 #include <dbghelp.h> // For SymLoadModule64 and al.
56 #include <tlhelp32.h> // For Module32First and al. 61 #include <tlhelp32.h> // For Module32First and al.
57 62
58 // These aditional WIN32 includes have to be right here as the #undef's below 63 // These aditional WIN32 includes have to be right here as the #undef's below
59 // makes it impossible to have them elsewhere. 64 // makes it impossible to have them elsewhere.
60 #include <winsock2.h> 65 #include <winsock2.h>
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 USE(length); 779 USE(length);
775 } 780 }
776 781
777 782
778 void OS::Sleep(int milliseconds) { 783 void OS::Sleep(int milliseconds) {
779 ::Sleep(milliseconds); 784 ::Sleep(milliseconds);
780 } 785 }
781 786
782 787
783 void OS::Abort() { 788 void OS::Abort() {
784 // Make the MSVCRT do a silent abort. 789 if (!IsDebuggerPresent()) {
785 _set_abort_behavior(0, _WRITE_ABORT_MSG); 790 // Make the MSVCRT do a silent abort.
786 _set_abort_behavior(0, _CALL_REPORTFAULT); 791 _set_abort_behavior(0, _WRITE_ABORT_MSG);
787 abort(); 792 _set_abort_behavior(0, _CALL_REPORTFAULT);
793 abort();
794 } else {
795 DebugBreak();
796 }
788 } 797 }
789 798
790 799
791 void OS::DebugBreak() { 800 void OS::DebugBreak() {
792 __debugbreak(); 801 __debugbreak();
793 } 802 }
794 803
795 804
796 class Win32MemoryMappedFile : public OS::MemoryMappedFile { 805 class Win32MemoryMappedFile : public OS::MemoryMappedFile {
797 public: 806 public:
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 1575
1567 // Release the thread handles 1576 // Release the thread handles
1568 CloseHandle(data_->sampler_thread_); 1577 CloseHandle(data_->sampler_thread_);
1569 CloseHandle(data_->profiled_thread_); 1578 CloseHandle(data_->profiled_thread_);
1570 } 1579 }
1571 1580
1572 1581
1573 #endif // ENABLE_LOGGING_AND_PROFILING 1582 #endif // ENABLE_LOGGING_AND_PROFILING
1574 1583
1575 } } // namespace v8::internal 1584 } } // namespace v8::internal
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