Blame SOURCES/gdb-6.3-test-movedir-20050125.patch

132741
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
132741
From: Elena Zannoni <ezannoni@redhat.com>
132741
Date: Fri, 27 Oct 2017 21:07:50 +0200
132741
Subject: gdb-6.3-test-movedir-20050125.patch
132741
132741
;; Fix to support executable moving
132741
;;=fedoratest
132741
132741
2005-01-25  Elena Zannoni  <ezannoni@redhat.com>
132741
132741
        * gdb.base/move-dir.exp: New test.
132741
        * gdb.base/move-dir.c: Ditto.
132741
        * gdb.base/move-dir.h: Ditto.
132741
132741
diff --git a/gdb/testsuite/gdb.base/move-dir.c b/gdb/testsuite/gdb.base/move-dir.c
132741
new file mode 100644
132741
--- /dev/null
132741
+++ b/gdb/testsuite/gdb.base/move-dir.c
132741
@@ -0,0 +1,9 @@
132741
+#include <stdio.h>
132741
+#include <stdlib.h>
132741
+#include "move-dir.h"
132741
+
132741
+int main() {
132741
+   const char* hw = "hello world.";
132741
+   printf ("%s\n", hw);;
132741
+   other();
132741
+}
132741
diff --git a/gdb/testsuite/gdb.base/move-dir.exp b/gdb/testsuite/gdb.base/move-dir.exp
132741
new file mode 100644
132741
--- /dev/null
132741
+++ b/gdb/testsuite/gdb.base/move-dir.exp
132741
@@ -0,0 +1,57 @@
132741
+#   Copyright 2005
132741
+#   Free Software Foundation, Inc.
132741
+
132741
+# This program is free software; you can redistribute it and/or modify
132741
+# it under the terms of the GNU General Public License as published by
132741
+# the Free Software Foundation; either version 2 of the License, or
132741
+# (at your option) any later version.
132741
+#
132741
+# This program is distributed in the hope that it will be useful,
132741
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
132741
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
132741
+# GNU General Public License for more details.
132741
+#
132741
+# You should have received a copy of the GNU General Public License
132741
+# along with this program; if not, write to the Free Software
132741
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
132741
+
132741
+set testfile "move-dir"
132741
+set srcfile ${testfile}.c
132741
+set incfile ${testfile}.h
132741
+set binfile [standard_output_file ${testfile}]
132741
+
132741
+set testdir [standard_output_file incdir]
132741
+
132741
+remote_exec build "mkdir $testdir"
132741
+remote_exec build "cp ${srcdir}/${subdir}/${srcfile} [standard_output_file ${srcfile}]"
132741
+remote_exec build "cp ${srcdir}/${subdir}/${incfile} [standard_output_file ${incfile}]"
132741
+
132741
+set additional_flags "additional_flags=-I${subdir}/incdir"
132741
+
132741
+if  { [gdb_compile [standard_output_file ${srcfile}] "${binfile}" executable [list debug $additional_flags]] != "" } {
132741
+    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
132741
+}
132741
+
132741
+# Create and source the file that provides information about the compiler
132741
+# used to compile the test case.
132741
+
132741
+if [get_compiler_info ${binfile}] {
132741
+    return -1;
132741
+}
132741
+
132741
+
132741
+set oldtimeout $timeout
132741
+set timeout [expr "$timeout + 60"]
132741
+
132741
+# Start with a fresh gdb.
132741
+
132741
+gdb_exit
132741
+gdb_start
132741
+gdb_test "cd ../.." "" ""
132741
+gdb_load ${binfile}
132741
+gdb_test "list main" ".*hw.*other.*" "found main"
132741
+gdb_test "list other" ".*ostring.*" "found include file"
132741
+
132741
+
132741
+set timeout $oldtimeout
132741
+return 0
132741
diff --git a/gdb/testsuite/gdb.base/move-dir.h b/gdb/testsuite/gdb.base/move-dir.h
132741
new file mode 100644
132741
--- /dev/null
132741
+++ b/gdb/testsuite/gdb.base/move-dir.h
132741
@@ -0,0 +1,6 @@
132741
+#include <stdlib.h>
132741
+
132741
+void other() {
132741
+  const char* ostring = "other";
132741
+  printf ("%s\n", ostring);;
132741
+}