Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
f87ff765
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f87ff765
编写于
11月 06, 2014
作者:
A
Alex Crichton
浏览文件
操作
浏览文件
下载
差异文件
rollup merge of #18654 : michaelwoerister/lldb-test-timeout
上级
3c81f33a
36088ab2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
1 deletion
+28
-1
mk/tests.mk
mk/tests.mk
+3
-1
src/etc/lldb_batchmode.py
src/etc/lldb_batchmode.py
+25
-0
未找到文件。
mk/tests.mk
浏览文件 @
f87ff765
...
...
@@ -677,7 +677,9 @@ CTEST_DEPS_cfail_$(1)-T-$(2)-H-$(3) = $$(CFAIL_TESTS)
CTEST_DEPS_bench_$(1)-T-$(2)-H-$(3)
=
$
$(BENCH_TESTS)
CTEST_DEPS_perf_$(1)-T-$(2)-H-$(3)
=
$
$(PERF_TESTS)
CTEST_DEPS_debuginfo-gdb_$(1)-T-$(2)-H-$(3)
=
$
$(DEBUGINFO_GDB_TESTS)
CTEST_DEPS_debuginfo-lldb_$(1)-T-$(2)-H-$(3)
=
$
$(DEBUGINFO_LLDB_TESTS)
CTEST_DEPS_debuginfo-lldb_$(1)-T-$(2)-H-$(3)
=
$
$(DEBUGINFO_LLDB_TESTS)
\
$(S)
src/etc/lldb_batchmode.py
\
$(S)
src/etc/lldb_rust_formatters.py
CTEST_DEPS_codegen_$(1)-T-$(2)-H-$(3)
=
$
$(CODEGEN_TESTS)
endef
...
...
src/etc/lldb_batchmode.py
浏览文件 @
f87ff765
...
...
@@ -28,8 +28,10 @@ import lldb
import
os
import
sys
import
threading
import
thread
import
re
import
atexit
import
time
# Set this to True for additional output
DEBUG_OUTPUT
=
False
...
...
@@ -130,6 +132,22 @@ def start_breakpoint_listener(target):
target
.
GetBroadcaster
().
AddListener
(
listener
,
lldb
.
SBTarget
.
eBroadcastBitBreakpointChanged
)
def
start_watchdog
():
"Starts a watchdog thread that will terminate the process after a certain period of time"
watchdog_start_time
=
time
.
clock
()
watchdog_max_time
=
watchdog_start_time
+
30
def
watchdog
():
while
time
.
clock
()
<
watchdog_max_time
:
time
.
sleep
(
1
)
print
(
"TIMEOUT: lldb_batchmode.py has been running for too long. Aborting!"
)
thread
.
interrupt_main
()
# Start the listener and let it run as a daemon
watchdog_thread
=
threading
.
Thread
(
target
=
watchdog
)
watchdog_thread
.
daemon
=
True
watchdog_thread
.
start
()
####################################################################################################
# ~main
####################################################################################################
...
...
@@ -147,6 +165,9 @@ print("Debugger commands script is '%s'." % script_path)
print
(
"Target executable is '%s'."
%
target_path
)
print
(
"Current working directory is '%s'"
%
os
.
getcwd
())
# Start the timeout watchdog
start_watchdog
()
# Create a new debugger instance
debugger
=
lldb
.
SBDebugger
.
Create
()
...
...
@@ -175,6 +196,10 @@ try:
for
line
in
script_file
:
command
=
line
.
strip
()
if
command
==
"run"
or
command
==
"r"
or
re
.
match
(
"^process\s+launch.*"
,
command
):
# Before starting to run the program, let the thread sleep a bit, so all
# breakpoint added events can be processed
time
.
sleep
(
0.5
)
if
command
!=
''
:
execute_command
(
command_interpreter
,
command
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录