www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Incredibly Annoying Bug

reply imr1984 <imr1984_member pathlink.com> writes:
If I have two source files: main.d and test.d with the following contents: 

main.d:
import test.d;

int main (char[][] args)
{
TemplateStruct!(int) test;
test.func(1);

return 0;
}

test.d:
struct TemplateStruct(T)
{
void func(int x)
{
x++;
}
}

Then if I try to step into test.func(), the code editor VS 2003 (and WinDBG)
just stays in the main.d file, even though it knows its in the test.d file. This
makes it incredibly hard to debug. The problem is with that parameterized
struct, if i remove it then alls fine:

main.d:
import test.d;

int main (char[][] args)
{
TemplateStruct!(int) test;
test.func(1);

return 0;
}

test.d:
struct TemplateStruct(T)
{
void func(int x)
{
x++;
}
}

So this means that DMD is producing bogus symbol information when parameterized
structs are used. In my complex project where this turns up, this bug also
causes the IDE to crash :(
May 23 2005
parent reply "Andrew Fedoniouk" <news terrainformatica.com> writes:
 Then if I try to step into test.func(), the code editor VS 2003 (and 
 WinDBG)
 just stays in the main.d file, even though it knows its in the test.d 
 file. This
 makes it incredibly hard to debug. The problem is with that parameterized
 struct, if i remove it then alls fine:

Bug? It is just a template instantiation. That is how templates work and why they are so effective.
 causes the IDE to crash :(

VS6 and WinDBG are both fine with this. Andrew. "imr1984" <imr1984_member pathlink.com> wrote in message news:d6tvh1$2g69$1 digitaldaemon.com...
 If I have two source files: main.d and test.d with the following contents:

 main.d:
 import test.d;

 int main (char[][] args)
 {
 TemplateStruct!(int) test;
 test.func(1);

 return 0;
 }

 test.d:
 struct TemplateStruct(T)
 {
 void func(int x)
 {
 x++;
 }
 }

 Then if I try to step into test.func(), the code editor VS 2003 (and 
 WinDBG)
 just stays in the main.d file, even though it knows its in the test.d 
 file. This
 makes it incredibly hard to debug. The problem is with that parameterized
 struct, if i remove it then alls fine:

 main.d:
 import test.d;

 int main (char[][] args)
 {
 TemplateStruct!(int) test;
 test.func(1);

 return 0;
 }

 test.d:
 struct TemplateStruct(T)
 {
 void func(int x)
 {
 x++;
 }
 }

 So this means that DMD is producing bogus symbol information when 
 parameterized
 structs are used. In my complex project where this turns up, this bug also
 causes the IDE to crash :(

 

May 24 2005
parent imr1984 <imr1984_member pathlink.com> writes:
Yes templates are great, but the bug is that the debug symbol information takes
my debugger into the wrong file when templated code is called. This is not cool.

In article <d6vuge$26h0$1 digitaldaemon.com>, Andrew Fedoniouk says...
 Then if I try to step into test.func(), the code editor VS 2003 (and 
 WinDBG)
 just stays in the main.d file, even though it knows its in the test.d 
 file. This
 makes it incredibly hard to debug. The problem is with that parameterized
 struct, if i remove it then alls fine:

Bug? It is just a template instantiation. That is how templates work and why they are so effective.
 causes the IDE to crash :(

VS6 and WinDBG are both fine with this. Andrew. "imr1984" <imr1984_member pathlink.com> wrote in message news:d6tvh1$2g69$1 digitaldaemon.com...
 If I have two source files: main.d and test.d with the following contents:

 main.d:
 import test.d;

 int main (char[][] args)
 {
 TemplateStruct!(int) test;
 test.func(1);

 return 0;
 }

 test.d:
 struct TemplateStruct(T)
 {
 void func(int x)
 {
 x++;
 }
 }

 Then if I try to step into test.func(), the code editor VS 2003 (and 
 WinDBG)
 just stays in the main.d file, even though it knows its in the test.d 
 file. This
 makes it incredibly hard to debug. The problem is with that parameterized
 struct, if i remove it then alls fine:

 main.d:
 import test.d;

 int main (char[][] args)
 {
 TemplateStruct!(int) test;
 test.func(1);

 return 0;
 }

 test.d:
 struct TemplateStruct(T)
 {
 void func(int x)
 {
 x++;
 }
 }

 So this means that DMD is producing bogus symbol information when 
 parameterized
 structs are used. In my complex project where this turns up, this bug also
 causes the IDE to crash :(

 


May 25 2005