-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tuple or Args...
packs show nothing in the debugger?
#286
Comments
I guess by Regarding tuples, there is some support for compiler internal tuples, but nothing specific for std.typecons.Tuple. I'm wondering if the __debug* should also be searched for as free function so you can add them without modifying library code. I haven't tried anything yet, but it would be good if you can provide examples so I don't have to guess your use case. |
Ah I didn't realise compiler symbols were being hidden, but I guess that makes sense! DMD does make a lot of named temp symbols. I wonder if the debug info has sufficient metadata available to know if the symbol to be hidden is a function argument, and then not hide it in that case?
Interesting idea. It reminds me of a systemic issue I have with D in general though on that front; the namespace of a user defined free function which is intended to be used UFCS style to do this sort of functionality expansion on types you don't control; there's always a problem with namespacing... I define the symbol somewhere, but there's no way to associate the import path with the original symbol. How would you find it? Normally the calling code is unable to have explicit imports for the helper functions... I imagine a similar challenge in the debugger, and I wonder if a creative solution for the debugger might also inform a similar solution for use in regular code...
Literally just a |
Maybe anything starting with
Indeed, not so obvious, but there is no module scope in the debug info to begin with, just mangling. I guess it has to be a global symbol search disregarding module name and return type. The good thing would be that it should also work with LDC which does not emit debug info for methods of a struct.
I tried that. Unfortunately, dmd doesn't emit any debug information about fields of a tuple, just a couple of methods. It works with LDC. There is even an option "recombine tuples from compiler generated fields" in the Mago options, but that results in misplaced commas (just fixed that). |
The new version https://github.com/dlang/visuald/releases/tag/v1.4.0-rc4 now doesn't hide It also supports free __debug functions as in string __debugOverview(ref const String s)
{
return s._s;
}
auto __debugOverview(ref Tuple!(int,int,int) tpl)
{
struct S { int a, b, c; }
return new S(tpl[0], tpl[1], tpl[2] );
}
auto __debugExpanded(ref Tuple!(int,int,int) tpl)
{
return __debugOverview(tpl);
} which can also be used as a workaround for the missing tuple debug info. Unfortunately returning larger structs directly doesn't work yet. You need explicite instantiations for the used tuple-types, though. |
I use a lot of
Args...
and there seems to be no way to inspect them in the debugger.Also
Tuple
just shows in the debugger as an empty struct. Any way to make these show the proper sequence of values?The text was updated successfully, but these errors were encountered: