cancel
Showing results for 
Search instead for 
Did you mean: 

Array Values Erased by Debug Tools Error Cube IDE 1.14.1

EPala.2
Associate III

Hi, I am running a debug session for a project and am running into a pretty baffling problem where values I load into an array are seemingly getting erased by a tools error. 

I have a class that has an array as one of its members, that gets filled with pointers to UI objects. This has worked for me on numerous other projects. 

I had to update to CubeIDE 1.14.1 recently, and suddenly the array values are getting erased as soon as any of the class methods are called. As you can see here, the array shows all the correct values, but then once the class method service_all() is called, the array values get deleted:

Before: 

Screenshot 2024-01-23 at 3.05.18 PM.png

After (before any part of the service_all() method is even executed!):

EPala2_0-1706041671453.png

I have optimization disabled for this part of the source code. Any idea what is causing this? It's completely baffling and has ground development to a complete halt. 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

I don't really have an explanation, but to help debug you can set a hardware watchpoint on ui_ctrls[0], which will break when the program edits that memory. Perhaps an IRQ or another task is firing.

Examining the memory directly at 0x24005248 with the Memory Viewer may be helpful to confirm/deny what the Expressions window is telling you.

Examining the disassembly may show clues as well.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

I don't really have an explanation, but to help debug you can set a hardware watchpoint on ui_ctrls[0], which will break when the program edits that memory. Perhaps an IRQ or another task is firing.

Examining the memory directly at 0x24005248 with the Memory Viewer may be helpful to confirm/deny what the Expressions window is telling you.

Examining the disassembly may show clues as well.

If you feel a post has answered your question, please click "Accept as Solution".
EPala.2
Associate III

Okay thanks, putting the hardware watchpoint on ui_ctrls[0] let me track down the error. Values were being written to an array past its bounds by a loop. Will keep that trick in mind for future debugging.