This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Why is the debugger hanging?

Hi

I'm writing my first ARM application. I have C++ code that works in Visual Studio on Windows and I am porting it to ARM using ARM Dev Studio. I want to target Cortex M6 but am currently targeting Cortex-A53 as that is suggested in the tutorial.  My code builds ok and runs ok in the debugger up to a certain point, at which the debugger hangs when I try to step over the next line:

It seems to be a consequence of accessing the pointer rather than the cout. Earlier cout's work ok. I think the pointer is valid.

Please can you help me find out why this is happening? I don't know what to do next.

Thanks

David

Parents
  • Hi Stephen,

    I mentioned above that the exception occurs when accessing a member of a structure:

    Execution stopped in EL3h mode at EL3:0x000000008000A40C
    EL3:0x000000008000A40C 168,38 unsigned sectionId = p_sectionInfo->sectionId_rb_symInc_startPrbc_numPrbc_struct.sectionId;
                                                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    The interesting thing is that sectionId is a bit field in a union:

        union
        {
            struct
            {
                uint32 numPrbc   : 8,
                       startPrbc : 10,
                       symInc    : 1,
                       rb        : 1,
                       sectionId : 12;
            } sectionId_rb_symInc_startPrbc_numPrbc_struct;
            unsigned sectionId_rb_symInc_startPrbc_numPrbc;
        };
    If I access the 32-bit value sectionId_rb_symInc_startPrbc_numPrbc instead of the bit field, no exception occurs. So a workaround is to access the 32-bit value and to shift and mask to access sectionId. If I do that my program runs with no exceptions.

    Are you aware of any restrictions of the armclang compiler that might prevent access to such bitfields?

    Best regards

    David

Reply
  • Hi Stephen,

    I mentioned above that the exception occurs when accessing a member of a structure:

    Execution stopped in EL3h mode at EL3:0x000000008000A40C
    EL3:0x000000008000A40C 168,38 unsigned sectionId = p_sectionInfo->sectionId_rb_symInc_startPrbc_numPrbc_struct.sectionId;
                                                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    The interesting thing is that sectionId is a bit field in a union:

        union
        {
            struct
            {
                uint32 numPrbc   : 8,
                       startPrbc : 10,
                       symInc    : 1,
                       rb        : 1,
                       sectionId : 12;
            } sectionId_rb_symInc_startPrbc_numPrbc_struct;
            unsigned sectionId_rb_symInc_startPrbc_numPrbc;
        };
    If I access the 32-bit value sectionId_rb_symInc_startPrbc_numPrbc instead of the bit field, no exception occurs. So a workaround is to access the 32-bit value and to shift and mask to access sectionId. If I do that my program runs with no exceptions.

    Are you aware of any restrictions of the armclang compiler that might prevent access to such bitfields?

    Best regards

    David

Children