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

Implement debugger intrinsic __findnonnull #130

Closed
werat opened this issue May 21, 2021 · 0 comments · Fixed by #151
Closed

Implement debugger intrinsic __findnonnull #130

werat opened this issue May 21, 2021 · 0 comments · Fixed by #151
Labels
enhancement New feature or request

Comments

@werat
Copy link
Member

werat commented May 21, 2021

__findnonnull is an important intrinsic used by NatVis in the CustomListItems element -- https://docs.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects?view=vs-2019#customlistitems-expansion

I couldn't find any documentation for it, but empirically it looks like this:

template <typename T>
int __findnonnull(T** ptr, int64_t size) {
  if (size < 0 || size > 100000000) {
    error("Passing in a buffer size that is negative or in excess of 100 million to __findnonnull() is not allowed.");
  }
  for (int i = 0; i < size; ++ i) {
    if (ptr[i] != nullptr) {
      return i;
    }
  }
  return -1;
}
@werat werat added the enhancement New feature or request label May 21, 2021
werat added a commit that referenced this issue Jul 8, 2021
`__findnonnull` is often used in NatVis for visualizing complex data structures like hash tables. Implement it in a similar way as the native Visual Studio debugger.

Fixes #130
@werat werat closed this as completed in #151 Jul 9, 2021
werat added a commit that referenced this issue Jul 9, 2021
`__findnonnull` is often used in NatVis for visualizing complex data structures like hash tables. Implement it in a similar way as the native Visual Studio debugger.

Fixes #130
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant