Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to load source for library "bootstrap_impl" #3686

Closed
devoncarew opened this issue Jun 15, 2012 · 4 comments
Closed

unable to load source for library "bootstrap_impl" #3686

devoncarew opened this issue Jun 15, 2012 · 4 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@devoncarew
Copy link
Member

We received the following user feedback:

Running the standlone program in Debug mode resulted in failure to find source code for core library.

foo(u) { u.add(123); }

void main() {
 foo(new List<String>());
}

I was trying to provoke a type error when crossing into corelib.
DartEditor then opened a window named: "GrowableObjectArray.ad()" with the content: Source not found.

Finding the corelib source should be easy.


I tracked this down a bit. The stack frame in question has a source location uri of "bootstrap_impl". Normally this is something like "dart:core" or "dart:coreimpl". In order to get the source, we ask the VM for all loaded libraries, look for a library with the given name, then ask the VM for the source for the library's libraryId.

There isn't any library returned with the name bootstrap_impl. If the wire protocol was changed so that the getSource command took a URI instead of a libraryId, that'd fix the issue. Or if bootstrap_impl was returned in teh list of loaded libraries. I'm not sure if that's the right solution - I don't know if this library should be exposed through the API or not.

@devoncarew
Copy link
Member Author

Issue #3695 has been merged into this issue.

@DartBot
Copy link

DartBot commented Jun 29, 2012

This comment was originally written by @mhausner


The debugger now sends a library id with each frame. The library id for GrowableObjectArray.add is 1, which refers to dart:coreimpl. You can get a list of source URLs for a library with the command getScriptURLs. If you do that for dart:coreimpl, it shows "bootstrap_impl" as the only source URL. With the library id and this URL, you can get the source code.

Be warned though that the source code for the pre-loaded libraries does not look pretty at the moment, because we re-generate the source from the token stream, and we don't know where newlines were in the original source. We will eventually do a better job in recreating the source.

If this does not solve your issue, reassign the bug back to me.

Thanks!


Set owner to @devoncarew.
Added NeedsInfo label.

@devoncarew
Copy link
Member Author

Added Started label.

@devoncarew
Copy link
Member Author

Added Fixed label.

@devoncarew devoncarew added Type-Defect area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. labels Jul 3, 2012
@devoncarew devoncarew self-assigned this Jul 3, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

2 participants