mago-mi: GDB/MI compatible frontend for Mago debugger

E.S. Quinn via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Thu May 19 20:15:46 PDT 2016


Unfortunately in this particular case, CDT's debugging is pretty 
fancy and is going to need most if not all of the MI.

On Thursday, 19 May 2016 at 13:29:14 UTC, Bruno Medeiros wrote:
> On 19/05/2016 08:41, Vadim Lopatin wrote:
>> On Wednesday, 18 May 2016 at 18:02:12 UTC, Bruno Medeiros 
>> wrote:
>>> While DDT technically work oks with GDB (the GDB from 
>>> mingw-w64 that
>>> is), you are right, there isn't a compiler on Windows that 
>>> supplies
>>> debug info in the way GDB understands. See
>>> https://wiki.dlang.org/Debuggers.
>>>
>>> DMD produces debug info COFF or OMF format, which GDB doesn't 
>>> know
>>> anything about (nor ever will). LDC should in theory work 
>>> with DWARF
>>> info, but this is broken somehow. Not because of LLVM though, 
>>> since
>>> for example Rust on Windows works. As for GDC, it doesn't 
>>> even supply
>>> binaries for Windows (that target Windows) -  it is not a 
>>> supported
>>> platform.
>>>
>>> BTW, Eclipse/DDT should in theory work with mago-mi as well, 
>>> at least
>>> if the protocol is implemented correctly. Have you tried it? 
>>> I dunno
>>> how complete your MI implementation is.
>>
>> So it looks like mago-mi might be helpful for DDT on Windows.
>> mago-mi supports subset of GDB/MI commands enough for 
>> DlangIDE, but it
>> can be easy extended.
>>
>> Currenlty supported commands can be shown using help command 
>> (use
>> --interpreter=mi2 when running mago-mi, otherwise it will 
>> print non-MI
>> commands). Also commands are listed in readme file
>> https://github.com/buggins/mago/blob/master/MagoMI/mago-mi/README.md
>>
>> I didn't try DDT with mago-mi, and so I'm not sure which 
>> commands must
>> be supported by debugger to get it working with DDT.
>>
>> To get list of commands DDT tries to use you can either add
>> --log-file=magomi.log --log-level=TRACE to mago-mi command 
>> line or use
>> debug build of mago-mi.
>> It will all STDIN data to log file, and report errors for 
>> unsupported
>> commands.
>>
>
> I also don't know which MI commands need to be supported to 
> have it work with DDT. The thing is I didn't write the GDB 
> debugger integration for DDT, I just reused the one from CDT. 
> So I'm not that familiar with those internals.
>
> BTW, the MI integration is fairly language agnostic, so in 
> theory your debugger could be used by CDT to debug C/C++ 
> programs too, no? At least those generated by DMC. Maybe Visual 
> Studio ones too?

I'm experimenting with the build of mago-mi that comes with the 
current ~master for dlangide, and it seems to throw an 
unrecognized parameter error when on the --log-level=TRACE 
parameter.

And it seems that the version string it returns upsets eclipse, 
as it throws the following error:

  Could not determine GDB version using command: 
D:\WinHome\<redacted>\AppData\Roaming\dub\packages\dlangide-master\bin\mago-mi.exe --version
  Unexpected output format:

  mago-mi debugger v0.1


Though, from my experience using it in Linux, eclipse-CDT's 
debugger seems pretty full-featured; it will likely require large 
swaths of mi functionality to be fully useful.


More information about the Digitalmars-d-announce mailing list