lite-xl / lite-xl-ide

A set of plugins to convert lite-xl into a proper IDE.
24 stars 5 forks source link

Debug: just doesn'to work #20

Open BartolomeyKant opened 4 days ago

BartolomeyKant commented 4 days ago

I configured Debuger with target binary in my ~/.config/lite-xl/init.lua

config.target_binary = "absolute path to executable binary"

Pressing Debugger: Start Or Continue just doing nothing.

adamharrison commented 4 days ago

Hrm. Odd. That should work, but there's interplay with build and debugger if you have both installed (it uses your build targets to set target_binary).

If build's not working right now for you (based on the other issue), try uninstalling it and only using debugger; that may help.

BartolomeyKant commented 4 days ago

Hrm. Odd. That should work, but there's interplay with build and debugger if you have both installed (it uses your build targets to set target_binary).

Ok. I found the problem. I made a typo in config.target_binary and system.get_file_info had always return nil.

Now debugger started but if I add a breakpoint whole lite xl crushes.

Error: /usr/share/lite-xl/core/docview.lua:444: bad argument #1 to 'sub' (string expected, got nil)

stack traceback:
    [C]: in function 'string.sub'
    /usr/share/lite-xl/core/docview.lua:444: in upvalue 'draw_line_text'
    /home/bartolomey/.config/lite-xl/plugins/codeplus/init.lua:68: in function </home/bartolomey/.config/lite-xl/plugins/codeplus/init.lua:67>
    (...tail calls...)
    /home/bartolomey/.config/lite-xl/plugins/bracketmatch.lua:236: in upvalue 'draw_line_text'
    /home/bartolomey/.config/lite-xl/plugins/colorpreview.lua:74: in function </home/bartolomey/.config/lite-xl/plugins/colorpreview.lua:73>
    (...tail calls...)
    /usr/share/lite-xl/core/docview.lua:585: in upvalue 'docview_draw'
    /home/bartolomey/.config/lite-xl/plugins/debugger/init.lua:250: in upvalue 'old_draw'
    /usr/share/lite-xl/plugins/linewrapping.lua:529: in upvalue 'parent_draw'
    /home/bartolomey/.config/lite-xl/plugins/gitblame/init.lua:145: in function </home/bartolomey/.config/lite-xl/plugins/gitblame/init.lua:144>
    (...tail calls...)
    /home/bartolomey/.config/lite-xl/plugins/debugger/init.lua:385: in method 'draw'
    ... (skipping 15 levels)
    ...y/.config/lite-xl/plugins/plugin_manager/plugin_view.lua:66: in upvalue 'draw'
    /usr/share/lite-xl/plugins/autocomplete.lua:598: in upvalue 'root_view_draw'
    /usr/share/lite-xl/plugins/contextmenu.lua:32: in upvalue 'root_view_draw'
    /usr/share/lite-xl/plugins/treeview.lua:498: in upvalue 'root_view_draw'
    /home/bartolomey/.config/lite-xl/plugins/lsp/listbox.lua:520: in upvalue 'root_view_draw'
    /home/bartolomey/.config/lite-xl/libraries/widget/init.lua:1468: in function 'core.rootview.draw'
    /usr/share/lite-xl/core/init.lua:1341: in function 'core.step'
    /usr/share/lite-xl/core/init.lua:1401: in function 'core.run'
    (...tail calls...)
    [string "local core..."]:14: in function <[string "local core..."]:6>
    [C]: in function 'xpcall'
    [string "local core..."]:6: in main chunk
adamharrison commented 4 days ago

Hrm. I don't use codeplus, could be something to do with that. Not sure. I'll look into it.

BartolomeyKant commented 4 days ago

I just remove codeplus and got the same error

Error: /usr/share/lite-xl/core/docview.lua:444: bad argument #1 to 'sub' (string expected, got nil)

stack traceback:
    [C]: in function 'string.sub'
    /usr/share/lite-xl/core/docview.lua:444: in function </usr/share/lite-xl/core/docview.lua:438>
    (...tail calls...)
    /home/bartolomey/.config/lite-xl/plugins/bracketmatch.lua:236: in upvalue 'draw_line_text'
    /home/bartolomey/.config/lite-xl/plugins/colorpreview.lua:74: in function </home/bartolomey/.config/lite-xl/plugins/colorpreview.lua:73>
    (...tail calls...)
    /usr/share/lite-xl/core/docview.lua:585: in upvalue 'docview_draw'
    /home/bartolomey/.config/lite-xl/plugins/debugger/init.lua:250: in upvalue 'old_draw'
    /usr/share/lite-xl/plugins/linewrapping.lua:529: in upvalue 'parent_draw'
    /home/bartolomey/.config/lite-xl/plugins/gitblame/init.lua:145: in function </home/bartolomey/.config/lite-xl/plugins/gitblame/init.lua:144>
    (...tail calls...)
    /home/bartolomey/.config/lite-xl/plugins/debugger/init.lua:385: in method 'draw'
    /usr/share/lite-xl/core/node.lua:592: in function 'core.node.draw'
    ... (skipping 14 levels)
    ...y/.config/lite-xl/plugins/plugin_manager/plugin_view.lua:66: in upvalue 'draw'
    /usr/share/lite-xl/plugins/autocomplete.lua:598: in upvalue 'root_view_draw'
    /usr/share/lite-xl/plugins/contextmenu.lua:32: in upvalue 'root_view_draw'
    /usr/share/lite-xl/plugins/treeview.lua:498: in upvalue 'root_view_draw'
    /home/bartolomey/.config/lite-xl/plugins/lsp/listbox.lua:520: in upvalue 'root_view_draw'
    /home/bartolomey/.config/lite-xl/libraries/widget/init.lua:1468: in function 'core.rootview.draw'
    /usr/share/lite-xl/core/init.lua:1341: in function 'core.step'
    /usr/share/lite-xl/core/init.lua:1401: in function 'core.run'
    (...tail calls...)
    [string "local core..."]:14: in function <[string "local core..."]:6>
    [C]: in function 'xpcall'
    [string "local core..."]:6: in main chunk
adamharrison commented 4 days ago

No idea then. Could be a distinction between what lxl I'm running and your version (it should be functional on 2.1.5, but my main driver is the RC for 3.0).

I'll take a look.