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

The debugger API needs a method to get all the libraries imported by library with a filter parameter to filter on prefix strings #11899

Closed
a-siva opened this issue Jul 18, 2013 · 3 comments
Assignees
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@a-siva
Copy link
Contributor

a-siva commented Jul 18, 2013

Here is the current code for getting imported libraries which match a prefix:

331 void getImportedLibrariesMatchingPrefix(int32_t libraryId, Dart_Handle prefix, V
      ector<std::pair<Dart_Handle, intptr_t> >* libraries)
  332 {
  333 Dart_Handle imports = Dart_GetLibraryImports(libraryId);
  334 ASSERT(!Dart_IsError(imports));
  335 // Unfortunately dart_debugger_api.h adds a trailing dot to import prefixes.
  336 if (!Dart_IsNull(prefix))
  337 prefix = addTrailingDot(prefix);
  338 intptr_t length = 0;
  339 Dart_ListLength(imports, &length);
  340 for (intptr_t i = 0; i < length; i += 2) {
  341 Dart_Handle importPrefix = Dart_ListGetAt(imports, i);
  342 ASSERT(Dart_IsNull(importPrefix) || Dart_IsString(importPrefix));
  343 bool equals = false;
  344 Dart_Handle result = Dart_ObjectEquals(prefix, importPrefix, &equals);
  345 ASSERT(!Dart_IsError(result));
  346 if (equals) {
  347 Dart_Handle importedLibraryIdHandle = Dart_ListGetAt(imports, i + 1)
      ;
  348 ASSERT(Dart_IsInteger(importedLibraryIdHandle));
  349 int64_t importedLibraryId;
  350 Dart_IntegerToInt64(importedLibraryIdHandle, &importedLibraryId);
  351 Dart_Handle libraryURL = Dart_GetLibraryURL(importedLibraryId);
  352 ASSERT(!Dart_IsError(libraryURL));
  353 Dart_Handle library = Dart_LookupLibrary(libraryURL);
  354 ASSERT(Dart_IsLibrary(library));
  355 libraries->append(std::pair<Dart_Handle, intptr_t>(library, imported
      LibraryId));
  356 }
  357 }
  358 }

@a-siva
Copy link
Contributor Author

a-siva commented Sep 18, 2013

Added this to the Later milestone.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@a-siva a-siva self-assigned this Aug 4, 2014
@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed priority-unassigned labels Feb 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants