Comment 1 for bug 2059856

Revision history for this message
In , Zixing Liu (liushuyu-011) wrote :

Created attachment 15447
Minimal reproducible example (D source code)

Hi there,

I have discovered a D class type resolution regression since GDB 10 (it was working properly in GDB 9).

Please find the reproducer in the file attached. You can compile the source code using either GDC or LDC2 (both can reproduce this issue):

gdc -g -O0 t.d -o t

To reproduce the bug, set the breakpoint to t.d:10 and examine the `i` global variable (using `p t.i`). GDB will then complain that "'t.i' has unknown type; cast it to its declared type."

I found a workaround to this problem by using `p (uv*)_D1t1iCQf2uv`, but obviously, this is non-ideal: the developer may not know the mangled variable name easily.

Since this looks like a regression, I did a simple `git bisect` that led me to this commit: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=727b7b1864973c2645a554727afd0eaf1303673a. I am unsure how demangle changes could affect the type resolution (maybe it's because GDB got confused about which entity to decode?)