lite-xl / lite-xl-ide

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

Trying to run GDB on windows with zig-mingw built .exe fails #5

Closed mundusnine closed 1 month ago

mundusnine commented 11 months ago

When calling the debugger:start-or-continue command on windows on a .exe built with zig cc -ggdb3 it opens the toggle window(stack trace etc.) then says starting and nothing happens: image

No log messages appear either.

Miscellaneous info:

zig cc generates separate symbol files even when using mingw-libc.

gdb is on PATH as I use scoop to install it.

mundusnine commented 11 months ago

So after some searching, I found out that this isn't a windows issue, but more a pragtical issue. So the process in pragtical needs to have a second argument which is a table of process options: image

and as we can see from the process.c in pragtical it is indeed needed.

Right now, it still doesn't debug even when passing the options table. Maybe I need to put a specific setting for the PIPE's since we are using gdb from command-line if I am not mistaken ?

jgmdev commented 11 months ago

The issue on Pragtical should be that since we incorporated https://github.com/lite-xl/lite-xl/pull/1455 the editor is no longer doing a chdir to the current root project directory. The solution would be to adapt lite-xl-ide plugin to account for this change or we restore the chdir to root project directory to support older plugins.

As a workaround you may set cwd option to core.root_project().path and see if that works.

adamharrison commented 1 month ago

As this is an issue only in pragtical, I am closing this issue; when lite-xl transitions over to this system, this will be included as part of the standard plugin.