VS2012以上版本 C++环境查看 lua5.1 栈/Global/Registry的可视化器
来源:互联网 发布:服装营销数据分析 编辑:程序博客网 时间:2024/06/07 10:24
<pre class="html" name="code"><?xml version="1.0" encoding="utf-8"?> <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> <Type Name="lua_State"> <DisplayString>lua_State</DisplayString> <Expand> <Item Name="[stack size]">top-base</Item> <IndexListItems> <Size>top-base</Size> <ValueNode>base[$i]</ValueNode> </IndexListItems> <Item Name="[globals]">l_gt</Item> <Item Name="[registry]">l_G->l_registry</Item> <Item Name="[call]" Condition="ci->func->tt!=0">ci->func</Item> <IndexListItems> <Size>ci - base_ci-1</Size> <ValueNode>base_ci[$i+1].func</ValueNode> </IndexListItems> </Expand> </Type> <Type Name="Node"> <DisplayString>{i_key} 〓 {i_val}</DisplayString> <Expand><Item Name="[key]" Condition="i_key.tvk.tt==5">i_key.tvk</Item> <Item Name="[val]">i_val</Item><ExpandedItem Condition="i_key.tvk.tt!=5 && i_val.tt==5">i_val</ExpandedItem> </Expand> </Type> <Type Name="lua_Node"> <DisplayString Condition="i_val.tt==0">{i_key} ×</DisplayString> <DisplayString>{i_key} 〓 {i_val}</DisplayString> <Expand> <Item Name="[key]" Condition="i_key.tvk.tt==5">i_key.tvk</Item> <Item Name="[val]" Condition="i_key.tvk.tt==5">i_val</Item> <ExpandedItem Condition="i_key.tvk.tt!=5 && i_val.tt==5">i_val</ExpandedItem> </Expand> </Type> <Type Name="lua_TValue"> <DisplayString Condition="tt==0">NIL</DisplayString> <DisplayString Condition="tt==1">{(bool)value.b}</DisplayString> <DisplayString Condition="tt==2">{value.p} lightuserdata</DisplayString> <DisplayString Condition="tt==3">number={value.n}</DisplayString> <DisplayString Condition="tt==4">{value.gc->ts}</DisplayString> <DisplayString Condition="tt==5">{value.gc->h}</DisplayString> <DisplayString Condition="tt==6">{value.gc->cl}</DisplayString> <DisplayString Condition="tt==7">{value.gc->u}</DisplayString> <DisplayString Condition="tt==8">thread {value.gc->th}</DisplayString> <DisplayString>empty</DisplayString> <Expand> <Item Name="[lightuserdata]" Condition="tt==2">(const char *)value.p</Item> <Item Name="[function]" Condition="tt==6">value.gc->cl</Item> <Item Name="[userdata]" Condition="tt==7">value.gc->u</Item> <Item Name="[thread]" Condition="tt==8">value.gc->th</Item><ExpandedItem Condition="tt==5">value.gc->h</ExpandedItem><Item Name="[原始视图table]" Condition="tt==5">value.gc->h</Item> </Expand> </Type> <Type Name="Udata"> <DisplayString>userdata</DisplayString> </Type> <Type Name="CClosure"> <DisplayString>C++ function {f}</DisplayString> </Type> <Type Name="LClosure"> <DisplayString>Lua function {*p->source} : line {*p->lineinfo, d}</DisplayString> </Type> <Type Name="Closure"> <DisplayString Condition="c.isC">{c}</DisplayString> <DisplayString Condition="!c.isC">{l}</DisplayString> </Type> <Type Name="Table"> <DisplayString>Table 数组元素个数:{sizearray,d}, 哈希元素空间:{1<<lsizenode,d}</DisplayString> <Expand> <Item Name="metatable元表" Condition="metatable!=0">metatable</Item> <IndexListItems> <Size>sizearray</Size> <ValueNode>array[$i]</ValueNode> </IndexListItems><Item Name="■数组哈希分割线■" Condition="sizearray!=0">0</Item> <IndexListItems> <Size>1<<lsizenode</Size> <ValueNode>node[$i]</ValueNode> </IndexListItems> </Expand> </Type> <Type Name="TString"> <DisplayString>{(const char *)(&tsv+sizeof(*this)/sizeof(tsv)),s8}</DisplayString> <StringView>(const char *)(&tsv+sizeof(*this)/sizeof(tsv)),s8</StringView> </Type> <Type Name="TKey"> <DisplayString>{tvk}</DisplayString> </Type> <Type Name="ZLua::LuaLocalRef"><DisplayString>{L->base[m_stackIndex-1]}</DisplayString> <Expand> <Item Name="StackIndex">m_stackIndex</Item><ExpandedItem >L->base[m_stackIndex-1]</ExpandedItem></Expand> </Type> <Type Name="ZLua::LuaLocalTableRef"><DisplayString>{L->base[m_stackIndex-1]}</DisplayString> <Expand> <Item Name="StackIndex">m_stackIndex</Item><ExpandedItem >L->base[m_stackIndex-1]</ExpandedItem></Expand> </Type> <Type Name="ZLua::LuaRegistryRef"><DisplayString>{L->l_G->l_registry.value.gc->h.array[m_ref-1]}</DisplayString> <Expand> <Item Name="Table">L->l_G->l_registry.value.gc->h.array[m_ref-1]</Item> </Expand> </Type> <Type Name="ZLua::LuaDependencyPropertyTable"><DisplayString>{L->l_G->l_registry.value.gc->h.array[m_tableRef-1].value.gc->h}</DisplayString> <Expand> <Item Name="Table">L->l_G->l_registry.value.gc->h.array[m_tableRef-1].value.gc->h</Item> </Expand> </Type></AutoVisualizer>
将上述代码保存为lua.natvis,放入Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Packages\Debugger\Visualizers(你的地址也许不同,可以尝试搜索硬盘stl.natvis)或者C:\Users\用户名\Documents\Visual Studio 2013\Visualizers\
请注意是找到文件夹,不要自己创建。
然后在vs c++环境下,选项要关闭 选项-编辑并继续 功能(这两功能不兼容……)
这样你就也许可以在c++代码中查看lua_State变量了,可以展开查看Registry注册表或全局表
失败的话,你也许要在lua.h后面加载lstate.h文件
(以上配置文件仅支持5.1,若需要5.2请自行翻墙访问http://blog.basemetalgames.com/2013/05/lua-natvis.html)
0 0
- VS2012以上版本 C++环境查看 lua5.1 栈/Global/Registry的可视化器
- 在lua5.2.3的环境下,vs2012生成c的dll程序块供lua调用
- windows环境下用vs2012实现lua5.3.1的编译
- Cocos2d-x+Lua5.3.3+Vs2012运行环境
- DirectX 在VS2012及以上版本的配置
- LocalDB简介和在VS2012及以上版本的使用
- lua5.1 + c + linux
- VS2012及以上版本制作安装程序
- VS2012及以上版本中,禁用_s版本函数的方法
- VS2012配置Lua5.3.1
- VS2012编译Lua5.3.1
- 适用于android 4.0以上版本的子线程网络图片查看器
- 在SQL Server2005以上版本中查看数据表的信息
- lua5.1.4版本的变量中文支持
- Vs2012 编译配置 Lua5.2.3
- 【深度学习】笔记1_Ubuntu14.04下caffe环境的搭建,无GPU版本以及python可视化环境的配置
- Lua5.1的常用API
- SqlServer2005以上版本查看死锁管理
- Intent的应用(初识intent)
- 解决Xcode 6 beta 编译Cocos2d-x iOS项目失败
- 集成速达移动106短信接口的短信验证码实现
- 『常识』面向对象编程思想
- PHP 工厂模式
- VS2012以上版本 C++环境查看 lua5.1 栈/Global/Registry的可视化器
- i++和++i的区别--后缀运算符效率研究
- opengl 光照闪烁
- POJ 2503 解题报告
- opencv 搜索图像
- session 一级缓存和sessionFactory 二级缓存
- spring配置事务的5种方式
- 基于二叉搜索树的map的c++实现
- 为何与0xff进行与运算