以TeamTalk server端 为例
前提 源码编译成功可以运行??
你也可以通过VSCode添加Task编译源码
VSCode插件
Bash Debug? shell
打开TeamTalk根目录
添加 launch.json
{
// 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": "route_server",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/auto_setup/im_server/im-server-1/route_server/route_server",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/auto_setup/im_server/im-server-1/route_server",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "login_server",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/auto_setup/im_server/im-server-1/login_server/login_server",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/auto_setup/im_server/im-server-1/login_server",
"environment": [],
"externalConsole": false,
"linux": { // 下面是Linux平台下,需要配置的参数,这里暂时不用关心
"MIMode": "gdb",
"setupCommands": [{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}]
},
},
{
"name": "http_msg_server",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/auto_setup/im_server/im-server-1/http_msg_server/http_msg_server",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/auto_setup/im_server/im-server-1/http_msg_server",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "msg_server",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/auto_setup/im_server/im-server-1/msg_server/msg_server",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}/auto_setup/im_server/im-server-1/msg_server",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "db_proxy_server",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/auto_setup/im_server/im-server-1/db_proxy_server/db_proxy_server",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/auto_setup/im_server/im-server-1/db_proxy_server",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"type": "bashdb",
"request": "launch",
"name": "Bash-Debug (simplest configuration)",
"program": "start_all.sh"
},
{
"type": "bashdb",
"request": "launch",
"name": "redis",
"program": "setup.sh",
"cwd": "${workspaceFolder}/auto_setup/redis",
"args": ["install"],
}
],
"compounds": [
{
"name": "TeamTalk-Server",
"configurations": ["redis","route_server", "db_proxy_server","http_msg_server","msg_server","login_server"],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
然后设置断点 启动对应服务?
?
?msg_server设置断点?
php页面 可分离Debug 也可一并debug?
|