Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/debugger.h" | 5 #include "vm/debugger.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 1885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1896 target_function.end_token_pos()); | 1896 target_function.end_token_pos()); |
| 1897 } | 1897 } |
| 1898 | 1898 |
| 1899 | 1899 |
| 1900 SourceBreakpoint* Debugger::SetBreakpointAtLine(const String& script_url, | 1900 SourceBreakpoint* Debugger::SetBreakpointAtLine(const String& script_url, |
| 1901 intptr_t line_number) { | 1901 intptr_t line_number) { |
| 1902 Library& lib = Library::Handle(isolate_); | 1902 Library& lib = Library::Handle(isolate_); |
| 1903 Script& script = Script::Handle(isolate_); | 1903 Script& script = Script::Handle(isolate_); |
| 1904 const GrowableObjectArray& libs = | 1904 const GrowableObjectArray& libs = |
| 1905 GrowableObjectArray::Handle(isolate_->object_store()->libraries()); | 1905 GrowableObjectArray::Handle(isolate_->object_store()->libraries()); |
| 1906 const GrowableObjectArray& scripts = | |
| 1907 GrowableObjectArray::Handle(GrowableObjectArray::New()); | |
|
siva
2014/09/26 20:02:48
....Handle(isolate_, GrowableObjectArray::New());
hausner
2014/09/26 20:19:12
Done.
| |
| 1906 for (intptr_t i = 0; i < libs.Length(); i++) { | 1908 for (intptr_t i = 0; i < libs.Length(); i++) { |
| 1907 lib ^= libs.At(i); | 1909 lib ^= libs.At(i); |
| 1908 script = lib.LookupScript(script_url); | 1910 script = lib.LookupScript(script_url); |
| 1909 if (!script.IsNull()) { | 1911 if (!script.IsNull()) { |
| 1910 break; | 1912 scripts.Add(script); |
| 1911 } | 1913 } |
| 1912 } | 1914 } |
| 1913 if (script.IsNull()) { | 1915 if (scripts.Length() == 0) { |
| 1914 if (FLAG_verbose_debug) { | 1916 if (FLAG_verbose_debug) { |
| 1915 OS::Print("Failed to find script with url '%s'\n", | 1917 OS::Print("Failed to find script with url '%s'\n", |
| 1916 script_url.ToCString()); | 1918 script_url.ToCString()); |
| 1917 } | 1919 } |
| 1918 return NULL; | 1920 return NULL; |
| 1919 } | 1921 } |
| 1922 if (scripts.Length() > 1) { | |
| 1923 if (FLAG_verbose_debug) { | |
| 1924 OS::Print("Multiple scripts match url '%s'\n", script_url.ToCString()); | |
| 1925 } | |
| 1926 return NULL; | |
| 1927 } | |
| 1928 script ^= scripts.At(0); | |
| 1920 intptr_t first_token_idx, last_token_idx; | 1929 intptr_t first_token_idx, last_token_idx; |
| 1921 script.TokenRangeAtLine(line_number, &first_token_idx, &last_token_idx); | 1930 script.TokenRangeAtLine(line_number, &first_token_idx, &last_token_idx); |
| 1922 if (first_token_idx < 0) { | 1931 if (first_token_idx < 0) { |
| 1923 // Script does not contain the given line number. | 1932 // Script does not contain the given line number. |
| 1924 if (FLAG_verbose_debug) { | 1933 if (FLAG_verbose_debug) { |
| 1925 OS::Print("Script '%s' does not contain line number %" Pd "\n", | 1934 OS::Print("Script '%s' does not contain line number %" Pd "\n", |
| 1926 script_url.ToCString(), line_number); | 1935 script_url.ToCString(), line_number); |
| 1927 } | 1936 } |
| 1928 return NULL; | 1937 return NULL; |
| 1929 } else if (last_token_idx < 0) { | 1938 } else if (last_token_idx < 0) { |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2583 } | 2592 } |
| 2584 | 2593 |
| 2585 | 2594 |
| 2586 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 2595 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 2587 ASSERT(bpt->next() == NULL); | 2596 ASSERT(bpt->next() == NULL); |
| 2588 bpt->set_next(code_breakpoints_); | 2597 bpt->set_next(code_breakpoints_); |
| 2589 code_breakpoints_ = bpt; | 2598 code_breakpoints_ = bpt; |
| 2590 } | 2599 } |
| 2591 | 2600 |
| 2592 } // namespace dart | 2601 } // namespace dart |
| OLD | NEW |