chore(natvis): Add natvis files for all used wwlib containers - #3283
chore(natvis): Add natvis files for all used wwlib containers#3283xezon wants to merge 1 commit into
Conversation
Covers VectorClass<T>, DynamicVectorClass<T>, BooleanVectorClass SimpleVecClass<T>, SimpleDynVecClass<T> ShareBufferClass<T> UniqueArrayClass<T> GenericNode, GenericList, Node<T>, List<T>, DataNode<T> SList<T>, SLNode<T> MultiListObjectClass, GenericMultiListClass, MultiListClass<T>, RefMultiListClass<T>, GenericMultiListIterator, MultiListIterator<T>, RefMultiListIterator<T> HashTableClass, HashTableIteratorClass HashTemplateClass<K,V>, HashTemplateIterator<K,V> StringClass WideStringClass MPSCIntrusiveQueue<T>
PR Summary by QodoAdd Visual Studio visualizers for WWLib containers
AI Description
Diagram
High-Level Assessment
Files changed (13)
|
Code Review by Qodo
1. New hash iterators show debugger errors
|
|
| Filename | Overview |
|---|---|
| resources/CMakeLists.txt | Registers all twelve nested WWLib Natvis files using the established MSVC IDE resource pattern. |
| resources/visualstudio/wwlib/vector.natvis | Visualizes fixed, dynamic, and packed-boolean vectors with counts and storage expressions matching their implementations; its new-file prologue lacks the required license. |
| resources/visualstudio/wwlib/listnode.natvis | Adds sentinel-aware visualizers for generic and typed intrusive lists; its new-file prologue lacks the required license. |
| resources/visualstudio/wwlib/multilist.natvis | Adds circular-list, membership, node, and iterator visualizers consistent with the multilist layouts; its new-file prologue lacks the required license. |
| resources/visualstudio/wwlib/hash.natvis | Adds bucket-chain and iterator visualization for the non-template hash table, but omits the required GPL prologue. |
| resources/visualstudio/wwlib/hashtemplate.natvis | Adds sentinel-aware template hash and iterator visualization, but omits the required GPL prologue. |
| resources/visualstudio/wwlib/wwstring.natvis | Visualizes narrow strings and allocation metadata, but reports the raw cached length and omits the required license prologue. |
| resources/visualstudio/wwlib/widestring.natvis | Visualizes wide strings using the shared header layout, but has the same cached-length discrepancy and missing license prologue. |
| resources/visualstudio/wwlib/mpsc_intrusive_queue.natvis | Adds newest-first raw-link traversal consistent with queue publication semantics; its new-file prologue lacks the required license. |
Prompt To Fix All With AI
### Issue 1
resources/visualstudio/wwlib/hash.natvis:1
**Missing GPL license headers**
This new Natvis file starts with the XML declaration and omits the GPL license prologue required for newly created files. The same omission appears in the other eleven new files under `resources/visualstudio/wwlib/`. This repository requirement must be satisfied before merging.
### Issue 2
resources/visualstudio/wwlib/wwstring.natvis:11
**Length display can be wrong**
After a caller writes through a mutable string buffer, the stored header length may remain zero while `Get_Length()` computes the actual length from the terminator. Reading the raw header here therefore shows `[length] = 0` for a valid non-empty string. The equivalent expression in `widestring.natvis` has the same problem; both visualizers should use the class's effective-length behavior.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "chore(natvis): Add natvis files for all ..." | Re-trigger Greptile
This change adds natvis files for all used wwlib containers. It allows to inspect them properly in Visual Studio.
I only looked at
DynamicVectorClassin Visual Studio and it looked fine.Coverage
Twelve new files in a new
resources/visualstudio/wwlib/subfolder, one per WWLib header,matching the existing one-family-per-file naming. The subfolder keeps the WWLib set from
crowding the four existing top-level files and makes the source library each visualizer
belongs to obvious from the path.
vector.natvisVectorClass<T>,DynamicVectorClass<T>,BooleanVectorClasssimplevec.natvisSimpleVecClass<T>,SimpleDynVecClass<T>sharebuf.natvisShareBufferClass<T>uarray.natvisUniqueArrayClass<T>listnode.natvisGenericNode,GenericList,Node<T>,List<T>,DataNode<T>slist.natvisSList<T>,SLNode<T>multilist.natvisMultiListObjectClass,GenericMultiListClass,MultiListClass<T>,RefMultiListClass<T>,GenericMultiListIterator,MultiListIterator<T>,RefMultiListIterator<T>hash.natvisHashTableClass,HashTableIteratorClasshashtemplate.natvisHashTemplateClass<K,V>,HashTemplateIterator<K,V>wwstring.natvisStringClasswidestring.natvisWideStringClassmpsc_intrusive_queue.natvisMPSCIntrusiveQueue<T>Deliberately not covered:
IndexClass(INDEX.h),NTreeClass/NTreeLeafClass,BinaryHeapClass,HashListClass,DoubleNode,Buffer— zero instantiations outsideWWLib, so the rules could not be validated against real data.
hashtab.his entirelyinside
#if 0,search.his a dead duplicate ofINDEX.h, andSTLUtils.hrange/const_rangeare trivial iterator pairs.AI Use
This was a one shot generation with Claude Opus 5. It claimed to have verified all of them with Visual Studio.
wwlib.lib/wwdebug.lib/wwstub.lib, driven headlessly bycdb.exewith.nvload+dx -r2. All 12 files reported "Successfully loaded visualizers", no<error>nodes, and every container's contents matched what the harness wrote —g_dynvec→{ size=3 }10/20/30, the MultiList → 301/302/303, the hash table →alpha/beta,g_string→"hello natvis"length 12.