aboutsummaryrefslogtreecommitdiff
path: root/src/tools.c
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2013-11-07 10:34:33 +0100
committerBenoit Germain <bnt.germain@gmail.com>2013-11-07 10:34:33 +0100
commit4c0e2ab502994a659e7905fa23049b197f437024 (patch)
tree325a0c42c45997e55eaf0e1cb1ea5c9cd3bf7841 /src/tools.c
parent15ced800ad7b9e57369d17cdd7676883d938062f (diff)
downloadlanes-4c0e2ab502994a659e7905fa23049b197f437024.tar.gz
lanes-4c0e2ab502994a659e7905fa23049b197f437024.tar.bz2
lanes-4c0e2ab502994a659e7905fa23049b197f437024.zip
Improved some DEBUGSPEW output
Diffstat (limited to 'src/tools.c')
-rw-r--r--src/tools.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tools.c b/src/tools.c
index 8fba8c2..f9b34be 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -1708,15 +1708,17 @@ static void inter_copy_func( lua_State* L2, uint_t L2_cache_i, lua_State* L, uin
1708#endif // LUA_VERSION_NUM 1708#endif // LUA_VERSION_NUM
1709 for( n = 0; (upname = lua_getupvalue( L, i, 1 + n)) != NULL; ++ n) 1709 for( n = 0; (upname = lua_getupvalue( L, i, 1 + n)) != NULL; ++ n)
1710 { // ... _G up[n] 1710 { // ... _G up[n]
1711 DEBUGSPEW_CODE( fprintf( stderr, INDENT_BEGIN "UPNAME[%d]: %s\n" INDENT_END, n, upname)); 1711 DEBUGSPEW_CODE( fprintf( stderr, INDENT_BEGIN "UPNAME[%d]: %s -> " INDENT_END, n, upname));
1712#if LUA_VERSION_NUM == 502 1712#if LUA_VERSION_NUM == 502
1713 if( lua_rawequal( L, -1, -2)) // is the upvalue equal to the global table? 1713 if( lua_rawequal( L, -1, -2)) // is the upvalue equal to the global table?
1714 { 1714 {
1715 DEBUGSPEW_CODE( fprintf( stderr, "pushing destination global scope\n"));
1715 lua_pushglobaltable( L2); // ... {cache} ... function <upvalues> 1716 lua_pushglobaltable( L2); // ... {cache} ... function <upvalues>
1716 } 1717 }
1717 else 1718 else
1718#endif // LUA_VERSION_NUM 1719#endif // LUA_VERSION_NUM
1719 { 1720 {
1721 DEBUGSPEW_CODE( fprintf( stderr, "copying value\n"));
1720 if( !inter_copy_one_( L2, L2_cache_i, L, lua_gettop( L), VT_NORMAL, mode_, upname)) // ... {cache} ... function <upvalues> 1722 if( !inter_copy_one_( L2, L2_cache_i, L, lua_gettop( L), VT_NORMAL, mode_, upname)) // ... {cache} ... function <upvalues>
1721 { 1723 {
1722 luaL_error( L, "Cannot copy upvalue type '%s'", luaL_typename( L, -1)); 1724 luaL_error( L, "Cannot copy upvalue type '%s'", luaL_typename( L, -1));
@@ -1861,7 +1863,7 @@ static bool_t inter_copy_one_( lua_State* L2, uint_t L2_cache_i, lua_State* L, u
1861 { 1863 {
1862 size_t len; 1864 size_t len;
1863 char const* s = lua_tolstring( L, i, &len); 1865 char const* s = lua_tolstring( L, i, &len);
1864 DEBUGSPEW_CODE( if( vt == VT_KEY) fprintf( stderr, INDENT_BEGIN "KEY: %s\n" INDENT_END, s)); 1866 DEBUGSPEW_CODE( if( vt == VT_KEY) fprintf( stderr, INDENT_BEGIN "KEY: '%s'\n" INDENT_END, s));
1865 lua_pushlstring( L2, s, len); 1867 lua_pushlstring( L2, s, len);
1866 } 1868 }
1867 break; 1869 break;
@@ -1906,9 +1908,11 @@ static bool_t inter_copy_one_( lua_State* L2, uint_t L2_cache_i, lua_State* L, u
1906 } 1908 }
1907 { 1909 {
1908 DEBUGSPEW_CODE( fprintf( stderr, INDENT_BEGIN "FUNCTION\n" INDENT_END)); 1910 DEBUGSPEW_CODE( fprintf( stderr, INDENT_BEGIN "FUNCTION\n" INDENT_END));
1911 DEBUGSPEW_CODE( ++ debugspew_indent_depth);
1909 STACK_CHECK( L2); 1912 STACK_CHECK( L2);
1910 push_cached_func( L2, L2_cache_i, L, i, mode_, upName_); 1913 push_cached_func( L2, L2_cache_i, L, i, mode_, upName_);
1911 STACK_END( L2, 1); 1914 STACK_END( L2, 1);
1915 DEBUGSPEW_CODE( -- debugspew_indent_depth);
1912 } 1916 }
1913 break; 1917 break;
1914 1918