MCUXpresso RT1170 gdb variables optimized out - can't stop optmization

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MCUXpresso RT1170 gdb variables optimized out - can't stop optmization

ソリューションへジャンプ
2,856件の閲覧回数
robert_s
Contributor III

Hi,

I have been developing a C application using an RT1170 for several months now and keep coming up against a problem when debugging: When I try to view the values of variables many appear as <optimized out>.

I have turned off optimization within the MCUXpresso IDE, trying both -O0 and -Og.

I have also tried declaring specific variables as 'volatile', which is one other suggestion I found,  buy no luck.

Doe anyone have any other suggestions?

Is it really the case that some optimization cannot be turned off?

Thanks.

ラベル(2)
タグ(1)
0 件の賞賛
返信
1 解決策
2,845件の閲覧回数
robert_s
Contributor III

Hi Kerry,

Thank you for your reply.

It took me a while to reproduce the problem, but I think I have worked out what was going on.

Originally I must have had the optimization level as '-O0' (none) which often results in variables being displayed in MCUXpresso as "<optimized out>".

With the optimization level set to '-Og' (debug) then it looks like only uninitialised variables appear as <optimized out> until they are set. That probably confused me!

Regards,

Robert

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
2,853件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @robert_s 

  Could you please give me some screenshot about your issues?

  Do you also can reproduce issues on the  RT SDK project or not?

  Even you add the variable to the Expressions window, still have this issues?

Please give me more details about it, thanks.

Best Regards,

Kerry

0 件の賞賛
返信
2,846件の閲覧回数
robert_s
Contributor III

Hi Kerry,

Thank you for your reply.

It took me a while to reproduce the problem, but I think I have worked out what was going on.

Originally I must have had the optimization level as '-O0' (none) which often results in variables being displayed in MCUXpresso as "<optimized out>".

With the optimization level set to '-Og' (debug) then it looks like only uninitialised variables appear as <optimized out> until they are set. That probably confused me!

Regards,

Robert

0 件の賞賛
返信
2,840件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @robert_s ,

   Thank you for your updated information.

 So, now your issue is solved, right?

  If your question is solved, please help to mark the correct answer, just to close this case, thanks.

 Any new issues, welcome to create the new question post.

Best Regards,

Kerry

 

0 件の賞賛
返信