/
debugging.h
43 lines (38 loc) · 1.15 KB
/
debugging.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* debugging.h
*
* Created on: 14 sept. 2018
* Author: Nico
*/
#ifndef LUABINDING_DEBUGGING_H_
#define LUABINDING_DEBUGGING_H_
#include "libnetwork.h"
#include "luaapplication.h"
#include "bytebuffer.h"
class LuaDebugging {
static NetworkLink *studio;
static lua_State *breakedL;
static std::map<int,std::set<std::string>> breakpoints;
static int subCount;
static int debuggerMode;
static std::string lastFile;
static void studioCommandInternal(const std::vector<char> &data,lua_State *L,lua_Debug *ar);
static void serializeValue(ByteBuffer &buffer,lua_State *L,int n,int nref);
static void setupBreakMode(int m);
public:
static bool profiling;
static int lastLine;
static lua_State *L;
static int yieldHookMask;
static lua_Hook hook;
static void studioLink(NetworkLink *server);
static void studioCommand(const std::vector<char> &data);
#ifdef LUA_IS_LUAU
static void debuggerHook(lua_State *L,lua_Debug *ar);
static void profilerHook(lua_State *L,int enter);
#else
static void debuggerHook(void *context,lua_State *L,lua_Debug *ar);
#endif
static void reinitDebugger();
};
#endif /* LUABINDING_DEBUGGING_H_ */