Hi, I am using s32k312 and MCAL version is 5.0.0, the startup and linker files is based on MCAL package.
I defined a bool variable named LibDiagCom_Initialized, and I found in the LiveWatch and memory it was changed unexpectedly. I set a data breakpoint and found a struct variable with a pointer was changing the memory.
So is this pointer a wilder pointer?
Hi@yumi
From the screenshot you provided, I don't see any relationship between "LibDiagCom_Initialized" and "Lpspi_Ip_axStateStructure". Is there a problem?
My understanding of a "dangling pointer"(野指针) is usually that it points to an unknown, random location. I don't see that problem here.
Hi Selent,
From the Live Watch, you can see the location of 'LibDiagCom_Initialized' is 0x2040 37df, and the pointer RxBuffer in Lpspi_Ip_axStateStructure point to 0x204037DC.
I set a data breakpoint for LibDiagCom_Initialized, the scenery is LibDiagCom_Initialized value is changed by the RxBuffer at the data breakpoint, as shows in another picture.
So my question is:
Shouldn't the RxBuffer in Lpspi_Ip_axStateStructure point to somewhere at initialization? If not, is it a dangling pointer?
In the image you provided, I did not see that the value of "LibDiagCom_Initialized" had changed.
You'd better provide me with your test routine, because I still don't understand it. I don't see any problems in the images you provided.