Samsung / netcoredbg

NetCoreDbg is a managed code debugger with MI interface for CoreCLR.
MIT License
743 stars 98 forks source link

`ToString()` and `GetType()` no longer works on generic objects #123

Closed alberto-carp closed 12 months ago

alberto-carp commented 1 year ago

After latest upgrade, it seems that netcoredbg no longer evaluate correctly methods like ToString() or GetType() on generic objects ( lists, dictionaries, etc). The issue seems to be general for all the generic objects which inherits from a non-generic object and try to call a function from the base. This functionality previously worked. I manage to make a fix by modifying the WalkMethods from the Evaluator class, by adding a new parameter to the WalkMethodsCallback. This callback now accept also an additional parameter has_generic_arguments which is true if the current type has generic args. In the initial code we, incorrectly pass the generic type arguments to the evaluation function also to the inherited methods from the base class and get an ParameterCountMishMatchException exception. when evaluating.

It's ok if I open a PR with my changes ?

viewizard commented 1 year ago

It's ok if I open a PR with my changes ?

Sure, PR are welcome. Please note, since we have only internal CI with tests, we don't merge PRs directly, but move it in our internal repo first. BTW, did you tested your changes with test suite? https://github.com/Samsung/netcoredbg/tree/master/test-suite

alberto-carp commented 1 year ago

No. I will run the tests then, before opening the PR.

gbalykov commented 12 months ago

This should be fixed in latest release. Feel free to reopen if you see any more related issues.