Bug 380183 - [debugger] Lookup for files in the whole workspace for debug local resolution
Summary: [debugger] Lookup for files in the whole workspace for debug local resolution
Status: RESOLVED FIXED
Alias: None
Product: LDT
Classification: Tools
Component: LuaDevelopmentTools (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday
Depends on:
Blocks:
 
Reported: 2012-05-21 18:01 EDT by uiy uiy CLA
Modified: 2012-06-08 11:38 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description uiy uiy CLA 2012-05-21 18:01:22 EDT
When you create a project outside the current workspace and attempt to debug it, the debugger seems to always open up a new source file of the exact same source file that has the breakpoint in it.

For example, Suppose I have a project located C:\Test and have a breakpoint at main.lua. If the project is not in the current workspace environment then then the debugger "opens" up the source file in read only mode regardless if main.lua is open in ldt or not. This does not happen when the project is in the workspace.

Setting the DBGT to module causes nothing to open even though the LUA_PATH is properly set.

From digging a little it seems that Debugger.lua will "send" the source code to the remote DBGT if it is "not found" using some test. The test seems to be flawed. This is probably a bug related to the windows and how debugger.lua deals with file names(converting them to uri's).

Supposedly using the module resolution in setting up debug configuration is suppose to solve this problem but it makes it worse as no breakpoints are hit. Either it is not finding or not understanding the lua_path or debugger.lua is not passing the right path for DBGT to understand under it's own module resolution code block(which I haven't looked into much).


It doesn't make much sense why having the project in a different workspace should break the DGBT or debugger.lua but it does... at least on windows in my setup.
Comment 1 Simon Bernard CLA 2012-06-08 11:01:43 EDT
should be fixed in 559069fd8fac2b4ebdc13c2e305a1e7e724e4ca7
Comment 2 Simon Bernard CLA 2012-06-08 11:38:35 EDT
Hi uiy uiy,

When you create a new project from an existing location, by default there are no source folder defined.(as we can not guess easily what the user want)
For a project, setting a source folder is a bit the same thing than setting your lua path at runtime. It's the way to explain where/how source files can be found.

With your version of LDT, if you defined correctly your source folders (right click on folder or project then play the build path menu), the debugger should work .

But your bug reveals 2 problems :
  - setting the source path correctly should be not mandatory for local resolution (as we used absolute path for resolution, even if source path is not set correctly we can retrieve the file). 
 - the wizard should help the user to understand he must set a source folder for his project when he used an existing location. (see Bug 382114)

Maybe you could update your LDT to the latest version and tell us if it's working better for your use case now?