bug

dickl dick221z at yahoo.com
Thu Apr 12 11:12:31 PDT 2007


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


More information about the Digitalmars-d-debugger mailing list