little LfW debugger and lanes module incompatibility

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

little LfW debugger and lanes module incompatibility

Benoit Germain

Hello,

 

Open the editor, and copy the attached code snippet :

 

local laneFunc = function()

end

 

require "lanes"

local lane_gen = lanes.gen(laneFunc)

local lane_h = lane_gen()

return true

 

Then start the debugger, step until after the lane_h variable is assigned, and hover the mouse cursor over the lane_h variable, and the debugger will terminate itself with «quitting debugger » in the log. It would seem that this happens because the userdata contained in lane_h doesn’t have a __tostring() metamethod. At least when considering this trace from a more complex app :

 

...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:776: C:\Program Files\Lua\5.1\lua\lanes.lua:189: Unknown key: __tostring

stack traceback:

                ...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:1485: in function <...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:1484>

                [C]: ?

                [C]: in function 'assert'

                ...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:776: in function <...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:701>

                Launcher_ConsolesPanel.wlua:84: in function 'refreshFromNeighborhood'

                Launcher_ConsolesPanel.wlua:648: in function <Launcher_ConsolesPanel.wlua:646>

                (tail call): ?

                [C]: in function 'MainLoop'

                Launcher.wlua:87: in main chunk

                [C]: ?

 

                local lane_h_MT= getmetatable( lane_h)

                lane_h_MT.__tostring = function() return "hello" end

 

before inspecting the variable doesn’t solve the problem. What can I do to fix this ?

 

 

Thanks,

 

B. Germain

 

Reply | Threaded
Open this post in threaded view
|

RE: little LfW debugger and lanes module incompatibility

Benoit Germain

Oh, I forgot : I’ve tried adding this

 

                __tostring = function( me)

                               return "I'm a lane"

                end

 

to the lane_mt metatable, but to no avail. It gets called when calling print on the lane, but the debugger still breaks.

 

De : [hidden email] [mailto:[hidden email]] De la part de Benoit Germain
Envoyé : jeudi 10 décembre 2009 11:48
À : Lua list
Objet : little LfW debugger and lanes module incompatibility

 

Hello,

 

Open the editor, and copy the attached code snippet :

 

local laneFunc = function()

end

 

require "lanes"

local lane_gen = lanes.gen(laneFunc)

local lane_h = lane_gen()

return true

 

Then start the debugger, step until after the lane_h variable is assigned, and hover the mouse cursor over the lane_h variable, and the debugger will terminate itself with «quitting debugger » in the log. It would seem that this happens because the userdata contained in lane_h doesn’t have a __tostring() metamethod. At least when considering this trace from a more complex app :

 

...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:776: C:\Program Files\Lua\5.1\lua\lanes.lua:189: Unknown key: __tostring

stack traceback:

                ...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:1485: in function <...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:1484>

                [C]: ?

                [C]: in function 'assert'

                ...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:776: in function <...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:701>

                Launcher_ConsolesPanel.wlua:84: in function 'refreshFromNeighborhood'

                Launcher_ConsolesPanel.wlua:648: in function <Launcher_ConsolesPanel.wlua:646>

                (tail call): ?

                [C]: in function 'MainLoop'

                Launcher.wlua:87: in main chunk

                [C]: ?

 

                local lane_h_MT= getmetatable( lane_h)

                lane_h_MT.__tostring = function() return "hello" end

 

before inspecting the variable doesn’t solve the problem. What can I do to fix this ?

 

 

Thanks,

 

B. Germain

 

Reply | Threaded
Open this post in threaded view
|

Re: little LfW debugger and lanes module incompatibility

Linker
Lanes is a multi-threads module. Normal lua debuger cannot debug
multi-thread program.

On 12/10/09, Benoit Germain <[hidden email]> wrote:

> Oh, I forgot : I've tried adding this
>
>                 __tostring = function( me)
>                                return "I'm a lane"
>                 end
>
> to the lane_mt metatable, but to no avail. It gets called when calling print
> on the lane, but the debugger still breaks.
>
> De : [hidden email]
> [mailto:[hidden email]] De la part de Benoit Germain
> Envoyé : jeudi 10 décembre 2009 11:48
> À : Lua list
> Objet : little LfW debugger and lanes module incompatibility
>
> Hello,
>
> Open the editor, and copy the attached code snippet :
>
> local laneFunc = function()
> ...
> end
>
> require "lanes"
> local lane_gen = lanes.gen(laneFunc)
> local lane_h = lane_gen()
> return true
>
> Then start the debugger, step until after the lane_h variable is assigned,
> and hover the mouse cursor over the lane_h variable, and the debugger will
> terminate itself with «quitting debugger » in the log. It would seem that
> this happens because the userdata contained in lane_h doesn't have a
> __tostring() metamethod. At least when considering this trace from a more
> complex app :
>
> ...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:776: C:\Program
> Files\Lua\5.1\lua\lanes.lua:189: Unknown key: __tostring
> stack traceback:
>
> ...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:1485: in function
> <...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:1484>
>                 [C]: ?
>                 [C]: in function 'assert'
>                 ...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:776:
> in function <...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:701>
>                 Launcher_ConsolesPanel.wlua:84: in function
> 'refreshFromNeighborhood'
>                 Launcher_ConsolesPanel.wlua:648: in function
> <Launcher_ConsolesPanel.wlua:646>
>                 (tail call): ?
>                 [C]: in function 'MainLoop'
>                 Launcher.wlua:87: in main chunk
>                 [C]: ?
>
>                 local lane_h_MT= getmetatable( lane_h)
>                 lane_h_MT.__tostring = function() return "hello" end
>
> before inspecting the variable doesn't solve the problem. What can I do to
> fix this ?
>
>
> Thanks,
>
> B. Germain
>
>

--
Sent from my mobile device

Regards,
Linker Lin
[hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: little LfW debugger and lanes module incompatibility

Benoit Germain
Yes, but the behaviour I observe is situated in the main thread. At no point am I trying to debug/break into the created thread (and it wont work anyway since SciTE doesn't know about the other threads I created with the lane). From the main thread point of view, this lane is just some userdata it attempts to display. I can step the debugger until after the creation of the lane and leave it there as long as I want, it won't abort until I attempt to display the contents of the lane variable. So I guess what I have to do now is debug the debugger while being used to debug that code snippet. How can I do this?


-----Message d'origine-----
De : [hidden email] [mailto:[hidden email]] De la part de Linker
Envoyé : jeudi 10 décembre 2009 12:56
À : Lua list
Objet : Re: little LfW debugger and lanes module incompatibility

Lanes is a multi-threads module. Normal lua debuger cannot debug
multi-thread program.

On 12/10/09, Benoit Germain <[hidden email]> wrote:

> Oh, I forgot : I've tried adding this
>
>                 __tostring = function( me)
>                                return "I'm a lane"
>                 end
>
> to the lane_mt metatable, but to no avail. It gets called when calling print
> on the lane, but the debugger still breaks.
>
> De : [hidden email]
> [mailto:[hidden email]] De la part de Benoit Germain
> Envoyé : jeudi 10 décembre 2009 11:48
> À : Lua list
> Objet : little LfW debugger and lanes module incompatibility
>
> Hello,
>
> Open the editor, and copy the attached code snippet :
>
> local laneFunc = function()
> ...
> end
>
> require "lanes"
> local lane_gen = lanes.gen(laneFunc)
> local lane_h = lane_gen()
> return true
>
> Then start the debugger, step until after the lane_h variable is assigned,
> and hover the mouse cursor over the lane_h variable, and the debugger will
> terminate itself with «quitting debugger » in the log. It would seem that
> this happens because the userdata contained in lane_h doesn't have a
> __tostring() metamethod. At least when considering this trace from a more
> complex app :
>
> ...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:776: C:\Program
> Files\Lua\5.1\lua\lanes.lua:189: Unknown key: __tostring
> stack traceback:
>
> ...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:1485: in function
> <...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:1484>
>                 [C]: ?
>                 [C]: in function 'assert'
>                 ...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:776:
> in function <...a\5.1\SciTE\scite-debug\lua_clidebugger\debugger.lua:701>
>                 Launcher_ConsolesPanel.wlua:84: in function
> 'refreshFromNeighborhood'
>                 Launcher_ConsolesPanel.wlua:648: in function
> <Launcher_ConsolesPanel.wlua:646>
>                 (tail call): ?
>                 [C]: in function 'MainLoop'
>                 Launcher.wlua:87: in main chunk
>                 [C]: ?
>
>                 local lane_h_MT= getmetatable( lane_h)
>                 lane_h_MT.__tostring = function() return "hello" end
>
> before inspecting the variable doesn't solve the problem. What can I do to
> fix this ?
>
>
> Thanks,
>
> B. Germain
>
>

--
Sent from my mobile device

Regards,
Linker Lin
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: little LfW debugger and lanes module incompatibility

steve donovan
On Thu, Dec 10, 2009 at 2:13 PM, Benoit Germain <[hidden email]> wrote:
userdata it attempts to display. I can step the debugger until after
the creation of the lane and leave it there as long as I want, it
won't abort until I attempt to display the contents of the lane
variable. So I guess what I have to do now is debug the debugger while
being used to debug that code snippet. How can I do this?

I'll have a look at this this weekend - you should be able to debug
the main thread, I _think_
Reply | Threaded
Open this post in threaded view
|

RE: little LfW debugger and lanes module incompatibility

Benoit Germain
In fact, I already am, it's just that I must be careful not to let the mouse cursor getting too close to a lane handle.

-----Message d'origine-----
De : [hidden email] [mailto:[hidden email]] De la part de steve donovan
Envoyé : jeudi 10 décembre 2009 13:22
À : Lua list
Objet : Re: little LfW debugger and lanes module incompatibility

On Thu, Dec 10, 2009 at 2:13 PM, Benoit Germain <[hidden email]> wrote:
userdata it attempts to display. I can step the debugger until after
the creation of the lane and leave it there as long as I want, it
won't abort until I attempt to display the contents of the lane
variable. So I guess what I have to do now is debug the debugger while
being used to debug that code snippet. How can I do this?

I'll have a look at this this weekend - you should be able to debug
the main thread, I _think_