defold / editor2-issues

DEPRECATED
44 stars 4 forks source link

Setting break points in .gui_script files doesn't work #1805

Open olovn opened 6 years ago

olovn commented 6 years ago

Expected behaviour

The debugger should trigger at break points in .gui_script files.

Actual behaviour

The debugger doesn't trigger break points in .gui_script files.

Steps to reproduce

I tried to put breakpoint in the following to two files in our project Presto: shared/shared_gui/main_gui.gui_script level/level_components/components/level_gui/level_gui_top.gui_script


Build time2018-04-11T11:50:06.611065
Defold channeleditor-alpha
Defold editor shaca7750738d6500f91a23ccdfef3e6c338fe10389
Defold engine shaf9995611e4d5befaa75d6b6d7becdd52823e01eb
Defold version1.2.125
GPUAMD Radeon R9 M295X OpenGL Engine
GPU Driver2.1 ATI-1.66.31
Java version1.8.0_102-b14
OS archx86_64
OS nameMac OS X
OS version10.13.4
erikangelin-king commented 6 years ago

@olovn Can't repro in simple project - can you try? Is this both with Run with Debugger and Build + Attach?

olovn commented 6 years ago

I got this behaviour both when I started with debugger and when I attached debugger after previously starting the game. I could trigger break points in our main.script file but not in two two mentioned .gui_script files.

erikangelin-king commented 6 years ago

@olovn I did Build + Attach and put a breakpoint in update at /shared/shared_gui/main_gui.gui_script:31 and it stops nicely. Strange.

olovn commented 6 years ago

I heard that you and Mats could not reproduce it. Perhaps this only happens on my computer. If so, then perhaps it's more return of investment to fix other bugs that more people have trouble with. So you can close it for now if you wish. Hopefully this is a mysterious temporary problem. If it's still a problem after a couple of reboots and further editor/engine upgrades, than I can contact you again.

erikangelin-king commented 6 years ago

@olovn Nope, we're not letting this go so easily :)

olovn commented 6 years ago

I tried to wipe that build directory. That helped a bit:

  • After wiping build, and restarting Defold, I could trigger the breakpoint in main_gui.gui_script
  • I could still not trigger the break point in level_gui_top.gui_script
erikangelin-king commented 6 years ago

@olovn There is a sad reason for it not working in level_gui_top.gui.script :( There is currently a cap for how long paths the debugger can report - 59 chars tops - and that path is what .. 69?

olovn commented 6 years ago

Ah, so you've solved the problem, interesting. Is it possible to increase that limit? Seems a bit conservative

erikangelin-king commented 6 years ago

According to @andsveking there is a #define somewhere, but we need to make sure we get the same behaviour across all platforms in plain lua and luajit. More of an engine issue.

matgis-king commented 6 years ago

Possibly not an engine issue after all. The buffer limit is inside Lua itself, but should be fine as long as we truncate paths the same way when we set breakpoints, etc. Currently it looks like we send the full paths to mobdebug from the editor. It could be as simple as truncating them in the same way, but it seems there is a special case for .lua paths becoming module names internally. Unsure if we should truncate those as well. We also get these truncated paths back in the messages from mobdebug, so I guess we'd have to resolve them into the full proj-paths.