Thursday, May 9, 2013

Lua .natvis

I like Lua.  Sure, it has a few quirks, but it's pretty quick, and integrates nicely with C++.  Plus the source code compiled straight out of the box, even on Visual Studio 2012.

The main problem I ran into with Visual Studio 2012 is that Microsoft completely reworked the system for user formatting of variables, previously done with the autoexp.dat file.  The new system uses .natvis files, which is an XML file that lets you specify how your data is formatted.

Debugging Lua callbacks in C++ can be a bit difficult.  I put together some .natvis definitions for Lua 5.1 and 5.2 that helps to interpret the lua_State type, so you can see what is on the stack, and dig into tables, all from Visual Studio.

Today's anagram is...

Assemblage Team