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.

Breakpoints before main( ) function

Hi,

I'm running mcu_plus_sdk_243x Hello.cpp example.

Is it possible to set breakpoints before the main() function?  ( To see static variables initialization)

Thanks,

Eli

  • I just put a breakpoint into system_msp432P401R.c and it stopped just fine. I don't know if cinit has debugging symbols, though.

  • Hi,

    I found some entry point for main function

    but I don't know what to put instead of main - to view all global objects  initialization

    For example I put before main()

    MyObjectPtr* = new CMyClass();

    I would like to debug the code that does the  new (all the memory allocations) 

    Thanks,

    Eli

  • You probably need to break into cinit, the source should be available, but it might not be compiled with debugging symbols;

  • You are getting beyond my ken - especially with C++ - but in startup_msp432P401r_ccs.c there is this:

    /* Forward declaration of the default fault handlers. */
    /* This is the code that gets called when the processor first starts execution */
    /* following a reset event.  Only the absolutely necessary set is performed,   */
    /* after which the application supplied entry() routine is called.  Any fancy  */
    /* actions (such as making decisions based on the reset cause register, and    */
    /* resetting the bits in that register) are left solely in the hands of the    */
    /* application.                                                                */
    void Reset_Handler(void)
    {
        SystemInit();

        /* Jump to the CCS C Initialization Routine. */
        __asm("    .global _c_int00\n"
              "    b.w     _c_int00");
    }

  • Hi,

    Yes but when I put the entry to _c_int00 and single step from there - I'm not getting to global C++ initialization just to the BSS.

    I see all kind of entries at boot_armv7r.c - but which to choose ?

    Thanks,

    Eli

     

  • Hi,

    You can disable the run to main option then your code won't run till main and you can put breakpoint post that.

    Please refer https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/104963/enable-autorun-to-main

    Regards,

    Ankur