Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Lua Development Tools » Streamlining LDT
Streamlining LDT [message #873502] Fri, 18 May 2012 11:34 Go to next message
uiy uiy is currently offline uiy uiyFriend
Messages: 50
Registered: May 2012
Member
Is there any way to fix these problems:


1. Combine the debugging. I have to select the debug configuration to run. Clicking on the debug does not work(gives an error). I have to click the external tools configuration to run(and match it up with what I want to do). Would be nice to have a key like 'F5' start debugging and 'F5' start non-debugging. (then they could switch over to step control afterwards or change step. I'm used to F9 and F10)

2. I have to close the source file that was opened durring debugging. It is a read only copy of what is already opened. For example, if I debug "Mytest.lua" then I get another window like "D:/workspace/Mytest.lua".

3. Fix debugger.lua so that it skips over itself if the remote debugger is not found instead of throwing a warning. This will allow me to not have to have to external tool configurations.

4. Possibly show the global variables, but local to the file, as local variables in the inspector(that way I don't have to go hunt them).

5. Possibly more options in the settings to configure various properties.

6. Do not show(or ability to turn off) escaped character in inspector. Just seems excessive to see things like \\"C:\\\\program files\\\\\" (when the string is simply "C:\\program files\\"

I'm not sure how much of this stuff is due to eclipse as I'm new to it.

[Updated on: Fri, 18 May 2012 12:08]

Report message to a moderator

Re: Streamlining LDT [message #873519 is a reply to message #873502] Fri, 18 May 2012 12:24 Go to previous messageGo to next message
uiy uiy is currently offline uiy uiyFriend
Messages: 50
Registered: May 2012
Member
The solution to 3 is to modify debugger.lua's debugger_loop(lines marked by ****):

local function debugger_loop(self, async_packet)
blockingtcp.settimeout(self.skt, nil) -- set socket blocking

-- in async mode, the debugger does not wait for another command before continuing and does not modify previous_context
local async_mode = async_packet ~= nil

if self.previous_context and not async_mode then
self.state = "break"
previous_context_response(self)
end
self.stack = ContextManager() -- will be used to mutualize context allocation for each loop

while true do
-- reads packet
--local packet = async_packet or assert(read_packet(self.skt))
*** local packet = async_packet or read_packet(self.skt)
*** if not packet then print("No remote debugger found. Bypassing...") return end
async_packet = nil
log("DEBUGGER", "DEBUG", packet)
local cmd, args, data = cmd_parse(packet)

(this may or may not leave the debugger in an unstable state and effect the main program but does allow it to continue as normal if no remove debugger is connected)

[Updated on: Fri, 18 May 2012 12:25]

Report message to a moderator

Re: Streamlining LDT [message #873522 is a reply to message #873519] Fri, 18 May 2012 12:30 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin CabéFriend
Messages: 154
Registered: July 2009
Location: Toulouse, France
Senior Member

Your solution to 3/ sounds like a great improvement indeed. Again, could you please open a bug with the proposed fix?
FWIW it would probably be better to use log(...) instead of print(...)

Thanks so much for your efforts in providing feedback and improvements! This is much appreciated!
Re: Streamlining LDT [message #873548 is a reply to message #873502] Fri, 18 May 2012 14:03 Go to previous messageGo to next message
Julien Desgats is currently offline Julien DesgatsFriend
Messages: 12
Registered: August 2011
Junior Member
Sorry for textual links: I cant put links on messages yet Mad
uiy uiy wrote on Fri, 18 May 2012 07:34

1. Combine the debugging. I have to select the debug configuration to run. Clicking on the debug does not work(gives an error). I have to click the external tools configuration to run(and match it up with what I want to do). Would be nice to have a key like 'F5' start debugging and 'F5' start non-debugging. (then they could switch over to step control afterwards or change step. I'm used to F9 and F10)

I don't use external tools so I can't help you on this one, sorry.

uiy uiy wrote on Fri, 18 May 2012 07:34

2. I have to close the source file that was opened durring debugging. It is a read only copy of what is already opened. For example, if I debug "Mytest.lua" then I get another window like "D:/workspace/Mytest.lua".


This is due to path mapping that failed somehow. The default option (local resolution) requires that the files are phisically the same. (see wiki.eclipse.org/Koneki/LDT/User_Guide/Concepts/Debugger#Source_Mapping for more informations)

uiy uiy wrote on Fri, 18 May 2012 07:34

3. Fix debugger.lua so that it skips over itself if the remote debugger is not found instead of throwing a warning. This will allow me to not have to have to external tool configurations.


Yes it could be a good improvement. Your fix does the job but you better break the loop instead of returning directly (the code after the loop does some cleanup, allowing some objects to be collected). An even better improvement could be to remove debug hook to remove debugger performance overhead.

uiy uiy wrote on Fri, 18 May 2012 07:34

4. Possibly show the global variables, but local to the file, as local variables in the inspector(that way I don't have to go hunt them).


If I understand correctly, you want to be able to see which of your local variables leaked to global namespace because of a forgotten "local"? I think this job is more for static analysis tools than debuggers (you may be interested by this little script: github.com/hjelmeland/globals).

uiy uiy wrote on Fri, 18 May 2012 07:34

5. Possibly more options in the settings to configure various properties.

Which properties would you like to see?

uiy uiy wrote on Fri, 18 May 2012 07:34

6. Do not show(or ability to turn off) escaped character in inspector. Just seems excessive to see things like \\"C:\\\\program files\\\\\" (when the string is simply "C:\\program files\\"

This notation is intended mimic Lua notation for strings to show that the variable is a string. Also because when you edit then you type full Lua expressions (e.g. { answer = 42 } is evaluated as table and not as string).

But indeed, the backslashes are doubled and shouldn't be in edit mode, it is a bug (I just opened a new bug on tracker). Thanks for report.
Re: Streamlining LDT [message #873568 is a reply to message #873548] Fri, 18 May 2012 14:49 Go to previous messageGo to next message
uiy uiy is currently offline uiy uiyFriend
Messages: 50
Registered: May 2012
Member
Thanks Julien:

2. It seems to be a name resolution issue. The wiki says it will send the code if the file is not found. I have redone my project and remove all possible spaces but still same issue. I have tried hard coding various paths and nothing seems to work. What I do know is that the "source" is set to "unknown" and sent to the debugger in the Init function and this looks where the issue may be coming from.

4. Yes, well, I generally do not add local to top level variables in simple test cases. Maybe debugger could be modified with the suggested code to get the list of global variables and display them as root in the inspector?

5. I come from using VS and it has many many properties to modify. I'm not suggestion a lot have to be added but it would be nice to have the ability to configure various things from editor options(tabs, whitespace management, indentation(high level of control here) to build control/configuration). Obviously something to work on in the long term if possible.

6. In my case I am using ldt to help with latex development. Many times I have to print lua code from lua that first goes through the text system. This means I end up with many different escape characters that can become really confusion(it is already confusing enough).

For example:

tex.print sends a string to the tex process. In some cases for dynamic code I have to do tex.print('... \\directlua{tex.print("\\\\...') where the inner tex.print is actually part of the string and usually end up having several orders of quotes inside.

The main issues I have are really just things that slow me down. The source control issue and having click multiple places to get the debug to run. It seems that part of the issue is with eclipse. If I do not have some file selected and try to run eclipse will pop up telling me one of the environmental variables, if I used one, is empty... or if I try to click the debug icon with nothing selected in the project it will complain. I'm used to just hitting F5 or F6 and building or executing the project and that's.

Anyways, great project non-the-less. Definitely the best overall lua editor I've seen.
Re: Streamlining LDT [message #873571 is a reply to message #873568] Fri, 18 May 2012 14:57 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin CabéFriend
Messages: 154
Registered: July 2009
Location: Toulouse, France
Senior Member

uiy uiy wrote on Fri, 18 May 2012 16:49

5. I come from using VS and it has many many properties to modify. I'm not suggestion a lot have to be added but it would be nice to have the ability to configure various things from editor options(tabs, whitespace management, indentation(high level of control here) to build control/configuration). Obviously something to work on in the long term if possible.


Did you have a look at the Window>Preferences dialog, and its Lua entry? Smile You have a decent amount of configurable editing settings related to the formatter (inc. white space management), the syntax coloring, the code templates, ...
Looking forward to hearing what you think is missing though!
Re: Streamlining LDT [message #873655 is a reply to message #873571] Fri, 18 May 2012 19:17 Go to previous message
uiy uiy is currently offline uiy uiyFriend
Messages: 50
Registered: May 2012
Member
Yes, I saw some... It's not as bad as I made it out but would be nice for a bit more control. The ability to control whitespaces is pretty important IMO. There many more options than I thought as many are under the general tab and for some reason I never looked in there ;/

Some options I would be interested in

Backspace should be greedy or at least move one tab back

Indentation should always be at a multiple of a tab (the first character of a line should always fall on an indentation level)
Indentation highlighting(lines or whole indentation region) (not a big deal but can be visually useful)

For example, it would be nice to have the spacebar treated as the tab key on a new line(this forces tab based indentation).

The last edit location is a very nice feature but only seems to remember the last place. Would be nice to have about 10 places(obviously there can be syncing issues but it would be nice to be able to move forward and backwards so small changes in several places could easily be revisited)

I think I missed a few settings as the layout is a bit different from vs. I'm sure some of the stuff I'm interested in is there already but I'll just have to spend some time with it.










Previous Topic:Bug in debugger.lua processing files?
Next Topic:install ldt
Goto Forum:
  


Current Time: Wed Nov 26 20:51:31 GMT 2014

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

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