1 Star 0 Fork 44

wangxiao65/gdb

forked from src-openEuler/gdb 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
gdb-rhbz2232086-refactor-selftest-support.patch 2.54 KB
一键复制 编辑 原始数据 按行查看 历史
SuperSix173 提交于 2024-01-24 15:15 . upgrade GDB version to 14.1
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Andrew Burgess <aburgess@redhat.com>
Date: Fri, 24 Nov 2023 11:10:08 +0000
Subject: gdb-rhbz2232086-refactor-selftest-support.patch
;; Back-port upstream commit 1f0fab7ff86 as part of a fix for
;; non-deterministic gdb-index generation (RH BZ 2232086).
gdb/testsuite: small refactor in selftest-support.exp
Split out the code that makes a copy of the GDB executable ready for
self testing into a new proc. A later commit in this series wants to
load the GDB executable into GDB (for creating an on-disk debug
index), but doesn't need to make use of the full do_self_tests proc.
There should be no changes in what is tested after this commit.
Approved-By: Tom Tromey <tom@tromey.com>
diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp
--- a/gdb/testsuite/lib/selftest-support.exp
+++ b/gdb/testsuite/lib/selftest-support.exp
@@ -92,11 +92,13 @@ proc selftest_setup { executable function } {
return 0
}
-# A simple way to run some self-tests.
-
-proc do_self_tests {function body} {
- global GDB tool
-
+# Prepare for running a self-test by moving the GDB executable to a
+# location where we can use it as the inferior. Return the filename
+# of the new location.
+#
+# If the current testing setup is not suitable for running a
+# self-test, then return an empty string.
+proc selftest_prepare {} {
# Are we testing with a remote board? In that case, the target
# won't have access to the GDB's auxilliary data files
# (data-directory, etc.). It's simpler to just skip.
@@ -120,19 +122,31 @@ proc do_self_tests {function body} {
# Run the test with self. Copy the file executable file in case
# this OS doesn't like to edit its own text space.
- set GDB_FULLPATH [find_gdb $GDB]
+ set gdb_fullpath [find_gdb $::GDB]
if {[is_remote host]} {
- set xgdb x$tool
+ set xgdb x$::tool
} else {
- set xgdb [standard_output_file x$tool]
+ set xgdb [standard_output_file x$::tool]
}
# Remove any old copy lying around.
remote_file host delete $xgdb
+ set filename [remote_download host $gdb_fullpath $xgdb]
+
+ return $filename
+}
+
+# A simple way to run some self-tests.
+
+proc do_self_tests {function body} {
+ set file [selftest_prepare]
+ if { $file eq "" } {
+ return
+ }
+
gdb_start
- set file [remote_download host $GDB_FULLPATH $xgdb]
# When debugging GDB with GDB, some operations can take a relatively long
# time, especially if the build is non-optimized. Bump the timeout for the
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangxiao65/gdb.git
git@gitee.com:wangxiao65/gdb.git
wangxiao65
gdb
gdb
master

搜索帮助