Skip to main content
Associate
September 18, 2024
Question

Debugger is showing signed value for unsigned char

  • September 18, 2024
  • 5 replies
  • 4569 views

Hello guys,

I have a problem like this. How can I fix this problem

Debug_Error.PNG

5 replies

Andrew Neil
Super User
September 18, 2024
A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Guven47Author
Associate
September 19, 2024

The debugger interprets uint8 data as int8

mƎALLEm
Technical Moderator
September 19, 2024

Could you please attach a project reproducing the behavior?

"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question."
Pavel A.
Super User
September 18, 2024

Yellow color marks values that changed since last read by the debugger, for example after doing a step or hitting a breakpoint.

 

Guven47Author
Associate
September 19, 2024

The debugger interprets uint8 data as int8

mƎALLEm
Technical Moderator
September 18, 2024

Do you mean you get a negative value for an unsigned variable?

"To give better visibility on the answered topics, please click on ""Accept as Solution"" on the reply which solved your issue or answered your question."
Guven47Author
Associate
September 19, 2024

Yes,I got negative value from unsigned varible. How can I fix ?

Associate II
September 19, 2024

You can right on the value field and pick "Cast to Type" and then type e.g. uint32_t or whatever you want. 

Karl Yamashita
Principal
September 19, 2024

@DaveJ wrote:

You can right on the value field and pick "Cast to Type" and then type e.g. uint32_t or whatever you want. 


You're not getting the point. The OP is already showing the variable as uint8_t but the value is showing as negative (-128)

Plus the OP is in Live Expressions and unless you know of a trick, you can't change the type

If a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source
Andrew Neil
Super User
September 19, 2024

Does this also happen in the 'Variables' view?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Guven47Author
Associate
September 20, 2024

Yes,it's happening.