↑ ↓ ← → 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
->
↑ ↓ ← → 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
->
↑ ↓ ← → 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.
↑ ↓ ← → 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..
↑ ↓
← → 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
↑ ↓ ← → 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
↑ ↓ ← → 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
↑ ↓ ← → 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
↑ ↓ ← → 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
↑ ↓ ← → 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