oneTBB icon indicating copy to clipboard operation
oneTBB copied to clipboard

Add debugger visualization Natvis file for TBB types

Open AnnaKeba opened this issue 3 years ago • 3 comments

The PR adds debugger visualization Natvis file for several TBB types, this makes debugging easier and more visible for developers. Can be used in Microsoft Visual Studio and Visual Studio Code.

Check "Natvis File Location" paragraph to choose the preferred location of the natvis file, after this the debugger will pick it up automatically: https://docs.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects?view=vs-2019#BKMK_natvis_location .

Signed-off-by: Anna Keba [email protected]

Visualizations implemented for the following types:

  • tbb::combinable
  • tbb::enumerable_thread_specific
  • tbb::concurrent_vector
  • tbb::concurrent_unordered_set

Usage examples: 'tbb::combinable' with visualization: TBB_full_combinable

'tbb::combinable' with default view: default_comb_new

'tbb::enumerable_thread_specific' with visualization: thread_good

'tbb::enumerable_thread_specific' with default view: thread_no

'tbb::concurrent_vector' with visualization: vector_good

'tbb::concurrent_vector' with default view: vector_no

'tbb::concurrent_unordered_set' with visualization: set_good

'tbb::concurrent_unordered_set' with default view: st_no

Visualizations for empty objects: comb_empty thread_empty vector_empty set_empty

AnnaKeba avatar Jul 02 '21 17:07 AnnaKeba

Does it integrates to VS automatically or some steps are required?

alexey-katranov avatar Jul 02 '21 17:07 alexey-katranov

Does it integrates to VS automatically or some steps are required?

The debugger will pick it up automatically as long as the file is in one of the locations described in the link, you can choose the preferred option: https://docs.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects?view=vs-2019#BKMK_natvis_location . I've added this into the description as well. @alexey-katranov

AnnaKeba avatar Jul 05 '21 13:07 AnnaKeba

@alexey-katranov @anton-potapov Could you please take a look if you're happy with the changes, answered to your question above.

AnnaKeba avatar Apr 19 '22 10:04 AnnaKeba

@AnnaKeba, Sorry for the late response. Thank you for your contribution! We have looked into the functionality you describe and found that it relies on the internal details of oneTBB classes (field and function names, etc.). These details can change in the future oneTBB releases and make Natvis files outdated. This PR can be merged to oneTBB master but the corresponding Natvis file update in case of some internal details change cannot be guaranteed. Some additional PRs can be required in the future to keep Natvis files up-to-date.

kboyarinov avatar Oct 19 '22 14:10 kboyarinov