summaryrefslogtreecommitdiff
path: root/gdb-6.5-section-num-fixup-test.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-06 05:48:09 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-06 05:48:09 +0000
commitab322c77aab87050c6ca0ce58e18f31e269e519b (patch)
tree7ff9c6a18efd867f35cb6f8fb08893c6b655376f /gdb-6.5-section-num-fixup-test.patch
parent19677e130f0cd283f7884cc4b6b3d52f8812dae5 (diff)
automatic import of gdbopeneuler24.03_LTS
Diffstat (limited to 'gdb-6.5-section-num-fixup-test.patch')
-rw-r--r--gdb-6.5-section-num-fixup-test.patch127
1 files changed, 127 insertions, 0 deletions
diff --git a/gdb-6.5-section-num-fixup-test.patch b/gdb-6.5-section-num-fixup-test.patch
new file mode 100644
index 0000000..2fa3995
--- /dev/null
+++ b/gdb-6.5-section-num-fixup-test.patch
@@ -0,0 +1,127 @@
+From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
+From: Fedora GDB patches <invalid@email.com>
+Date: Fri, 27 Oct 2017 21:07:50 +0200
+Subject: gdb-6.5-section-num-fixup-test.patch
+
+;; Test a crash on libraries missing the .text section.
+;;=fedoratest
+
+diff --git a/gdb/testsuite/gdb.base/datalib-lib.c b/gdb/testsuite/gdb.base/datalib-lib.c
+new file mode 100644
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/datalib-lib.c
+@@ -0,0 +1,22 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++ Copyright 2008 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++ Please email any bugs, comments, and/or additions to this file to:
++ bug-gdb@prep.ai.mit.edu */
++
++int var;
+diff --git a/gdb/testsuite/gdb.base/datalib-main.c b/gdb/testsuite/gdb.base/datalib-main.c
+new file mode 100644
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/datalib-main.c
+@@ -0,0 +1,26 @@
++/* This testcase is part of GDB, the GNU debugger.
++
++ Copyright 2008 Free Software Foundation, Inc.
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++ Please email any bugs, comments, and/or additions to this file to:
++ bug-gdb@prep.ai.mit.edu */
++
++int
++main (void)
++{
++ return 0;
++}
+diff --git a/gdb/testsuite/gdb.base/datalib.exp b/gdb/testsuite/gdb.base/datalib.exp
+new file mode 100644
+--- /dev/null
++++ b/gdb/testsuite/gdb.base/datalib.exp
+@@ -0,0 +1,56 @@
++# Copyright 2008 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++
++if {[use_gdb_stub]} {
++ untested "skipping test because of use_gdb_stub"
++ return -1
++}
++
++set testfile datalib
++set srcfilemain ${testfile}-main.c
++set srcfilelib ${testfile}-lib.c
++set libfile [standard_output_file ${testfile}-lib.so]
++set binfile [standard_output_file ${testfile}-main]
++if { [gdb_compile "${srcdir}/${subdir}/${srcfilelib}" "${libfile}" executable [list debug {additional_flags=-shared -nostdlib}]] != "" } {
++ untested "Couldn't compile test program"
++ return -1
++}
++if { [gdb_compile "${srcdir}/${subdir}/${srcfilemain}" "${binfile} ${libfile}" executable {debug}] != "" } {
++ untested "Couldn't compile test program"
++ return -1
++}
++
++# Get things started.
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++gdb_load ${binfile}
++
++# We must use a separate library as the main executable is compiled to the
++# address 0 by default and it would get fixed up already at the end of
++# INIT_OBJFILE_SECT_INDICES. We also cannot PRELINK it as PRELINK is missing
++# on ia64. The library must be NOSTDLIB as otherwise some stub code would
++# create the `.text' section there. Also DEBUG option is useful as some of
++# the crashes occur in dwarf2read.c.
++
++# FAIL case:
++# ../../gdb/ia64-tdep.c:2838: internal-error: sect_index_text not initialized
++# A problem internal to GDB has been detected,
++
++gdb_test "start" \
++ "main \\(\\) at .*${srcfilemain}.*" \
++ "start"