Noux GDB: resolve '..' in run script

If the path of a Genode source file (as extracted from the binary test
application) contains a part like '/a/b/../' where '/a' exists, but '/a/b'
does not exist anymore, 'tar' complains. With this patch, the run script
normalizes the path before calling 'tar'.

Fixes #875.
This commit is contained in:
Christian Prochaska 2013-09-04 12:25:43 +02:00 committed by Norman Feske
parent 58b8e766d1
commit 3ca14f53fe
1 changed files with 3 additions and 0 deletions

View File

@ -57,6 +57,9 @@ exec mkdir -p bin/test-gdb_monitor-src
foreach test_binary $test_binaries {
set source_files [ exec [cross_dev_prefix]objdump -dl bin/$test_binary | grep "^/.*:.*" | sed -e "s/:.*//" | uniq ]
foreach source_file $source_files {
# resolve '..' to avoid problems with 'tar' with parts like '/a/b/../'
# where '/a' exists, but '/a/b' does not
set source_file [file normalize $source_file]
if [file exists $source_file] {
set dirname [ exec dirname $source_file]
exec mkdir -p bin/test-gdb_monitor-src$dirname