Bug 13915 – Mago doesn't handle C code very well

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
visuald
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2014-12-30T06:52:00Z
Last change time
2017-01-24T07:43:34Z
Assigned to
nobody
Creator
turkeyman

Comments

Comment #0 by turkeyman — 2014-12-30T06:52:18Z
So I'm debugging x64 code with Mago. I often step into C code, where I find that function arguments aren't working properly, most of the time (but not all the time), the debugger is unable to inspect the value of function args. I'd suggesting trying to step into some C code from D under Mago-x64. There are lots of problems...
Comment #1 by r.sagitario — 2015-01-01T22:08:38Z
I guess the arguments are still in registers while stepping through C code. Mago might not support that too well. We cannot support C/C++ completely, not sure where to draw the line. It would be best to have some mixed mode with the C++ part handled by the VS debugger, but I'm not aware of that being possible (the C#/C++ mixed mode debugger is just another engine).
Comment #2 by turkeyman — 2015-01-02T10:58:55Z
Yeah, I don't know that mixed mode with different debuggers is possible. I suspect, sadly, it's just going to be a long and slow process of making Mago support relevant C/C++ cases as they arise, such that in the end, it becomes a useful mixed-mode debugger of it's own. For me personally, I probably use a rather small subset of C/C++ debugger features. I barely use templates or modern language features in C++, and that's probably the majority of the complexity. What do you know about LLDB? If Clang can output COFF and CV8/PDB, does that mean LLDB can read those formats? Do you foresee a time where we may be able to create a Visual Studio shim for LLDB?
Comment #3 by r.sagitario — 2015-01-02T13:14:37Z
Some basic features like variable lifetime/register support should help D too, though dmd doesn't output that info yet. So C style code might be workable. I guess COFF/CV8 support for clang is meant to integrate clang into the VS world, not to support it in lldb. At last years CppCon, I met a few people from Google that were assigned to improve Clang's Windows experience including full debug support.
Comment #4 by r.sagitario — 2015-05-17T14:12:17Z
The lexical scope support in mago might help here. Try it in Visual D 0.3.41.
Comment #5 by r.sagitario — 2017-01-24T07:43:34Z
Mago treats "->" as "." now. With the new Concord integration C/C++ and D should no longer interfere, so work on supporting C in mago is futile.