Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: debug inspector tool shows '???' for some static constants.



Permlink Replies: 3 - Last Post: Jul 23, 2016 12:53 AM Last Post By: Alex Belo
Brian Dumas

Posts: 7
Registered: 10/3/99
debug inspector tool shows '???' for some static constants.
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 21, 2016 12:56 PM
Hi All,

I have this issue. I have a class that has only static const unsigned constants (call it A_Class). It is used as a parent class. Then I have a class that descends from A_Class and has a function b_getint, and c_getdouble (call it B_Class)

so

class A_Class
{
public:
static const unsigned A1;
static const unsigned B1;
}

class B_Class : public A_Class
{
public:
int b_getint();
double c_getdouble();
}

Above is the header, the cpp file for A_Class implements the static variables and give them values, and the B_Class implements the functions.

I then create an object of B_Class : B_Class* bc = new B_Class;

when I look at the bc object with the debug tool Inspect, it shows A1 as having the value I set, but the B1 variable has '???' next to it. Currently in other code, the B1 object is using he A1 value, but not the B1 value. So, it this why I see the '???' as a value for B1?

my system : Window 7 Pro 64 bit. RAD Studio 2007. 8GB memory.

Thanks, Brian
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: debug inspector tool shows '???' for some static constants.
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 21, 2016 1:41 PM   in response to: Brian Dumas in response to: Brian Dumas
Brian wrote:

when I look at the bc object with the debug tool Inspect, it shows
A1 as having the value I set, but the B1 variable has '???' next to it.
Currently in other code, the B1 object is using he A1 value, but not
the B1 value. So, it this why I see the '???' as a value for B1?

The compiler likely removed B1 from the executable during optmization since
no code was actually using it. Try writing some code that uses the B1 value
and see if the problem goes away.

--
Remy Lebeau (TeamB)
Brian Dumas

Posts: 7
Registered: 10/3/99
Re: debug inspector tool shows '???' for some static constants.
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 21, 2016 3:00 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thank you Remy.

Remy Lebeau (TeamB) wrote:
Brian wrote:

when I look at the bc object with the debug tool Inspect, it shows
A1 as having the value I set, but the B1 variable has '???' next to it.
Currently in other code, the B1 object is using he A1 value, but not
the B1 value. So, it this why I see the '???' as a value for B1?

The compiler likely removed B1 from the executable during optmization since
no code was actually using it. Try writing some code that uses the B1 value
and see if the problem goes away.

--
Remy Lebeau (TeamB)
Alex Belo

Posts: 626
Registered: 10/8/06
Re: debug inspector tool shows '???' for some static constants.
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 23, 2016 12:53 AM   in response to: Brian Dumas in response to: Brian Dumas
Brian Dumas wrote:

Try writing some code that uses the B1 value

Thank you Remy.

Also you can try declaring the variable as 'volatile'.

This trick usually works fine when you declare a temporary var in code
to see some intermediate value in debugger even in Release mode
(optimized code).

--
Alex
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02