This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to view the value of function pointer in the debug window



Hello

I'm coding state machine using function pointers. I have declared structure like this

typedef struct LinkStateMachine TLinkStateMachine;

typedef void (*LinkStateProc)(TLinkStateMachine *sm, EIndication event);

struct LinkStateMachine
{
    LinkStateProc curLinkState;
    Uint16 linkState;
};
SO, the LinkStateMachine is structure with pointer to the function which represents the state. The problem is that when i want to debug it, i cannot see the value of the curLinkState variable (that is, the current value of the function pointer). Is there any way to see this in debugging window.

I have temporarily solved the problem by adding another variable linkState which I update with current link state. this helped me to debug the system and get it running. however, I am still curious if there is an option (or plugin) that would enable me to display the value of a function pointer.

Ilija

  • Which version of CCS are you using? Is there a simple test project you can send us that we can use to reproduce the behavior?

  • Hi, I'm using CCS Version: 5.3.0.00090. I don't have sample program, but if you want i can somewhere upload the whole project that I am using. Currently it is not big because i have implemented the very basic functionalities that I need.

    To explain in more details, i if I want to debug the project, I cannot see the value of the function pointer, that is, I don't see the address of which function it is currently holding in. Since the address of the function is the current state for me, i cannot see which is the current state. I saw on the internet that debugging function pointers can be a bit problematic with some IDE and i was wondering if is there a way to show the value of the function pointers in the CCS. Pleas send me a personal message where i can upload the files for you because i wouldn't like to have them uploaded on public forum.

  • I sent you a friend request. When you accept it, you can start a private conversation with me and attach your project folder. That way it will stay private between the two of us and not be visible in this public forum.

    Please also let us know which device/board/emulator you are working with as we would require the same set up to reproduce the behavior.