Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

boost_Containers.natvis

By: KindDragon on Jun 29th, 2013  |  syntax: XML  |  size: 2.36 KB  |  views: 101  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. VS2013 natvis
  2.  
  3. <Type Name="boost::container::deque&lt;*&gt;">
  4.     <DisplayString>{{ size={(sizeof($T1) &lt; 512 ? size_t(512 / sizeof($T1)) : size_t(1)) *
  5.         (members_.m_finish.m_node - members_.m_start.m_node - 1) + (members_.m_finish.m_cur - members_.m_finish.m_first) +
  6.         (members_.m_start.m_last - members_.m_start.m_cur)} }}</DisplayString>
  7.     <Expand>
  8.         <Item Name="[size]" ExcludeView="simple">(sizeof($T1) &lt; 512 ? size_t(512 / sizeof($T1)) : size_t(1)) *
  9.         (members_.m_finish.m_node - members_.m_start.m_node - 1) + (members_.m_finish.m_cur - members_.m_finish.m_first) +
  10.         (members_.m_start.m_last - members_.m_start.m_cur)</Item>
  11.         <Item Name="[buffer_size]" ExcludeView="simple">sizeof($T1) &lt; 512 ? size_t(512 / sizeof($T1)) : size_t(1)</Item>
  12.         <IndexListItems>
  13.             <Size>(sizeof($T1) &lt; 512 ? size_t(512 / sizeof($T1)) : size_t(1)) *
  14.             (members_.m_finish.m_node - members_.m_start.m_node - 1) + (members_.m_finish.m_cur - members_.m_finish.m_first) +
  15.             (members_.m_start.m_last - members_.m_start.m_cur)</Size>
  16.             <ValueNode>members_.m_start.m_node[(($i + (members_.m_start.m_cur - members_.m_start.m_first)) / (sizeof($T1) &lt; 512 ? size_t(512 / sizeof($T1)) : size_t(1)))][($i + (members_.m_start.m_cur - members_.m_start.m_first)) % (sizeof($T1) &lt; 512 ? size_t(512 / sizeof($T1)) : size_t(1))]</ValueNode>
  17.         </IndexListItems>
  18.     </Expand>
  19. </Type>
  20.  
  21. My suggestion:
  22. <Type Name="boost::container::deque&lt;*&gt;">
  23.     <Variable Name="bufferSize">sizeof($T1) &lt; 512 ? size_t(512 / sizeof($T1)) : size_t(1)</Variable>
  24.     <Variable Name="size">$bufferSize *
  25.         (members_.m_finish.m_node - members_.m_start.m_node - 1) + (members_.m_finish.m_cur - members_.m_finish.m_first) +
  26.         (members_.m_start.m_last - members_.m_start.m_cur)</Variable>
  27.  
  28.     <DisplayString>{{ size=$size }}</DisplayString>
  29.     <Expand>
  30.         <Item Name="[size]" ExcludeView="simple">$size</Item>
  31.         <Item Name="[buffer_size]" ExcludeView="simple">$bufferSize</Item>
  32.         <IndexListItems>
  33.             <Size>$size</Size>
  34.             <ValueNode>members_.m_start.m_node[(($i + (members_.m_start.m_cur - members_.m_start.m_first)) / $bufferSize)][($i + (members_.m_start.m_cur - members_.m_start.m_first)) % $bufferSize]</ValueNode>
  35.         </IndexListItems>
  36.     </Expand>
  37. </Type>