View mode: basic / threaded / horizontal-split · Log in · Help
April 09, 2007
bug
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
->
April 10, 2007
Re: bug
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
> ->
April 12, 2007
Re: bug
Tank you for the fix. But now the breakpoint is active forever which is not true for breakpoints not inside a loop.
April 12, 2007
Re: bug
Sorry, my bad.
April 12, 2007
Re: bug
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..
April 12, 2007
Re: bug
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
April 19, 2007
Re: bug
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
April 19, 2007
Re: bug
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
April 19, 2007
Re: bug
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
>>>
April 20, 2007
Re: bug
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
>>>>
« First   ‹ Prev
1 2
Top | Discussion index | About this forum | D home