mago icon indicating copy to clipboard operation
mago copied to clipboard

Bug with command -file-exec-and-symbols

Open andre2007 opened this issue 1 month ago • 3 comments

Hi,

this took my quite a time to find :)

When I execute this command: -file-exec-and-symbols "C:\dlang\projects\mago-dap\test\helloworld.exe"

an error is returned: ^error,msg="Executable file not found: C:\\dlang\\projects\\mago-dap\\est\\helloworld.exe"

Please note, instead of foldername test, it now says est. Just for testing, I tried to copy the folder test to est. Now the command -file-exec-and-symbols "C:\dlang\projects\mago-dap\test\helloworld.exe" works, because it finds the folder est.

It seems this command make strange things to the folder name...

Kind regadrs André

andre2007 avatar Nov 15 '25 20:11 andre2007

Copilot assumes this issue:

This is a string escaping issue. In C++, \t is interpreted as a tab character escape sequence. When the path is being constructed or passed as a string literal, the \t in

std::wstring path = L"C:\dlang\projects\mago-dap\test\helloworld.exe";

is being treated as a tab character, which then gets replaced or mangled.

andre2007 avatar Nov 15 '25 20:11 andre2007

String argument processing is here: https://github.com/rainers/mago/blob/master/MagoMI/mago-mi/source/miutils.cpp#L271, added with the comment "CDT compatibility fixes". I suspect always escaping \ as \\ is expected.

rainers avatar Nov 16 '25 08:11 rainers

Thanks I will try to make a pull request

andre2007 avatar Nov 16 '25 11:11 andre2007