Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Koneki » Debugger opening wrong sourcefile
icon4.gif  Debugger opening wrong sourcefile [message #900649] Tue, 07 August 2012 19:28 Go to next message
Jason Bob is currently offline Jason Bob
Messages: 5
Registered: August 2012
Junior Member
When using the LDT's debugger, it opens a non-existent sourcefile like so:

(link) i.imgur.com/10U0A.png
The eclipse forum will not allow me to post a link to outside of this domain, so please CTRL+C & CTRL+V that into your browser's URL bar.

So, how do I fix this?
Here's my run External Run config:

(link) i.imgur.com/lsB3q.png

P.S. what External Run config settings would you guys recommend? This one has to be changed for each project..
Re: Debugger opening wrong sourcefile [message #901306 is a reply to message #900649] Fri, 10 August 2012 12:48 Go to previous messageGo to next message
Simon Bernard is currently offline Simon Bernard
Messages: 154
Registered: July 2009
Senior Member
Hi,
The use of "external run config" is a kind of workaround because LDT don't support a "real" launch configuration. We will support that correctly in the 0.9.0 version (available at the end of the year).
Thijs Schreijer did a tutorial about the external run config with LDT. Did you try it ?
HTH
Re: Debugger opening wrong sourcefile [message #901319 is a reply to message #901306] Fri, 10 August 2012 15:23 Go to previous messageGo to next message
Jason Bob is currently offline Jason Bob
Messages: 5
Registered: August 2012
Junior Member
Hi Simon,

I have already set up my external run configuration in a decent working way.

The real problem I want to address in this thread is the fact that the debugger is opening the wrong files.

If I'm trying to debug the file "/home/jason/workspace/project/file.lua" the debugger will open the non-existent file "/home/jason/file.lua".

How do I resolve this issue?
Re: Debugger opening wrong sourcefile [message #905532 is a reply to message #901319] Thu, 30 August 2012 11:13 Go to previous messageGo to next message
Simon Bernard is currently offline Simon Bernard
Messages: 154
Registered: July 2009
Senior Member
Hi,
Currently you use the debugger with external run configuration, but did you succeed to debug using command line ?

As you say the debugger don't search the good file.
To retrieve the absolute file path, we used the relative path returned by the lua debug API and the process working directory.
We did not found any reliable way to determine the current working dir for all platform.
Under linux we used the PWD Environment variable.
(we will not have this problem any more with the 0.9.0 version because working directory will be given by eclipse to the debugger)
Could you try to add this line
print (package.path)
print (os.getenv("PWD"))

at the begin of the file and give me the result to check if all is normal?
Simon
Re: Debugger opening wrong sourcefile [message #928875 is a reply to message #905532] Sun, 30 September 2012 23:17 Go to previous messageGo to next message
Jason Bob is currently offline Jason Bob
Messages: 5
Registered: August 2012
Junior Member
Hi Simon,

I'm sorry for not responding to this earlier, but only recently have I begun to use Koneki's LDT so much again.

Quote:

Could you try to add this line
print (package.path)
print (os.getenv("PWD"))

at the begin of the file and give me the result to check if all is normal?


Here:
./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua
/home/jason


So yeah, the wrong directory...

If I write my own version of os.getenv() such as this, everything is fixed:
local getenv = os.getenv;
function os.getenv(s)
if s == "PWD" then
return "/my/directory/"
else
return getenv(s)
end
end


This works fine, but is tedious to set up in each project.

Any ideas of what else could fix this? Or rather, when 0.9.0 stable will be released ?
Re: Debugger opening wrong sourcefile [message #932811 is a reply to message #928875] Thu, 04 October 2012 09:02 Go to previous messageGo to next message
Simon Bernard is currently offline Simon Bernard
Messages: 154
Registered: July 2009
Senior Member
Hi Jason,
As better workaround than override os.getenv, you could define the environment variable in your external Tools configuration. you can use the "environment" tab to add the PWD variable. I never test it but that must work.
The 0.9.0 stable release should be released at the end of the year.
You could already test the last milestone release, and report us your feedback or any bugs about it Smile.

Re: Debugger opening wrong sourcefile [message #935247 is a reply to message #932811] Sat, 06 October 2012 17:14 Go to previous messageGo to next message
Jason Bob is currently offline Jason Bob
Messages: 5
Registered: August 2012
Junior Member
Simon Bernard wrote on Thu, 04 October 2012 09:02

The 0.9.0 stable release should be released at the end of the year.
You could already test the last milestone release, and report us your feedback or any bugs about it Smile.


Thanks so much Simon, while also being super awesome, the new 0.9 milestone launching UI seems to fix this Smile

Unfortunately however, I have a new problem with the debugger.

In the variables pane, where you can see all of the visible variables to a function, trying to display the
contents of a table breaks it. The entire pane becomes gray with this text printed: "Unable to load children
of <variable name>". This will persist with each step of the debugger until that variable is no longer visible
(such as stepping out of its function) or until the debug session ends.
Re: Debugger opening wrong sourcefile [message #936925 is a reply to message #935247] Mon, 08 October 2012 09:39 Go to previous message
Simon Bernard is currently offline Simon Bernard
Messages: 154
Registered: July 2009
Senior Member
I try to reproduce your problem but for now I can't Confused.

Which kind of Lua VM do you use ?
Could you give me a sample of code which failed for you ?
Previous Topic:[version .9] Issues with Debug
Next Topic:[SOLVED] Task tags
Goto Forum:
  


Current Time: Mon Apr 21 05:37:24 EDT 2014

Powered by FUDForum. Page generated in 0.01784 seconds