www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.debugger - ddbg 0.3

reply Bill Baxter <dnewsgroup billbaxter.com> writes:
Stepping through loops works now, but the counter variable does not get 
updated in the list of watches.  Wait...<tests further> that's not 
exactly true.

It doesn't get updated in this situation:

     // during first loop it's ok
     for (int i = 0; i< s.blip.length; i++) {
         s.blip[i] = i;
     }
     // but here i doesn't get updated in watch window
     for (int i = 0; i< s.blip.length; i++) {
         s.blip[i] = i*2;
     }

Declared outside of the for scope, it's ok:
     int i;
     for (i = 0; i< s.blip.length; i++) {
         s.blip[i] = i;
     }
     for (i = 0; i< s.blip.length; i++) {
         s.blip[i] = i*2;
     }



Also inout values seem to show up as void*.  Is there a way to cast a 
variable in CodeBlocks' watch list?  I tried  (int*)myptr but CB says 
"invalid expression".  I also tried cast(int*)myptr, not really 
expecting that to work, but hoping, and it didn't work either.

--bb
Feb 26 2007
next sibling parent Bill Baxter <dnewsgroup billbaxter.com> writes:
Setting the program arguments in codeblocks doesn't seem to work right.

The program arguments just don't seem to get passed in to the debugger.


--bb
Feb 26 2007
prev sibling next sibling parent reply Jascha Wetzel <"[firstname]" mainia.de> writes:
the problem is the second declaration of i within the same frame. i'll
take care of it. until then try using different counter names to work
around this.

inout's are being marked void* by DMD, a codeview issue to be added to
arrays and enums.

Ddbg's expressions don't support casts, yet. but since casts are a good
workaround to DMD's codeview issues i'll have them in the next release.
currently the expression syntax is:

Expr  = Ident
       | Ident OExpr
OExpr = . Expr
       | [ Args ] OExpr
Args  = Slice | Lit | Expr
Slice = SlArg .. SlArg
SlArg = Lit | Expr
Lit   = Int | Float | Str | Char | $


Bill Baxter wrote:
 Stepping through loops works now, but the counter variable does not get
 updated in the list of watches.  Wait...<tests further> that's not
 exactly true.
 
 It doesn't get updated in this situation:
 
     // during first loop it's ok
     for (int i = 0; i< s.blip.length; i++) {
         s.blip[i] = i;
     }
     // but here i doesn't get updated in watch window
     for (int i = 0; i< s.blip.length; i++) {
         s.blip[i] = i*2;
     }
 
 Declared outside of the for scope, it's ok:
     int i;
     for (i = 0; i< s.blip.length; i++) {
         s.blip[i] = i;
     }
     for (i = 0; i< s.blip.length; i++) {
         s.blip[i] = i*2;
     }
 
 
 
 Also inout values seem to show up as void*.  Is there a way to cast a
 variable in CodeBlocks' watch list?  I tried  (int*)myptr but CB says
 "invalid expression".  I also tried cast(int*)myptr, not really
 expecting that to work, but hoping, and it didn't work either.
 
 --bb

Feb 27 2007
parent Jascha Wetzel <"[firstname]" mainia.de> writes:
Here is my first shot at extending the syntax to include casts.
You should be able to do things like
cast(char[])(cast(mystruct*)foo.bar).strtable[key]
with it.
Any comments?

Expr                 = RefChain | Cast RefChain
RefChain             = ExprElem | ExprElem RefExpr
ExprElem             = Ident | '(' Expr ')'
RefExpr              = '.' ExprChain | '[' Args ']' RefExpr

Cast                 = 'cast' '(' Type ')'
Type                 = BasicType | BasicType QuantList
QuantList            = Quantifier | Quantifier QuanList
Quantifier   	     = '*' | '[' ']' | '[' Type ']'
BasicType            = 'void' | 'bool' | 'byte' | 'ubyte' | 'char'
                     | ... all the others ...

Args                 = Slice | Lit | Expr
Slice                = SlArg '..' SlArg
SlArg                = Lit | Expr
Lit                  = Int | Float | Str | Char | '$'
Feb 27 2007
prev sibling parent reply Robin Allen <r.a3 ntlworld.com> writes:
import std.stdio;

void main(char[][] args)
{
	try
	{
		throw new Exception("Hello");
	}
	catch(Exception e)
	{
		writefln(e.msg);
	}
}

---

Ddbg breaks with an 'unhandled exception' here, even though the 
exception is handled!

-Rob
Feb 28 2007
parent reply Jascha Wetzel <"[firstname]" mainia.de> writes:
sure you used 0.0.3? it doesn't break when i try that...

Robin Allen wrote:
 import std.stdio;
 
 void main(char[][] args)
 {
     try
     {
         throw new Exception("Hello");
     }
     catch(Exception e)
     {
         writefln(e.msg);
     }
 }
 
 ---
 
 Ddbg breaks with an 'unhandled exception' here, even though the
 exception is handled!
 
 -Rob

Feb 28 2007
parent Robin Allen <r.a3 ntlworld.com> writes:
Jascha Wetzel wrote:
 sure you used 0.0.3? it doesn't break when i try that...
 
 Robin Allen wrote:
 import std.stdio;

 void main(char[][] args)
 {
     try
     {
         throw new Exception("Hello");
     }
     catch(Exception e)
     {
         writefln(e.msg);
     }
 }

 ---

 Ddbg breaks with an 'unhandled exception' here, even though the
 exception is handled!

 -Rob


Oops, sorry, ignore me. Turns out I can't count to 0.0.3.
Feb 28 2007