Incorrect memory locations for Enum values in expressions window

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Incorrect memory locations for Enum values in expressions window

Jump to solution
660 Views
dan_quist
Contributor III

Hi,

 

using CW 10.2 build 120413.

 

I believe I've found a bug in the expressions window that has cost me a couple days of work.

 

In my c++ application, I am using a custom class that I will call classX. If I add classX to the expressions window, I can expand the view and see all the class members and their values. However, many of the class members were not showing the values that I woudl expect.

 

I picked a couple members from classX and compared the memory locations to the memory locations in the Variables window, and they have different addresses! It is offset by 10-20 words.

 

The base address of the class is the same in both the Expression and Variable windows, so I start going down the list to see where the memory is going wrong.

 

I hit a section of Enum values, Enum1, Enum2, Enum3, and THEY ALL POINT TO THE SAME MEMORY LOCATION! The variable immediately following the enums then starts to advance again.

 

Base address0x100

Enum10x101

Enum20x101<----- THESE ARE NOT ADVANCING

Enum30x101

Int40x102

Int50x103

 

This is causing the entire class structure to get offset whenever there is an Enum value. I tried reproducing the problem with another struct/class but no luck. The class is rather large so I'm wondering if it's maybe a size issue??

 

Also, if I view the class in the Variables window, everything is correct so this is definitely a codewarrior problem.

Labels (1)
0 Kudos
1 Solution
462 Views
dan_quist
Contributor III

The problem has been resolved.

 

The project was built using other projects as dependencies. One of the build options is "Enums always int". This was set in one project and not set in the other which was causing the problems.

 

Properties -> C/C++ Build -> Settings -> Tool Settings -> Language

View solution in original post

0 Kudos
2 Replies
462 Views
CrasyCat
Specialist III

Hello

 

I would recommend you to submit a service request to allow an investigation of the problem,.

Click here to submit a service request.

Make sure to attach a reproducible project to the service request.

 

CrasyCat

0 Kudos
463 Views
dan_quist
Contributor III

The problem has been resolved.

 

The project was built using other projects as dependencies. One of the build options is "Enums always int". This was set in one project and not set in the other which was causing the problems.

 

Properties -> C/C++ Build -> Settings -> Tool Settings -> Language

0 Kudos