Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Koneki » Debugger opening wrong sourcefile
Debugger opening wrong sourcefile [message #1416575] Tue, 07 August 2012 23:28 Go to next message
Jason Bob is currently offline Jason BobFriend
Messages: 10
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 #1416586 is a reply to message #1416575] Fri, 10 August 2012 16:48 Go to previous messageGo to next message
Simon Bernard is currently offline Simon BernardFriend
Messages: 345
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 http://www.thijsschreijer.nl/blog/?p=604 about the external run config with LDT. Did you try it ?
HTH
Re: Debugger opening wrong sourcefile [message #1416588 is a reply to message #1416586] Fri, 10 August 2012 19:23 Go to previous messageGo to next message
Jason Bob is currently offline Jason BobFriend
Messages: 10
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 #1416631 is a reply to message #1416588] Thu, 30 August 2012 15:13 Go to previous messageGo to next message
Simon Bernard is currently offline Simon BernardFriend
Messages: 345
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 #1416675 is a reply to message #1416631] Mon, 01 October 2012 03:17 Go to previous messageGo to next message
Jason Bob is currently offline Jason BobFriend
Messages: 10
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 #1416681 is a reply to message #1416675] Thu, 04 October 2012 13:02 Go to previous messageGo to next message
Simon Bernard is currently offline Simon BernardFriend
Messages: 345
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 http://eclipse.org/koneki/ldt/#installation, and report us your feedback or any bugs about it :).
Re: Debugger opening wrong sourcefile [message #1416685 is a reply to message #1416681] Sat, 06 October 2012 21:14 Go to previous messageGo to next message
Jason Bob is currently offline Jason BobFriend
Messages: 10
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 :).


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

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 #1416686 is a reply to message #1416685] Mon, 08 October 2012 13:39 Go to previous message
Simon Bernard is currently offline Simon BernardFriend
Messages: 345
Registered: July 2009
Senior Member
I try to reproduce your problem but for now I can't :?.

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:Task tags
Goto Forum:
  


Current Time: Thu Mar 28 09:48:33 GMT 2024

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

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

Back to the top