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

No "VARIABLES" when debugging GTests with Test Explorer - Debugging not working after stopping on a breakpoint #7105

Closed
H-G-Hristov opened this issue Mar 4, 2021 · 13 comments
Labels
debugger more info needed The issue report is not actionable in its current state

Comments

@H-G-Hristov
Copy link

H-G-Hristov commented Mar 4, 2021

Type: Debugger

Describe the bug

  • OS and Version: MacOS BigSur 11.2.2
  • VS Code Version: January 2021 (version 1.53)
  • C/C++ Extension Version: 1.2.2
  • Other extensions you installed (and if the issue persists after disabling them): C/C++ Extension Pack, C++ TestMate, Test Explorer UI, etc.

To Reproduce

Debugging Google Test Unit Tests with Google Test:

  1. Set a break point
  2. Start debugging by clicking the bug icon in Test Explorer.

Sometimes when the breakpoint is hit - the VARIABLES pane is empty. The Call Stack is available usually (maybe even always). Unfortunately that is all the information I could provide.

Screen Shot 2021-03-04 at 2 10 38 PM

@WardenGnaw
Copy link
Member

Which debugger are you using cppdbg or cppvsdbg and if possible can you provide logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true } in your launch.json

@WardenGnaw WardenGnaw added debugger more info needed The issue report is not actionable in its current state labels Mar 8, 2021
@H-G-Hristov
Copy link
Author

H-G-Hristov commented Mar 10, 2021

@WardenGnaw I don't know about: cppdbg or cppvsdbg? How can I find that out? Also I am not quite sure where to see the expected logs? I use the default "settings" if that's correct to say.

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [],
    "logging": {
        "engineLogging": true, 
        "trace": true, 
        "traceResponse": true
     }
}

@sean-mcmanus
Copy link
Contributor

In your launch.json, an "Add Configuration..." button should appear in the bottom right that you can use to create a default configuration. You should be using cppdbg. This is the gdb launch template with logging added:

{
    "version": "0.2.0",
    "configurations": [
    {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "enter program name, for example ${workspaceFolder}/a.out",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "logging": {
                "engineLogging": true,
                "trace": true,
                "traceResponse": true
            }
        }
    ]
}

e.g. your "logging" appears to be outside of a configuration.

@H-G-Hristov
Copy link
Author

@sean-mcmanus Thanks for the tip. I changed my launch.json to:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [

        {
            "name": "(lldb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "enter program name, for example ${workspaceFolder}/a.out",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "lldb",
            // "logging": {
            //     "engineLogging": true,
            //     "trace": true,
            //     "traceResponse": true
            // }
        },
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "enter program name, for example ${workspaceFolder}/a.out",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            // "logging": {
            //     "engineLogging": true,
            //     "trace": true,
            //     "traceResponse": true
            // }
        }
    ]
}

@H-G-Hristov
Copy link
Author

H-G-Hristov commented Mar 16, 2021

I haven't experienced the described issue recently (maybe because I wasn't doing much debugging). Unfortunately as seen above I have just disabled the logging.
And just got the following, which seems that the locals are just partially displayed, incl. there is nothing in this, etc.
I am launching the debugging via the GTest extension:

Screen Shot 2021-03-16 at 11 40 01 AM
Screen Shot 2021-03-16 at 11 45 53 AM

So maybe this is a partial issue of the original issue?
I am not launching via Launcher because the project is a library and has just GTest unit tests.

@H-G-Hristov
Copy link
Author

H-G-Hristov commented Mar 18, 2021

I generally experience a variety of issues when debugging on MacOS Big Sur. Like debugger shortcuts F12, F11 etc. seem to interfere with MacOS shortcuts. I don't get step in functionality, instead some MacOS functionality gets triggered.
The debugger appears to hang: clicking on the buttons Continue (F5) doesn't do anything, etc.
VisualStudioCodeBigSur.log

Yet the fan starts blowing like jet during a take-off:

Screen Shot 2021-03-18 at 11 17 32 AM

@H-G-Hristov
Copy link
Author

H-G-Hristov commented Mar 18, 2021

One way the previously described hang happens is like that:

I click on "Debug" (as seen on the Screenshot) in the Test file:

Screen Shot 2021-03-18 at 11 31 26 AM

Then I click "Continue". The second breakpoint in another file (Source file) is hit:

Screen Shot 2021-03-18 at 11 31 53 AM

Then regardless what I click: "Continue", "Step in", etc. the debugger appears to hang. If I click "Stop". I can place the next break point in the constructor itself and remove the second one to work around this.

Screen Shot 2021-03-18 at 11 42 50 AM

Or I get a CPU meltdown again:

Screen Shot 2021-03-18 at 11 40 02 AM

MeltDown.log

Note:

I can go and Force Quit these lldb-mi processes.
I am sorry about starting this issue as complaint about missing variables in the debugger pane and continuing it as generic debugger issues bug report.

@H-G-Hristov
Copy link
Author

Today I consistently once again I experience this issue. I have attached a log.

debug.log.txt
Screen Shot 2021-04-12 at 8 37 19 PM

@H-G-Hristov
Copy link
Author

And the lldb-mi process is again using 100% CPU. This didn't happen for nearly a month.
Screen Shot 2021-04-12 at 8 40 34 PM

@H-G-Hristov
Copy link
Author

And again debugging doesn't actually work. After stopping on a breakpoint nothing but "Stop" works - continue, step, step over - don't do anything.

@H-G-Hristov H-G-Hristov changed the title No "VARIABLES" when debugging GTests with Test Explorer No "VARIABLES" when debugging GTests with Test Explorer - Debugging not working after stopping on a breakpoint Apr 13, 2021
@H-G-Hristov
Copy link
Author

@sean-mcmanus @WardenGnaw I noticed a pattern. If the debugging pane is opened - debugging fails. If the debugging panel is opened and I point over a variable I get to see its value. Then debugging works - I step to the next variable and if I open the debugging pane - I see the variables. Does this make any sense?

Screen Shot 2021-04-13 at 10 16 57 AM

@hchxdu
Copy link

hchxdu commented Jun 1, 2021

今天,我再次经历这个问题。我附上了一根圆木。

debug.log.txt
屏幕截图 2021-04-12 晚上 8 37 19

@H-G-Hristov
Copy link
Author

Continued here: #9831

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugger more info needed The issue report is not actionable in its current state
Projects
None yet
Development

No branches or pull requests

4 participants