www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics



digitalmars.D.debugger - bug

↑ ↓ ← bobef <asd asd.asd> writes:
As you can see below, if you set a bp in a loop and when it is reached you
re-set it on the same line and run again, the break point is not working.




test.d

--------------------------------

module test;

int main(char[][] argv)
{
	for(int c=0;c<50;c++)
	{
		c=c; //line 7
		c=c;
		c=c;
		c=c;
		c=c;
	}
	return 0;
}


C:\......>ddbg test.exe
Ddbg v0.0.6 alpha - D Debugger
Copyright (c) 2007 Jascha Wetzel
http://ddbg.mainia.de/

->bp test.d:7
Breakpoint set: test.d:7 0x402021
->r
ntdll.dll  loaded
KERNEL32.dll  loaded
USER32.dll  loaded
GDI32.dll  loaded
IMM32.dll  loaded
ADVAPI32.dll  loaded
RPCRT4.dll  loaded
LPK.dll  loaded
USP10.dll  loaded
msvcrt.dll  loaded
Breakpoint 0 hit
test.d:7 0x402021
                c=c;
->bp test.d:7
Breakpoint set: test.d:7 0x402021
->r
Process terminated
->
Apr 09 2007
Jascha Wetzel <"[firstname]" mainia.de> writes:
this is already fixed in the next release.

bobef wrote:
 As you can see below, if you set a bp in a loop and when it is reached you
re-set it on the same line and run again, the break point is not working.
 
 
 
 
 test.d
 
 --------------------------------
 
 module test;
 
 int main(char[][] argv)
 {
 	for(int c=0;c<50;c++)
 	{
 		c=c; //line 7
 		c=c;
 		c=c;
 		c=c;
 		c=c;
 	}
 	return 0;
 }
 
 
 C:\......>ddbg test.exe
 Ddbg v0.0.6 alpha - D Debugger
 Copyright (c) 2007 Jascha Wetzel
 http://ddbg.mainia.de/
 
 ->bp test.d:7
 Breakpoint set: test.d:7 0x402021
 ->r
 ntdll.dll  loaded
 KERNEL32.dll  loaded
 USER32.dll  loaded
 GDI32.dll  loaded
 IMM32.dll  loaded
 ADVAPI32.dll  loaded
 RPCRT4.dll  loaded
 LPK.dll  loaded
 USP10.dll  loaded
 msvcrt.dll  loaded
 Breakpoint 0 hit
 test.d:7 0x402021
                 c=c;
 ->bp test.d:7
 Breakpoint set: test.d:7 0x402021
 ->r
 Process terminated
 ->

Apr 10 2007
↑ ↓ bobef <asd asd.asd> writes:
Tank you for the fix. But now the breakpoint is active forever which is not
true for breakpoints not inside a loop.
Apr 12 2007
↑ ↓ → bobef <asd asd.asd> writes:
Sorry, my bad.
Apr 12 2007
→ dickl <dick221z yahoo.com> writes:
I see two problems with 0.1.1

1) I set a breakpoint a few lines above a foreach loop. I continue and 
the debugger keeps breaking at the foreach loop.

2) When evaluating a wchar string, cast(wchar)str doesn't correctly show 
the value of the string.

I'll try to reduce the code to something smaller and post the code later 
on..
Apr 12 2007
dickl <dick221z yahoo.com> writes:
The following code will show the debugger break at places where break 
points are not set.

Also, the wchar[] str doesn't evaluate properly.

-----------------------------------------


import std.stdio;
  import std.utf;

  int main()
  {

  // cast(wchar)str doesn't evaluate properly in ddbg 0.1.1
      wchar [] str = toUTF16(cast(char [])"Hello");

  // set a break point here (line 10)
      writefln(str);
  //single step (over) until inside of the foreach loop
      Test t = new Test;


      foreach(wch;t)
      {
          wchar c = wch;
  // dispite doing a step (over), ddbg will stop inside of the onApply
  // doing a continue from this point , ddbg will break on the foreach 
statement
          writefln(c);
      }

      return 0;
  }//end int main()


  class Test
  {
     wchar [] str;

    this()
    {
        str=toUTF16(cast(char [])"Hello Again");
    }


  	int opApply(int delegate(inout wchar wch) dg)
  	{
  		int result=0;
  		for(uint i=0;i<str.length;i++)
  		{
  			result=dg(str[i]);
  			if(result)
  				break;
  		}
  		return result;
  	}
  }//end class Test
Apr 12 2007
↑ ↓ Jascha Wetzel <"[firstname]" mainia.de> writes:
thanks!
both fixed in the next release

dickl wrote:
 
 The following code will show the debugger break at places where break
 points are not set.
 
 Also, the wchar[] str doesn't evaluate properly.
 
 -----------------------------------------
 
 
 import std.stdio;
  import std.utf;
 
  int main()
  {
 
  // cast(wchar)str doesn't evaluate properly in ddbg 0.1.1
      wchar [] str = toUTF16(cast(char [])"Hello");
 
  // set a break point here (line 10)
      writefln(str);
  //single step (over) until inside of the foreach loop
      Test t = new Test;
 
 
      foreach(wch;t)
      {
          wchar c = wch;
  // dispite doing a step (over), ddbg will stop inside of the onApply
  // doing a continue from this point , ddbg will break on the foreach
 statement
          writefln(c);
      }
 
      return 0;
  }//end int main()
 
 
  class Test
  {
     wchar [] str;
 
    this()
    {
        str=toUTF16(cast(char [])"Hello Again");
    }
 
 
      int opApply(int delegate(inout wchar wch) dg)
      {
          int result=0;
          for(uint i=0;i<str.length;i++)
          {
              result=dg(str[i]);
              if(result)
                  break;
          }
          return result;
      }
  }//end class Test

Apr 19 2007
↑ ↓ Jascha Wetzel <"[firstname]" mainia.de> writes:
wrong - the wchar problem will not be fixed. DMD uses ambiguous CV types
here (wchar[] = ushort[]) - bugzilla #1104

Jascha Wetzel wrote:
 thanks!
 both fixed in the next release
 
 dickl wrote:
 The following code will show the debugger break at places where break
 points are not set.

 Also, the wchar[] str doesn't evaluate properly.

 -----------------------------------------


 import std.stdio;
  import std.utf;

  int main()
  {

  // cast(wchar)str doesn't evaluate properly in ddbg 0.1.1
      wchar [] str = toUTF16(cast(char [])"Hello");

  // set a break point here (line 10)
      writefln(str);
  //single step (over) until inside of the foreach loop
      Test t = new Test;


      foreach(wch;t)
      {
          wchar c = wch;
  // dispite doing a step (over), ddbg will stop inside of the onApply
  // doing a continue from this point , ddbg will break on the foreach
 statement
          writefln(c);
      }

      return 0;
  }//end int main()


  class Test
  {
     wchar [] str;

    this()
    {
        str=toUTF16(cast(char [])"Hello Again");
    }


      int opApply(int delegate(inout wchar wch) dg)
      {
          int result=0;
          for(uint i=0;i<str.length;i++)
          {
              result=dg(str[i]);
              if(result)
                  break;
          }
          return result;
      }
  }//end class Test


Apr 19 2007
↑ ↓ dckl <dick221z yahoo.com> writes:
Well maybe 1.014 will fix the problem :)

Would it be possible to have it evaluate if cast to a wchar ?


Jascha Wetzel wrote:
 wrong - the wchar problem will not be fixed. DMD uses ambiguous CV types
 here (wchar[] = ushort[]) - bugzilla #1104

 Jascha Wetzel wrote:
   
 thanks!
 both fixed in the next release

 dickl wrote:
     
 The following code will show the debugger break at places where break
 points are not set.

 Also, the wchar[] str doesn't evaluate properly.

 -----------------------------------------


 import std.stdio;
  import std.utf;

  int main()
  {

  // cast(wchar)str doesn't evaluate properly in ddbg 0.1.1
      wchar [] str = toUTF16(cast(char [])"Hello");

  // set a break point here (line 10)
      writefln(str);
  //single step (over) until inside of the foreach loop
      Test t = new Test;


      foreach(wch;t)
      {
          wchar c = wch;
  // dispite doing a step (over), ddbg will stop inside of the onApply
  // doing a continue from this point , ddbg will break on the foreach
 statement
          writefln(c);
      }

      return 0;
  }//end int main()


  class Test
  {
     wchar [] str;

    this()
    {
        str=toUTF16(cast(char [])"Hello Again");
    }


      int opApply(int delegate(inout wchar wch) dg)
      {
          int result=0;
          for(uint i=0;i<str.length;i++)
          {
              result=dg(str[i]);
              if(result)
                  break;
          }
          return result;
      }
  }//end class Test
       



Apr 19 2007
↑ ↓ Jascha Wetzel <"[firstname]" mainia.de> writes:
it already evaluates as expected if you cast to wchar

->= str
{
  [0] = 0x0048,
  [1] = 0x0065,
  [2] = 0x006c,
  [3] = 0x006c,
  [4] = 0x006f
}
->= cast(wchar[])str
"Hello"

dckl wrote:
 Well maybe 1.014 will fix the problem :)
 
 Would it be possible to have it evaluate if cast to a wchar ?
 
 
 Jascha Wetzel wrote:
 wrong - the wchar problem will not be fixed. DMD uses ambiguous CV types
 here (wchar[] = ushort[]) - bugzilla #1104

 Jascha Wetzel wrote:
  
 thanks!
 both fixed in the next release

 dickl wrote:
    
 The following code will show the debugger break at places where break
 points are not set.

 Also, the wchar[] str doesn't evaluate properly.

 -----------------------------------------


 import std.stdio;
  import std.utf;

  int main()
  {

  // cast(wchar)str doesn't evaluate properly in ddbg 0.1.1
      wchar [] str = toUTF16(cast(char [])"Hello");

  // set a break point here (line 10)
      writefln(str);
  //single step (over) until inside of the foreach loop
      Test t = new Test;


      foreach(wch;t)
      {
          wchar c = wch;
  // dispite doing a step (over), ddbg will stop inside of the onApply
  // doing a continue from this point , ddbg will break on the foreach
 statement
          writefln(c);
      }

      return 0;
  }//end int main()


  class Test
  {
     wchar [] str;

    this()
    {
        str=toUTF16(cast(char [])"Hello Again");
    }


      int opApply(int delegate(inout wchar wch) dg)
      {
          int result=0;
          for(uint i=0;i<str.length;i++)
          {
              result=dg(str[i]);
              if(result)
                  break;
          }
          return result;
      }
  }//end class Test
       




Apr 20 2007
↑ ↓ → dickl <dick221z yahoo.com> writes:
My stupidity, I was forgetting the [] in the cast

Jascha Wetzel wrote:
 it already evaluates as expected if you cast to wchar
 
 ->= str
 {
   [0] = 0x0048,
   [1] = 0x0065,
   [2] = 0x006c,
   [3] = 0x006c,
   [4] = 0x006f
 }
 ->= cast(wchar[])str
 "Hello"
 
 dckl wrote:
 Well maybe 1.014 will fix the problem :)

 Would it be possible to have it evaluate if cast to a wchar ?


 Jascha Wetzel wrote:
 wrong - the wchar problem will not be fixed. DMD uses ambiguous CV types
 here (wchar[] = ushort[]) - bugzilla #1104

 Jascha Wetzel wrote:
  
 thanks!
 both fixed in the next release

 dickl wrote:
    
 The following code will show the debugger break at places where break
 points are not set.

 Also, the wchar[] str doesn't evaluate properly.

 -----------------------------------------


 import std.stdio;
  import std.utf;

  int main()
  {

  // cast(wchar)str doesn't evaluate properly in ddbg 0.1.1
      wchar [] str = toUTF16(cast(char [])"Hello");

  // set a break point here (line 10)
      writefln(str);
  //single step (over) until inside of the foreach loop
      Test t = new Test;


      foreach(wch;t)
      {
          wchar c = wch;
  // dispite doing a step (over), ddbg will stop inside of the onApply
  // doing a continue from this point , ddbg will break on the foreach
 statement
          writefln(c);
      }

      return 0;
  }//end int main()


  class Test
  {
     wchar [] str;

    this()
    {
        str=toUTF16(cast(char [])"Hello Again");
    }


      int opApply(int delegate(inout wchar wch) dg)
      {
          int result=0;
          for(uint i=0;i<str.length;i++)
          {
              result=dg(str[i]);
              if(result)
                  break;
          }
          return result;
      }
  }//end class Test
       





Apr 21 2007