| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project 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 "src/api.h" | 5 #include "src/api.h" |
| 6 | 6 |
| 7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
| 8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
| 9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
| 10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
| (...skipping 8877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8888 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); | 8888 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| 8889 internal_isolate->stack_guard()->ClearDebugBreak(); | 8889 internal_isolate->stack_guard()->ClearDebugBreak(); |
| 8890 } | 8890 } |
| 8891 | 8891 |
| 8892 | 8892 |
| 8893 bool Debug::CheckDebugBreak(Isolate* isolate) { | 8893 bool Debug::CheckDebugBreak(Isolate* isolate) { |
| 8894 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); | 8894 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| 8895 return internal_isolate->stack_guard()->CheckDebugBreak(); | 8895 return internal_isolate->stack_guard()->CheckDebugBreak(); |
| 8896 } | 8896 } |
| 8897 | 8897 |
| 8898 void Debug::SetMessageHandler(Isolate* isolate, |
| 8899 v8::Debug::MessageHandler handler) {} |
| 8898 | 8900 |
| 8899 void Debug::SetMessageHandler(Isolate* isolate, | 8901 void Debug::SendCommand(Isolate* isolate, const uint16_t* command, int length, |
| 8900 v8::Debug::MessageHandler handler) { | 8902 ClientData* client_data) {} |
| 8901 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | |
| 8902 ENTER_V8(i_isolate); | |
| 8903 i_isolate->debug()->SetMessageHandler(handler); | |
| 8904 } | |
| 8905 | |
| 8906 | |
| 8907 void Debug::SendCommand(Isolate* isolate, | |
| 8908 const uint16_t* command, | |
| 8909 int length, | |
| 8910 ClientData* client_data) { | |
| 8911 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); | |
| 8912 internal_isolate->debug()->EnqueueCommandMessage( | |
| 8913 i::Vector<const uint16_t>(command, length), client_data); | |
| 8914 } | |
| 8915 | |
| 8916 | 8903 |
| 8917 MaybeLocal<Value> Debug::Call(Local<Context> context, | 8904 MaybeLocal<Value> Debug::Call(Local<Context> context, |
| 8918 v8::Local<v8::Function> fun, | 8905 v8::Local<v8::Function> fun, |
| 8919 v8::Local<v8::Value> data) { | 8906 v8::Local<v8::Value> data) { |
| 8920 PREPARE_FOR_EXECUTION(context, Debug, Call, Value); | 8907 PREPARE_FOR_EXECUTION(context, Debug, Call, Value); |
| 8921 i::Handle<i::Object> data_obj; | 8908 i::Handle<i::Object> data_obj; |
| 8922 if (data.IsEmpty()) { | 8909 if (data.IsEmpty()) { |
| 8923 data_obj = isolate->factory()->undefined_value(); | 8910 data_obj = isolate->factory()->undefined_value(); |
| 8924 } else { | 8911 } else { |
| 8925 data_obj = Utils::OpenHandle(*data); | 8912 data_obj = Utils::OpenHandle(*data); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 8946 const int kArgc = 1; | 8933 const int kArgc = 1; |
| 8947 v8::Local<v8::Value> argv[kArgc] = {obj}; | 8934 v8::Local<v8::Value> argv[kArgc] = {obj}; |
| 8948 Local<Value> result; | 8935 Local<Value> result; |
| 8949 has_pending_exception = | 8936 has_pending_exception = |
| 8950 !v8_fun->Call(context, Utils::ToLocal(debug), kArgc, argv) | 8937 !v8_fun->Call(context, Utils::ToLocal(debug), kArgc, argv) |
| 8951 .ToLocal(&result); | 8938 .ToLocal(&result); |
| 8952 RETURN_ON_FAILED_EXECUTION(Value); | 8939 RETURN_ON_FAILED_EXECUTION(Value); |
| 8953 RETURN_ESCAPED(result); | 8940 RETURN_ESCAPED(result); |
| 8954 } | 8941 } |
| 8955 | 8942 |
| 8956 void Debug::ProcessDebugMessages(Isolate* isolate) { | 8943 void Debug::ProcessDebugMessages(Isolate* isolate) {} |
| 8957 reinterpret_cast<i::Isolate*>(isolate)->debug()->ProcessDebugMessages(true); | |
| 8958 } | |
| 8959 | |
| 8960 | 8944 |
| 8961 Local<Context> Debug::GetDebugContext(Isolate* isolate) { | 8945 Local<Context> Debug::GetDebugContext(Isolate* isolate) { |
| 8962 return debug::GetDebugContext(isolate); | 8946 return debug::GetDebugContext(isolate); |
| 8963 } | 8947 } |
| 8964 | 8948 |
| 8965 | 8949 |
| 8966 MaybeLocal<Context> Debug::GetDebuggedContext(Isolate* isolate) { | 8950 MaybeLocal<Context> Debug::GetDebuggedContext(Isolate* isolate) { |
| 8967 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 8951 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| 8968 ENTER_V8(i_isolate); | 8952 ENTER_V8(i_isolate); |
| 8969 if (!i_isolate->debug()->in_debug_scope()) return MaybeLocal<Context>(); | 8953 if (!i_isolate->debug()->in_debug_scope()) return MaybeLocal<Context>(); |
| (...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10021 Address callback_address = | 10005 Address callback_address = |
| 10022 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 10006 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 10023 VMState<EXTERNAL> state(isolate); | 10007 VMState<EXTERNAL> state(isolate); |
| 10024 ExternalCallbackScope call_scope(isolate, callback_address); | 10008 ExternalCallbackScope call_scope(isolate, callback_address); |
| 10025 callback(info); | 10009 callback(info); |
| 10026 } | 10010 } |
| 10027 | 10011 |
| 10028 | 10012 |
| 10029 } // namespace internal | 10013 } // namespace internal |
| 10030 } // namespace v8 | 10014 } // namespace v8 |
| OLD | NEW |