burner / test_migration2

0 stars 0 forks source link

New debug experience: possible to execute pure functions during expression evaluation? #32

Open burner opened 7 years ago

burner commented 7 years ago

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...

burner commented 7 years ago

r.sagitario commented on 2017-01-14T09:42:40Z

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.

burner commented 7 years ago

turkeyman commented on 2017-01-14T10:58:34Z

_<

burner commented 6 years ago

turkeyman commented on 2018-05-06T20:11:31Z

How's this going? Has there been any progress? This would be super handy!! pure properties are overwhelmingly common.

burner commented 6 years ago

r.sagitario commented on 2018-05-07T06:12:51Z

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.

burner commented 6 years ago

r.sagitario commented on 2018-05-24T07:11:57Z

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...

burner commented 6 years ago

turkeyman commented on 2018-05-25T04:02:57Z

It can call them... even if they mutate global state?

burner commented 6 years ago

r.sagitario commented on 2018-05-25T05:22:17Z

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 :-/

burner commented 6 years ago

turkeyman commented on 2018-05-25T05:37:31Z

This is going to be so amazing if it works!

burner commented 6 years ago

r.sagitario commented on 2018-06-02T12:46:38Z

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.

burner commented 6 years ago

turkeyman commented on 2018-06-06T05:11:58Z

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).

burner commented 6 years ago

r.sagitario commented on 2018-06-06T06:30:09Z

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.

burner commented 5 years ago

r.sagitario commented on 2019-08-04T15:37:22Z

Arbitrary return types now supported in https://github.com/dlang/visuald/releases/tag/v0.50.1-beta1