2

I'm new to vala/clutter development and trying to setup Nemiver to debug my vala/clutter programs. I'm using monodevelop to edit and build the clutter-demo example from the vala web page. I am passing the compiler the --pkg clutter-1.0 -g --save-temps options. I have the clutter-debuginfo package installed (I'm on Fedora 16). The program runs fine from within monodevelop.

When running the executable from Nemiver I can view certain local variables such as the integer loop counter in the code below, but I can't see a value for clutter objects properties such as the r.width value. Although the "r" is listed in the context tab as type pointer to clutterRectangle, there is no + sign next to it to expand and look at the width property. Similarly, when I highlight r.width in the code and right click and choose inspect variable, I don't get any information.

Forgive my ignorance but does anyone know what I have to do in order to make this work?

Any info at all is appreciated

thnx

private void create_rectangles () {
    for (int i = 0; i < colors.length; i++) {     // Nemiver shows the value of int i correctly 
          var r = new Rectangle ();

          r.width = r.height = stage.height / colors.length;  // can't get a value for r.width
          r.color = Color.from_string (colors[i]);
          r.anchor_gravity = Gravity.CENTER;    // *********** My Break Point is set here in Nemiver 
          r.y = i * r.height + r.height / 2;

          stage.add_actor (r);

          rectangles[i] = r;
    }
}

1 Answers1

2

GDB does not work with vala syntax. C queries must be used. Probably width and height are properties, so you must do something like:

clutter_actor_get_width(r);

Also for debugging purposes, it's better to pass -X -O0 so that gcc turns off optimizations.

lethalman
  • 1,976
  • 1
  • 14
  • 18
  • Okay, I typed that into my immediate window and got back a value. Thanks for that. So are those switches to pass to valac? – user1094779 Dec 17 '11 at 15:46
  • Yes. The `-X` flag tells valac to pass what follows through to to GCC and `-O0` tells GCC not to optimize. – ssokolow Dec 28 '11 at 19:59