Open dlangBugzillaToGithub opened 7 years ago
The VS debugger can call functions in the watch window, but that needs appropriate debug information. Unfortunately the full function type info is not generated by dmd.
_<
How's this going? Has there been any progress? This would be super handy!!
pure
properties are overwhelmingly common.
I remember I tried allowing calls within the expression evaluator (and fixed the parsing) but actually executing it didn't work so easily. So no support yet.
The concord plugin in the latest build on https://ci.appveyor.com/project/rainers/visuald allows calling simple free functions, i.e. no arguments. They might have to be given fully qualified, e.g. "TestApp.testcall()".
No member functions so far...
It can call them... even if they mutate global state?
Yes, you can also do this in C++. It's necessary to click the "Try Again" icon, though, to not reevaluate it in the watch window with every step. I think this can be done, too.
For properties execution should be automatic, but I don't think the debug info contains info about strong purity. We might have to extract that info from the mangling :-/
This is going to be so amazing if it works!
You can now call function and delegates without arguments in the watch window, i.e. this includes member functions. You'll still have to add "()" even for properties.
Okay, that's awesome!
Seems to work well. So for const pure properties (or methods that look like properties) where it's safe to call them without mutating, is it possible to automatically populate the struct/class with phony members for the property getters? Ideally they would have a different little icon than data members (like C# does with its properties).
I'm currently still trying to figure out how to deal with slices and delegates, because they are returned in a way incompatible with any C++ ABI.
There is currently no annotation of pure or const in the debug info, and I have so far avoided adding a demangler.
Not sure about automatically showing them for any class or struct, maybe I should have a look how it works in C#. I'm currently leaning towards making them available for explicit use in some kind of visualizer, so you can also avoid repeating the same information by property functions and private members when showing the struct.
Arbitrary return types now supported in https://github.com/dlang/visuald/releases/tag/v0.50.1-beta1
turkeyman reported this on 2016-11-16T03:33:32Z
Transfered from https://issues.dlang.org/show_bug.cgi?id=16692
CC List
Description
Is it possible to execute 'pure' functions during expression evaluation? Being able to hover over properties for instance would be SOOO helpful.
Debug engine would need to be able to evaluate any function arguments, and then produce a function call using those evaluated arguments, result folds back into expression evaluation...