Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Lua Development Tools » [SOLVED] Debugger attaches, but nothing else happens(Trying to debug embedded scripts, debugger attaches but nothing else happens until it terminates.)
[SOLVED] Debugger attaches, but nothing else happens [message #1055890] Wed, 08 May 2013 11:05 Go to next message
Neil W is currently offline Neil WFriend
Messages: 14
Registered: May 2013
Junior Member
Hi,

I've built Lua 5.1.5 as a dll. I execute scripts that can be passed into the my program or are embedded as part of its test infrastructure.

I'm trying to use LDT (0.9.0.201212171109)to debug scripts, but am not having much luck. The scripts are run using lua_pcall, and given a name (e.g. UserScript1.lua) but not saved to disk.

I start the debugger by selecting a 'Lua Attach to Application' configuration. I have 'break on first line' and 'Enable DBGP logging' selected. I also have a file in my project called UserScript1.lua which corresponds in content to the embedded test script being run.

The console shows [Debug Console]NewConfiguration(1) until my program has run, then shows <terminated>[Debug Console] etc.

The script debug log shows:
Event	MODEL_SPECIFIC/5 from org.eclipse.dltk.dbgp.internal.DbgpDebugingEngine
<<	<?xml version="1.0" encoding="UTF-8" ?>
<init fileuri="unknown:/" idekey="luaidekey" protocol_version="1.0" parent="" thread="main" appid="Lua DBGp" language="Lua" session="1368010931_main" xmlns="urn:debugger_protocol_v1"/>
>>	feature_set -n max_children -i 142 -v 32
<<	<?xml version="1.0" encoding="UTF-8" ?>
<response feature="max_children" success="1" command="feature_set" transaction_id="142" xmlns="urn:debugger_protocol_v1"/>
>>	feature_set -n max_depth -i 143 -v 2
<<	<?xml version="1.0" encoding="UTF-8" ?>
<response feature="max_depth" success="1" command="feature_set" transaction_id="143" xmlns="urn:debugger_protocol_v1"/>
>>	feature_set -n max_data -i 144 -v 8192
<<	<?xml version="1.0" encoding="UTF-8" ?>
<response feature="max_data" success="1" command="feature_set" transaction_id="144" xmlns="urn:debugger_protocol_v1"/>
>>	feature_get -n stdin -i 145
<<	<?xml version="1.0" encoding="UTF-8" ?>
<response transaction_id="145" feature_name="stdin" command="feature_get" supported="0" xmlns="urn:debugger_protocol_v1"><![CDATA[false]]></response>
>>	feature_set -n notify_ok -i 146 -v 1
<<	<?xml version="1.0" encoding="UTF-8" ?>
<response feature="notify_ok" success="0" command="feature_set" transaction_id="146" xmlns="urn:debugger_protocol_v1"/>
>>	stdout -c 2 -i 147
<<	<?xml version="1.0" encoding="UTF-8" ?>
<response command="stdout" transaction_id="147" success="1" xmlns="urn:debugger_protocol_v1"/>
>>	stderr -c 2 -i 148
<<	<?xml version="1.0" encoding="UTF-8" ?>
<response command="stderr" transaction_id="148" success="1" xmlns="urn:debugger_protocol_v1"/>
>>	breakpoint_set -r 0 -t line -s enabled -n 2 -i 149 -f [url]file:///C:/Program%20Files/LuaDevelopmentTools64/workspace/test/src/UserScript1.lua[/url]
<<	<?xml version="1.0" encoding="UTF-8" ?>
<response transaction_id="149" id="0" state="enabled" command="breakpoint_set" xmlns="urn:debugger_protocol_v1"/>
>>	breakpoint_set -r 0 -t line -s enabled -n 5 -i 150 -f [url]file:///C:/Program%20Files/LuaDevelopmentTools64/workspace/test/src/UserScript1.lua[/url]
<<	<?xml version="1.0" encoding="UTF-8" ?>
<response transaction_id="150" id="1" state="enabled" command="breakpoint_set" xmlns="urn:debugger_protocol_v1"/>
Event	CREATE from org.eclipse.dltk.internal.debug.core.model.ScriptThread
>>	step_into -i 151
Event	MODEL_SPECIFIC/4 from org.eclipse.dltk.internal.debug.core.model.ScriptThread
Event	RESUME from org.eclipse.dltk.internal.debug.core.model.ScriptThread
Event	CHANGE from org.eclipse.dltk.internal.debug.core.model.ScriptThread
Event	MODEL_SPECIFIC/2 from org.eclipse.koneki.ldt.debug.core.internal.attach.LuaAttachDebuggingEngineRunner$1
Event	TERMINATE from org.eclipse.dltk.internal.debug.core.model.ScriptThread


I'd appreciate any help diagnosing this problem. Even if I had the source mapping incorrect, I would have expected to see the script I run being downloaded to the debugger, but nothing happens.

TIA,

Neil

[Updated on: Wed, 12 June 2013 04:47] by Moderator

Report message to a moderator

Re: Debugger attaches, but nothing else happens [message #1057841 is a reply to message #1055890] Thu, 09 May 2013 09:19 Go to previous messageGo to next message
Neil W is currently offline Neil WFriend
Messages: 14
Registered: May 2013
Junior Member
I've just seen this in the debugger.lua file:
-- * Dynamic code (compiled with load or loadstring) is not handled (the debugger will step over it, like C code)

I suspect that is the cause of my problems, as I'm using lua_loadbuffer on my embedded script.

If anyone knows of a workaround to this, (quite new to Lua, so there may be a different way of doing things, but using the filesystem is not an option) then I'd love to hear it.

Thanks,

Neil
Re: Debugger attaches, but nothing else happens [message #1057860 is a reply to message #1057841] Thu, 09 May 2013 11:42 Go to previous messageGo to next message
Neil W is currently offline Neil WFriend
Messages: 14
Registered: May 2013
Junior Member
Success! To use an embedded script you need to load it in the style of luaL_loadfile, pushing the filename onto the stack first with lua_pushfstring(L, "@%s", filename); and removing it after calling luaL_loadbuffer.
Re: Debugger attaches, but nothing else happens [message #1057996 is a reply to message #1057860] Fri, 10 May 2013 11:52 Go to previous message
Benjamin Cabé is currently offline Benjamin CabéFriend
Messages: 201
Registered: July 2009
Location: Toulouse, France
Senior Member

Kudos! Smile
I'm glad you solved your problem!


Previous Topic:Can't use the editor under Mac OS
Next Topic:[SOLVED] lua attach debugger not working
Goto Forum:
  


Current Time: Fri Apr 26 11:41:46 GMT 2024

Powered by FUDForum. Page generated in 0.03359 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top