Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1558)

Unified Diff: runtime/vm/debugger_api_impl_test.cc

Issue 11696005: Improve line info accuracy in debugging (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger_api_impl_test.cc
===================================================================
--- runtime/vm/debugger_api_impl_test.cc (revision 16548)
+++ runtime/vm/debugger_api_impl_test.cc (working copy)
@@ -971,20 +971,24 @@
const String& script_url = String::Handle(String::New(TestCase::url()));
Function& func = Function::Handle();
- // TODO(hausner): Looking up functions from source and line number
- // needs to be refined. We currently dont find "main" on line 7.
- for (int line = 8; line <= 9; line++) {
+ for (int line = 7; line <= 9; line++) {
func = test_lib.LookupFunctionInSource(script_url, line);
EXPECT(!func.IsNull());
EXPECT_STREQ("main", String::Handle(func.name()).ToCString());
}
- func = test_lib.LookupFunctionInSource(script_url, 3);
+ for (int line = 2; line <= 4; line++) {
+ func = test_lib.LookupFunctionInSource(script_url, 3);
+ EXPECT(!func.IsNull());
+ EXPECT_STREQ("foo", String::Handle(func.name()).ToCString());
+ }
+
+ // The VM generates an implicit constructor for class A and
+ // locates it at the token position of the keyword 'class'.
+ func = test_lib.LookupFunctionInSource(script_url, 1);
EXPECT(!func.IsNull());
- EXPECT_STREQ("foo", String::Handle(func.name()).ToCString());
+ EXPECT_STREQ("A.", String::Handle(func.name()).ToCString());
- func = test_lib.LookupFunctionInSource(script_url, 1);
- EXPECT(func.IsNull());
func = test_lib.LookupFunctionInSource(script_url, 6);
EXPECT(func.IsNull());
func = test_lib.LookupFunctionInSource(script_url, 10);
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698