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

Cannot launch a debugging session on Ubuntu 23.04 #35

Open
kyselejsyrecek opened this issue Oct 5, 2023 · 3 comments
Open

Cannot launch a debugging session on Ubuntu 23.04 #35

kyselejsyrecek opened this issue Oct 5, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@kyselejsyrecek
Copy link

The extension is unable to start a debugging session on Ubuntu 23.04. When launching the session, an error window pops up in bottom-right corner of VS Code, reading that /bin/bash failed to launch. The following error message then appears in the Output Window:

[error] [Extension Host] stderr: agent-proxy: žádný proces nenalezen

(In English: no process found)

I have tried launching the debugging session without and with agent-proxy downloaded from Linux kernel website and linked to ${workspaceFolder}/agent-proxy with a symbolic link with the same result. I am using the latest version of this extension, but behaviour of the experimental version is the same.

image
image

Configuration from launch.json:

    {
      "name": "KGDB: remote kernel debugging (serial console)",
      "type": "cppdbg", // required for GDB and LLDB
      "request": "launch", // attach to running Linux kernel
      "program": "${workspaceFolder}/rpm/${input:targetPlatform}/BUILD/linux/vmlinux",
      "preLaunchTask": "${command:embeddedLinuxDev.breakKernel}",
      "cwd": "${workspaceFolder}",
      "MIMode": "gdb", 
      "setupCommands": [
        {
          "description": "Set path to source files",
          "text": "set dir ${workspaceFolder}/linux",
          "ignoreFailures": false
        },
        {
          "description": "Connect to target machine.",
          "text": "target remote localhost:${config:kerneldev.serial_port}",
          "ignoreFailures": false
        }
      ],
      "miDebuggerPath": "gdb-multiarch"
    }
@kyselejsyrecek
Copy link
Author

kyselejsyrecek commented Oct 5, 2023

It seems that the shellArgs: ["--norc", "--noprofile"] property from file out/Utils/ExtensionsUtils.js (two occurrences) is passed incorrectly to the bash process. Modifying it to shellArgs: ["--noprofile"] solves the problem with Bash process crashing but does not help with agent-proxy.

I also found that the error agent-proxy: no process found was coming from killall agent-proxy command in file scripts/agentProxy.sh and thus was a false positive. After enabling debugging output from the script file with set -x, I was finally able to find the cause for agent-proxy failures which was the setting "kerneldev.serial_dev": "/dev/ttyUSB0" in settings.json. The correct setting is "kerneldev.serial_dev": "ttyUSB0". Moreover, "text": "target remote localhost:${config:kerneldev.serial_port}" from launch.json must be replaced with "text": "target remote localhost:${config:kerneldev.kgdb_port}" to make GDB attach to the correct port from serial splitter.

The only issue is thus the crash of bash process with parameters "--norc", "--noprofile".

@microhobby microhobby self-assigned this Oct 8, 2023
@microhobby microhobby added the bug Something isn't working label Oct 8, 2023
@microhobby
Copy link
Owner

hey @kyselejsyrecek thanks for the reports! I will take a look

@kyselejsyrecek
Copy link
Author

Hello @microhobby, sorry for my typos (which I have now corrected) and thanks for taking a look at the crashing Bash process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants