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 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1951 v8::Local<v8::Function> fun = | 1951 v8::Local<v8::Function> fun = |
1952 v8::Function::Cast(*api_exec_state->Get(fun_name)); | 1952 v8::Function::Cast(*api_exec_state->Get(fun_name)); |
1953 v8::TryCatch try_catch; | 1953 v8::TryCatch try_catch; |
1954 v8::Local<v8::Object> cmd_processor = | 1954 v8::Local<v8::Object> cmd_processor = |
1955 v8::Object::Cast(*fun->Call(api_exec_state, 0, NULL)); | 1955 v8::Object::Cast(*fun->Call(api_exec_state, 0, NULL)); |
1956 if (try_catch.HasCaught()) { | 1956 if (try_catch.HasCaught()) { |
1957 PrintLn(try_catch.Exception()); | 1957 PrintLn(try_catch.Exception()); |
1958 return; | 1958 return; |
1959 } | 1959 } |
1960 | 1960 |
1961 // Notify the debugger that a debug event has occurred. | 1961 // Notify the debugger that a debug event has occurred unless auto continue is |
| 1962 // active in which case no event is send. |
1962 if (!auto_continue) { | 1963 if (!auto_continue) { |
1963 bool success = SetEventJSONFromEvent(event_data); | 1964 bool success = SetEventJSONFromEvent(event_data); |
1964 if (!success) { | 1965 if (!success) { |
1965 // If failed to notify debugger just continue running. | 1966 // If failed to notify debugger just continue running. |
1966 return; | 1967 return; |
1967 } | 1968 } |
1968 } | 1969 } |
1969 | 1970 |
1970 // Process requests from the debugger. | 1971 // Process requests from the debugger. |
1971 host_running_ = false; | 1972 host_running_ = false; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2044 v8::String::Value val(response); | 2045 v8::String::Value val(response); |
2045 Vector<uint16_t> str(reinterpret_cast<uint16_t*>(*val), | 2046 Vector<uint16_t> str(reinterpret_cast<uint16_t*>(*val), |
2046 response->Length()); | 2047 response->Length()); |
2047 | 2048 |
2048 // Set host_running_ correctly for nested debugger evaluations. | 2049 // Set host_running_ correctly for nested debugger evaluations. |
2049 host_running_ = running; | 2050 host_running_ = running; |
2050 | 2051 |
2051 // Return the result. | 2052 // Return the result. |
2052 SendMessage(str); | 2053 SendMessage(str); |
2053 | 2054 |
2054 // Return from debug event processing is VM should be running. | 2055 // Return from debug event processing if either the VM is put into the |
| 2056 // runnning state (through a continue command) or auto continue is active |
| 2057 // and there are no more commands queued. |
2055 if (running || (auto_continue && !HasCommands())) { | 2058 if (running || (auto_continue && !HasCommands())) { |
2056 return; | 2059 return; |
2057 } | 2060 } |
2058 } | 2061 } |
2059 } | 2062 } |
2060 | 2063 |
2061 | 2064 |
2062 // Puts a command coming from the public API on the queue. Creates | 2065 // Puts a command coming from the public API on the queue. Creates |
2063 // a copy of the command string managed by the debugger. Up to this | 2066 // a copy of the command string managed by the debugger. Up to this |
2064 // point, the command data was managed by the API client. Called | 2067 // point, the command data was managed by the API client. Called |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2168 } | 2171 } |
2169 | 2172 |
2170 | 2173 |
2171 void LockingMessageQueue::Clear() { | 2174 void LockingMessageQueue::Clear() { |
2172 ScopedLock sl(lock_); | 2175 ScopedLock sl(lock_); |
2173 queue_.Clear(); | 2176 queue_.Clear(); |
2174 } | 2177 } |
2175 | 2178 |
2176 | 2179 |
2177 } } // namespace v8::internal | 2180 } } // namespace v8::internal |
OLD | NEW |