OLD | NEW |
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "log.h" | 45 #include "log.h" |
46 | 46 |
47 #include "../include/v8-debug.h" | 47 #include "../include/v8-debug.h" |
48 | 48 |
49 namespace v8 { | 49 namespace v8 { |
50 namespace internal { | 50 namespace internal { |
51 | 51 |
52 #ifdef ENABLE_DEBUGGER_SUPPORT | 52 #ifdef ENABLE_DEBUGGER_SUPPORT |
53 static void PrintLn(v8::Local<v8::Value> value) { | 53 static void PrintLn(v8::Local<v8::Value> value) { |
54 v8::Local<v8::String> s = value->ToString(); | 54 v8::Local<v8::String> s = value->ToString(); |
55 char* data = NewArray<char>(s->Length() + 1); | 55 ScopedVector<char> data(s->Length() + 1); |
56 if (data == NULL) { | 56 if (data.start() == NULL) { |
57 V8::FatalProcessOutOfMemory("PrintLn"); | 57 V8::FatalProcessOutOfMemory("PrintLn"); |
58 return; | 58 return; |
59 } | 59 } |
60 s->WriteAscii(data); | 60 s->WriteAscii(data.start()); |
61 PrintF("%s\n", data); | 61 PrintF("%s\n", data.start()); |
62 DeleteArray(data); | |
63 } | 62 } |
64 | 63 |
65 | 64 |
66 static Handle<Code> ComputeCallDebugBreak(int argc) { | 65 static Handle<Code> ComputeCallDebugBreak(int argc) { |
67 CALL_HEAP_FUNCTION(StubCache::ComputeCallDebugBreak(argc), Code); | 66 CALL_HEAP_FUNCTION(StubCache::ComputeCallDebugBreak(argc), Code); |
68 } | 67 } |
69 | 68 |
70 | 69 |
71 static Handle<Code> ComputeCallDebugPrepareStepIn(int argc) { | 70 static Handle<Code> ComputeCallDebugPrepareStepIn(int argc) { |
72 CALL_HEAP_FUNCTION(StubCache::ComputeCallDebugPrepareStepIn(argc), Code); | 71 CALL_HEAP_FUNCTION(StubCache::ComputeCallDebugPrepareStepIn(argc), Code); |
(...skipping 2729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2802 { | 2801 { |
2803 Locker locker; | 2802 Locker locker; |
2804 Debugger::CallMessageDispatchHandler(); | 2803 Debugger::CallMessageDispatchHandler(); |
2805 } | 2804 } |
2806 } | 2805 } |
2807 } | 2806 } |
2808 | 2807 |
2809 #endif // ENABLE_DEBUGGER_SUPPORT | 2808 #endif // ENABLE_DEBUGGER_SUPPORT |
2810 | 2809 |
2811 } } // namespace v8::internal | 2810 } } // namespace v8::internal |
OLD | NEW |