mago
mago copied to clipboard
mago-mi: -break-insert -f does not work.
-break-insert -f
allows for the insertion of breakpoints before the actual executable file is loaded. Breakpoints created like this seem to never be hit.
@buggins I guess this refers to mago-mi.
Yes it does refer to mago-mi.
I will check it. I'm planning to work on dlangide debugging support improvement next month, so I can hack mago-mi
Thanks. I've noticed another unrelated issue. See #15.
I also hit this issue. @pirocks I assume you ask because this is related to IntelliJ D plugin you are involved. I did some tests and it seems it is related to the order:
-- Breakpoint is not hit --
C:\D\tools\mago-mi.exe --interpreter=mi2
-break-insert -f C:/D/projects/magotest/source/app.d:6
-file-exec-and-symbols C:/D/projects/magotest/magotest.exe
run
-- Breakpoint is hit --
C:\D\tools\mago-mi.exe --interpreter=mi2
-file-exec-and-symbols C:/D/projects/magotest/magotest.exe
-break-insert -f C:/D/projects/magotest/source/app.d:6
run
-- Breakpoint is hit --
C:\D\tools\mago-mi.exe --interpreter=mi2 C:/D/projects/magotest/magotest.exe
-break-insert -f C:/D/projects/magotest/source/app.d:6
-list-features
run
The IntelliJ D Plugin has 2 issues:
-
Instead of executing command
-file-exec-and-symbols C:/D/projects/magotest/magotest.exe
it executes commandfile C:/D/projects/magotest/magotest.exe
. MagoMI only knows about the-file-exec-and-symbols
command. As far as I understand the documentation both should be equivalent. -
It sets the breakpoint before the executable is set.
I do not know whether setting breakpoints should be supported before the executable is set. But an easy way to solve the issue is just to change the OS call from C:\D\tools\mago-mi.exe --interpreter=mi2
to C:\D\tools\mago-mi.exe --interpreter=mi2 C:/D/projects/magotest/magotest.exe
and remove the command "file C:/D/projects/magotest/magotest.exe" because the executable is already set. As far as I understood this is also the way DlangIDE is working.
I compared the behavior of GDB mi2 (linux) with MagoMI. In my test also GDB mi2 does not allow setting a breakpoint before the executable is specified. Doing so, will throw an error with the message "please specify executable first with command file".
Please note, while gdb mi2 knows the commands "file" and "-file-exec-and-symbols", MagoMI only knows command "-file-exec-and-symbols". Therefore "-file-exec-and-symbols" should be used by IntelliJ D plugin.
This issue can be closed. Today the merge of the pr was done which loads the executable first and then sets the breakpoints.
It might no longer be necessary for intellij, but the GDB/MI-API defines this function. So I think the issue can stay open.