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

Debugger is waiting a preLaunchTask (QEMU in waiting mode) #90288

Closed
AIG-Livny opened this issue Feb 8, 2020 · 5 comments
Closed

Debugger is waiting a preLaunchTask (QEMU in waiting mode) #90288

AIG-Livny opened this issue Feb 8, 2020 · 5 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@AIG-Livny
Copy link

AIG-Livny commented Feb 8, 2020

I saw this #6209 but it does not work for me, because QEMU doesn't write anything in console.

Debugger is waiting for the process to complete. Obviously, this process must be performed during debugging.
I am trying to run my program for ARM in QEMU:
launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug program",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}\\test.elf",
            "miDebuggerServerAddress": "localhost:9000",
            "stopAtEntry": true,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "D:\\gcc_arm\\bin\\arm-none-eabi-gdb.exe",
            "preLaunchTask": "Build and run",
        }
    ]
}

tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build",
            "type": "shell",
            "command": "make",
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },
        {
            "label": "Run QEMU",
            "type": "shell",
            "isBackground": true,
            "command": "qemu-system-arm -S -gdb tcp::9000 -M lm3s811evb -kernel test.elf -nographic",
        },
        {
            "label": "Build and run",
            "dependsOrder":"sequence",
            "dependsOn": [
                "Build",
                "Run QEMU",
            ]
        }
    ]
}

As you can see, I run QEMU with the -S key. This forces QEMU to wait for the Debugger.
The console is empty at this time.
Everything works great if I run QEMU manually.
Maybe there is some kind of function to start Debug without waiting for completion?
Or do I need to get QEMU to write something in console?
Is it possible to add such a function in VSCode?

@AIG-Livny AIG-Livny changed the title Degugger is waiting a preLaunchTask (QEMU in waiting mode) Debugger is waiting a preLaunchTask (QEMU in waiting mode) Feb 8, 2020
@AIG-Livny
Copy link
Author

Hmm. This works:
tasks.json:

{
            "label": "Run QEMU",
            "type": "shell",
            "isBackground": true,
            "command": "echo Starting QEMU&qemu-system-arm -S -gdb tcp::9000 -M lm3s811evb -kernel test.elf -nographic",
            "problemMatcher": {
                "pattern": {
                    "regexp": "^(Starting QEMU)",
                    "line": 1,
                },
                "background": {
                    "activeOnStart": true,
                    "beginsPattern": "^(Starting QEMU)",
                    "endsPattern": "^(Starting QEMU)"
                }
            }
        },

launch.json:
"preLaunchTask": "Run QEMU",

But, this does not work:
tasks.json:

{
            "label": "Build",
            "type": "shell",
            "command": "make",
            "group": {
                "kind": "build",
                "isDefault": true
            },
        },
{
            "label": "Run QEMU",
            "type": "shell",
            "isBackground": true,
            "command": "echo Starting QEMU&qemu-system-arm -S -gdb tcp::9000 -M lm3s811evb -kernel test.elf -nographic",
            "problemMatcher": {
                "pattern": {
                    "regexp": "^(Starting QEMU)",
                    "line": 1,
                },
                "background": {
                    "activeOnStart": true,
                    "beginsPattern": "^(Starting QEMU)",
                    "endsPattern": "^(Starting QEMU)"
                }
            }
            
        },
{
            "label": "Build and run",
            "dependsOrder":"sequence",
            "dependsOn": [
                "Build",
                "Run QEMU",
            ]
        }

launch.json:
"preLaunchTask": "Build and run",

Oh...

@AIG-Livny
Copy link
Author

Ok, now it works as i wanted...
"command": "make&echo Starting QEMU&qemu-system-arm -S -gdb tcp::9000 -M lm3s811evb -kernel test.elf -nographic",

@isidorn
Copy link
Contributor

isidorn commented Feb 10, 2020

This is probably due to the taskService not sending correct events after a tusk has finished. Forward to @alexr00 as she might want to potentially investigate this. Thanks

@isidorn isidorn assigned alexr00 and unassigned weinand and isidorn Feb 10, 2020
@alexr00
Copy link
Member

alexr00 commented Feb 10, 2020

Currently, having background tasks in a a 'dependsOn` is not supported. Duplicate of #70283

@alexr00 alexr00 added the *duplicate Issue identified as a duplicate of another issue(s) label Feb 10, 2020
@vscodebot
Copy link

vscodebot bot commented Feb 10, 2020

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Feb 10, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

4 participants