pkulchenko/MobDebug

can't run the examples

Closed this issue · 6 comments

Hi, I meet a problem when run the examples server.lua && start.lua
I have lua5.1.
The connection established correctly, But the client side can not receive the "STEP\n" sent by the listener(client:send("STEP\n")),
then, it would be blocked at the receive() function forever.

  1. I tried to send something from client to server, the server can receive it correctly.
  2. I also tried to write some test code with lua socket 2.0.2 which send data from server to client, every thing works fine.so it should not be a lua socket issue.

@danerduo, I'm a bit confused. You can start the server, using lua server.lua command, and then start the client in a different window using lua start.lua command. If I use step command several times and then run command, this is the output I get (in the window running server.lua):

Lua Remote Debugger
Run the program you wish to debug
Paused at file start.lua
Type 'help' for commands
> step
Paused at file start.lua line 5
> step
Paused at file start.lua line 8
> step
Paused at file start.lua line 9
> step
Paused at file start.lua line 10
> run
Program finished

Is it not working for you? What system are you running on? What results are you getting and what you expect to get?

Thanks for your comment, I was run on OSX 10.9 with lua 5.1 && lua socket2.0.2, It's work for me about only 1 of 10 times.
the result I got is something like this :
window1 :
Lua Remote Debugger
Run the program you wish to debug

reason:
(in listen(),
client:send("STEP\n")
client:receive()//blocked here!!!!!!!!!!!!!!!!
)

window2 : shows nothing.

reason:
( in debugger_loop()
while true do
line, err = server:receive() //blocked here!!!!!!!!!!!!!!!!!
if not line and err == "timeout" then)

I thought it was a lua socket issue, so I write some test code nearly the same as what listen() and start() do, and it works...so I push the issue here to see if you can help with it.
Thanks again

Add more : it means I can not even get the line "Type 'help' for commands" show at most time. But if it works(about 1 of 10 times), every thing goes well.

@danerduo, you are right, there is indeed an issue that was recently introduced (most likely by 02e4749). If you roll back to an earlier version, it should not have this issue. I'm working on a fix.

@pkulchenko , thanks for your help, I will try an earlier version.

@danerduo, should be fixed now in the latest master; give it a try. Thank you for reporting!