Skip to content

Conversation

@viable-alternative
Copy link
Contributor

natvis for Visual Studio. (Requires PR#134 to compile)

  • Open test/natvis/natvis_demo.sln with visual studio 2022
  • Set breakpoint on line 51 of main.cpp and see how the maps look in the debugger.

(Screenshots attached)
2025-03-30 22_54_50-natvis_demo (Debugging) - Microsoft Visual Studio
2025-03-30 22_58_21-natvis_demo (Debugging) - Microsoft Visual Studio
2025-03-30 22_55_49-natvis_demo (Debugging) - Microsoft Visual Studio
2025-03-30 22_57_09-natvis_demo (Debugging) - Microsoft Visual Studio

@martinus
Copy link
Owner

martinus commented Oct 6, 2025

Hi, I unfortunately can't properly review this because I don't have windows. I ran it through an Claude 4.5, and it found these issues:

🐛 Critical Bug Found
Line 76 in unordered_dense.natvis - There's an index bug in the segmented_map visualizer:

<Item Name="[{idx1*m_values.num_elements_in_block + idx2}] ({idx1}x{idx2}) {m_values.m_blocks[idx1][idx2].first}">m_values.m_blocks[0][idx2].second</Item>

The value part uses m_values.m_blocks[0][idx2] but it should use m_values.m_blocks[idx1][idx2] to match the key part. Currently, it always shows values from block 0, which would display incorrect values for elements in blocks 1+.

The same issue exists in line 34 for segmented_set


Before I can merge this, is can you remove the hardcoded versions in the file? If not then you need to update the lint-version.py file to detect these, so they are not forgotten when updating the version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants