Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to read variables during 2nd breakpoint stop #831

Closed
tdjastrzebski opened this issue Mar 1, 2023 · 14 comments
Closed

Unable to read variables during 2nd breakpoint stop #831

tdjastrzebski opened this issue Mar 1, 2023 · 14 comments

Comments

@tdjastrzebski
Copy link

tdjastrzebski commented Mar 1, 2023

I have been experiencing this problem forever, but now it really stops me from debugging so decided to report it.
The first time execution stops at a breakpoint everything works as expected, variable values properly show up in RUN AND DEBUG

debug-problem-1

During the second stop at the same breakpoint variables do not show up in RUN AND DEBUG panel, but on hoover they still do.

debug-problem-2

And, finally, during the third stop variables do not show at all. On hoover only little empty box is displayed. The issue is probably related to #808

DEBUG CONSOLE window below

2nd stop
debug-problem-4

3rd stop and hoover
debug-problem-3

Environment: OpenOCD 0.12, GCC 12.2.1, Cortex-Debug the latest 1.6.10.
With OpenOCD 0.11 and GCC 10.3 results are the same.

@tdjastrzebski
Copy link
Author

Cortex-Debug 1.6.11-pre4 seems to fix the hoover issue but variable values in RUN AND DEBUG panel still do not show up during the 2nd and subsequent breakpoint stops.

@haneefdm
Copy link
Collaborator

haneefdm commented Mar 2, 2023

Can I see your launch.json and the output from the Debug Console?

@tdjastrzebski
Copy link
Author

tdjastrzebski commented Mar 2, 2023

@haneefdm Here it is, console output attached, two same breakpoint stops.

{
    "name": "Debug (OpenOCD)",
    "type":"cortex-debug",
    "request": "launch",
    "servertype":"openocd",
    "showDevDebugOutput": "both",
    "cwd": "${workspaceRoot}",
    "executable": "BUILD/debug/${workspaceRootFolderName}.elf",
    "svdFile": "STM32L4x2.svd",
    "runToEntryPoint": "main",
    "device": "STM32L432KCUx",
    "searchDir": ["${env:OpenOCD}/scripts"],
    "serverArgs": [
        "-c hla_serial 066EFF535488524867153759"
    ],
    "configFiles": [
        "/interface/stlink.cfg",
        "/target/stm32l4x.cfg",
    ],
    "interface": "swd",
    "swoConfig": {
        "enabled": true,
        "cpuFrequency": 180000000,
        "swoFrequency": 2000000,
        "source": "probe",
        "decoders": [
            { "type": "console", "label": "ITM", "port": 0 }
        ]
    },
}

console ouput.txt

@haneefdm
Copy link
Collaborator

haneefdm commented Mar 2, 2023

Is there anything in the STACK window? If you don't see a stack, then you will not see any variables either.

You can also set "showDevDebugOutput": "vscode" and attach that console output? We are pretty sure we sent VSCode the stack information and it then has to request variables -- which it kinda seems like it did.

@tdjastrzebski
Copy link
Author

tdjastrzebski commented Mar 2, 2023

CALL STACK info is always displayed correctly, DEBUG output with "showDevDebugOutput": "vscode" attached.
console ouput 2.txt
debug-problem-5

@haneefdm
Copy link
Collaborator

haneefdm commented Mar 3, 2023

Aha. I know exactly why that is happening. Bug in our SW and perhaps even a change in how more recent versions of gdb work. A fix is on the way

@haneefdm
Copy link
Collaborator

haneefdm commented Mar 3, 2023

Do you mind trying the latest 1.7.x pre-release?

https://github.com/Marus/cortex-debug/releases

Eager to hear feedback

@haneefdm
Copy link
Collaborator

haneefdm commented Mar 3, 2023

If you enable pre-releases within VSCode, this release will also be available over there. Note that this release has a LOT of changes -- mostly related to this issue. New features as well like Live Watch. A LOT of code had to be re-written/re-factored

@tdjastrzebski
Copy link
Author

tdjastrzebski commented Mar 4, 2023

@haneefdm Thank you for your help and dedication to improving this indispensable tool. It seems that in 1.7.0-pre1 the problem still persists. Console output attached.
console output 3.txt

@tdjastrzebski tdjastrzebski changed the title Unable to read variables at 2nd breakpoint stop Unable to read variables during 2nd breakpoint stop Mar 4, 2023
haneefdm added a commit that referenced this issue Mar 4, 2023
@haneefdm
Copy link
Collaborator

haneefdm commented Mar 4, 2023

Could you try this release please.

https://github.com/Marus/cortex-debug/releases/tag/v1.7.1-pre1

This was a huge change in our code base. I had been testing it for a while and it was already supposed to be in 1.7.0 but I missed it.

@tdjastrzebski
Copy link
Author

As far as I can tell, now it works as expected! Thank you for your effort, it is much appreciated.

@haneefdm
Copy link
Collaborator

haneefdm commented Mar 4, 2023

Thanks for reporting back.

Do, globals, statics in the 'VARIABLES' Panel, and expressions in the 'WATCH' windows also work properly? I know, it is hard to tell...

Take your time, no hurry.

@haneefdm
Copy link
Collaborator

I am going to close this issue...

@tdjastrzebski
Copy link
Author

tdjastrzebski commented Mar 11, 2023

Everything seems to work as expected, thanks again, it is probably one of the most important issue fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants