diff options
Diffstat (limited to 'sys-devel/gdb/files')
-rw-r--r-- | sys-devel/gdb/files/gdb-12.1-configure-clang16.patch | 112 | ||||
-rw-r--r-- | sys-devel/gdb/files/gdb-12.1-core-file-detach.patch | 155 | ||||
-rw-r--r-- | sys-devel/gdb/files/gdb-12.1-readline-8.2-build.patch | 29 | ||||
-rw-r--r-- | sys-devel/gdb/files/gdb-13.1-Wenum-constexpr-conversion-clang16.patch | 128 | ||||
-rw-r--r-- | sys-devel/gdb/files/gdb-13.1-musl-lfs.patch | 23 |
5 files changed, 0 insertions, 447 deletions
diff --git a/sys-devel/gdb/files/gdb-12.1-configure-clang16.patch b/sys-devel/gdb/files/gdb-12.1-configure-clang16.patch deleted file mode 100644 index 3b2c15de4895..000000000000 --- a/sys-devel/gdb/files/gdb-12.1-configure-clang16.patch +++ /dev/null @@ -1,112 +0,0 @@ -https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=0075c53724f78c78aa1692cc8e3bf1433eeb0b9f -https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=885b6660c17fb91980b5682514ef54668e544b02 -https://bugzilla.redhat.com/show_bug.cgi?id=2143992 - -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Keith Seitz <keiths@redhat.com> -Date: Tue, 29 Nov 2022 13:43:34 -0800 -Subject: gdb-rhbz2143992-libiberty-fix-c89isms-in-configure.patch - -;; libiberty: Fix C89-isms in configure tests -;; (Florian Weimer, RHBZ 2143992) - - libiberty/ - - * acinclude.m4 (ac_cv_func_strncmp_works): Add missing - int return type and parameter list to the definition of main. - Include <stdlib.h> and <string.h> for prototypes. - (ac_cv_c_stack_direction): Add missing - int return type and parameter list to the definitions of - main, find_stack_direction. Include <stdlib.h> for exit - prototype. - * configure: Regenerate. - ---- a/libiberty/acinclude.m4 -+++ b/libiberty/acinclude.m4 -@@ -24,6 +24,8 @@ AC_CACHE_CHECK([for working strncmp], ac_cv_func_strncmp_works, - [AC_TRY_RUN([ - /* Test by Jim Wilson and Kaveh Ghazi. - Check whether strncmp reads past the end of its string parameters. */ -+#include <stdlib.h> -+#include <string.h> - #include <sys/types.h> - - #ifdef HAVE_FCNTL_H -@@ -51,7 +53,8 @@ AC_CACHE_CHECK([for working strncmp], ac_cv_func_strncmp_works, - - #define MAP_LEN 0x10000 - --main () -+int -+main (void) - { - #if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE) - char *p; -@@ -157,7 +160,10 @@ if test $ac_cv_os_cray = yes; then - fi - - AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, --[AC_TRY_RUN([find_stack_direction () -+[AC_TRY_RUN([#include <stdlib.h> -+ -+int -+find_stack_direction (void) - { - static char *addr = 0; - auto char dummy; -@@ -169,7 +175,9 @@ AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, - else - return (&dummy > addr) ? 1 : -1; - } --main () -+ -+int -+main (void) - { - exit (find_stack_direction() < 0); - }], ---- a/libiberty/configure -+++ b/libiberty/configure -@@ -6918,7 +6918,10 @@ else - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ --find_stack_direction () -+#include <stdlib.h> -+ -+int -+find_stack_direction (void) - { - static char *addr = 0; - auto char dummy; -@@ -6930,7 +6933,9 @@ find_stack_direction () - else - return (&dummy > addr) ? 1 : -1; - } --main () -+ -+int -+main (void) - { - exit (find_stack_direction() < 0); - } -@@ -7755,6 +7760,8 @@ else - - /* Test by Jim Wilson and Kaveh Ghazi. - Check whether strncmp reads past the end of its string parameters. */ -+#include <stdlib.h> -+#include <string.h> - #include <sys/types.h> - - #ifdef HAVE_FCNTL_H -@@ -7782,7 +7789,8 @@ else - - #define MAP_LEN 0x10000 - --main () -+int -+main (void) - { - #if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE) - char *p; - diff --git a/sys-devel/gdb/files/gdb-12.1-core-file-detach.patch b/sys-devel/gdb/files/gdb-12.1-core-file-detach.patch deleted file mode 100644 index c0f8a8ee0269..000000000000 --- a/sys-devel/gdb/files/gdb-12.1-core-file-detach.patch +++ /dev/null @@ -1,155 +0,0 @@ -https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=0fe74cb9ad35add9c6da4df5c9879f254d918a6a - -From: Pedro Alves <pedro@palves.net> -Date: Wed, 22 Jun 2022 18:44:37 +0100 -Subject: [PATCH] Fix core-file -> detach -> crash (corefiles/29275) - -After loading a core file, you're supposed to be able to use "detach" -to unload the core file. That unfortunately regressed starting with -GDB 11, with these commits: - - 1192f124a308 - gdb: generalize commit_resume, avoid commit-resuming when threads have pending statuses - 408f66864a1a - detach in all-stop with threads running - -resulting in a GDB crash: - - ... - Thread 1 "gdb" received signal SIGSEGV, Segmentation fault. - 0x0000555555e842bf in maybe_set_commit_resumed_all_targets () at ../../src/gdb/infrun.c:2899 - 2899 if (proc_target->commit_resumed_state) - (top-gdb) bt - #0 0x0000555555e842bf in maybe_set_commit_resumed_all_targets () at ../../src/gdb/infrun.c:2899 - #1 0x0000555555e848bf in scoped_disable_commit_resumed::reset (this=0x7fffffffd440) at ../../src/gdb/infrun.c:3023 - #2 0x0000555555e84a0c in scoped_disable_commit_resumed::reset_and_commit (this=0x7fffffffd440) at ../../src/gdb/infrun.c:3049 - #3 0x0000555555e739cd in detach_command (args=0x0, from_tty=1) at ../../src/gdb/infcmd.c:2791 - #4 0x0000555555c0ba46 in do_simple_func (args=0x0, from_tty=1, c=0x55555662a600) at ../../src/gdb/cli/cli-decode.c:95 - #5 0x0000555555c112b0 in cmd_func (cmd=0x55555662a600, args=0x0, from_tty=1) at ../../src/gdb/cli/cli-decode.c:2514 - #6 0x0000555556173b1f in execute_command (p=0x5555565c5916 "", from_tty=1) at ../../src/gdb/top.c:699 - -The code that crashes looks like: - - static void - maybe_set_commit_resumed_all_targets () - { - scoped_restore_current_thread restore_thread; - - for (inferior *inf : all_non_exited_inferiors ()) - { - process_stratum_target *proc_target = inf->process_target (); - - if (proc_target->commit_resumed_state) - ^^^^^^^^^^^ - -With 'proc_target' above being null. all_non_exited_inferiors filters -out inferiors that have pid==0. We get here at the end of -detach_command, after core_target::detach has already run, at which -point the inferior _should_ have pid==0 and no process target. It is -clear it no longer has a process target, but, it still has a pid!=0 -somehow. - -The reason the inferior still has pid!=0, is that core_target::detach -just unpushes, and relies on core_target::close to actually do the -getting rid of the core and exiting the inferior. The problem with -that is that detach_command grabs an extra strong reference to the -process stratum target, so the unpush_target inside -core_target::detach doesn't actually result in a call to -core_target::close. - -Fix this my moving the cleaning up the core inferior to a shared -routine called by both core_target::close and core_target::detach. We -still need to cleanup the inferior from within core_file::close -because there are paths to it that want to get rid of the core without -going through detach. E.g., "core-file" -> "run". - -This commit includes a new test added to gdb.base/corefile.exp to -cover the "core-file core" -> "detach" scenario. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29275 - -Change-Id: Ic42bdd03182166b19f598428b0dbc2ce6f67c893 ---- a/gdb/corelow.c -+++ b/gdb/corelow.c -@@ -120,6 +120,9 @@ public: - - private: /* per-core data */ - -+ /* Get rid of the core inferior. */ -+ void clear_core (); -+ - /* The core's section table. Note that these target sections are - *not* mapped in the current address spaces' set of target - sections --- those should come only from pure executable or -@@ -290,10 +293,8 @@ core_target::build_file_mappings () - /* An arbitrary identifier for the core inferior. */ - #define CORELOW_PID 1 - --/* Close the core target. */ -- - void --core_target::close () -+core_target::clear_core () - { - if (core_bfd) - { -@@ -307,6 +308,14 @@ core_target::close () - - current_program_space->cbfd.reset (nullptr); - } -+} -+ -+/* Close the core target. */ -+ -+void -+core_target::close () -+{ -+ clear_core (); - - /* Core targets are heap-allocated (see core_target_open), so here - we delete ourselves. */ -@@ -592,9 +601,15 @@ core_target_open (const char *arg, int from_tty) - void - core_target::detach (inferior *inf, int from_tty) - { -- /* Note that 'this' is dangling after this call. unpush_target -- closes the target, and our close implementation deletes -- 'this'. */ -+ /* Get rid of the core. Don't rely on core_target::close doing it, -+ because target_detach may be called with core_target's refcount > 1, -+ meaning core_target::close may not be called yet by the -+ unpush_target call below. */ -+ clear_core (); -+ -+ /* Note that 'this' may be dangling after this call. unpush_target -+ closes the target if the refcount reaches 0, and our close -+ implementation deletes 'this'. */ - inf->unpush_target (this); - - /* Clear the register cache and the frame cache. */ ---- a/gdb/testsuite/gdb.base/corefile.exp -+++ b/gdb/testsuite/gdb.base/corefile.exp -@@ -207,6 +207,16 @@ gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp ( - - gdb_test "core" "No core file now." - -+# Test that we can unload the core with the "detach" command. -+ -+proc_with_prefix corefile_detach {} { -+ clean_restart $::binfile -+ -+ gdb_test "core-file $::corefile" "Core was generated by .*" "load core" -+ gdb_test "detach" "No core file now\\." "detach core" -+} -+ -+corefile_detach - - # Test a run (start) command will clear any loaded core file. - -@@ -222,6 +232,8 @@ proc corefile_test_run {} { - return - } - -+ clean_restart $::binfile -+ - gdb_test "core-file $corefile" "Core was generated by .*" "run: load core again" - gdb_test "info files" "\r\nLocal core dump file:\r\n.*" "run: sanity check we see the core file" - diff --git a/sys-devel/gdb/files/gdb-12.1-readline-8.2-build.patch b/sys-devel/gdb/files/gdb-12.1-readline-8.2-build.patch deleted file mode 100644 index fad27ee4ca85..000000000000 --- a/sys-devel/gdb/files/gdb-12.1-readline-8.2-build.patch +++ /dev/null @@ -1,29 +0,0 @@ -https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=1add37b567a7dee39d99f37b37802034c3fce9c4 -https://bugs.gentoo.org/842252 - -From: Andreas Schwab <schwab@linux-m68k.org> -Date: Sun, 20 Mar 2022 14:01:54 +0100 -Subject: [PATCH] Add support for readline 8.2 - -In readline 8.2 the type of rl_completer_word_break_characters changed to -include const. ---- a/gdb/completer.c -+++ b/gdb/completer.c -@@ -36,7 +36,7 @@ - calling a hook instead so we eliminate the CLI dependency. */ - #include "gdbcmd.h" - --/* Needed for rl_completer_word_break_characters() and for -+/* Needed for rl_completer_word_break_characters and for - rl_filename_completion_function. */ - #include "readline/readline.h" - -@@ -2011,7 +2011,7 @@ gdb_completion_word_break_characters_throw () - rl_basic_quote_characters = NULL; - } - -- return rl_completer_word_break_characters; -+ return (char *) rl_completer_word_break_characters; - } - - char * diff --git a/sys-devel/gdb/files/gdb-13.1-Wenum-constexpr-conversion-clang16.patch b/sys-devel/gdb/files/gdb-13.1-Wenum-constexpr-conversion-clang16.patch deleted file mode 100644 index adc09f83ea68..000000000000 --- a/sys-devel/gdb/files/gdb-13.1-Wenum-constexpr-conversion-clang16.patch +++ /dev/null @@ -1,128 +0,0 @@ -https://bugs.gentoo.org/894174 -https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ae61525fcf456ab395d55c45492a106d1275873a - -From ae61525fcf456ab395d55c45492a106d1275873a Mon Sep 17 00:00:00 2001 -From: Simon Marchi <simon.marchi@efficios.com> -Date: Thu, 23 Feb 2023 12:35:40 -0500 -Subject: [PATCH] gdbsupport: ignore -Wenum-constexpr-conversion in - enum-flags.h - -When building with clang 16, we get: - - CXX gdb.o - In file included from /home/smarchi/src/binutils-gdb/gdb/gdb.c:19: - In file included from /home/smarchi/src/binutils-gdb/gdb/defs.h:65: - /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/enum-flags.h:95:52: error: integer value -1 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion] - integer_for_size<sizeof (T), static_cast<bool>(T (-1) < T (0))>::type - ^ - -The error message does not make it clear in the context of which enum -flag this fails (i.e. what is T in this context), but it doesn't really -matter, we have similar warning/errors for many of them, if we let the -build go through. - -clang is right that the value -1 is invalid for the enum type we cast -1 -to. However, we do need this expression in order to select an integer -type with the appropriate signedness. That is, with the same signedness -as the underlying type of the enum. - -I first wondered if that was really needed, if we couldn't use -std::underlying_type for that. It turns out that the comment just above -says: - - /* Note that std::underlying_type<enum_type> is not what we want here, - since that returns unsigned int even when the enum decays to signed - int. */ - -I was surprised, because std::is_signed<std::underlying_type<enum_type>> -returns the right thing. So I tried replacing all this with -std::underlying_type, see if that would work. Doing so causes some -build failures in unittests/enum-flags-selftests.c: - - CXX unittests/enum-flags-selftests.o - /home/smarchi/src/binutils-gdb/gdb/unittests/enum-flags-selftests.c:254:1: error: static assertion failed due to requirement 'gdb::is_same<selftests::enum_flags_tests::check_valid_expr254::archetype<enum_flags<s - elftests::enum_flags_tests::RE>, selftests::enum_flags_tests::RE, enum_flags<selftests::enum_flags_tests::RE2>, selftests::enum_flags_tests::RE2, enum_flags<selftests::enum_flags_tests::URE>, selftests::enum_fla - gs_tests::URE, int>, selftests::enum_flags_tests::check_valid_expr254::archetype<enum_flags<selftests::enum_flags_tests::RE>, selftests::enum_flags_tests::RE, enum_flags<selftests::enum_flags_tests::RE2>, selfte - sts::enum_flags_tests::RE2, enum_flags<selftests::enum_flags_tests::URE>, selftests::enum_flags_tests::URE, unsigned int>>::value == true': - CHECK_VALID (true, int, true ? EF () : EF2 ()) - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /home/smarchi/src/binutils-gdb/gdb/unittests/enum-flags-selftests.c:91:3: note: expanded from macro 'CHECK_VALID' - CHECK_VALID_EXPR_6 (EF, RE, EF2, RE2, UEF, URE, VALID, EXPR_TYPE, EXPR) - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/valid-expr.h:105:3: note: expanded from macro 'CHECK_VALID_EXPR_6' - CHECK_VALID_EXPR_INT (ESC_PARENS (typename T1, typename T2, \ - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/valid-expr.h:66:3: note: expanded from macro 'CHECK_VALID_EXPR_INT' - static_assert (gdb::is_detected_exact<archetype<TYPES, EXPR_TYPE>, \ - ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This is a bit hard to decode, but basically enumerations have the -following funny property that they decay into a signed int, even if -their implicit underlying type is unsigned. This code: - - enum A {}; - enum B {}; - - int main() { - std::cout << std::is_signed<std::underlying_type<A>::type>::value - << std::endl; - std::cout << std::is_signed<std::underlying_type<B>::type>::value - << std::endl; - auto result = true ? A() : B(); - std::cout << std::is_signed<decltype(result)>::value << std::endl; - } - -produces: - - 0 - 0 - 1 - -So, the "CHECK_VALID" above checks that this property works for enum flags the -same way as it would if you were using their underlying enum types. And -somehow, changing integer_for_size to use std::underlying_type breaks that. - -Since the current code does what we want, and I don't see any way of doing it -differently, ignore -Wenum-constexpr-conversion around it. - -Change-Id: Ibc82ae7bbdb812102ae3f1dd099fc859dc6f3cc2 ---- a/gdbsupport/enum-flags.h -+++ b/gdbsupport/enum-flags.h -@@ -91,9 +91,12 @@ template<> struct integer_for_size<8, 1> { typedef int64_t type; }; - template<typename T> - struct enum_underlying_type - { -+ DIAGNOSTIC_PUSH -+ DIAGNOSTIC_IGNORE_ENUM_CONSTEXPR_CONVERSION - typedef typename - integer_for_size<sizeof (T), static_cast<bool>(T (-1) < T (0))>::type - type; -+ DIAGNOSTIC_POP - }; - - namespace enum_flags_detail ---- a/include/diagnostics.h -+++ b/include/diagnostics.h -@@ -76,6 +76,11 @@ - # define DIAGNOSTIC_ERROR_SWITCH \ - DIAGNOSTIC_ERROR ("-Wswitch") - -+# if __has_warning ("-Wenum-constexpr-conversion") -+# define DIAGNOSTIC_IGNORE_ENUM_CONSTEXPR_CONVERSION \ -+ DIAGNOSTIC_IGNORE ("-Wenum-constexpr-conversion") -+# endif -+ - #elif defined (__GNUC__) /* GCC */ - - # define DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS \ -@@ -155,4 +160,8 @@ - # define DIAGNOSTIC_ERROR_SWITCH - #endif - -+#ifndef DIAGNOSTIC_IGNORE_ENUM_CONSTEXPR_CONVERSION -+# define DIAGNOSTIC_IGNORE_ENUM_CONSTEXPR_CONVERSION -+#endif -+ - #endif /* DIAGNOSTICS_H */ --- -2.31.1 diff --git a/sys-devel/gdb/files/gdb-13.1-musl-lfs.patch b/sys-devel/gdb/files/gdb-13.1-musl-lfs.patch deleted file mode 100644 index d7778e305903..000000000000 --- a/sys-devel/gdb/files/gdb-13.1-musl-lfs.patch +++ /dev/null @@ -1,23 +0,0 @@ -https://bugs.gentoo.org/905922 -https://sourceware.org/bugzilla/show_bug.cgi?id=30450 -https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=2e977d9901393ea1bacbe1896af0929e968bc811 - -From 2e977d9901393ea1bacbe1896af0929e968bc811 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Wed, 22 Feb 2023 16:28:22 -0800 -Subject: [PATCH] gdbserver/linux-low.cc: Fix a typo in ternary operator - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- a/gdbserver/linux-low.cc -+++ b/gdbserver/linux-low.cc -@@ -5390,7 +5390,7 @@ proc_xfer_memory (CORE_ADDR memaddr, unsigned char *readbuf, - if (lseek (fd, memaddr, SEEK_SET) != -1) - bytes = (readbuf != nullptr - ? read (fd, readbuf, len) -- ? write (fd, writebuf, len)); -+ : write (fd, writebuf, len)); - #endif - - if (bytes < 0) --- -2.31.1 |