Disable code optimization for Debug target

Sysprogs forums Forums VisualGDB Disable code optimization for Debug target

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10012
    hfrmobile
    Participant

    In my point of view it would be helpful when debugging to disable code optimization since when I debug an VisualGDB application  it is jumping like a “crazy horse through” the code …

    In the VisualGDB project settings I added the -O0 (disable code optimizations completely) but it doesn’t change anything.

    Useful tips but not what I am looking for at the moment: http://visualgdb.com/debugging/

    Example: pDevice == NULL:

        47: GELinBeeper::GELinBeeper(const char *pDevice)
        48: {
        49:    if (pDevice == NULL)
        50:    {
        51:        _pDevice = (char *)DEFAULT_BEEPER;
        52:    }
        53:    else
        54:    {
        55:        _pDevice = (char *)pDevice;
        56:    }
        57: }

     

    Breakpoint at 49:
    47, 51, 55, 51, 57

    Or is there something wrong with my settings?

     

    #10016
    hfrmobile
    Participant

    After adding -O0 to the “Common flags” (Debug target) and a rebuild the problem is gone!

     

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.