Merge pull request #671 from MihailRis/debugging-client
Debugging client
This commit is contained in:
@@ -8,5 +8,5 @@ multiline-string-end = "]]"
|
||||
keywords = [
|
||||
"and", "break", "do", "else", "elseif", "end", "false", "for", "function",
|
||||
"if", "in", "local", "nil", "not", "or", "repeat", "return", "then", "true",
|
||||
"until", "while"
|
||||
"until", "while", "self", "error"
|
||||
]
|
||||
|
||||
@@ -60,7 +60,9 @@ if is_debugging then
|
||||
current_func = _debug_getinfo(2).func
|
||||
current_func_stack_size = calc_stack_size()
|
||||
__pause("breakpoint")
|
||||
debug.pull_events()
|
||||
while debug.pull_events() do
|
||||
__pause()
|
||||
end
|
||||
end, "lr")
|
||||
end
|
||||
|
||||
@@ -92,6 +94,7 @@ function debug.pull_events()
|
||||
if not events then
|
||||
return
|
||||
end
|
||||
local keepPaused = false
|
||||
for i, event in ipairs(events) do
|
||||
if event[1] == DBG_EVENT_SET_BREAKPOINT then
|
||||
debug.set_breakpoint(event[2], event[3])
|
||||
@@ -116,9 +119,10 @@ function debug.pull_events()
|
||||
value = value[key]
|
||||
end
|
||||
__sendvalue(value, event[2], event[3], event[4])
|
||||
__pause()
|
||||
keepPaused = true
|
||||
end
|
||||
end
|
||||
return keepPaused
|
||||
end
|
||||
|
||||
function debug.set_breakpoint(source, line)
|
||||
|
||||
@@ -3,7 +3,7 @@ local Schedule = {
|
||||
set_interval = function(self, ms, callback, repetions)
|
||||
local id = self._next_interval
|
||||
self._intervals[id] = {
|
||||
last_called = 0.0,
|
||||
last_called = self._timer,
|
||||
delay = ms / 1000.0,
|
||||
callback = callback,
|
||||
repetions = repetions,
|
||||
|
||||
@@ -39,6 +39,16 @@ end
|
||||
local Socket = {__index={
|
||||
send=function(self, ...) return network.__send(self.id, ...) end,
|
||||
recv=function(self, ...) return network.__recv(self.id, ...) end,
|
||||
recv_async=function(self, length, usetable)
|
||||
while self:is_alive() do
|
||||
local available = self:available()
|
||||
if available >= length then
|
||||
return self:recv(length, usetable)
|
||||
end
|
||||
coroutine.yield()
|
||||
end
|
||||
return self:recv(length, usetable)
|
||||
end,
|
||||
close=function(self) return network.__close(self.id) end,
|
||||
available=function(self) return network.__available(self.id) or 0 end,
|
||||
is_alive=function(self) return network.__is_alive(self.id) end,
|
||||
|
||||
@@ -47,6 +47,7 @@ local function complete_app_lib(app)
|
||||
end
|
||||
app.reset_content = core.reset_content
|
||||
app.is_content_loaded = core.is_content_loaded
|
||||
app.set_title = core.set_title
|
||||
|
||||
function app.config_packs(packs_list)
|
||||
-- Check if packs are valid and add dependencies to the configuration
|
||||
|
||||
Reference in New Issue
Block a user