Visual D seems to have a new bug

Rainer Schuetze r.sagitario at gmx.de
Tue Oct 1 18:44:37 UTC 2019



On 01/10/2019 17:41, Brett wrote:
> On Tuesday, 1 October 2019 at 06:12:42 UTC, Rainer Schuetze wrote:
>>
>>
>> On 01/10/2019 06:05, Brett wrote:
>>> Variables are not showing properly. Specifically the trouble I'm
>>> having is with this pointers.
>>>
>>> I have a simple struct and toString and this shows in the
>>> watches/locals but it expands to not found:
>>>
>>> -        this    0x0000028d3a7d12c8 {0x000000005da0e220}
>>> -            0x000000005da0e220
>>>         x    D0001: Error: Expression couldn't be evaluated
>>>
>>> simply doing auto This = this;
>>>
>>> This works.
>>>
>>> I've noticed other weird issues in the watches and locals not showing
>>> variables.
>>>
>>
>> A test case would be helpful...
>>
>> I can only suspect that 'this' is stored in some register, but that it
>> is not reflected in the debug information. It looks like your struct
>> contains a pointer, maybe the value shown doesn't point to existing
>> memory? Does `This` show the same pointer values, but proper fields?
> 
> -        this    0x0000016ff0f6b588 {0x000000000001ffff}    P**
> +            0x000000000001ffff    P*
> -        This    {x=131071}    P
> 
> auto This = this;
> 
> This is not showing as a pointer, this is a double pointer and seems to
> be referring to the first value.
> 
> Not sure if the address is right, probably is, seems the problem is that
> this is being treating as a **.
> 
> I don't have any reduced test case now but it should be simple to do or
> find the bug I imagine.
> 
> It literally is just
> 
> struct P { long x; auto foo() { auto This = this; } }
> 
> type of thing with a bunch of other stuff that is irrelevant to the
> problem.
> 
> It shouldn't matter how P is being used(I am using pointers to P in
> arrays P*[] in some cases that may be throwing something off that is
> malformed already).
> 
> But clearly since `auto This = this` is correct, this is either 1. A
> debugging map error(when it displays this automatically it screws up and
> dereferences it twice) or 2. Or most likely 1.
> 
> The reason being is that the code uses this and works fine so it is no
> actually dereferencing junk.
> 
> Recently you modified the code to fix a pointer bug with variables in
> the watch(null values I believe) and so chances are that screwed up
> this. It used to work fine so is a relatively new thing and the bug is
> clearly an extra dereferencing issue and only a "visual" problem.
> 
>

I cannot easily reproduce the issue, but it might already be fixed by
the same patch as the one avoiding crashes with pointers to empty arrays.

You can try to replace "c:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\Common7\Packages\Debugger\MagoNatCC.dll" (or
similar path depending on the VS version) with the
Appveyor artifact here:
https://ci.appveyor.com/project/rainers/mago/builds/27804605/artifacts

This version also contains some of your recent suggestions.


More information about the Digitalmars-d-debugger mailing list