Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Napoleon on May 12, 2014, 09:37:41 am

Title: C: Watchlist says "There is no member named ..." erroneously.
Post by: Napoleon on May 12, 2014, 09:37:41 am
[Ubuntu 13.10, CB 13.12 from source]

I'm doing an assignment using gnu99 C.  In it I have a struct defined in a header file I'm including in my current project.  I'm using a pointer variable to point at an instance created using malloc().
When my program stops at a breakpoint, I can't see the contents of the structure's members in the watch list.

The watchlist correctly identifies the struct name the pointer is associated with, however it cannot be expanded to view its member values.
When I try to watch buffer->entries, the watchlist displays "There is no member named entries." in the value column.

In my source, the tooltip that pops up when I hover over the member's name shows:   "entries | No symbol 'entries' in current context.".

I've tried dereferencing, typecasting, but nothing I can think of works. (When I'm debugging a C++ project, then do I get the "+" symbol next to objects.)

Would someone please explain what's going on and how to do this correctly?

Cheers,
Nap
Title: Re: C: Watchlist says "There is no member named ..." erroneously.
Post by: oBFusCATed on May 12, 2014, 10:28:21 am
Read this: http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks

Most probably you've compiled you project without symbols.
Title: Re: C: Watchlist says "There is no member named ..." erroneously.
Post by: Napoleon on May 12, 2014, 11:23:03 am
thanks oBFusCATed,  I guess I missed a few points in my OP.

I have the [-g] option set in the build options for the target I'm working with.
All the simple variables show ok, the problem only exists with Structs.

I've had a look at that page before I posted.