Watch vs Live Watch variable value mismatch

Sysprogs forums Forums VisualGDB Watch vs Live Watch variable value mismatch

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32554
    mdn
    Participant

    Hello Everyone,

    I am using VisualGDB on VS2019 to develop an embedded-SW solution based on C++.

    I am using semi-hosting and have noticed that in my live watch, there are two global variables wakeUpVehState and sysBtnState that share the same memory address. This is of course an unexpected behavior.

    I have set the variables as volatile and I have disabled compiling optimizations to exclude the possibility that due to optimization the compiler might misbehave. Still I had no success.

    Eventually I set those two variables in the normal watch and I got the 2 different addresses and correct values. Please refer to the image attached.

    I am asking if there might be some setting in VisualGDB that might cause this issue or if it is simply a bug in the Live Watch. I would also like to notice, that this issue has already occurred in other occasions, but not always. It happens sporadically.

     

    -In green are the definitions of the global variables.

    -In brown are some random variable assignments.

    -In blue are the Watch values (which are correct)

    -In red are the live watch values.

     

     

    Thank you in advance!

    Attachments:
    You must be logged in to view attached files.
    #32556
    support
    Keymaster

    Hi,

    This looks like the ELF file you are debugging defines some variable attributes in an unexpected way, so VisualGDB fails to compute the proper addresses. If you could share the ELF file via our support form along with the correct addresses of the variables, we should be able to investigate this further.

    #32557
    mdn
    Participant

    Hello,

    thank you I appreciate the quick reply.

    I have actually accidentally solved my problem. I have changed the type of sigType_t : uint8_t to of sigType_t : uint32_t. Now the live watch gives me correct values.

    It would be nice if you could investigate the reason why it happens in the first place.

    I have sent the ELF file to you.

     

    Best regards!

     

    Attachments:
    You must be logged in to view attached files.
    #32568
    support
    Keymaster

    Thanks, we have received the ELF file, however we could not reproduce the problem on our side – the addresses are different:

    This could have been solved by a recent update to VisualGDB adding support to bitfields to Live Watch. Please feel free to update to VisualGDB 5.6r5 and let us know if the problem persists.

    Attachments:
    You must be logged in to view attached files.
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.