The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros | Functions
ldebug.cpp File Reference
#include <stdarg.h>
#include <stddef.h>
#include <string.h>
#include "lua.h"
#include "lapi.h"
#include "lcode.h"
#include "ldebug.h"
#include "ldo.h"
#include "lfunc.h"
#include "lobject.h"
#include "lopcodes.h"
#include "lstate.h"
#include "lstring.h"
#include "ltable.h"
#include "ltm.h"
#include "lvm.h"
Include dependency graph for ldebug.cpp:

Go to the source code of this file.

Macros

#define ldebug_c
 
#define LUA_CORE
 
#define noLuaClosure(f)   ((f) == NULL || (f)->c.tt == LUA_TCCL)
 

Functions

static const char * getfuncname (lua_State *L, CallInfo *ci, const char **name)
 
static int currentpc (CallInfo *ci)
 
static int currentline (CallInfo *ci)
 
LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count)
 
LUA_API lua_Hook lua_gethook (lua_State *L)
 
LUA_API int lua_gethookmask (lua_State *L)
 
LUA_API int lua_gethookcount (lua_State *L)
 
LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar)
 
static const char * upvalname (Proto *p, int uv)
 
static const char * findvararg (CallInfo *ci, int n, StkId *pos)
 
static const char * findlocal (lua_State *L, CallInfo *ci, int n, StkId *pos)
 
LUA_API const char * lua_getlocal (lua_State *L, const lua_Debug *ar, int n)
 
LUA_API const char * lua_setlocal (lua_State *L, const lua_Debug *ar, int n)
 
static void funcinfo (lua_Debug *ar, Closure *cl)
 
static void collectvalidlines (lua_State *L, Closure *f)
 
static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, Closure *f, CallInfo *ci)
 
LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar)
 
static const char * getobjname (Proto *p, int lastpc, int reg, const char **name)
 
static void kname (Proto *p, int pc, int c, const char **name)
 
static int filterpc (int pc, int jmptarget)
 
static int findsetreg (Proto *p, int lastpc, int reg)
 
static int isinstack (CallInfo *ci, const TValue *o)
 
static const char * getupvalname (CallInfo *ci, const TValue *o, const char **name)
 
l_noret luaG_typeerror (lua_State *L, const TValue *o, const char *op)
 
l_noret luaG_concaterror (lua_State *L, StkId p1, StkId p2)
 
l_noret luaG_aritherror (lua_State *L, const TValue *p1, const TValue *p2)
 
l_noret luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2)
 
static void addinfo (lua_State *L, const char *msg)
 
l_noret luaG_errormsg (lua_State *L)
 
l_noret luaG_runerror (lua_State *L, const char *fmt,...)
 

Macro Definition Documentation

#define ldebug_c

Definition at line 12 of file ldebug.cpp.

#define LUA_CORE

Definition at line 13 of file ldebug.cpp.

#define noLuaClosure (   f)    ((f) == NULL || (f)->c.tt == LUA_TCCL)

Definition at line 32 of file ldebug.cpp.

Referenced by auxgetinfo(), collectvalidlines(), and funcinfo().

Function Documentation

static void addinfo ( lua_State L,
const char *  msg 
)
static

Definition at line 556 of file ldebug.cpp.

References lua_State::ci, ci_func, currentline(), getstr, isLua, LUA_IDSIZE, luaO_chunkid(), and luaO_pushfstring().

Referenced by luaG_runerror().

static int auxgetinfo ( lua_State L,
const char *  what,
lua_Debug ar,
Closure f,
CallInfo ci 
)
static
static void collectvalidlines ( lua_State L,
Closure f 
)
static
static int currentline ( CallInfo ci)
static

Definition at line 44 of file ldebug.cpp.

References ci_func, currentpc(), and getfuncline.

Referenced by addinfo(), and auxgetinfo().

static int currentpc ( CallInfo ci)
static

Definition at line 38 of file ldebug.cpp.

References ci_func, isLua, CallInfo::l, lua_assert, pcRel, and CallInfo::u.

Referenced by currentline(), findlocal(), getfuncname(), and luaG_typeerror().

static int filterpc ( int  pc,
int  jmptarget 
)
static

Definition at line 329 of file ldebug.cpp.

Referenced by findsetreg().

static const char* findlocal ( lua_State L,
CallInfo ci,
int  n,
StkId pos 
)
static
static int findsetreg ( Proto p,
int  lastpc,
int  reg 
)
static
static const char* findvararg ( CallInfo ci,
int  n,
StkId pos 
)
static

Definition at line 106 of file ldebug.cpp.

References clLvalue, CallInfo::func, CallInfo::l, and CallInfo::u.

Referenced by findlocal().

static void funcinfo ( lua_Debug ar,
Closure cl 
)
static
static const char * getfuncname ( lua_State L,
CallInfo ci,
const char **  name 
)
static
static const char * getobjname ( Proto p,
int  lastpc,
int  reg,
const char **  name 
)
static
static const char* getupvalname ( CallInfo ci,
const TValue o,
const char **  name 
)
static

Definition at line 498 of file ldebug.cpp.

References ci_func, i, LClosure::p, upvalname(), LClosure::upvals, and UpVal::v.

Referenced by luaG_typeerror().

static int isinstack ( CallInfo ci,
const TValue o 
)
static

Definition at line 490 of file ldebug.cpp.

References CallInfo::l, and CallInfo::u.

Referenced by luaG_typeerror().

static void kname ( Proto p,
int  pc,
int  c,
const char **  name 
)
static

Definition at line 309 of file ldebug.cpp.

References getobjname(), INDEXK, ISK, Proto::k, svalue, ttisstring, and what().

Referenced by getobjname().

LUA_API lua_Hook lua_gethook ( lua_State L)

Definition at line 67 of file ldebug.cpp.

References lua_State::hook.

Referenced by db_gethook().

LUA_API int lua_gethookcount ( lua_State L)

Definition at line 77 of file ldebug.cpp.

References lua_State::basehookcount.

Referenced by db_gethook().

LUA_API int lua_gethookmask ( lua_State L)

Definition at line 72 of file ldebug.cpp.

References lua_State::hookmask.

Referenced by db_gethook().

LUA_API int lua_getinfo ( lua_State L,
const char *  what,
lua_Debug ar 
)
LUA_API const char* lua_getlocal ( lua_State L,
const lua_Debug ar,
int  n 
)
LUA_API int lua_getstack ( lua_State L,
int  level,
lua_Debug ar 
)
LUA_API int lua_sethook ( lua_State L,
lua_Hook  func,
int  mask,
int  count 
)
LUA_API const char* lua_setlocal ( lua_State L,
const lua_Debug ar,
int  n 
)

Definition at line 165 of file ldebug.cpp.

References findlocal(), lua_Debug::i_ci, lua_lock, lua_unlock, pos, setobjs2s, and lua_State::top.

Referenced by db_setlocal().

l_noret luaG_aritherror ( lua_State L,
const TValue p1,
const TValue p2 
)

Definition at line 538 of file ldebug.cpp.

References luaG_typeerror(), and luaV_tonumber().

Referenced by luaV_arith().

l_noret luaG_concaterror ( lua_State L,
StkId  p1,
StkId  p2 
)

Definition at line 531 of file ldebug.cpp.

References lua_assert, luaG_typeerror(), ttisnumber, and ttisstring.

Referenced by luaV_concat().

l_noret luaG_errormsg ( lua_State L)
l_noret luaG_ordererror ( lua_State L,
const TValue p1,
const TValue p2 
)

Definition at line 546 of file ldebug.cpp.

References luaG_runerror(), and objtypename.

Referenced by luaV_lessequal(), and luaV_lessthan().

l_noret luaG_runerror ( lua_State L,
const char *  fmt,
  ... 
)
l_noret luaG_typeerror ( lua_State L,
const TValue o,
const char *  op 
)
static const char* upvalname ( Proto p,
int  uv 
)
static

Definition at line 99 of file ldebug.cpp.

References check_exp, getstr, Upvaldesc::name, and Proto::upvalues.

Referenced by getobjname(), and getupvalname().