Browse Source

added natvis file for Visual Studio debugger

Stas Klinov 7 years ago
parent
commit
3454229971
2 changed files with 30 additions and 1 deletions
  1. 25 0
      misc/manticore.natvis
  2. 5 1
      src/CMakeLists.txt

+ 25 - 0
misc/manticore.natvis

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
+
+<Type Name="VecTraits_T&lt;*&gt;">
+    <DisplayString>{{ size={m_iCount} }}</DisplayString>
+    <Expand>
+        <Item Name="[size]">m_iCount</Item>
+        <ArrayItems>
+            <Size>m_iCount</Size>
+            <ValuePointer>m_pData</ValuePointer>
+        </ArrayItems>
+    </Expand>
+</Type>
+
+<Type Name="CSphString">
+    <DisplayString>{m_sValue,s}</DisplayString>
+    <StringView>m_sValue,sb</StringView>
+</Type>
+
+<Type Name="ExtHit_t">
+    <DisplayString>(docid={m_uDocid}, field={m_uHitpos>>24}, pos={m_uHitpos&lt;0x7fffff}, qpos={m_uQuerypos}, hit_raw={m_uHitpos})</DisplayString>
+</Type>    
+
+</AutoVisualizer>

+ 5 - 1
src/CMakeLists.txt

@@ -145,7 +145,11 @@ add_custom_target (
 add_dependencies ( tarball vergen )
 
 # our mega-lib
-add_library ( libsphinx STATIC ${LIBSPHINX_SRCS} ${HEADERS} ${GHEADERS} ${LIBSPHINX_BISON} ${LIBSPHINX_FLEX} ${CHARSET_FILES} ${CHARSET_TEMPLATE} )
+if ( WIN32 )
+	add_library ( libsphinx STATIC ${LIBSPHINX_SRCS} ${HEADERS} ${GHEADERS} ${LIBSPHINX_BISON} ${LIBSPHINX_FLEX} ${CHARSET_FILES} ${CHARSET_TEMPLATE} "../misc/manticore.natvis" )
+else ()
+	add_library ( libsphinx STATIC ${LIBSPHINX_SRCS} ${HEADERS} ${GHEADERS} ${LIBSPHINX_BISON} ${LIBSPHINX_FLEX} ${CHARSET_FILES} ${CHARSET_TEMPLATE} )
+endif()
 add_dependencies ( libsphinx vergen )
 
 # our executables