Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
b01de503
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b01de503
编写于
4月 06, 2018
作者:
知行合一2018
提交者:
Jiangtao Hu
4月 08, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vscode: support entering debug mode with F5 key in VSCode.
上级
71185d2d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
169 addition
and
2 deletion
+169
-2
.vscode/launch.json
.vscode/launch.json
+9
-2
.vscode/tasks.json
.vscode/tasks.json
+21
-0
docker/scripts/dev_start_gdb_server.sh
docker/scripts/dev_start_gdb_server.sh
+63
-0
scripts/start_gdb_server.sh
scripts/start_gdb_server.sh
+76
-0
未找到文件。
.vscode/launch.json
浏览文件 @
b01de503
...
...
@@ -5,10 +5,17 @@
"name"
:
"C++ Launch"
,
"type"
:
"cppdbg"
,
"request"
:
"launch"
,
//
you
can
change
the
"planning"
to
your
module
name.
//
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.
//
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 the gdbserver in the ocker"
,
but
the
module
name
and
the
port
//
number
should
be
consistent
with
this
file.
"preLaunchTask"
:
"start gdbserver"
,
"args"
:
[],
"stopAtEntry"
:
false
,
"cwd"
:
"${workspaceRoot}"
,
...
...
.vscode/tasks.json
浏览文件 @
b01de503
...
...
@@ -92,6 +92,27 @@
"message"
:
5
}
}
},
{
"label"
:
"start gdbserver"
,
"type"
:
"shell"
,
//
you
can
change
the
"planning"
module
name
to
another
one
and
//
change
the
"1111"
to
another
port
number.
//
Note:
the
module
name
and
port
number
should
be
same
as
in
//
the
"launch.json"
file.
"command"
:
"bash docker/scripts/dev_start_gdb_server.sh planning 1111"
,
"isBackground"
:
true
,
"problemMatcher"
:
{
"owner"
:
"custom"
,
"pattern"
:
{
"regexp"
:
"__________"
},
"background"
:
{
"activeOnStart"
:
true
,
"beginsPattern"
:
"^Listening on port$"
,
"endsPattern"
:
"^$"
}
}
}
]
}
\ No newline at end of file
docker/scripts/dev_start_gdb_server.sh
0 → 100755
浏览文件 @
b01de503
#!/usr/bin/env bash
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
function
check_docker_open
()
{
docker ps
--format
"{{.Names}}"
|
grep
apollo_dev 1>/dev/null 2>&1
if
[
$?
!=
0
]
;
then
echo
"The docker is not started, please start it first. "
exit
1
fi
}
function
print_usage
()
{
RED
=
'\033[0;31m'
BLUE
=
'\033[0;34m'
BOLD
=
'\033[1m'
NONE
=
'\033[0m'
echo
-e
"
\n
${
RED
}
Usage
${
NONE
}
:
.
${
BOLD
}
/dev_debug_server.sh
${
NONE
}
MODULE_NAME PORT_NUMBER"
echo
-e
"
${
RED
}
MODULE_NAME
${
NONE
}
:
${
BLUE
}
planning
${
NONE
}
: debug the planning module.
${
BLUE
}
control
${
NONE
}
: debug the control module.
${
BLUE
}
routing
${
NONE
}
: debug the routing module.
..., and so on."
echo
-e
"
${
RED
}
PORT_NUMBER
${
NONE
}
:
${
NONE
}
a port number, such as '1111'."
}
if
[
$#
-lt
2
]
;
then
print_usage
exit
1
fi
check_docker_open
DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
cd
"
${
DIR
}
/../.."
pwd
xhost +local:root 1>/dev/null 2>&1
#echo $@
docker
exec
\
-u
$USER
\
-it
apollo_dev
\
/bin/bash scripts/start_gdb_server.sh
$@
xhost
-local
:root 1>/dev/null 2>&1
scripts/start_gdb_server.sh
0 → 100755
浏览文件 @
b01de503
#!/usr/bin/env bash
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
function
print_usage
()
{
RED
=
'\033[0;31m'
BLUE
=
'\033[0;34m'
BOLD
=
'\033[1m'
NONE
=
'\033[0m'
echo
-e
"
\n
${
RED
}
Usage
${
NONE
}
:
.
${
BOLD
}
/start_gdb_server.sh
${
NONE
}
MODULE_NAME PORT_NUMBER"
echo
-e
"
${
RED
}
MODULE_NAME
${
NONE
}
:
${
BLUE
}
planning
${
NONE
}
: debug the planning module.
${
BLUE
}
control
${
NONE
}
: debug the control module.
${
BLUE
}
routing
${
NONE
}
: debug the routing module.
..., and so on."
echo
-e
"
${
RED
}
PORT_NUMBER
${
NONE
}
:
${
NONE
}
a port number, such as '1111'."
}
if
[
$#
-lt
2
]
;
then
print_usage
exit
1
fi
DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
source
"
${
DIR
}
/apollo_base.sh"
MODULE_NAME
=
$1
PORT_NUM
=
$2
shift
2
# If there is a gdbserver process running, stop it first.
GDBSERVER_NUMS
=
$(
pgrep
-c
-x
"gdbserver"
)
if
[
${
GDBSERVER_NUMS
}
-ne
0
]
;
then
sudo
pkill
-f
"gdbserver"
fi
# Because the "grep ${MODULE_NAME}" always generates a process with the name of
# "${MODULE_NAME}", I added another grep to remove grep itself from the output.
# The following command got a wrong result and I can't find the reason.
#PROCESS_ID=$(ps -eo pid,command | grep "${MODULE_NAME}" | grep -v "grep" | awk '{print $1}')
# This one is OK.
PROCESS_ID
=
$(
pgrep
-o
-x
"
${
MODULE_NAME
}
"
)
#echo ${PROCESS_ID}
# If the moudle is not started, start it first.
if
[
-z
${
PROCESS_ID
}
]
;
then
#echo "The '${MODULE_NAME}' module is not started, please start it in the dreamview first. "
#exit 1
# run function from apollo_base.sh
# run command_name module_name
run
${
MODULE_NAME
}
"
$@
"
PROCESS_ID
=
$(
pgrep
-o
-x
"
${
MODULE_NAME
}
"
)
fi
sudo
gdbserver :
${
PORT_NUM
}
--attach
${
PROCESS_ID
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录