Incorrect memory locations for Enum values in expressions window

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Incorrect memory locations for Enum values in expressions window

跳至解决方案
1,278 次查看
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.

标签 (1)
0 项奖励
回复
1 解答
1,080 次查看
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 项奖励
回复
2 回复数
1,080 次查看
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 项奖励
回复
1,081 次查看
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 项奖励
回复