mercredi 24 juillet 2019

Finding the corruption of static variable in a translation unit

In my library I have a static variable declared in the file scope.

static uint16_t s_currentEndpointCount = 0u;

While assigning the value in a function the value seems to change but while accessing using another function it seems to be corrupted and hold unusual values.

This I happening in C++ application which is using the Lib. Well, want to know how to debug or watch the statically allocated variables. How to get a snapshot of the memory.

Aucun commentaire:

Enregistrer un commentaire