apollo icon indicating copy to clipboard operation
apollo copied to clipboard

cannot debug planning module by using vscode

Open l1xiao opened this issue 8 years ago • 4 comments

Dear Apollo developers, I built the Apollo but failed to run starting debugging. the error message said as follow:

Unable to start debugging. Program path '/home/li/apollo-master/bazel-bin/modules/planning/planning' is missing or invalid.

GDB failed with message: /home/li/apollo-master/bazel-bin/modules/planning/planning: 没有那个文件或目录.

I reproduce this error by:

  1. shift + ctrl + b in vscode to build
  2. click "Debug->start debugging" button
  3. using apollo 3.0 and ubuntu 14

other information: 1.I can run the planning process by using dreamview, so I think the execute files have complied successfully. 2.my launch.json:

{
    "version": "0.2.0",
    "configurations": [
    {
        "name": "C++ Launch",
        "type": "cppdbg",
        "request": "launch",
        // You can change the "planning" to your module name, but it should be 
        // same as in gdbserver of the docker container. 
        "program": "${workspaceRoot}/bazel-bin/modules/planning/planning",
        // You can change "localhost:1111" to another "IP:port" name, but it 
        // should be same as in gdbserver of the docker container.  
        "miDebuggerServerAddress": "localhost:1111",
        // You can change the task to meet your demands in the 
        // ".vscode/tasks.json" file (search the label:  
        // "start gdbserver", but the module name and the port 
        // number should be consistent with this file.        
        "preLaunchTask": "start gdbserver",
        "args": [],
        "stopAtEntry": false,
        "cwd": "${workspaceRoot}",
        "environment": [],
        "externalConsole": true,
        "linux": {
            "MIMode": "gdb"
        },
        "osx": {
            "MIMode": "gdb"
        },
        "windows": {
            "MIMode": "gdb"
        }
    }
    ]
}

l1xiao avatar Nov 04 '18 07:11 l1xiao

inside docker, can you try the following commands?

bash scripts/start_gdb_server.sh planning 1111 ps -ef | grep planning

ycool avatar Mar 07 '19 19:03 ycool

@ycool I also meet this problem. I tried to run the bash scripts/start_gdb_server.sh planning 1111, planning is working. I can use gdb to attach "target remote", and the gdb server print connection info. But when using vscode, it shows **_Unable to start debugging. Program path '/apollo/bazel-bin/cyber/mainboard' is missing or invalid.

GDB failed with message: /apollo/bazel-bin/cyber/mainboard: No such file or directory._**

wobistdu avatar Mar 14 '19 10:03 wobistdu

Stale issue closed.

storypku avatar Nov 18 '20 08:11 storypku

@ycool I also meet this problem. I tried to run the bash scripts/start_gdb_server.sh planning 1111, planning is working. I can use gdb to attach "target remote", and the gdb server print connection info. But when using vscode, it shows **_Unable to start debugging. Program path '/apollo/bazel-bin/cyber/mainboard' is missing or invalid.

GDB failed with message: /apollo/bazel-bin/cyber/mainboard: No such file or directory._**

Hey, bro. I encountered the same problem, how did you solve it?

EthanCodesss avatar Mar 09 '22 12:03 EthanCodesss