• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修订版c9a1dc08aaf6cb16b9d07fcee5420c3c73b9dd72 (tree)
时间2003-01-09 09:45:08
作者Andrew Cagney <cagney@redh...>
CommiterAndrew Cagney

Log Message

2003-01-08 Andrew Cagney <ac131313@redhat.com>

* gdb_mbuild.sh: Add --keep option. When specified, keep the
build directories. Save edited gdb output in Mbuild.log. If a
build fails, remove any final GDB executable.

更改概述

差异

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -5,6 +5,12 @@
55
66 2003-01-08 Andrew Cagney <ac131313@redhat.com>
77
8+ * gdb_mbuild.sh: Add --keep option. When specified, keep the
9+ build directories. Save edited gdb output in Mbuild.log. If a
10+ build fails, remove any final GDB executable.
11+
12+2003-01-08 Andrew Cagney <ac131313@redhat.com>
13+
814 * gdb_mbuild.sh: Edit the output of `maint print architecture'
915 replacing hex constants with function names and stripping leading
1016 file name directory prefixes.
--- a/gdb/gdb_mbuild.sh
+++ b/gdb/gdb_mbuild.sh
@@ -29,6 +29,7 @@ Usage: gdb_mbuild.sh [ <options> ... ] <srcdir> <builddir>
2929 -j <makejobs> Run <makejobs> in parallel. Passed to make.
3030 On a single cpu machine, 2 is recommended.
3131 -k Keep going. Do not stop after the first build fails.
32+ --keep Keep builds. Do not remove each build when finished.
3233 -e <regexp> Regular expression for selecting the targets to build.
3334 -f Force rebuild. Even rebuild previously built directories.
3435 -v Be more (and more, and more) verbose.
@@ -53,6 +54,7 @@ keepgoing=
5354 force=false
5455 targexp=""
5556 verbose=0
57+keep=false
5658 while test $# -gt 0
5759 do
5860 case "$1" in
@@ -72,6 +74,9 @@ do
7274 # Should we soldier on after the first build fails?
7375 keepgoing=-k
7476 ;;
77+ --keep )
78+ keep=true
79+ ;;
7580 -e )
7681 # A regular expression for selecting targets
7782 shift
@@ -261,8 +266,13 @@ do
261266
262267 if test ! -x gdb/gdb -a ! -x gdb/gdb.exe
263268 then
269+ # Iff the build fails remove the final build target so that
270+ # the follow-on code knows things failed. Stops the follow-on
271+ # code thinking that a failed rebuild succedded (executable
272+ # left around from previous build).
264273 echo ... ${make} ${keepgoing} ${makejobs} ${target}
265- ${make} ${keepgoing} ${makejobs} all-gdb 2>&1 | log 1 Build.log
274+ ( ${make} ${keepgoing} ${makejobs} all-gdb || rm -f gdb/gdb gdb/gdb.exe
275+ ) 2>&1 | log 1 Build.log
266276 fi
267277 fail "compile failed" ! -x gdb/gdb -a ! -x gdb/gdb.exe
268278
@@ -284,7 +294,6 @@ EOF
284294 # Create a sed script that cleans up the output from GDB.
285295 rm -f mbuild.sed
286296 touch mbuild.sed || exit 1
287-
288297 # Rules to replace <0xNNNN> with the corresponding function's
289298 # name.
290299 sed -n -e '/<0x0*>/d' -e 's/^.*<0x\([0-9a-f]*\)>.*$/0x\1/p' Gdb.log \
@@ -295,18 +304,25 @@ EOF
295304 test ${verbose} -gt 0 && echo "${addr} ${func}" 1>&2
296305 echo "s/<${addr}>/<${func}>/g"
297306 done >> mbuild.sed
298-
299307 # Rules to strip the leading paths off of file names.
300308 echo 's/"\/.*\/gdb\//"gdb\//g' >> mbuild.sed
309+ # Run the script
310+ sed -f mbuild.sed Gdb.log > Mbuild.log
301311
302312 # Replace the build directory with a file as semaphore that stops
303313 # a rebuild. (should the logs be saved?)
304314
305315 cd ${builddir}
306- rm -f ${target}.tmp
307- sed -f ${target}/mbuild.sed ${target}/Gdb.log > ${target}.tmp
308- rm -rf ${target}
309- mv ${target}.tmp ${target}
316+
317+ if ${keep}
318+ then
319+ :
320+ else
321+ rm -f ${target}.tmp
322+ mv ${target}/Mbuild.log ${target}.tmp
323+ rm -rf ${target}
324+ mv ${target}.tmp ${target}
325+ fi
310326
311327 # Success!
312328 echo ... ${target} built