[ZeroBrane Studio] Re: debug lua on an embedded micro

  • From: "Jim Hall" <j.hall@xxxxxxxxxxx>
  • To: <zerobrane@xxxxxxxxxxxxx>
  • Date: Thu, 18 Sep 2014 11:41:23 -0400

Hi Paul,

 

The settimeout(0) does set the socket_recv() call to non blocking. It returns 
without delay. However receive(1) calls the Luasockets buffer service that 
waits for at least 1 character from the socket before returning. 

 

When I click pause the resulting S from the SUSPEND message moves things on. 

Mobdebug then returns “Paused at file test4.lua line 43”.  

 

Does ZBS do something like a ‘keep alive’ message that maybe I turned off?

 

 

Jim Hall                    j.hall@xxxxxxxxxxx

781-254-4579          www.air2app.com

 

      

 

Monitor and Control Your Remote Application

 

From: zerobrane-bounce@xxxxxxxxxxxxx [mailto:zerobrane-bounce@xxxxxxxxxxxxx] On 
Behalf Of Paul K
Sent: Tuesday, September 16, 2014 5:19 PM
To: zerobrane@xxxxxxxxxxxxx
Subject: [ZeroBrane Studio] Re: debug lua on an embedded micro

 

Hi Jim,

 

> I found that when my script hits the breakpoint, execution stops with a  call 
> to is_pending()

 

That's normal; is_pending will try to read one character, but in a non-blocking 
way (it does settimeout(0)). Check if your receive(1) implementation takes 
timeout into account.

 

It's possible to rewrite it using select, but receive(1) has some advantages, 
so this is what mobdebug is using.

 

Paul.

 

PNG image

Other related posts: