X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch;h=985cb6a5d99839e96fd0464d5b359a77e49f98c5;hb=77d1099;hp=044a408ef51a24d4e092a9b5877d7300fc342c79;hpb=321e94d61aceab20eb50bc5296671301ab33cc26;p=packages%2Fgdb.git diff --git a/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch b/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch index 044a408..985cb6a 100644 --- a/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch +++ b/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch @@ -1,3 +1,13 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Fedora GDB patches +Date: Fri, 27 Oct 2017 21:07:50 +0200 +Subject: + gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch + +;; Fix 'gdb gives highly misleading error when debuginfo pkg is present, +;; but not corresponding binary pkg' (RH BZ 981154). +;;=push+jan + Comments by Sergio Durigan Junior : This is the fix for RH BZ #981154 @@ -15,10 +25,10 @@ Comments by Sergio Durigan Junior : NULL after it is free'd, otherwise the code below thinks that it is still valid and doesn't print the necessary warning ("Try: yum install ..."). -Index: gdb-7.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp -=================================================================== +diff --git a/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp +new file mode 100644 --- /dev/null -+++ gdb-7.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp ++++ b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp @@ -0,0 +1,97 @@ +# Copyright (C) 2014 Free Software Foundation, Inc. + @@ -51,9 +61,9 @@ Index: gdb-7.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning. +} + +# We first need to generate a corefile -+set escapedfilename [string_to_regexp ${objdir}/${subdir}/gcore.test] ++set escapedfilename [string_to_regexp [standard_output_file gcore.test]] +set core_supported 0 -+gdb_test_multiple "gcore ${objdir}/${subdir}/gcore.test" \ ++gdb_test_multiple "gcore [standard_output_file gcore.test]" \ + "save a corefile" \ +{ + -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" { @@ -75,7 +85,7 @@ Index: gdb-7.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning. +# Move the binfile to a temporary name +remote_exec build "mv $binfile ${binfile}.old" + -+# Reinitialize GDB and see if we get a yum warning ++# Reinitialize GDB and see if we get a yum/dnf warning +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir @@ -84,21 +94,21 @@ Index: gdb-7.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning. + gdb_test "set build-id-verbose 1" "" \ + "set build-id-verbose" + -+ gdb_test "set debug-file-directory ${objdir}/${subdir}" "" \ ++ gdb_test "set debug-file-directory [file dirname [standard_output_file gcore.test]]" "" \ + "set debug-file-directory" + -+ gdb_test "core-file ${objdir}/${subdir}/gcore.test" \ -+ "Missing separate debuginfo for the main executable file\r\nTry: yum --enablerepo='\\*debug\\*' install $objdir/$subdir/$build_id_without_debug\r\n.*" \ -+ "test first yum warning" ++ gdb_test "core-file [standard_output_file gcore.test]" \ ++ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install [standard_output_file $build_id_without_debug]\r\n.*" \ ++ "test first yum/dnf warning" +} + +# Now we define and create our .build-id -+file mkdir [file dirname ${objdir}/${subdir}/${build_id_without_debug}] ++file mkdir [file dirname [standard_output_file ${build_id_without_debug}]] +# Cannot use "file link" (from TCL) because it requires the target file to +# exist. -+remote_exec build "ln -s $binfile ${objdir}/${subdir}/${build_id_without_debug}" ++remote_exec build "ln -s $binfile [standard_output_file ${build_id_without_debug}]" + -+# Reinitialize GDB to get the second yum warning ++# Reinitialize GDB to get the second yum/dnf warning +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir @@ -107,25 +117,13 @@ Index: gdb-7.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning. + gdb_test "set build-id-verbose 1" "" \ + "set build-id-verbose" + -+ gdb_test "set debug-file-directory ${objdir}/${subdir}" "" \ ++ gdb_test "set debug-file-directory [file dirname [standard_output_file gcore.test]]" "" \ + "set debug-file-directory" + -+ gdb_test "core-file ${objdir}/${subdir}/gcore.test" \ -+ "Missing separate debuginfo for the main executable file\r\nTry: yum --enablerepo='\\*debug\\*' install $binfile\r\n.*" \ -+ "test second yum warning" ++ gdb_test "core-file [standard_output_file gcore.test]" \ ++ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install $binfile\r\n.*" \ ++ "test second yum/dnf warning" +} + +# Leaving the link there will cause breakage in the next run. -+remote_exec build "rm -f ${objdir}/${subdir}/${build_id_without_debug}" -Index: gdb-7.7/gdb/build-id.c -=================================================================== ---- gdb-7.7.orig/gdb/build-id.c -+++ gdb-7.7/gdb/build-id.c -@@ -588,6 +588,7 @@ build_id_to_debug_bfd (size_t build_id_l - if (abfd == NULL) - { - xfree (filename); -+ filename = NULL; - continue; - } - ++remote_exec build "rm -f [standard_output_file ${build_id_without_debug}]"