[ZeroBrane Studio] Re: Wierd error

  • From: Rob Probin <rob.probin@xxxxxxxxx>
  • To: zerobrane@xxxxxxxxxxxxx
  • Date: Wed, 01 Oct 2014 19:05:36 +0100



Just to makes sure we are on the same page with this: the line printed
is from print() statement on the line that is *after* the line you do
"done" command on and *before* the line with a breakpoint? The reason
I want to confirm this is that debug hook should be reset when "done"
is executed, so you should get "nil" instead of "function".

Of course not :-)

I'll try again:
            print(require('mobdebug')._VERSION, debug.gethook())
            volume_fraction = time_fraction / attack
            print(require('mobdebug')._VERSION, debug.gethook())

The first breakpoint is on the volume_fraction line. I don't remove this breakpoint - and there are more breakpoints later in sequence of the code.

   * It prints that version line
   * Then the breakpoint it hits then once
   * Then I hit "| |>"
   * Then I get "bad argument #1 to 'cororesume' (coroutine expected)"
     (appears in the application console).
   * No more version prints... are in either ZBS or the application console

Is this code inside a coroutine by any chance?
I don't believe it's running in a co-routine. The function is called from main.lua right after we 'require' that sound file.

More evidence:

            print(coroutine.running())
            print(require('mobdebug')._VERSION, debug.gethook())
            volume_fraction = time_fraction / attack
            print(require('mobdebug')._VERSION, debug.gethook())

"thread: 0x1005823c0"    true
0.606    function() --[[..skipped..]] end    "crl"    0

Are you using Lua 5.1, 5.2, or LuaJIT?

Lua 5.2.2


Regards,
Rob

Other related posts: