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.

CCS Theia does not show holding at main on debug start

Other Parts Discussed in Thread: MSPM0G3507

Weird issue with Theia.

I have a program that has a function called by main.

If that function is commented out, everything is fine:

When that function is NOT commented, Theia does not show that I am holding at main:

I assume I am, since it shows it paused.

(ETA: I had the devil of a time getting both images in!)

  • Oh, this is on the MSPM0G3507 Launchpad

  • I assume I am, since it shows it paused.

    Can you expand the Call Stack to confirm?

    (ETA: I had the devil of a time getting both images in!)

    You should be able to drag and drop images from your local PC to the edit/reply field. Is that what you were trying?

    If that function is commented out, everything is fine:

    When that function is NOT commented, Theia does not show that I am holding at main:

    What is the function (I don't see it in the screenshot)? Can you provide a small test case?

    Thanks

    ki 

  • "You should be able to drag and drop images from your local PC to the edit/reply field. Is that what you were trying?"

    I finally did that, at first I was using the "Insert Image" dialog, and it kept replacing images with previous ones.

  • I finally did that, at first I was using the "Insert Image" dialog, and it kept replacing images with previous ones.

    This is actually how I usually do it. But for multiple images you have to do one at a time. If you press upload again before hitting OK, it will just replace the image.

  • Here is the call stack:

  • I can't do a small test case, every time I do, it makes the problem go away. I can zip up the project and post it.

    FWIW, here is the function:

    void DoKey(int key) {
        
      uint32_t keystate;
      uint32_t notkeystate;
    
      // Note Pressed/Released only changes *after* the debounce period
      // Now that the serial commands are out of the way, check the keys
    
      // Check one key at a time
      // First turn "on" the column
      DL_GPIO_clearPins(GPIO_KEYBOARD_PORT, KeyStuff[key].col);
    
      keystate = DL_GPIO_readPins(GPIO_KEYBOARD_PORT, KeyStuff[key].row);
      notkeystate = !keystate;
    
      if (KeyStuff[key].debounce == 0) {
        // We are idle, did we get a change of state?
        if (KeyStuff[key].pressed == RELEASED) {
          // Currently not pressed
          if (!keystate) {
            // We are pressed
            KeyStuff[key].debounce = GetMillis();
          }
        } else {
          // Currently pressed
          if (keystate) {
            // We are released
            KeyStuff[key].debounce = GetMillis();
          }
        }
      } else {
        // In a debounce period
        if ((GetMillis() - KeyStuff[key].debounce) > BOUNCE_TICKS) {
          KeyStuff[key].debounce = 0;
    
          if (!keystate) {
            // We are Pressed
            KeyStuff[key].pressed = PRESSED;
    
            switch (key) {
    
            case 0: // Up Fast
              if (EchoState == true) {
                StartSerialTX("key0 Pressed\r\n");
              }
              // SetSpeed(FASTSPEED);
              // Direction(UPDIR);
              // GoForever();
              break;
    
            case 1: // Goto Mark
              if (EchoState == true) {
                StartSerialTX("key1 Pressed\r\n");
              }
              // SetSpeed(FASTSPEED);
              // GoPosition(Mark[CurrentMark]);
              // DisplayPos();
              break;
    
            case 2: // Down Fast
              if (EchoState == true) {
                StartSerialTX("key2 Pressed\r\n");
              }
              // SetSpeed(FASTSPEED);
              // Direction(DWNDIR);
              // GoForever();
              break;
    
            case 3: // Up Slow
              if (EchoState == true) {
                StartSerialTX("key3 Pressed\r\n");
              }
              // SetSpeed(SLOWSPEED);
              // Direction(UPDIR);
              // GoForever();
              break;
    
            case 4: // Change current mark
              if (EchoState == true) {
                StartSerialTX("key4 Pressed\r\n");
              }
    
              // CurrentMark++;
              // CurrentMark = (CurrentMark > 2) ? (0) : (CurrentMark);
              // DisplayMark();
              break;
    
            case 5: // Down Slow
              if (EchoState == true) {
                StartSerialTX("key5 Pressed\r\n");
              }
              // SetSpeed(SLOWSPEED);
              // Direction(DWNDIR);
              // GoForever();
              break;
    
            case 6: // Goto zero
              if (EchoState == true) {
                StartSerialTX("key6 Pressed\r\n");
              }
              // SetSpeed(FASTSPEED);
              // GoPosition(0);
              // DisplayPos();
              break;
    
            case 7: // Set Current Mark
              if (EchoState == true) {
                StartSerialTX("key7 Pressed\r\n");
              }
    
              // Mark[CurrentMark] = GetPosition();
              // DisplayMark();
    
              break;
    
            case 8: // Set Zero
              if (EchoState == true) {
                StartSerialTX("key8 Pressed\r\n");
              }
              // Zero();
              // DisplayPos();
              break;
            }
          } else {
            // We are released
            KeyStuff[key].pressed = RELEASED;
    
            // On release
            switch (key) {
    
            case 0: // Up Fast
              if (EchoState == true) {
                StartSerialTX("key0 Released\r\n");
              }
              // Stop();
              // DisplayPos();
              break;
    
            case 1: // Goto Mark
              if (EchoState == true) {
                StartSerialTX("key1 Released\r\n");
              }
              break;
    
            case 2: // Down Fast
              if (EchoState == true) {
                StartSerialTX("key2 Released\r\n");
              }
              // Stop();
              // DisplayPos();
              break;
    
            case 3: // Up Slow
              if (EchoState == true) {
                StartSerialTX("key3 Released\r\n");
              }
              // Stop();
              // DisplayPos();
              break;
    
            case 4: // Change Mark
              if (EchoState == true) {
                StartSerialTX("key4 Released\r\n");
              }
              break;
    
            case 5: // Down Slow
              if (EchoState == true) {
                StartSerialTX("key5 Released\r\n");
              }
              // Stop();
              // DisplayPos();
              break;
    
            case 6: // Goto Zero
              if (EchoState == true) {
                StartSerialTX("key6 Released\r\n");
              }
              break;
    
            case 7: // Set Mark
              if (EchoState == true) {
                StartSerialTX("key7 Released\r\n");
              }
              break;
    
            case 8: // Set Zero
              if (EchoState == true) {
                StartSerialTX("key8 Released\r\n");
              }
              break;
    
            } // case
          }   // if
        }     // if
      }       // if keybounce = 0
    
      DL_GPIO_setPins(GPIO_KEYBOARD_PORT, KeyStuff[key].col);
      
    }

    If I remove the body or comment it out the issue goes away.

  • If you can provide a zip of the project, that'd be great. You can send via private E2E message if you wish,

  • Hi Keith - I don't mean to interrupt your debug discussion with Ki, but you may find the FAQ below helpful - Jim

    [FAQ] Easy way to insert screen snippet or image into post

  • sent by PM

  • Thanks, let's continue the conversation there.

  • For those following the thread, the root cause was determined to be with the generated DWARF debug symbols from the compiler. It appears that multiple source lines being mapped to the same address. Looks like the compiler/linker is including erroneous source line mapping for functions that are not included in the final .text section. A bug has been filed for the compiler.