Author Topic: watching std::list iterator class member  (Read 4095 times)

Offline O-san

  • Multiple posting newcomer
  • *
  • Posts: 25
    • OddGames
watching std::list iterator class member
« on: March 29, 2009, 07:00:52 pm »
Hello!

I’ve got a problem with code completion and the watch window. I’d be very grateful if anyone could tell me how I can see class members of a list::iterator in the watch? I thought this would work:

It->mValue

But it does not. Instead I get this message in the watch result “There is no member or method named mValue”. The code completion that lets you choose between the different class members in a dropdown list does not work either. There are however no compilation errors.
« Last Edit: March 29, 2009, 07:03:08 pm by O-san »

Offline O-san

  • Multiple posting newcomer
  • *
  • Posts: 25
    • OddGames
Re: watching std::list iterator class member
« Reply #1 on: March 29, 2009, 09:16:14 pm »
Found this bug description for gdb http://sourceware.org/bugzilla/show_bug.cgi?id=8722.

So it turns out that the bug is outside code::blocks scope. Their "solution" proposed works reasonably well also.
Mod: feel free to remove topic.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: watching std::list iterator class member
« Reply #2 on: March 29, 2009, 09:42:50 pm »
Mod: feel free to remove topic.

No, because it shows a solution, that can help other users too.

In short instead of trying it->mValue , you should try (*it).mValue .

It seems to be a gdb-bug with overloaded "->"-operators.