D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 13915 - Mago doesn't handle C code very well
Summary: Mago doesn't handle C code very well
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: visuald (show other issues)
Version: D2
Hardware: x86_64 Windows
: P1 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-30 06:52 UTC by Manu
Modified: 2017-01-24 07:43 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Manu 2014-12-30 06:52:18 UTC
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 Rainer Schuetze 2015-01-01 22:08:38 UTC
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 Manu 2015-01-02 10:58:55 UTC
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 Rainer Schuetze 2015-01-02 13:14:37 UTC
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 Rainer Schuetze 2015-05-17 14:12:17 UTC
The lexical scope support in mago might help here. Try it in Visual D 0.3.41.
Comment 5 Rainer Schuetze 2017-01-24 07:43:34 UTC
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.