OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 6713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6724 | 6724 |
6725 | 6725 |
6726 // Test that debug messages get processed when ProcessDebugMessages is called. | 6726 // Test that debug messages get processed when ProcessDebugMessages is called. |
6727 TEST(Backtrace) { | 6727 TEST(Backtrace) { |
6728 DebugLocalContext env; | 6728 DebugLocalContext env; |
6729 v8::Isolate* isolate = env->GetIsolate(); | 6729 v8::Isolate* isolate = env->GetIsolate(); |
6730 v8::HandleScope scope(isolate); | 6730 v8::HandleScope scope(isolate); |
6731 | 6731 |
6732 v8::Debug::SetMessageHandler(BacktraceData::MessageHandler); | 6732 v8::Debug::SetMessageHandler(BacktraceData::MessageHandler); |
6733 | 6733 |
6734 // TODO(3995): This doesn't work with --always-opt because we don't have | 6734 // TODO(mstarzinger): This doesn't work with --always-opt because we don't |
6735 // correct source positions in optimized code. Enable once we have. | 6735 // have correct source positions in optimized code. Enable once we have. |
6736 i::FLAG_always_opt = false; | 6736 i::FLAG_always_opt = false; |
6737 | 6737 |
6738 const int kBufferSize = 1000; | 6738 const int kBufferSize = 1000; |
6739 uint16_t buffer[kBufferSize]; | 6739 uint16_t buffer[kBufferSize]; |
6740 const char* scripts_command = | 6740 const char* scripts_command = |
6741 "{\"seq\":0," | 6741 "{\"seq\":0," |
6742 "\"type\":\"request\"," | 6742 "\"type\":\"request\"," |
6743 "\"command\":\"backtrace\"}"; | 6743 "\"command\":\"backtrace\"}"; |
6744 | 6744 |
6745 // Check backtrace from ProcessDebugMessages. | 6745 // Check backtrace from ProcessDebugMessages. |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7589 "let y = 2; \n" | 7589 "let y = 2; \n" |
7590 "debugger; \n" | 7590 "debugger; \n" |
7591 "x * y", | 7591 "x * y", |
7592 30); | 7592 30); |
7593 ExpectInt32( | 7593 ExpectInt32( |
7594 "x = 1; y = 2; \n" | 7594 "x = 1; y = 2; \n" |
7595 "debugger;" | 7595 "debugger;" |
7596 "x * y", | 7596 "x * y", |
7597 30); | 7597 30); |
7598 } | 7598 } |
OLD | NEW |