nxp-mcuxpresso / vscode-for-mcux

Support for NXP Visual Studio Code for MCUXpresso Extension project.
13 stars 0 forks source link

Debugger was unable to continue the process #30

Closed mabroens closed 6 months ago

mabroens commented 7 months ago

Hi ,, since yesterday i have the issue that my VScode is complainig it can not debug the code. the project builds and runs fine but no more debugging.

see below: image

so i reverted my code and started debugging the issue, which i so far am unable to locate. but....

in my header (the comment section of main.c where i have my disclaimer) i can make the problem appear and disappear just by adding one empty line or space.

with this the debugger works fine: image

and with this it fails: image

Br Martijn

cristitep-nxp commented 7 months ago

Hi,

  1. What debug probe do you use? Segger? Or something else?
  2. What device target do you use?
  3. Can you share the gdb log from Debug Console? Be sure you switch to true in the launch.json -> "logging": { "engineLogging": true}. And we need 2 logs: one for successful debug session and another one with the exception.
  4. Since changing a comment to produce a debugger malfunction looks like an improbable scenario, our first impression might be that you actually encountered the issue from https://github.com/microsoft/vscode-cpptools/issues/10819. So can you help with the next experiment to prove our theory:
    • when you encounter the exception, can you issue a "Continue" command in the debugger toolbar? Does the execution then jump to main() ?
    • can you do a consecutive debug without code modification? Do you see "Exception in reset.S" vs. "successful at main()" in the same alternated order?

Regards, Cristian

mabroens commented 7 months ago

Hi Cristian,

I use:

  1. debugger: mculink

  2. Target: mcxn9xxbrk_cm33_cpu0

  3. dbg enabled:

    {
    "configurations": [
    { 
      "type": "cppdbg",
      "name": "Debug project configuration",
      "request": "launch",
      "cwd": "${workspaceRoot}",
      "MIMode": "gdb",
      "setupCommands": [
        {
          "text": "set remotetimeout 600"
        },
        {
          "text": "set debug-file-directory"
        }
      ],
      "program": "",
      "miDebuggerServerAddress": "",
      "variables": {
        "mcuxStopAtSymbol": "main",
        "mcuxSerialNumber": "4XTDOS5OGQVHA",
        "mcuxAttach": "false",
        "mcuxRemoteProbeType": ""
      },
      "logging": {
        "engineLogging": true
      }
    } 
    ]
    }

    but no change on the output window:

    [main] Building folder: V2X_Beacon_OOT 
    [build] Starting build
    [proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build c:/zephyr/projects/V2X_Beacon_OOT/build --config debug --target all --
    [build] ninja: no work to do.
    [driver] Build completed: 00:00:00.265
    [build] Build finished with exit code 0

    but i guess/hope you are refering to a file that should be generated now. please pouint me to it.

  4. when you encounter the exception, can you issue a "Continue" command in the debugger toolbar? Does the execution then jump to main() ? No. it is stuck there.

  5. can you do a consecutive debug without code modification? Do you see "Exception in reset.S" vs. "successful at main()" in the same alternated order? No idea. when i press the reset button on the HW i can see that my latest code is running.

cristitep-nxp commented 6 months ago

Hi @mabroens,

Can we consider the answer you provided on https://github.com/microsoft/vscode-cpptools/issues/10819 that is actually the answer for this ticket, so this one can be closed?

PS. If yes, can you please remove the comment from https://github.com/microsoft/vscode-cpptools/issues/10819 since this seems to be another issue for cpptools extension?

Regards, Cristian

mabroens commented 6 months ago

Hi @cristitep-nxp , yes we can close this ticket. the solution:

Hi I was able to finally find the rootcause!!!

it seems that breakpoints from previous session where causing the issue. So for anyone runnig into this issue:

once you get this error msg. go to your debug perspective, remove all Breakpoints. close the session and download it again. now you are able to rerun and debug your code.

seems like a bug in the GUI to me. I was able to solve this issue on all my machines.

Br Marijn

and i removed the response in https://github.com/microsoft/vscode-cpptools/issues/10819