diff --git a/0002-Add-support-for-readline-8.2.patch b/0002-Add-support-for-readline-8.2.patch deleted file mode 100644 index e3e80d9c35083686450dc4c406579496b076f7d4..0000000000000000000000000000000000000000 --- a/0002-Add-support-for-readline-8.2.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 1add37b567a7dee39d99f37b37802034c3fce9c4 Mon Sep 17 00:00:00 2001 -From: Andreas Schwab -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. ---- - gdb/completer.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gdb/completer.c b/gdb/completer.c -index d3900ae2014..a51c16ac7f8 100644 ---- 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 * --- -2.33.0 - diff --git a/backport-CVE-2023-39128.patch b/backport-CVE-2023-39128.patch deleted file mode 100644 index 52f86d2d32df55591fcaf90080f9aa792ded7cf3..0000000000000000000000000000000000000000 --- a/backport-CVE-2023-39128.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 033bc52bb6190393c8eed80925fa78cc35b40c6d Mon Sep 17 00:00:00 2001 -From: Tom Tromey -Date: Wed, 16 Aug 2023 11:29:19 -0600 -Subject: [PATCH] Avoid buffer overflow in ada_decode - -A bug report pointed out a buffer overflow in ada_decode, which Keith -helpfully analyzed. ada_decode had a logic error when the input was -all digits. While this isn't valid -- and would probably only appear -in fuzzer tests -- it still should be handled properly. - -This patch adds a missing bounds check. Tested with the self-tests in -an asan build. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30639 -Reviewed-by: Keith Seitz ---- - gdb/ada-lang.c | 19 ++++++++++++++++++- - 1 file changed, 18 insertions(+), 1 deletion(-) - -diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c -index 4a9a6e0f38f..2f934b1e79a 100644 ---- a/gdb/ada-lang.c -+++ b/gdb/ada-lang.c -@@ -57,6 +57,7 @@ - #include "cli/cli-utils.h" - #include "gdbsupport/function-view.h" - #include "gdbsupport/byte-vector.h" -+#include "gdbsupport/selftest.h" - #include - #include "ada-exp.h" - #include "charset.h" -@@ -1377,7 +1378,7 @@ ada_decode (const char *encoded, bool wrap, bool operators) - i -= 1; - if (i > 1 && encoded[i] == '_' && encoded[i - 1] == '_') - len0 = i - 1; -- else if (encoded[i] == '$') -+ else if (i >= 0 && encoded[i] == '$') - len0 = i; - } - -@@ -1574,6 +1575,18 @@ Suppress: - return decoded; - } - -+#ifdef GDB_SELF_TEST -+ -+static void -+ada_decode_tests () -+{ -+ /* This isn't valid, but used to cause a crash. PR gdb/30639. The -+ result does not really matter very much. */ -+ SELF_CHECK (ada_decode ("44") == "44"); -+} -+ -+#endif -+ - /* Table for keeping permanent unique copies of decoded names. Once - allocated, names in this table are never released. While this is a - storage leak, it should not be significant unless there are massive -@@ -13984,4 +13997,8 @@ DWARF attribute."), - gdb::observers::new_objfile.attach (ada_new_objfile_observer, "ada-lang"); - gdb::observers::free_objfile.attach (ada_free_objfile_observer, "ada-lang"); - gdb::observers::inferior_exit.attach (ada_inferior_exit, "ada-lang"); -+ -+#ifdef GDB_SELF_TEST -+ selftests::register_test ("ada-decode", ada_decode_tests); -+#endif - } --- -2.39.3 - diff --git a/backport-CVE-2023-39129.patch b/backport-CVE-2023-39129.patch deleted file mode 100644 index c2083cecd6f87f2e7b7c9d29aeb2f37cb465e577..0000000000000000000000000000000000000000 --- a/backport-CVE-2023-39129.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 58abdf887821a5da09ba184c6e400a3bc5cccd5a Mon Sep 17 00:00:00 2001 -From: Keith Seitz -Date: Wed, 2 Aug 2023 08:35:11 -0700 -Subject: [PATCH] Verify COFF symbol stringtab offset - -This patch addresses an issue with malformed/fuzzed debug information that -was recently reported in gdb/30639. That bug specifically deals with -an ASAN issue, but the reproducer provided by the reporter causes a -another failure outside of ASAN: - -$ ./gdb --data-directory data-directory -nx -q UAF_2 -Reading symbols from /home/keiths/UAF_2... - - -Fatal signal: Segmentation fault ------ Backtrace ----- -0x59a53a gdb_internal_backtrace_1 - ../../src/gdb/bt-utils.c:122 -0x59a5dd _Z22gdb_internal_backtracev - ../../src/gdb/bt-utils.c:168 -0x786380 handle_fatal_signal - ../../src/gdb/event-top.c:889 -0x7864ec handle_sigsegv - ../../src/gdb/event-top.c:962 -0x7ff354c5fb6f ??? -0x611f9a process_coff_symbol - ../../src/gdb/coffread.c:1556 -0x611025 coff_symtab_read - ../../src/gdb/coffread.c:1172 -0x60f8ff coff_read_minsyms - ../../src/gdb/coffread.c:549 -0x60fe4b coff_symfile_read - ../../src/gdb/coffread.c:698 -0xbde0f6 read_symbols - ../../src/gdb/symfile.c:772 -0xbde7a3 syms_from_objfile_1 - ../../src/gdb/symfile.c:966 -0xbde867 syms_from_objfile - ../../src/gdb/symfile.c:983 -0xbded42 symbol_file_add_with_addrs - ../../src/gdb/symfile.c:1086 -0xbdf083 _Z24symbol_file_add_from_bfdRKN3gdb7ref_ptrI3bfd18gdb_bfd_ref_policyEEPKc10enum_flagsI16symfile_add_flagEPSt6vectorI14other_sectionsSaISC_EES8_I12objfile_flagEP7objfile - ../../src/gdb/symfile.c:1166 -0xbdf0d2 _Z15symbol_file_addPKc10enum_flagsI16symfile_add_flagEPSt6vectorI14other_sectionsSaIS5_EES1_I12objfile_flagE - ../../src/gdb/symfile.c:1179 -0xbdf197 symbol_file_add_main_1 - ../../src/gdb/symfile.c:1203 -0xbdf13e _Z20symbol_file_add_mainPKc10enum_flagsI16symfile_add_flagE - ../../src/gdb/symfile.c:1194 -0x90f97f symbol_file_add_main_adapter - ../../src/gdb/main.c:549 -0x90f895 catch_command_errors - ../../src/gdb/main.c:518 -0x9109b6 captured_main_1 - ../../src/gdb/main.c:1203 -0x910fc8 captured_main - ../../src/gdb/main.c:1310 -0x911067 _Z8gdb_mainP18captured_main_args - ../../src/gdb/main.c:1339 -0x418c71 main - ../../src/gdb/gdb.c:39 ---------------------- -A fatal error internal to GDB has been detected, further -debugging is not possible. GDB will now terminate. - -This is a bug, please report it. For instructions, see: -. - -Segmentation fault (core dumped) - -The issue here is that the COFF offset for the fuzzed symbol's -name is outside the string table. That is, the offset is greater -than the actual string table size. - -coffread.c:getsymname actually contains a FIXME about this, and that's -what I've chosen to address to fix this issue, following what is done -in the DWARF reader: - -$ ./gdb --data-directory data-directory -nx -q UAF_2 -Reading symbols from /home/keiths/UAF_2... -COFF Error: string table offset (256) outside string table (length 0) -(gdb) - -Unfortunately, I haven't any idea how else to test this patch since -COFF is not very common anymore. GCC removed support for it five -years ago with GCC 8. ---- - gdb/coffread.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/gdb/coffread.c b/gdb/coffread.c -index f8e14d8ad93..ae7632d49cb 100644 ---- a/gdb/coffread.c -+++ b/gdb/coffread.c -@@ -159,6 +159,7 @@ static file_ptr linetab_offset; - static file_ptr linetab_size; - - static char *stringtab = NULL; -+static long stringtab_length = 0; - - extern void stabsread_clear_cache (void); - -@@ -1303,6 +1304,7 @@ init_stringtab (bfd *abfd, file_ptr offset, gdb::unique_xmalloc_ptr *stora - /* This is in target format (probably not very useful, and not - currently used), not host format. */ - memcpy (stringtab, lengthbuf, sizeof lengthbuf); -+ stringtab_length = length; - if (length == sizeof length) /* Empty table -- just the count. */ - return 0; - -@@ -1322,8 +1324,9 @@ getsymname (struct internal_syment *symbol_entry) - - if (symbol_entry->_n._n_n._n_zeroes == 0) - { -- /* FIXME: Probably should be detecting corrupt symbol files by -- seeing whether offset points to within the stringtab. */ -+ if (symbol_entry->_n._n_n._n_offset > stringtab_length) -+ error (_("COFF Error: string table offset (%ld) outside string table (length %ld)"), -+ symbol_entry->_n._n_n._n_offset, stringtab_length); - result = stringtab + symbol_entry->_n._n_n._n_offset; - } - else --- -2.41.0.windows.3 - diff --git a/backport-CVE-2023-39130.patch b/backport-CVE-2023-39130.patch deleted file mode 100644 index 88d6bc67fde42db8a4f226003a11c8c57cde8d3f..0000000000000000000000000000000000000000 --- a/backport-CVE-2023-39130.patch +++ /dev/null @@ -1,342 +0,0 @@ -From 42cf538d633015c3d2e6c81a0ca96b31edc004f0 Mon Sep 17 00:00:00 2001 -From: Alan Modra -Date: Wed, 9 Aug 2023 09:58:36 +0930 -Subject: [PATCH] gdb: warn unused result for bfd IO functions - -Reference:https://sourceware.org/bugzilla/show_bug.cgi?id=30641 -Conflict:in gdb/coff-pe-read.c gdb/coffread.c gdb/dbxread.c gdb/xcoffread.c: -caused by commit: -98badbfdc (Use gdb_bfd_ref_ptr in objfile): -The type of the 'obfd' member in struct 'objfile' is changed from -'bfd *' to 'gdb_bfd_ref_ptr', needs to get the 'obfd' pointer by -using the get() method. -226f9f4fa (Rename bfd_bread and bfd_bwrite): -Only rename bfd_bread and bfd_bwrite to bfd_read and bfd_write. -6cb06a8cd (Unify gdb printf functions): -unify the printf family of functions by using gdb_printf. -We still using fprintf_unfiltered here. - -This fixes the compilation warnings introduced by my bfdio.c patch. - -The removed bfd_seeks in coff_symfile_read date back to 1994, commit -7f4c859520, prior to which the file used stdio rather than bfd to read -symbols. Since it now uses bfd to read the file there should be no -need to synchronise to bfd's idea of the file position. I also fixed -a potential uninitialised memory access. - -Approved-By: Andrew Burgess ---- - gdb/coff-pe-read.c | 118 ++++++++++++++++++++++++++++----------------- - gdb/coffread.c | 27 ++--------- - gdb/dbxread.c | 7 +-- - gdb/xcoffread.c | 5 +- - 4 files changed, 87 insertions(+), 70 deletions(-) - -diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c -index 90b406f..8edbf4c 100644 ---- a/gdb/coff-pe-read.c -+++ b/gdb/coff-pe-read.c -@@ -291,23 +291,31 @@ read_pe_truncate_name (char *dll_name) - - /* Low-level support functions, direct from the ld module pe-dll.c. */ - static unsigned int --pe_get16 (bfd *abfd, int where) -+pe_get16 (bfd *abfd, int where, bool *fail) - { - unsigned char b[2]; - -- bfd_seek (abfd, (file_ptr) where, SEEK_SET); -- bfd_bread (b, (bfd_size_type) 2, abfd); -+ if (bfd_seek (abfd, where, SEEK_SET) != 0 -+ || bfd_bread (b, 2, abfd) != 2) -+ { -+ *fail = true; -+ return 0; -+ } - return b[0] + (b[1] << 8); - } - - static unsigned int --pe_get32 (bfd *abfd, int where) -+pe_get32 (bfd *abfd, int where, bool *fail) - { - unsigned char b[4]; - -- bfd_seek (abfd, (file_ptr) where, SEEK_SET); -- bfd_bread (b, (bfd_size_type) 4, abfd); -- return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24); -+ if (bfd_seek (abfd, where, SEEK_SET) != 0 -+ || bfd_bread (b, 4, abfd) != 4) -+ { -+ *fail = true; -+ return 0; -+ } -+ return b[0] + (b[1] << 8) + (b[2] << 16) + ((unsigned) b[3] << 24); - } - - static unsigned int -@@ -323,7 +331,7 @@ pe_as32 (void *ptr) - { - unsigned char *b = (unsigned char *) ptr; - -- return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24); -+ return b[0] + (b[1] << 8) + (b[2] << 16) + ((unsigned) b[3] << 24); - } - - /* Read the (non-debug) export symbol table from a portable -@@ -376,37 +384,50 @@ read_pe_exported_syms (minimal_symbol_reader &reader, - || strcmp (target, "pei-i386") == 0 - || strcmp (target, "pe-arm-wince-little") == 0 - || strcmp (target, "pei-arm-wince-little") == 0); -+ -+ /* Possibly print a debug message about DLL not having a valid format. */ -+ auto maybe_print_debug_msg = [&] () -> void { -+ if (debug_coff_pe_read) -+ fprintf_unfiltered (gdb_stdlog, _("%s doesn't appear to be a DLL\n"), -+ bfd_get_filename (dll)); -+ }; -+ - if (!is_pe32 && !is_pe64) -- { -- /* This is not a recognized PE format file. Abort now, because -- the code is untested on anything else. *FIXME* test on -- further architectures and loosen or remove this test. */ -- return; -- } -+ return maybe_print_debug_msg (); - - /* Get pe_header, optional header and numbers of export entries. */ -- pe_header_offset = pe_get32 (dll, 0x3c); -+ bool fail = false; -+ pe_header_offset = pe_get32 (dll, 0x3c, &fail); -+ if (fail) -+ return maybe_print_debug_msg (); - opthdr_ofs = pe_header_offset + 4 + 20; - if (is_pe64) -- num_entries = pe_get32 (dll, opthdr_ofs + 108); -+ num_entries = pe_get32 (dll, opthdr_ofs + 108, &fail); - else -- num_entries = pe_get32 (dll, opthdr_ofs + 92); -+ num_entries = pe_get32 (dll, opthdr_ofs + 92, &fail); -+ if (fail) -+ return maybe_print_debug_msg (); - - if (num_entries < 1) /* No exports. */ - return; - if (is_pe64) - { -- export_opthdrrva = pe_get32 (dll, opthdr_ofs + 112); -- export_opthdrsize = pe_get32 (dll, opthdr_ofs + 116); -+ export_opthdrrva = pe_get32 (dll, opthdr_ofs + 112, &fail); -+ export_opthdrsize = pe_get32 (dll, opthdr_ofs + 116, &fail); - } - else - { -- export_opthdrrva = pe_get32 (dll, opthdr_ofs + 96); -- export_opthdrsize = pe_get32 (dll, opthdr_ofs + 100); -+ export_opthdrrva = pe_get32 (dll, opthdr_ofs + 96, &fail); -+ export_opthdrsize = pe_get32 (dll, opthdr_ofs + 100, &fail); - } -- nsections = pe_get16 (dll, pe_header_offset + 4 + 2); -+ if (fail) -+ return maybe_print_debug_msg (); -+ -+ nsections = pe_get16 (dll, pe_header_offset + 4 + 2, &fail); - secptr = (pe_header_offset + 4 + 20 + -- pe_get16 (dll, pe_header_offset + 4 + 16)); -+ pe_get16 (dll, pe_header_offset + 4 + 16, &fail)); -+ if (fail) -+ return maybe_print_debug_msg (); - expptr = 0; - export_size = 0; - -@@ -415,13 +436,14 @@ read_pe_exported_syms (minimal_symbol_reader &reader, - { - char sname[8]; - unsigned long secptr1 = secptr + 40 * i; -- unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -- unsigned long vsize = pe_get32 (dll, secptr1 + 16); -- unsigned long fptr = pe_get32 (dll, secptr1 + 20); -- -- bfd_seek (dll, (file_ptr) secptr1, SEEK_SET); -- bfd_bread (sname, (bfd_size_type) sizeof (sname), dll); -- -+ unsigned long vaddr = pe_get32 (dll, secptr1 + 12, &fail); -+ unsigned long vsize = pe_get32 (dll, secptr1 + 16, &fail); -+ unsigned long fptr = pe_get32 (dll, secptr1 + 20, &fail); -+ -+ if (fail -+ || bfd_seek (dll, secptr1, SEEK_SET) != 0 -+ || bfd_bread (sname, sizeof (sname), dll) != sizeof (sname)) -+ - if ((strcmp (sname, ".edata") == 0) - || (vaddr <= export_opthdrrva && export_opthdrrva < vaddr + vsize)) - { -@@ -461,16 +483,18 @@ read_pe_exported_syms (minimal_symbol_reader &reader, - for (i = 0; i < nsections; i++) - { - unsigned long secptr1 = secptr + 40 * i; -- unsigned long vsize = pe_get32 (dll, secptr1 + 8); -- unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -- unsigned long characteristics = pe_get32 (dll, secptr1 + 36); -+ unsigned long vsize = pe_get32 (dll, secptr1 + 8, &fail); -+ unsigned long vaddr = pe_get32 (dll, secptr1 + 12, &fail); -+ unsigned long characteristics = pe_get32 (dll, secptr1 + 36, &fail); - char sec_name[SCNNMLEN + 1]; - int sectix; - unsigned int bfd_section_index; - asection *section; - -- bfd_seek (dll, (file_ptr) secptr1 + 0, SEEK_SET); -- bfd_bread (sec_name, (bfd_size_type) SCNNMLEN, dll); -+ if (fail -+ || bfd_seek (dll, secptr1 + 0, SEEK_SET) != 0 -+ || bfd_bread (sec_name, SCNNMLEN, dll) != SCNNMLEN) -+ return maybe_print_debug_msg (); - sec_name[SCNNMLEN] = '\0'; - - sectix = read_pe_section_index (sec_name); -@@ -509,8 +533,9 @@ read_pe_exported_syms (minimal_symbol_reader &reader, - gdb::def_vector expdata_storage (export_size); - expdata = expdata_storage.data (); - -- bfd_seek (dll, (file_ptr) expptr, SEEK_SET); -- bfd_bread (expdata, (bfd_size_type) export_size, dll); -+ if (bfd_seek (dll, expptr, SEEK_SET) != 0 -+ || bfd_bread (expdata, export_size, dll) != export_size) -+ return maybe_print_debug_msg (); - erva = expdata - export_rva; - - nexp = pe_as32 (expdata + 24); -@@ -658,20 +683,27 @@ pe_text_section_offset (struct bfd *abfd) - } - - /* Get pe_header, optional header and numbers of sections. */ -- pe_header_offset = pe_get32 (abfd, 0x3c); -- nsections = pe_get16 (abfd, pe_header_offset + 4 + 2); -+ bool fail = false; -+ pe_header_offset = pe_get32 (abfd, 0x3c, &fail); -+ if (fail) -+ return DEFAULT_COFF_PE_TEXT_SECTION_OFFSET; -+ nsections = pe_get16 (abfd, pe_header_offset + 4 + 2, &fail); - secptr = (pe_header_offset + 4 + 20 + -- pe_get16 (abfd, pe_header_offset + 4 + 16)); -+ pe_get16 (abfd, pe_header_offset + 4 + 16, &fail)); -+ if (fail) -+ return DEFAULT_COFF_PE_TEXT_SECTION_OFFSET; - - /* Get the rva and size of the export section. */ - for (i = 0; i < nsections; i++) - { - char sname[SCNNMLEN + 1]; - unsigned long secptr1 = secptr + 40 * i; -- unsigned long vaddr = pe_get32 (abfd, secptr1 + 12); -+ unsigned long vaddr = pe_get32 (abfd, secptr1 + 12, &fail); - -- bfd_seek (abfd, (file_ptr) secptr1, SEEK_SET); -- bfd_bread (sname, (bfd_size_type) SCNNMLEN, abfd); -+ if (fail -+ || bfd_seek (abfd, secptr1, SEEK_SET) != 0 -+ || bfd_bread (sname, SCNNMLEN, abfd) != SCNNMLEN) -+ return DEFAULT_COFF_PE_TEXT_SECTION_OFFSET; - sname[SCNNMLEN] = '\0'; - if (strcmp (sname, ".text") == 0) - return vaddr; -diff --git a/gdb/coffread.c b/gdb/coffread.c -index c02aad6..6f58517 100644 ---- a/gdb/coffread.c -+++ b/gdb/coffread.c -@@ -691,8 +691,6 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) - - /* FIXME: dubious. Why can't we use something normal like - bfd_get_section_contents? */ -- bfd_seek (abfd, abfd->where, 0); -- - stabstrsize = bfd_section_size (info->stabstrsect); - - coffstab_build_psymtabs (objfile, -@@ -782,22 +780,6 @@ coff_symtab_read (minimal_symbol_reader &reader, - - scoped_free_pendings free_pending; - -- /* Work around a stdio bug in SunOS4.1.1 (this makes me nervous.... -- it's hard to know I've really worked around it. The fix should -- be harmless, anyway). The symptom of the bug is that the first -- fread (in read_one_sym), will (in my example) actually get data -- from file offset 268, when the fseek was to 264 (and ftell shows -- 264). This causes all hell to break loose. I was unable to -- reproduce this on a short test program which operated on the same -- file, performing (I think) the same sequence of operations. -- -- It stopped happening when I put in this (former) rewind(). -- -- FIXME: Find out if this has been reported to Sun, whether it has -- been fixed in a later release, etc. */ -- -- bfd_seek (objfile->obfd, 0, 0); -- - /* Position to read the symbol table. */ - val = bfd_seek (objfile->obfd, symtab_offset, 0); - if (val < 0) -@@ -1287,12 +1269,13 @@ init_stringtab (bfd *abfd, file_ptr offset, gdb::unique_xmalloc_ptr *stora - if (bfd_seek (abfd, offset, 0) < 0) - return -1; - -- val = bfd_bread ((char *) lengthbuf, sizeof lengthbuf, abfd); -- length = bfd_h_get_32 (symfile_bfd, lengthbuf); -- -+ val = bfd_bread (lengthbuf, sizeof lengthbuf, abfd); - /* If no string table is needed, then the file may end immediately - after the symbols. Just return with `stringtab' set to null. */ -- if (val != sizeof lengthbuf || length < sizeof lengthbuf) -+ if (val != sizeof lengthbuf) -+ return 0; -+ length = bfd_h_get_32 (symfile_bfd, lengthbuf); -+ if (length < sizeof lengthbuf) - return 0; - - storage->reset ((char *) xmalloc (length)); -diff --git a/gdb/dbxread.c b/gdb/dbxread.c -index cf35880..0cdebe0 100644 ---- a/gdb/dbxread.c -+++ b/gdb/dbxread.c -@@ -812,7 +812,8 @@ stabs_seek (int sym_offset) - symbuf_left -= sym_offset; - } - else -- bfd_seek (symfile_bfd, sym_offset, SEEK_CUR); -+ if (bfd_seek (symfile_bfd, sym_offset, SEEK_CUR) != 0) -+ perror_with_name (bfd_get_filename (symfile_bfd)); - } - - #define INTERNALIZE_SYMBOL(intern, extern, abfd) \ -@@ -2095,8 +2096,8 @@ dbx_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile) - symbol_size = SYMBOL_SIZE (pst); - - /* Read in this file's symbols. */ -- bfd_seek (objfile->obfd, SYMBOL_OFFSET (pst), SEEK_SET); -- read_ofile_symtab (objfile, pst); -+ if (bfd_seek (objfile->obfd, SYMBOL_OFFSET (pst), SEEK_SET) == 0) -+ read_ofile_symtab (objfile, pst); - } - - pst->readin = true; -diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c -index a854d4d..4b20054 100644 ---- a/gdb/xcoffread.c -+++ b/gdb/xcoffread.c -@@ -865,8 +865,9 @@ enter_line_range (struct subfile *subfile, unsigned beginoffset, - - while (curoffset <= limit_offset) - { -- bfd_seek (abfd, curoffset, SEEK_SET); -- bfd_bread (ext_lnno, linesz, abfd); -+ if (bfd_seek (abfd, curoffset, SEEK_SET) != 0 -+ || bfd_bread (ext_lnno, linesz, abfd) != linesz) -+ return; - bfd_coff_swap_lineno_in (abfd, ext_lnno, &int_lnno); - - /* Find the address this line represents. */ --- -2.33.0 - diff --git a/backport-Fix-gdb-coffread.c-build-on-32bit-architectures.patch b/backport-Fix-gdb-coffread.c-build-on-32bit-architectures.patch deleted file mode 100644 index e0b3c340e0d0349a1a0b1b83e3fe74f1275a97b2..0000000000000000000000000000000000000000 --- a/backport-Fix-gdb-coffread.c-build-on-32bit-architectures.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 91df9a6f810bca02883dae9275715b4960ea02f0 Mon Sep 17 00:00:00 2001 -From: Mark Wielaard -Date: Fri, 25 Aug 2023 23:09:18 +0200 -Subject: [PATCH] Fix gdb/coffread.c build on 32bit architectures - -Reference:https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=91df9a6f810bca02883dae9275715b4960ea02f0 -Conflict:NA - -The getsymname function tries to emit an error using %ld for an -uintptr_t argument. Use PRIxPTR instead. Which works on any architecture -for uintptr_t. ---- - gdb/coffread.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/coffread.c b/gdb/coffread.c -index ae7632d49cb..c609c963453 100644 ---- a/gdb/coffread.c -+++ b/gdb/coffread.c -@@ -1325,7 +1325,7 @@ getsymname (struct internal_syment *symbol_entry) - if (symbol_entry->_n._n_n._n_zeroes == 0) - { - if (symbol_entry->_n._n_n._n_offset > stringtab_length) -- error (_("COFF Error: string table offset (%ld) outside string table (length %ld)"), -+ error (_("COFF Error: string table offset (%" PRIxPTR ") outside string table (length %ld)"), - symbol_entry->_n._n_n._n_offset, stringtab_length); - result = stringtab + symbol_entry->_n._n_n._n_offset; - } --- -2.33.0 - diff --git a/backport-Use-hex_string-in-gdb-coffread.c-instead-of-PRIxPTR.patch b/backport-Use-hex_string-in-gdb-coffread.c-instead-of-PRIxPTR.patch deleted file mode 100644 index f85b40fd5b74ddf513fa82701fe081992d6c0410..0000000000000000000000000000000000000000 --- a/backport-Use-hex_string-in-gdb-coffread.c-instead-of-PRIxPTR.patch +++ /dev/null @@ -1,34 +0,0 @@ -From a6ce491c3d926650407927a338d9678ca983bee4 Mon Sep 17 00:00:00 2001 -From: Mark Wielaard -Date: Mon, 28 Aug 2023 16:30:14 +0200 -Subject: [PATCH] Use hex_string in gdb/coffread.c instead of PRIxPTR - -Reference:https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=a6ce491c3d926650407927a338d9678ca983bee4 -Conflict:NA - -The getsymname function uses PRIxPTR to print and uintptr_t value in -an error message. Use hex_string instead. - -Approved-By: Tom Tromey ---- - gdb/coffread.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gdb/coffread.c b/gdb/coffread.c -index c609c963453..c2fe9fa1761 100644 ---- a/gdb/coffread.c -+++ b/gdb/coffread.c -@@ -1325,8 +1325,8 @@ getsymname (struct internal_syment *symbol_entry) - if (symbol_entry->_n._n_n._n_zeroes == 0) - { - if (symbol_entry->_n._n_n._n_offset > stringtab_length) -- error (_("COFF Error: string table offset (%" PRIxPTR ") outside string table (length %ld)"), -- symbol_entry->_n._n_n._n_offset, stringtab_length); -+ error (_("COFF Error: string table offset (%s) outside string table (length %ld)"), -+ hex_string (symbol_entry->_n._n_n._n_offset), stringtab_length); - result = stringtab + symbol_entry->_n._n_n._n_offset; - } - else --- -2.33.0 - diff --git a/gdb-12.1.tar.xz b/gdb-14.1.tar.xz similarity index 67% rename from gdb-12.1.tar.xz rename to gdb-14.1.tar.xz index 8b168549ee742694cbe587951fa8f779d549eec2..cf3fff1861af650e82ef4cf906e170f0ed06db23 100644 Binary files a/gdb-12.1.tar.xz and b/gdb-14.1.tar.xz differ diff --git a/gdb-6.3-bz140532-ppc-unwinding-test.patch b/gdb-6.3-bz140532-ppc-unwinding-test.patch deleted file mode 100644 index 2e38a262e7b2718186e818e8b0cd02573be734be..0000000000000000000000000000000000000000 --- a/gdb-6.3-bz140532-ppc-unwinding-test.patch +++ /dev/null @@ -1,320 +0,0 @@ -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.3-bz140532-ppc-unwinding-test.patch - -;; Update PPC unwinding patches to their upstream variants (BZ 140532). -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S -@@ -0,0 +1,78 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2007 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. */ -+ -+ .section ".text" -+ .align 2 -+ .globl func0 -+ .type func0, @function -+func0: -+ stwu 1,-16(1) -+ mflr 0 -+ stw 31,12(1) -+ stw 0,20(1) -+ mr 31,1 -+ bl abort -+ .size func0, .-func0 -+ .align 2 -+ .globl func1 -+ .type func1, @function -+func1: -+ stwu 1,-16(1) -+ mflr 0 -+/* 20 = BO = branch always -+ 31 = BI = CR bit (ignored) */ -+ bcl 20,31,.Lpie -+.Lpie: stw 31,12(1) -+ stw 0,20(1) -+ mr 31,1 -+ bl func0 -+ mr 0,3 -+ lis 9,var@ha -+ lwz 9,var@l(9) -+ add 0,0,9 -+ mr 3,0 -+ lwz 11,0(1) -+ lwz 0,4(11) -+ mtlr 0 -+ lwz 31,-4(11) -+ mr 1,11 -+ blr -+ .size func1, .-func1 -+ .section .note.GNU-stack,"",@progbits -+ .ident "GCC: (GNU) 3.4.6 20060404 (Red Hat 3.4.6-8)" -+ -+/* Original source file: -+ -+#include -+ -+extern volatile int var; -+ -+int func0 (void) __attribute__((__noinline__)); -+int func0 (void) -+{ -+ abort (); -+ return var; -+} -+ -+int func1 (void) __attribute__((__noinline__)); -+int func1 (void) -+{ -+ return func0 () + var; -+} -+ -+*/ -diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S -@@ -0,0 +1,98 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2007 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. */ -+ -+ .section ".toc","aw" -+ .section ".text" -+ .align 2 -+ .globl func0 -+ .section ".opd","aw" -+ .align 3 -+func0: -+ .quad .L.func0,.TOC.@tocbase -+ .previous -+ .type func0, @function -+.L.func0: -+ mflr 0 -+ std 31,-8(1) -+ std 0,16(1) -+ stdu 1,-128(1) -+ mr 31,1 -+ bl abort -+ nop -+ .long 0 -+ .byte 0,0,0,1,128,1,0,1 -+ .size func0,.-.L.func0 -+ .section ".toc","aw" -+.LC1: -+ .tc var[TC],var -+ .section ".text" -+ .align 2 -+ .globl func1 -+ .section ".opd","aw" -+ .align 3 -+func1: -+ .quad .L.func1,.TOC.@tocbase -+ .previous -+ .type func1, @function -+.L.func1: -+ mflr 0 -+/* 20 = BO = branch always -+ 31 = BI = CR bit (ignored) */ -+ bcl 20,31,.Lpie -+.Lpie: std 31,-8(1) -+ std 0,16(1) -+ stdu 1,-128(1) -+ mr 31,1 -+ bl func0 -+ mr 11,3 -+ ld 9,.LC1@toc(2) -+ lwz 0,0(9) -+ add 0,11,0 -+ extsw 0,0 -+ mr 3,0 -+ ld 1,0(1) -+ ld 0,16(1) -+ mtlr 0 -+ ld 31,-8(1) -+ blr -+ .long 0 -+ .byte 0,0,0,1,128,1,0,1 -+ .size func1,.-.L.func1 -+ .section .note.GNU-stack,"",@progbits -+ .ident "GCC: (GNU) 3.4.6 20060404 (Red Hat 3.4.6-8)" -+ -+/* Original source file: -+ -+#include -+ -+extern volatile int var; -+ -+int func0 (void) __attribute__((__noinline__)); -+int func0 (void) -+{ -+ abort (); -+ return var; -+} -+ -+int func1 (void) __attribute__((__noinline__)); -+int func1 (void) -+{ -+ return func0 () + var; -+} -+ -+*/ -diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c -@@ -0,0 +1,29 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2007 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. */ -+ -+/* Force `-fpie' double jump bl->blrl. */ -+/* No longer used. */ -+volatile int var; -+ -+extern int func1 (void); -+ -+int main (void) -+{ -+ func1 (); -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp -@@ -0,0 +1,72 @@ -+# Copyright 2006, 2007 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. -+ -+# Test unwinding fixes of the PPC platform, specifically on the coping with BCL -+# jump of the PIE code. -+ -+if ![istarget "powerpc*-*-linux*"] then { -+ verbose "Skipping powerpc-linux prologue tests." -+ return -+} -+ -+set testfile "powerpc-bcl-prologue" -+set srcfile1 ${testfile}.c -+set flags "debug" -+if [istarget "powerpc-*"] then { -+ set srcfile2 ${testfile}-asm32.S -+ set flags "$flags additional_flags=-m32" -+} elseif [istarget "powerpc64-*"] then { -+ set srcfile2 ${testfile}-asm64.S -+ set flags "$flags additional_flags=-m64" -+} else { -+ fail "powerpc arch test" -+ return -+} -+set objfile2 [standard_output_file ${testfile}-asm.o] -+set binfile [standard_output_file ${testfile}] -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2}" ${binfile} executable $flags] != ""} { -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+# We should stop in abort(3). -+ -+gdb_run_cmd -+ -+gdb_test_multiple {} "continue to abort()" { -+ -re ".*Program received signal SIGABRT,.*$gdb_prompt $" { -+ pass "continue to abort()" -+ } -+} -+ -+# Check backtrace: -+# #3 0x0804835f in func0 () -+# #4 0x0804836a in func1 () -+# #5 0x0804838c in main () -+# (gdb) -+# `\\.?' prefixes are needed for ppc64 without `debug' (another bug). -+ -+set test "matching unwind" -+gdb_test_multiple "backtrace" $test { -+ -re "\r\n#\[0-9\]\[^\r\n\]* in \\.?func0 \\(\[^\r\n\]*\r\n#\[0-9\]\[^\r\n\]* in \\.?func1 \\(\[^\r\n\]*\r\n#\[0-9\]\[^\r\n\]* in \\.?main \\(\[^\r\n\]*\r\n$gdb_prompt $" { -+ pass $test -+ } -+} -diff --git a/gdb/testsuite/gdb.arch/powerpc-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-prologue.exp ---- a/gdb/testsuite/gdb.arch/powerpc-prologue.exp -+++ b/gdb/testsuite/gdb.arch/powerpc-prologue.exp -@@ -16,8 +16,9 @@ - # Test PowerPC prologue analyzer. - - # Do not run on AIX (where we won't be able to build the tests without --# some surgery) or on PowerPC64 (ditto, dot symbols). --if {[istarget *-*-aix*] || ![istarget "powerpc-*-*"]} then { -+# some surgery). PowerPC64 target would break due to dot symbols but we build -+# there PowerPC32 inferior. -+if {[istarget *-*-aix*] || ![istarget "powerpc*-*-*"]} then { - verbose "Skipping PowerPC prologue tests." - return - } diff --git a/gdb-6.3-bz202689-exec-from-pthread-test.patch b/gdb-6.3-bz202689-exec-from-pthread-test.patch deleted file mode 100644 index 74684ddddd593175bab85af8cd609e59a47a18e1..0000000000000000000000000000000000000000 --- a/gdb-6.3-bz202689-exec-from-pthread-test.patch +++ /dev/null @@ -1,109 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.3-bz202689-exec-from-pthread-test.patch - -;; Testcase for exec() from threaded program (BZ 202689). -;;=fedoratest - -2007-01-17 Jan Kratochvil - - * gdb.threads/threaded-exec.exp, gdb.threads/threaded-exec.c: New files. - -diff --git a/gdb/testsuite/gdb.threads/threaded-exec.c b/gdb/testsuite/gdb.threads/threaded-exec.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/threaded-exec.c -@@ -0,0 +1,46 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2007 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. */ -+ -+#include -+#include -+#include -+#include -+#include -+ -+ -+static void * -+threader (void *arg) -+{ -+ return NULL; -+} -+ -+int -+main (void) -+{ -+ pthread_t t1; -+ int i; -+ -+ i = pthread_create (&t1, NULL, threader, (void *) NULL); -+ assert (i == 0); -+ i = pthread_join (t1, NULL); -+ assert (i == 0); -+ -+ execl ("/bin/true", "/bin/true", NULL); -+ abort (); -+} -diff --git a/gdb/testsuite/gdb.threads/threaded-exec.exp b/gdb/testsuite/gdb.threads/threaded-exec.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/threaded-exec.exp -@@ -0,0 +1,41 @@ -+# threaded-exec.exp -- Check reset of the tracked threads on exec*(2) -+# Copyright (C) 2007 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 -+ -+set testfile threaded-exec -+set srcfile ${testfile}.c -+set binfile [standard_output_file ${testfile}] -+ -+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable []] != "" } { -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+ -+gdb_load ${binfile} -+ -+gdb_run_cmd -+ -+gdb_test_multiple {} "Program exited" { -+ -re "\r\n\\\[Inferior .* exited normally\\\]\r\n$gdb_prompt $" { -+ pass "Program exited" -+ } -+} diff --git a/gdb-6.3-focus-cmd-prev-test.patch b/gdb-6.3-focus-cmd-prev-test.patch deleted file mode 100644 index 27c85f1201bda6f22baf31c5cff4d3638e04068f..0000000000000000000000000000000000000000 --- a/gdb-6.3-focus-cmd-prev-test.patch +++ /dev/null @@ -1,53 +0,0 @@ -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.3-focus-cmd-prev-test.patch - -;; Test a crash on `focus cmd', `focus prev' commands. -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.base/focus-cmd-prev.exp b/gdb/testsuite/gdb.base/focus-cmd-prev.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/focus-cmd-prev.exp -@@ -0,0 +1,40 @@ -+# 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 $tracelevel then { -+ strace $tracelevel -+} -+ -+gdb_exit -+gdb_start -+ -+# Do not use gdb_test or \r\n there since: -+# commit d7e747318f4d04af033f16325f9b6d74f67079ec -+# Eliminate make_cleanup_ui_file_delete / make ui_file a class hierarchy -+ -+set test "focus cmd" -+gdb_test_multiple $test $test { -+ -re "$gdb_prompt $" { -+ pass $test -+ } -+} -+ -+set test "focus prev" -+gdb_test_multiple $test $test { -+ -re "$gdb_prompt $" { -+ pass $test -+ } -+} diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch index 6f6ecfbe290c0b7642ddc4cabaae3941a92c0ffc..01e8ffacd91ebff1ce9b77b8d60b0156bb9972f7 100644 --- a/gdb-6.3-gstack-20050411.patch +++ b/gdb-6.3-gstack-20050411.patch @@ -16,7 +16,7 @@ Subject: gdb-6.3-gstack-20050411.patch diff --git a/gdb/Makefile.in b/gdb/Makefile.in --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -1767,7 +1767,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force +@@ -2035,7 +2035,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force install: all @$(MAKE) $(FLAGS_TO_PASS) install-only @@ -25,7 +25,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e "$$t"` ; \ if test "x$$transformed_name" = x; then \ -@@ -1816,7 +1816,25 @@ install-guile: +@@ -2085,7 +2085,25 @@ install-guile: install-python: $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb @@ -52,7 +52,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e $$t` ; \ if test "x$$transformed_name" = x; then \ -@@ -1847,6 +1865,18 @@ uninstall: force $(CONFIG_UNINSTALL) +@@ -2116,6 +2134,18 @@ uninstall: force $(CONFIG_UNINSTALL) rm -f $(DESTDIR)$(bindir)/$$transformed_name @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do diff --git a/gdb-6.3-inheritancetest-20050726.patch b/gdb-6.3-inheritancetest-20050726.patch deleted file mode 100644 index 6e12c826cd02e313351a5480314877469a80eadd..0000000000000000000000000000000000000000 --- a/gdb-6.3-inheritancetest-20050726.patch +++ /dev/null @@ -1,160 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jeff Johnston -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.3-inheritancetest-20050726.patch - -;; Verify printing of inherited members test -;;=fedoratest - -2005-07-26 Jeff Johnston - - * gdb.cp/b146835.exp: New testcase. - * gdb.cp/b146835.cc: Ditto. - * gdb.cp/b146835b.cc: Ditto. - * gdb.cp/b146835.h: Ditto. - -diff --git a/gdb/testsuite/gdb.cp/b146835.cc b/gdb/testsuite/gdb.cp/b146835.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/b146835.cc -@@ -0,0 +1,31 @@ -+#include "b146835.h" -+#include -+ -+class F : public C { -+ -+protected: -+ -+ virtual void funcA (unsigned long a, B *b); -+ virtual void funcB (E *e); -+ virtual void funcC (unsigned long x, bool y); -+ -+ char *s1, *s2; -+ bool b1; -+ int k; -+ -+public: -+ void foo() { -+ std::cout << "foo" << std::endl; -+ } -+}; -+ -+ -+void F::funcA (unsigned long a, B *b) {} -+void F::funcB (E *e) {} -+void F::funcC (unsigned long x, bool y) {} -+ -+int main() -+{ -+ F f; -+ f.foo(); -+} -diff --git a/gdb/testsuite/gdb.cp/b146835.exp b/gdb/testsuite/gdb.cp/b146835.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/b146835.exp -@@ -0,0 +1,47 @@ -+# This testcase is part of GDB, the GNU debugger. -+ -+# Copyright 2005 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. -+ -+# Check that GDB can properly print an inherited member variable -+# (Bugzilla 146835) -+ -+set testfile "b146835" -+set srcfile ${testfile}.cc -+set srcfile2 ${testfile}b.cc -+set binfile [standard_output_file ${testfile}] -+if {[gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile2}" "${binfile}" executable {debug c++}] != "" } { -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+# -+# Run to `main' where we begin our tests. -+# -+ -+if ![runto_main] then { -+ gdb_suppress_tests -+} -+ -+gdb_test "break 'F::foo()'" "" -+gdb_continue_to_breakpoint "First line foo" -+ -+# Verify that we can access the inherited member d -+gdb_test "p d" " = \\(D \\*\\) *0x0" "Verify inherited member d accessible" -diff --git a/gdb/testsuite/gdb.cp/b146835.h b/gdb/testsuite/gdb.cp/b146835.h -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/b146835.h -@@ -0,0 +1,36 @@ -+ -+class A { -+ -+protected: -+ -+ virtual void funcA (unsigned long a, class B *b) = 0; -+ virtual void funcB (class E *e) = 0; -+ virtual void funcC (unsigned long x, bool y) = 0; -+ -+ void funcD (class E *e, class D* d); -+ virtual void funcE (E *e, D *d); -+ virtual void funcF (unsigned long x, D *d); -+}; -+ -+ -+class C : public A { -+ -+protected: -+ -+ int x; -+ class K *k; -+ class H *h; -+ -+ D *d; -+ -+ class W *w; -+ class N *n; -+ class L *l; -+ unsigned long *r; -+ -+public: -+ -+ C(); -+ int z (char *s); -+ virtual ~C(); -+}; -diff --git a/gdb/testsuite/gdb.cp/b146835b.cc b/gdb/testsuite/gdb.cp/b146835b.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/b146835b.cc -@@ -0,0 +1,11 @@ -+#include "b146835.h" -+ -+C::C() { d = 0; x = 3; } -+ -+int C::z (char *s) { return 0; } -+ -+C::~C() {} -+ -+void A::funcD (class E *e, class D *d) {} -+void A::funcE (E *e, D *d) {} -+void A::funcF (unsigned long x, D *d) {} diff --git a/gdb-6.3-rh-testversion-20041202.patch b/gdb-6.3-rh-testversion-20041202.patch index 82c693b0d509a7bd1cff90e732295b187ce62337..59132bf7b5893fe77e0b67268a0af9bff4200c8c 100644 --- a/gdb-6.3-rh-testversion-20041202.patch +++ b/gdb-6.3-rh-testversion-20041202.patch @@ -1,38 +1,34 @@ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Elena Zannoni +From: Andrew Burgess Date: Fri, 27 Oct 2017 21:07:50 +0200 Subject: gdb-6.3-rh-testversion-20041202.patch -;; Match the Fedora's version info. -;;=fedora +;; Check distro name is included in the version output. -2003-02-24 Elena Zannoni - - * gdb.gdb/selftest.exp: Add matching on specific Red Hat only version - string. - -diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp ---- a/gdb/testsuite/gdb.gdb/selftest.exp -+++ b/gdb/testsuite/gdb.gdb/selftest.exp -@@ -53,6 +53,9 @@ proc test_with_self { } { - -re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$gdb_prompt $" { - pass "printed version with cast" - } -+ -re ".\[0-9\]+ = .(Fedora|Red Hat Enterprise Linux) \[\\(\\)0-9.a-z\\-\]+.*$gdb_prompt $" { -+ pass "printed version Fedora or Red Hat Enterprise Linux only" -+ } - } - - # start the "xgdb" process -diff --git a/gdb/top.c b/gdb/top.c ---- a/gdb/top.c -+++ b/gdb/top.c -@@ -2234,7 +2234,7 @@ init_gdb_version_vars (void) - struct internalvar *major_version_var = create_internalvar ("_gdb_major"); - struct internalvar *minor_version_var = create_internalvar ("_gdb_minor"); - int vmajor = 0, vminor = 0, vrevision = 0; -- sscanf (version, "%d.%d.%d", &vmajor, &vminor, &vrevision); -+ sscanf (version, "Fedora %d.%d.%d", &vmajor, &vminor, &vrevision); - set_internalvar_integer (major_version_var, vmajor); - set_internalvar_integer (minor_version_var, vminor + (vrevision > 0)); - } +diff --git a/gdb/testsuite/gdb.base/fedora-version.exp b/gdb/testsuite/gdb.base/fedora-version.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/fedora-version.exp +@@ -0,0 +1,22 @@ ++# Copyright 2023 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 3 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, see . ++ ++# Start with a fresh gdb ++clean_restart ++ ++# Check the version string contains either the Fedora or RHEL distro ++# name, and that the version number looks roughly correct in format. ++gdb_test "show version" \ ++ "GNU gdb \\((Fedora Linux|Red Hat Enterprise Linux)\\) \[0-9\]+\\.\[0-9\]+-\[0-9\]+.*" diff --git a/gdb-6.3-test-movedir-20050125.patch b/gdb-6.3-test-movedir-20050125.patch deleted file mode 100644 index 31fbc60486e85e301e361d7c846df2ddc938903d..0000000000000000000000000000000000000000 --- a/gdb-6.3-test-movedir-20050125.patch +++ /dev/null @@ -1,101 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Elena Zannoni -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.3-test-movedir-20050125.patch - -;; Fix to support executable moving -;;=fedoratest - -2005-01-25 Elena Zannoni - - * gdb.base/move-dir.exp: New test. - * gdb.base/move-dir.c: Ditto. - * gdb.base/move-dir.h: Ditto. - -diff --git a/gdb/testsuite/gdb.base/move-dir.c b/gdb/testsuite/gdb.base/move-dir.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/move-dir.c -@@ -0,0 +1,9 @@ -+#include -+#include -+#include "move-dir.h" -+ -+int main() { -+ const char* hw = "hello world."; -+ printf ("%s\n", hw);; -+ other(); -+} -diff --git a/gdb/testsuite/gdb.base/move-dir.exp b/gdb/testsuite/gdb.base/move-dir.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/move-dir.exp -@@ -0,0 +1,57 @@ -+# Copyright 2005 -+# 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. -+ -+set testfile "move-dir" -+set srcfile ${testfile}.c -+set incfile ${testfile}.h -+set binfile [standard_output_file ${testfile}] -+ -+set testdir [standard_output_file incdir] -+ -+remote_exec build "mkdir $testdir" -+remote_exec build "cp ${srcdir}/${subdir}/${srcfile} [standard_output_file ${srcfile}]" -+remote_exec build "cp ${srcdir}/${subdir}/${incfile} [standard_output_file ${incfile}]" -+ -+set additional_flags "additional_flags=-I${subdir}/incdir" -+ -+if { [gdb_compile [standard_output_file ${srcfile}] "${binfile}" executable [list debug $additional_flags]] != "" } { -+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -+} -+ -+# Create and source the file that provides information about the compiler -+# used to compile the test case. -+ -+if [get_compiler_info ${binfile}] { -+ return -1; -+} -+ -+ -+set oldtimeout $timeout -+set timeout [expr "$timeout + 60"] -+ -+# Start with a fresh gdb. -+ -+gdb_exit -+gdb_start -+gdb_test "cd ../.." "" "" -+gdb_load ${binfile} -+gdb_test "list main" ".*hw.*other.*" "found main" -+gdb_test "list other" ".*ostring.*" "found include file" -+ -+ -+set timeout $oldtimeout -+return 0 -diff --git a/gdb/testsuite/gdb.base/move-dir.h b/gdb/testsuite/gdb.base/move-dir.h -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/move-dir.h -@@ -0,0 +1,6 @@ -+#include -+ -+void other() { -+ const char* ostring = "other"; -+ printf ("%s\n", ostring);; -+} diff --git a/gdb-6.3-threaded-watchpoints2-20050225.patch b/gdb-6.3-threaded-watchpoints2-20050225.patch deleted file mode 100644 index 42b5260ec96b2de8e43290877c787e4a68d93f93..0000000000000000000000000000000000000000 --- a/gdb-6.3-threaded-watchpoints2-20050225.patch +++ /dev/null @@ -1,253 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jeff Johnston -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.3-threaded-watchpoints2-20050225.patch - -;; Test sibling threads to set threaded watchpoints for x86 and x86-64 -;;=fedoratest - -2005-02-28 Jeff Johnston - - * config/i386/nm-linux.h: Change dr register routines to - accept a ptid_t first argument. Change all calling macros - to default the inferior_ptid for the first argument. - (i386_linux_insert_watchpoint): New prototype. - (i386_linux_remove_watchpoint, i386_linux_insert_hw_breakpoint): Ditto. - (i386_linux_remove_hw_breakpoint): Ditto. - (target_insert_watchpoint, target_remove_watchpoint): Undef and - override. - (target_insert_hw_breakpoint, target_remove_hw_breakpoint): Ditto. - * config/i386/nm-linux64.h: Ditto except add amd64 versions of - the watchpoint/hw-breakpoint insert/remove routines. - * i386-nat.c: Include "inferior.h" to define inferior_ptid. - * i386-linux-nat.c: Change all dr get/set routines to accept - ptid_t as first argument and to use this argument to determine - the tid for PTRACE. - (i386_linux_set_debug_regs_for_thread): New function. - (i386_linux_sync_debug_registers_callback): Ditto. - (i386_linux_sync_debug_registers_across_threads): Ditto. - (i386_linux_insert_watchpoint, i386_linux_remove_watchpoint): Ditto. - (i386_linux_hw_breakpoint, i386_linux_remove_hw_breakpoint): Ditto. - (i386_linux_new_thread): Ditto. - (_initialize_i386_linux_nat): Ditto. - * amd64-linux-nat.c: Change all dr get/set routines to accept - ptid_t as first argument and to use this argument to determine - the tid for PTRACE. - (amd64_linux_set_debug_regs_for_thread): New function. - (amd64_linux_sync_debug_registers_callback): Ditto. - (amd64_linux_sync_debug_registers_across_threads): Ditto. - (amd64_linux_insert_watchpoint, amd64_linux_remove_watchpoint): Ditto. - (amd64_linux_hw_breakpoint, amd64_linux_remove_hw_breakpoint): Ditto. - (amd64_linux_new_thread): Ditto. - (_initialize_amd64_linux_nat): Register linux new thread observer. - * testsuite/gdb.threads/watchthreads-threaded.c: New test case. - * testsuite/gdb.threads/watchthreads-threaded.exp: Ditto. - -[ With recent upstream GDB (6.8) reduced only to the testcase. ] - -[ It was called watchthreads2.{exp,c} before but it conflicted with FSF GDB new - testcase of the same name. ] - -FIXME: The testcase does not expects multiple watchpoints hits per one stop. - -diff --git a/gdb/testsuite/gdb.threads/watchthreads-threaded.c b/gdb/testsuite/gdb.threads/watchthreads-threaded.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/watchthreads-threaded.c -@@ -0,0 +1,65 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2002, 2003, 2004, 2005 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. -+ -+ This file is copied from schedlock.c. */ -+ -+#include -+#include -+#include -+#include -+ -+void *thread_function(void *arg); /* Pointer to function executed by each thread */ -+ -+#define NUM 5 -+ -+unsigned int args[NUM+1]; -+ -+int main() { -+ int res; -+ pthread_t threads[NUM]; -+ void *thread_result; -+ long i; -+ -+ for (i = 0; i < NUM; i++) -+ { -+ args[i] = 1; /* Init value. */ -+ res = pthread_create(&threads[i], -+ NULL, -+ thread_function, -+ (void *) i); -+ } -+ -+ args[i] = 1; -+ thread_function ((void *) i); -+ -+ exit(EXIT_SUCCESS); -+} -+ -+void *thread_function(void *arg) { -+ int my_number = (long) arg; -+ int *myp = (int *) &args[my_number]; -+ -+ /* Don't run forever. Run just short of it :) */ -+ while (*myp > 0) -+ { -+ (*myp) ++; usleep (1); /* Loop increment. */ -+ } -+ -+ pthread_exit(NULL); -+} -diff --git a/gdb/testsuite/gdb.threads/watchthreads-threaded.exp b/gdb/testsuite/gdb.threads/watchthreads-threaded.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/watchthreads-threaded.exp -@@ -0,0 +1,126 @@ -+# This testcase is part of GDB, the GNU debugger. -+ -+# Copyright 2005 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. -+ -+# Check that GDB can support multiple watchpoints across threads. -+ -+# This test verifies that a watchpoint is detected in the proper thread -+# so the test is only meaningful on a system with hardware watchpoints. -+if [target_info exists gdb,no_hardware_watchpoints] { -+ return 0; -+} -+ -+set testfile "watchthreads-threaded" -+set srcfile ${testfile}.c -+set binfile [standard_output_file ${testfile}] -+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } { -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+gdb_test "set can-use-hw-watchpoints 1" "" "" -+ -+# -+# Run to `main' where we begin our tests. -+# -+ -+if ![runto_main] then { -+ gdb_suppress_tests -+} -+ -+set args_2 0 -+set args_3 0 -+ -+gdb_breakpoint "thread_function" -+gdb_continue_to_breakpoint "thread_function" -+gdb_test "disable 2" "" -+ -+gdb_test_multiple "p args\[2\]" "get initial args2" { -+ -re "\\\$\[0-9\]* = (.*)$gdb_prompt $" { -+ set init_args_2 $expect_out(1,string) -+ pass "get initial args2" -+ } -+} -+ -+gdb_test_multiple "p args\[3\]" "get initial args3" { -+ -re "\\\$\[0-9\]* = (.*)$gdb_prompt $" { -+ set init_args_3 $expect_out(1,string) -+ pass "get initial args3" -+ } -+} -+ -+set args_2 $init_args_2 -+set args_3 $init_args_3 -+ -+# Watch values that will be modified by distinct threads. -+gdb_test "watch args\[2\]" "Hardware watchpoint 3: args\\\[2\\\]" -+gdb_test "watch args\[3\]" "Hardware watchpoint 4: args\\\[3\\\]" -+ -+set init_line [expr [gdb_get_line_number "Init value"]+1] -+set inc_line [gdb_get_line_number "Loop increment"] -+ -+# Loop and continue to allow both watchpoints to be triggered. -+for {set i 0} {$i < 30} {incr i} { -+ set test_flag 0 -+ gdb_test_multiple "continue" "threaded watch loop" { -+ -re "Hardware watchpoint 3: args\\\[2\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads-threaded.c:$init_line.*$gdb_prompt $" -+ { set args_2 1; set test_flag 1 } -+ -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads-threaded.c:$init_line.*$gdb_prompt $" -+ { set args_3 1; set test_flag 1 } -+ -re "Hardware watchpoint 3: args\\\[2\\\].*Old value = $args_2.*New value = [expr $args_2+1].*thread_function \\\(arg=0x2\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $" -+ { set args_2 [expr $args_2+1]; set test_flag 1 } -+ -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = $args_3.*New value = [expr $args_3+1].*thread_function \\\(arg=0x3\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $" -+ { set args_3 [expr $args_3+1]; set test_flag 1 } -+ } -+ # If we fail above, don't bother continuing loop -+ if { $test_flag == 0 } { -+ set i 30; -+ } -+} -+ -+# Print success message if loop succeeded. -+if { $test_flag == 1 } { -+ pass "threaded watch loop" -+} -+ -+# Verify that we hit first watchpoint in child thread. -+set message "watchpoint on args\[2\] hit in thread" -+if { $args_2 > 1 } { -+ pass $message -+} else { -+ fail $message -+} -+ -+# Verify that we hit second watchpoint in child thread. -+set message "watchpoint on args\[3\] hit in thread" -+if { $args_3 > 1 } { -+ pass $message -+} else { -+ fail $message -+} -+ -+# Verify that all watchpoint hits are accounted for. -+set message "combination of threaded watchpoints = 30 + initial values" -+if { [expr $args_2+$args_3] == [expr [expr 30+$init_args_2]+$init_args_3] } { -+ pass $message -+} else { -+ fail $message -+} diff --git a/gdb-6.5-bz109921-DW_AT_decl_file-test.patch b/gdb-6.5-bz109921-DW_AT_decl_file-test.patch deleted file mode 100644 index 8d03e3f11690f7bc930e926fa2bcd53cfd6fca35..0000000000000000000000000000000000000000 --- a/gdb-6.5-bz109921-DW_AT_decl_file-test.patch +++ /dev/null @@ -1,134 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.5-bz109921-DW_AT_decl_file-test.patch - -;; Find symbols properly at their original (included) file (BZ 109921). -;;=fedoratest - -https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=109921 - -It is duplicite to its upstream variant: -http://sourceware.org/ml/gdb-cvs/2007-01/msg00157.html -http://sourceware.org/ml/gdb-patches/2007-01/msg00434.html -2007-01-21 Jan Kratochvil - Daniel Jacobowitz - - * gdb.base/included.c, gdb.base/included.exp, - gdb.base/included.h: New files. - ------------------------------------------------------------------------------- - -2007-01-09 Jan Kratochvil - - * gdb.dwarf2/dw2-included.exp, gdb.dwarf2/dw2-included.c, - gdb.dwarf2/dw2-included.h: New files. - -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.c b/gdb/testsuite/gdb.dwarf2/dw2-included.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-included.c -@@ -0,0 +1,26 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2006 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. */ -+ -+#include "dw2-included.h" -+ -+int -+main() -+{ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.exp b/gdb/testsuite/gdb.dwarf2/dw2-included.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-included.exp -@@ -0,0 +1,47 @@ -+# Copyright 2006 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. -+ -+# Minimal DWARF-2 unit test -+ -+# This test can only be run on targets which support DWARF-2. -+# For now pick a sampling of likely targets. -+if {![istarget *-*-linux*] -+ && ![istarget *-*-gnu*] -+ && ![istarget *-*-elf*] -+ && ![istarget *-*-openbsd*] -+ && ![istarget arm-*-eabi*] -+ && ![istarget powerpc-*-eabi*]} { -+ return 0 -+} -+ -+set testfile "dw2-included" -+set srcfile ${testfile}.c -+set binfile [standard_output_file ${testfile}] -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+gdb_test "set listsize 1" "" -+gdb_test "list integer" "int integer;\r" -+gdb_test "ptype integer" "type = int\r" -+# Path varies depending on the build location. -+gdb_test "info variables integer" "\r\nFile \[^\r\n\]*/gdb.dwarf2/dw2-included.h:\r\n${decimal}:.*int integer;\r" -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-included.h b/gdb/testsuite/gdb.dwarf2/dw2-included.h -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-included.h -@@ -0,0 +1,20 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2006 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. */ -+ -+int integer; diff --git a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch index ac3aa17d2e8427906adf8ca855a13d8906e59295..ab64f7fcb3169b89c01f37ae48a79f6e37d5e62c 100644 --- a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +++ b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch @@ -44,7 +44,7 @@ glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug: diff --git a/gdb/printcmd.c b/gdb/printcmd.c --- a/gdb/printcmd.c +++ b/gdb/printcmd.c -@@ -1301,6 +1301,10 @@ process_print_command_args (const char *args, value_print_options *print_opts, +@@ -1308,6 +1308,11 @@ process_print_command_args (const char *args, value_print_options *print_opts, if (exp != nullptr && *exp) { @@ -52,9 +52,10 @@ diff --git a/gdb/printcmd.c b/gdb/printcmd.c + function descriptors. */ + if (target_has_execution () && strcmp (exp, "errno") == 0) + exp = "*(*(int *(*)(void)) __errno_location) ()"; - /* VOIDPRINT is true to indicate that we do want to print a void - value, so invert it for parse_expression. */ - expression_up expr = parse_expression (exp, nullptr, !voidprint); ++ + /* This setting allows large arrays to be printed by limiting the + number of elements that are loaded into GDB's memory; we only + need to load as many array elements as we plan to print. */ diff --git a/gdb/testsuite/gdb.dwarf2/dw2-errno.c b/gdb/testsuite/gdb.dwarf2/dw2-errno.c new file mode 100644 --- /dev/null diff --git a/gdb-6.5-ia64-libunwind-leak-test.patch b/gdb-6.5-ia64-libunwind-leak-test.patch deleted file mode 100644 index 6efdca9ef72fff6b47e67893bcb27bed4ae051ba..0000000000000000000000000000000000000000 --- a/gdb-6.5-ia64-libunwind-leak-test.patch +++ /dev/null @@ -1,135 +0,0 @@ -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.5-ia64-libunwind-leak-test.patch - -;; Test ia64 memory leaks of the code using libunwind. -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.base/unwind-leak.c b/gdb/testsuite/gdb.base/unwind-leak.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/unwind-leak.c -@@ -0,0 +1,29 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2007 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 */ -+ -+#include -+ -+int main() -+{ -+ for (;;) -+ alarm (0); -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.base/unwind-leak.exp b/gdb/testsuite/gdb.base/unwind-leak.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/unwind-leak.exp -@@ -0,0 +1,88 @@ -+# Copyright 2007 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 unwind-leak -+set srcfile ${testfile}.c -+set shfile [standard_output_file ${testfile}-gdb.sh] -+set binfile [standard_output_file ${testfile}] -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" 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} -+ -+set pid [exp_pid -i [board_info host fileid]] -+ -+# For C programs, "start" should stop in main(). -+ -+gdb_test "start" \ -+ "main \\(\\) at .*$srcfile.*" \ -+ "start" -+ -+set loc [gdb_get_line_number "alarm"] -+gdb_breakpoint $loc -+ -+proc memory_get {} { -+ global pid -+ set fd [open "/proc/$pid/statm"] -+ gets $fd line -+ close $fd -+ # number of pages of data/stack -+ scan $line "%*d%*d%*d%*d%*d%d" drs -+ return $drs -+} -+ -+set cycles 100 -+# For 100 cycles it was 1308: from = 363 KB, to = 1671 KB -+set permit_kb 100 -+verbose -log "cycles = $cycles, permit_kb = $permit_kb" -+ -+set fail 0 -+set test "breakpoint stop/continue cycles" -+for {set i $cycles} {$i > 0} {set i [expr {$i - 1}]} { -+ gdb_test_multiple "continue" $test { -+ -re "Breakpoint 2, main .*alarm .*.*${gdb_prompt} $" { -+ } -+ -re "Segmentation fault" { -+ fail $test -+ set i 0 -+ set fail 1 -+ } -+ } -+ if ![info exists from] { -+ set from [memory_get] -+ } -+} -+set to [memory_get] -+if {!$fail} { -+ verbose -log "from = $from KB, to = $to KB" -+ if {$from > 0 && $to > 10 && $to < $from + $permit_kb} { -+ pass $test -+ } else { -+ fail $test -+ } -+} diff --git a/gdb-6.5-last-address-space-byte-test.patch b/gdb-6.5-last-address-space-byte-test.patch deleted file mode 100644 index e99d81185339a1a2ee7467c91eb9992d1b7efd6e..0000000000000000000000000000000000000000 --- a/gdb-6.5-last-address-space-byte-test.patch +++ /dev/null @@ -1,62 +0,0 @@ -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.5-last-address-space-byte-test.patch - -;; Testcase for deadlocking on last address space byte; for corrupted backtraces. -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.base/largecore-last-address-lock.exp b/gdb/testsuite/gdb.base/largecore-last-address-lock.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/largecore-last-address-lock.exp -@@ -0,0 +1,49 @@ -+# Copyright 2006 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 $tracelevel then { -+ strace $tracelevel -+} -+ -+# Get things started. -+ -+gdb_exit -+gdb_start -+ -+# i386 (32-bit) only: gdb with Red Hat largecore patch did lock up: -+# https://enterprise.redhat.com/issue-tracker/?module=issues&action=view&tid=103263 -+# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=210614 -+ -+# i386: Bug exists when the `target_xfer_memory' condition -+# `(memaddr + len < region->hi)' operates on 64-bit operands on -+# largecore-patched with 32-bit addresses and so it can get `false' with -+# arbitrary `len'. -+ -+# x86_64: The bug is not present as the operands and calculations have the same -+# bit size. Would would still need to pass there the highest address -+# (`memaddr == 0xffffffffffffffff') but we would need to pass `len == 0' -+# to make the condition `(memaddr + len < region->hi)' false. -+# `len == 0' would get caught eariler. -+ -+# Error in the success case is immediate. -+set timeoutold ${timeout} -+set timeout 10 -+ -+gdb_test "x/xb 0xffffffff" \ -+ "Cannot access memory at address 0xffffffff" \ -+ "Read the last address space byte" -+ -+set timeout ${timeoutold} diff --git a/gdb-6.5-missed-trap-on-step-test.patch b/gdb-6.5-missed-trap-on-step-test.patch deleted file mode 100644 index 0ad8ad1a170ba1a2baa24ac7e248a218943b2fc5..0000000000000000000000000000000000000000 --- a/gdb-6.5-missed-trap-on-step-test.patch +++ /dev/null @@ -1,95 +0,0 @@ -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.5-missed-trap-on-step-test.patch - -;; Test hiding unexpected breakpoints on intentional step commands. -;;=fedoratest - -Fix has been committed to: - gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch - -diff --git a/gdb/testsuite/gdb.base/watchpoint-during-step.c b/gdb/testsuite/gdb.base/watchpoint-during-step.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/watchpoint-during-step.c -@@ -0,0 +1,30 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2007 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 */ -+ -+static int var; -+ -+int main() -+{ -+ var = 1; -+ var = 2; -+ var = 3; -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.base/watchpoint-during-step.exp b/gdb/testsuite/gdb.base/watchpoint-during-step.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/watchpoint-during-step.exp -@@ -0,0 +1,44 @@ -+# Copyright 2007 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. -+ -+set testfile watchpoint-during-step -+set srcfile ${testfile}.c -+set binfile [standard_output_file ${testfile}] -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" 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} -+ -+runto_main -+ -+gdb_breakpoint [gdb_get_line_number "var = 2"] -+gdb_continue_to_breakpoint "Find the first var set" -+ -+gdb_test "step" ".*var = 3;" "Step to the next var set" -+ -+gdb_test "watch var" "atchpoint .*: var" "Set the watchpoint" -+ -+# Here is the target point. Be careful to not have breakpoint set on the line -+# we step from as in this case it is a valid upstream KFAIL gdb/38 -+ -+gdb_test "step" ".*Old value = 2.*New value = 3.*" "Catch the watchpoint" diff --git a/gdb-6.5-readline-long-line-crash-test.patch b/gdb-6.5-readline-long-line-crash-test.patch deleted file mode 100644 index 087f9163b7c23cbd66bcfb00a20f07c2ae07f7c9..0000000000000000000000000000000000000000 --- a/gdb-6.5-readline-long-line-crash-test.patch +++ /dev/null @@ -1,111 +0,0 @@ -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.5-readline-long-line-crash-test.patch - -;; Fix readline segfault on excessively long hand-typed lines. -;;=fedoratest - -https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214196 - -diff --git a/gdb/testsuite/gdb.base/readline-overflow.exp b/gdb/testsuite/gdb.base/readline-overflow.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/readline-overflow.exp -@@ -0,0 +1,96 @@ -+# Copyright 2006 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 -+ -+# This file was written by Jan Kratochvil -+ -+# This file is part of the gdb testsuite. -+ -+# -+# Tests for readline buffer overflow. -+# -+ -+if $tracelevel { -+ strace $tracelevel -+} -+ -+global env -+ -+save_vars { env(GDBHISTFILE) env(HISTSIZE) TERM timeout } { -+ # The arrow key test relies on the standard VT100 bindings, so -+ # make sure that an appropriate terminal is selected. The same -+ # bug doesn't show up if we use ^P / ^N instead. -+ setenv TERM vt100 -+ -+ set timeout 600 -+ -+ set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history" -+ set env(HISTSIZE) "10" -+ -+ gdb_exit -+ gdb_start -+ gdb_reinitialize_dir $srcdir/$subdir -+ -+ -+ set width 11 -+ gdb_test "set width $width" \ -+ "" \ -+ "Setting width to $width." -+ #gdb_test "set height 1" \ -+ # "" \ -+ # "Setting height to 1." -+ send_gdb "run X" -+ set i 0 -+ # It crashes using `set width 7' on `set total 3560'. -+ # Sometimes it corrupts screen on `set width 7'. -+ # Bugreport used `set total 130001': -+ # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=214196 -+ # Check also `timeout' above. -+ set total 4200 -+ gdb_expect { -+ -re X { -+ incr i -+ if {$i <= $total} { -+ send_gdb "X" -+ exp_continue -+ } -+ } -+ -re "\[ \b\r\n\]" { -+ exp_continue -+ } -+ eof { -+ fail "gdb sending total $total characters" -+ note "Failed after sending $i characters, reason: EOF" -+ gdb_clear_suppressed -+ } -+ timeout { -+ fail "gdb sending total $total characters" -+ note "Failed after sending $i characters (timeout $timeout), reason: TIMEOUT" -+ gdb_clear_suppressed -+ } -+ default { -+ fail "gdb sending total $total characters" -+ note "Failed after sending $i characters, reason: 0=\[$expect_out(0,string)\] buffer=\[$expect_out(buffer)\]" -+ gdb_clear_suppressed -+ } -+ } -+ send_gdb "\r" -+ gdb_test "" \ -+ "No executable file specified..*" \ -+ "All the characters transferred" -+} diff --git a/gdb-6.5-sharedlibrary-path.patch b/gdb-6.5-sharedlibrary-path.patch deleted file mode 100644 index 360e5d3adcd3a1b3187012495903798d38a573d5..0000000000000000000000000000000000000000 --- a/gdb-6.5-sharedlibrary-path.patch +++ /dev/null @@ -1,193 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.5-sharedlibrary-path.patch - -;; Fix TLS symbols resolving for shared libraries with a relative pathname. -;; The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'. -;;=fedoratest: One should recheck if it is really fixed upstream. - -If you provided some relative path to the shared library, such as with - export LD_LIBRARY_PATH=. -then gdb would fail to match the shared library name during the TLS lookup. - -Dropped the workaround/fix for gdb-6.8.50.20081128 - is it still needed? - -The testsuite needs `gdb-6.3-bz146810-solib_absolute_prefix_is_empty.patch'. -The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'. - -2006-09-01 Jan Kratochvil - - * solib-svr4.c (svr4_fetch_objfile_link_map): Match even absolute - requested pathnames to the internal loaded relative pathnames. - -2007-10-16 Jan Kratochvil - - Port to GDB-6.7. - -2008-02-27 Jan Kratochvil - - Port to gdb-6.7.50.20080227. - -diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug-main.c b/gdb/testsuite/gdb.threads/tls-sepdebug-main.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/tls-sepdebug-main.c -@@ -0,0 +1,31 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2006 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 */ -+ -+#include -+ -+extern __thread int var; -+ -+int main() -+{ -+ /* Ensure we link against pthreads even with --as-needed. */ -+ pthread_testcancel(); -+ return var; -+} -diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c b/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c -@@ -0,0 +1,22 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2006 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 */ -+ -+__thread int var = 42; -diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug.exp b/gdb/testsuite/gdb.threads/tls-sepdebug.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.threads/tls-sepdebug.exp -@@ -0,0 +1,94 @@ -+# Copyright 2006 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. -+ -+# This test uses gdb_exit and gdb_start, which are not supported -+# on non-extended-remote sessions. -+if {[use_gdb_stub]} { -+ untested "skipping test because of stub" -+ return 0 -+} -+ -+if $tracelevel then { -+ strace $tracelevel -+} -+ -+set testfile tls-sepdebug -+set srcmainfile ${testfile}-main.c -+set srcsharedfile ${testfile}-shared.c -+ -+set binmainfile [standard_output_file ${testfile}-main] -+set binsharedbase ${testfile}-shared.so -+set binsharedfile [standard_output_file ${binsharedbase}] -+set binshareddebugfile [standard_output_file ${binsharedbase}.debug] -+ -+# Use explicit -soname as otherwise the full path to the library would get -+# encoded into ${binmainfile} making LD_LIBRARY_PATH tests useless. -+ -+# FIXME: gcc dependency (-Wl,-soname). -+ -+if { [gdb_compile_shlib "${srcdir}/${subdir}/${srcsharedfile}" "${binsharedfile}" [list debug additional_flags=-Wl,-soname=${binsharedbase}]] != "" } { -+ untested "Couldn't compile test library" -+ return -1 -+} -+ -+# eu-strip(1) works fine but it is a part of `elfutils', not `binutils'. -+if 0 then { -+ remote_exec build "eu-strip -f ${binshareddebugfile} ${binsharedfile}" -+} else { -+ remote_exec build "objcopy --only-keep-debug ${binsharedfile} ${binshareddebugfile}" -+ remote_exec build "objcopy --strip-debug ${binsharedfile}" -+ remote_exec build "objcopy --add-gnu-debuglink=${binshareddebugfile} ${binsharedfile}" -+} -+ -+# Do not use `shlib=' as it will automatically add also -rpath for gcc. -+ -+if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcmainfile} ${binsharedfile}" "${binmainfile}" executable {debug}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+# Get things started. -+ -+# Test also the proper resolving of relative library names to absolute ones. -+# \$PWD is easy - it is the absolute way -+# ${subdir} would fail on "print var" -+ -+set absdir [file dirname [standard_output_file ${binsharedbase}]] -+foreach ld_library_path [list $absdir [relative_filename [pwd] $absdir]] name { absolute relative } { -+ -+ gdb_exit -+ gdb_start -+ ###gdb_reinitialize_dir $srcdir/$subdir -+ -+ gdb_test "set env LD_LIBRARY_PATH=$ld_library_path" \ -+ "" \ -+ "set env LD_LIBRARY_PATH is $name" -+ -+ gdb_load ${binmainfile} -+ -+ # For C programs, "start" should stop in main(). -+ -+ gdb_test "start" \ -+ "main \\(\\) at .*${srcmainfile}.*" \ -+ "start" -+ -+ # Check for: Cannot find shared library `/usr/lib/debug/lib/libc-2.4.90.so.debug' in dynamic linker's load module list -+ # as happens with TLS variables and `separate_debug_objfile_backlink'. -+ -+ gdb_test "print var" \ -+ "\\\$1 = \[0-9\].*" \ -+ "print TLS variable from a shared library with $name-directory separate debug info file" -+} diff --git a/gdb-6.6-buildid-locate-rpm-scl.patch b/gdb-6.6-buildid-locate-rpm-scl.patch deleted file mode 100644 index 7d4389a6ce167dd82c12f526dc9f3b1989bedfa1..0000000000000000000000000000000000000000 --- a/gdb-6.6-buildid-locate-rpm-scl.patch +++ /dev/null @@ -1,42 +0,0 @@ -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-rpm-scl.patch - -;; [SCL] Skip deprecated .gdb_index warning for Red Hat built files (BZ 953585). -;;=push+jan - -warning: Skipping deprecated .gdb_index section -https://bugzilla.redhat.com/show_bug.cgi?id=953585 - -diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c ---- a/gdb/dwarf2/read.c -+++ b/gdb/dwarf2/read.c -@@ -2797,6 +2797,16 @@ read_gdb_index_from_buffer (const char *filename, - "set use-deprecated-index-sections on". */ - if (version < 6 && !deprecated_ok) - { -+#ifdef GDB_INDEX_VERIFY_VENDOR -+ extern int rpm_verify_vendor (const char *filename); -+ -+ /* Red Hat Developer Toolset exception. */ -+ if (rpm_verify_vendor (filename)) -+ {} -+ else -+ { -+ -+#endif - static int warning_printed = 0; - if (!warning_printed) - { -@@ -2808,6 +2818,10 @@ to use the section anyway."), - warning_printed = 1; - } - return 0; -+#ifdef GDB_INDEX_VERIFY_VENDOR -+ -+ } -+#endif - } - /* Version 7 indices generated by gold refer to the CU for a symbol instead - of the TU (for symbols coming from TUs), diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index efaf98999b38189d90cdbf332c935fadea4bb8f0..f38fdd55b2ecf8691e3d330ffe9d0d1e3126c52f 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -1,6 +1,6 @@ From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Fedora GDB patches -Date: Fri, 27 Oct 2017 21:07:50 +0200 +From: Kevin Buettner +Date: Wed, 22 Feb 2023 22:30:40 -0700 Subject: gdb-6.6-buildid-locate-rpm.patch ;;=push+jan @@ -232,10 +232,44 @@ diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4 # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. +diff --git a/gdb/build-id.c b/gdb/build-id.c +--- a/gdb/build-id.c ++++ b/gdb/build-id.c +@@ -780,10 +780,10 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) + static rpmts (*rpmtsCreate_p) (void); + extern rpmts rpmtsFree(rpmts ts); + static rpmts (*rpmtsFree_p) (rpmts ts); +- extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, ++ extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, + const void * keyp, size_t keylen); + static rpmdbMatchIterator (*rpmtsInitIterator_p) (const rpmts ts, +- rpmTag rpmtag, ++ rpmDbiTagVal rpmtag, + const void *keyp, + size_t keylen); + #else /* !DLOPEN_LIBRPM */ +@@ -838,7 +838,7 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) + && (rpmdbNextIterator_p = (Header (*) (rpmdbMatchIterator mi)) dlsym (h, "rpmdbNextIterator")) + && (rpmtsCreate_p = (rpmts (*) (void)) dlsym (h, "rpmtsCreate")) + && (rpmtsFree_p = (rpmts (*) (rpmts ts)) dlsym (h, "rpmtsFree")) +- && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator")))) ++ && (rpmtsInitIterator_p = (rpmdbMatchIterator (*) (const rpmts ts, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen)) dlsym (h, "rpmtsInitIterator")))) + { + warning (_("Opened library \"%s\" is incompatible (%s), " + "missing debuginfos notifications will not be displayed"), +@@ -926,7 +926,7 @@ missing_rpm_enlist_1 (const char *filename, int verify_vendor) + + /* RPMDBI_PACKAGES requires keylen == sizeof (int). */ + /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */ +- mi_debuginfo = rpmtsInitIterator_p (ts, (rpmTag) RPMDBI_LABEL, debuginfo, 0); ++ mi_debuginfo = rpmtsInitIterator_p (ts, (rpmDbiTagVal) RPMDBI_LABEL, debuginfo, 0); + xfree (debuginfo); + if (mi_debuginfo) + { diff --git a/gdb/config.in b/gdb/config.in --- a/gdb/config.in +++ b/gdb/config.in -@@ -39,6 +39,9 @@ +@@ -42,6 +42,9 @@ /* Handle .ctf type-info sections */ #undef ENABLE_LIBCTF @@ -245,9 +279,9 @@ diff --git a/gdb/config.in b/gdb/config.in /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS -@@ -259,6 +262,9 @@ - /* Define if you have the mpfr library. */ - #undef HAVE_LIBMPFR +@@ -265,6 +268,9 @@ + /* Define to 1 if you have the `m' library (-lm). */ + #undef HAVE_LIBM +/* Define if librpm library is being used. */ +#undef HAVE_LIBRPM @@ -258,7 +292,7 @@ diff --git a/gdb/config.in b/gdb/config.in diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -775,6 +775,11 @@ TARGET_OBS +@@ -778,6 +778,11 @@ AMD_DBGAPI_CFLAGS ENABLE_BFD_64_BIT_FALSE ENABLE_BFD_64_BIT_TRUE subdirs @@ -270,25 +304,25 @@ diff --git a/gdb/configure b/gdb/configure GDB_DATADIR DEBUGDIR MAKEINFO_EXTRA_FLAGS -@@ -880,6 +885,7 @@ with_gdb_datadir +@@ -911,6 +916,7 @@ with_gdb_datadir with_relocated_sources with_auto_load_dir with_auto_load_safe_path +with_rpm enable_targets enable_64_bit_bfd - enable_gdbmi -@@ -959,6 +965,8 @@ PKG_CONFIG_PATH - PKG_CONFIG_LIBDIR + with_amd_dbgapi +@@ -988,6 +994,8 @@ AMD_DBGAPI_CFLAGS + AMD_DBGAPI_LIBS DEBUGINFOD_CFLAGS DEBUGINFOD_LIBS +RPM_CFLAGS +RPM_LIBS YACC YFLAGS - XMKMF' -@@ -1635,6 +1643,8 @@ Optional Packages: - do not restrict auto-loaded files locations + ZSTD_CFLAGS +@@ -1679,6 +1687,8 @@ Optional Packages: + --with-amd-dbgapi support for the amd-dbgapi target (yes / no / auto) --with-debuginfod Enable debuginfo lookups with debuginfod (auto/yes/no) + --with-rpm query rpm database for missing debuginfos (yes/no, @@ -296,7 +330,7 @@ diff --git a/gdb/configure b/gdb/configure --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets --with-curses use the curses library instead of the termcap library -@@ -1715,6 +1725,8 @@ Some influential environment variables: +@@ -1759,6 +1769,8 @@ Some influential environment variables: C compiler flags for DEBUGINFOD, overriding pkg-config DEBUGINFOD_LIBS linker flags for DEBUGINFOD, overriding pkg-config @@ -305,7 +339,7 @@ diff --git a/gdb/configure b/gdb/configure YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. -@@ -6634,6 +6646,494 @@ _ACEOF +@@ -18039,6 +18051,495 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5 $as_echo "$with_auto_load_safe_path" >&6; } @@ -369,6 +403,7 @@ diff --git a/gdb/configure b/gdb/configure +#include +#include +#include ++#include + +int +main () @@ -485,7 +520,7 @@ diff --git a/gdb/configure b/gdb/configure +extern Header rpmdbNextIterator(rpmdbMatchIterator mi); +extern rpmts rpmtsCreate(void); +extern rpmts rpmtsFree(rpmts ts); -+extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, ++extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, + const void * keyp, size_t keylen); + +int @@ -747,7 +782,7 @@ diff --git a/gdb/configure b/gdb/configure +extern Header rpmdbNextIterator(rpmdbMatchIterator mi); +extern rpmts rpmtsCreate(void); +extern rpmts rpmtsFree(rpmts ts); -+extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, ++extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, + const void * keyp, size_t keylen); + +int @@ -803,7 +838,7 @@ diff --git a/gdb/configure b/gdb/configure diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -153,6 +153,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir, +@@ -173,6 +173,200 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir, [Directories safe to hold auto-loaded files.]) AC_MSG_RESULT([$with_auto_load_safe_path]) @@ -853,6 +888,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac +#include +#include +#include ++#include + ]], [[ + void *h; + const char *const *rpmverp; @@ -947,7 +983,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac +extern Header rpmdbNextIterator(rpmdbMatchIterator mi); +extern rpmts rpmtsCreate(void); +extern rpmts rpmtsFree(rpmts ts); -+extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, ++extern rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, + const void * keyp, size_t keylen); + ]]), [ + LIBRPM_COMPAT=true @@ -1006,15 +1042,15 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac diff --git a/gdb/event-top.c b/gdb/event-top.c --- a/gdb/event-top.c +++ b/gdb/event-top.c -@@ -42,6 +42,7 @@ - #include "gdbsupport/gdb-sigmask.h" +@@ -43,6 +43,7 @@ #include "async-event.h" #include "bt-utils.h" + #include "pager.h" +#include "symfile.h" /* readline include files. */ #include "readline/readline.h" -@@ -374,6 +375,8 @@ display_gdb_prompt (const char *new_prompt) +@@ -404,6 +405,8 @@ display_gdb_prompt (const char *new_prompt) /* Reset the nesting depth used when trace-commands is set. */ reset_command_nest_depth (); @@ -1023,7 +1059,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c /* Do not call the python hook on an explicit prompt change as passed to this function, as this forms a secondary/local prompt, IE, displayed but not set. */ -@@ -800,7 +803,10 @@ command_line_handler (gdb::unique_xmalloc_ptr &&rl) +@@ -788,7 +791,10 @@ command_line_handler (gdb::unique_xmalloc_ptr &&rl) command_handler (cmd); if (ui->prompt_state != PROMPTED) @@ -1038,7 +1074,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c diff --git a/gdb/symfile.h b/gdb/symfile.h --- a/gdb/symfile.h +++ b/gdb/symfile.h -@@ -342,6 +342,7 @@ extern void generic_load (const char *args, int from_tty); +@@ -367,6 +367,7 @@ extern void generic_load (const char *args, int from_tty); /* build-id support. */ extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr); extern void debug_print_missing (const char *binary, const char *debug); diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch index df453195223fed3062c0dd76f1a343f7f479650f..e9ec7b5775c2be5d8544d170d9adea9a0221f806 100644 --- a/gdb-6.6-buildid-locate-solib-missing-ids.patch +++ b/gdb-6.6-buildid-locate-solib-missing-ids.patch @@ -14,7 +14,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1339862 diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c -@@ -1250,14 +1250,28 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1320,14 +1320,28 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, } { @@ -45,7 +45,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c if (build_id != NULL) { char *name, *build_id_filename; -@@ -1272,23 +1286,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, +@@ -1342,23 +1356,7 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, xfree (name); } else diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index 1a87c47eb8e146589f6122fe674172b8b470c680..13500518cafce7c6149f1ba7218dd313b91d1fdf 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -9,7 +9,7 @@ Subject: gdb-6.6-buildid-locate.patch diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h --- a/bfd/libbfd-in.h +++ b/bfd/libbfd-in.h -@@ -115,7 +115,7 @@ static inline char * +@@ -110,7 +110,7 @@ static inline char * bfd_strdup (const char *str) { size_t len = strlen (str) + 1; @@ -21,7 +21,7 @@ diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h diff --git a/bfd/libbfd.h b/bfd/libbfd.h --- a/bfd/libbfd.h +++ b/bfd/libbfd.h -@@ -120,7 +120,7 @@ static inline char * +@@ -116,7 +116,7 @@ static inline char * bfd_strdup (const char *str) { size_t len = strlen (str) + 1; @@ -33,7 +33,7 @@ diff --git a/bfd/libbfd.h b/bfd/libbfd.h diff --git a/gdb/build-id.c b/gdb/build-id.c --- a/gdb/build-id.c +++ b/gdb/build-id.c -@@ -24,13 +24,71 @@ +@@ -24,14 +24,72 @@ #include "gdbsupport/gdb_vecs.h" #include "symfile.h" #include "objfiles.h" @@ -46,6 +46,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c +#include "gdb_bfd.h" +#include "gdbcmd.h" #include "gdbcore.h" + #include "cli/cli-style.h" +#include "inferior.h" +#include "objfiles.h" +#include "observable.h" @@ -59,8 +60,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c +show_build_id_verbose (struct ui_file *file, int from_tty, + struct cmd_list_element *c, const char *value) +{ -+ fprintf_filtered (file, _("Verbosity level of the build-id locator is %s.\n"), -+ value); ++ gdb_printf (file, _("Verbosity level of the build-id locator is %s.\n"), ++ value); +} +/* Locate NT_GNU_BUILD_ID and return its matching debug filename. + FIXME: NOTE decoding should be unified with the BFD core notes decoding. */ @@ -104,9 +105,9 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c -build_id_bfd_get (bfd *abfd) +build_id_bfd_shdr_get (bfd *abfd) { - if (!bfd_check_format (abfd, bfd_object) - && !bfd_check_format (abfd, bfd_core)) -@@ -43,6 +101,348 @@ build_id_bfd_get (bfd *abfd) + /* Dynamic objfiles such as ones created by JIT reader API + have no underlying bfd structure (that is, objfile->obfd +@@ -50,6 +108,348 @@ build_id_bfd_get (bfd *abfd) return NULL; } @@ -455,7 +456,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c /* See build-id.h. */ int -@@ -51,7 +451,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) +@@ -58,7 +458,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) const struct bfd_build_id *found; int retval = 0; @@ -464,7 +465,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c if (found == NULL) warning (_("File \"%s\" has no build-id, file skipped"), -@@ -66,63 +466,166 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) +@@ -73,63 +473,166 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check) return retval; } @@ -517,9 +518,9 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + if (separate_debug_file_debug) { -- fprintf_unfiltered (gdb_stdlog, _(" Trying %s..."), link.c_str ()); +- gdb_printf (gdb_stdlog, _(" Trying %s..."), link.c_str ()); - gdb_flush (gdb_stdlog); -+ fprintf_unfiltered (gdb_stdlog, _(" Trying %s..."), orig_link.c_str ()); ++ gdb_printf (gdb_stdlog, _(" Trying %s..."), orig_link.c_str ()); + gdb_flush (gdb_stdout); } @@ -539,8 +540,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c - if (filename == NULL) - { - if (separate_debug_file_debug) -- fprintf_unfiltered (gdb_stdlog, -- _(" no, unable to compute real path\n")); +- gdb_printf (gdb_stdlog, +- _(" no, unable to compute real path\n")); + if (seqno > 0) + { + /* There can be multiple build-id symlinks pointing to real files @@ -559,7 +560,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c - if (debug_bfd == NULL) - { - if (separate_debug_file_debug) -- fprintf_unfiltered (gdb_stdlog, _(" no, unable to open.\n")); +- gdb_printf (gdb_stdlog, _(" no, unable to open.\n")); + struct stat statbuf_trash; + + /* `access' automatically dereferences LINK. */ @@ -583,7 +584,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + if (filename == NULL) + { + if (separate_debug_file_debug) -+ fprintf_unfiltered (gdb_stdlog, ++ gdb_printf (gdb_stdlog, + _(" no, unable to compute real path\n")); + + continue; @@ -595,7 +596,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + if (debug_bfd == NULL) + { + if (separate_debug_file_debug) -+ fprintf_unfiltered (gdb_stdlog, _(" no, unable to open.\n")); ++ gdb_printf (gdb_stdlog, _(" no, unable to open.\n")); - return {}; + continue; @@ -604,8 +605,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + if (!build_id_verify (debug_bfd.get(), build_id_len, build_id)) + { + if (separate_debug_file_debug) -+ fprintf_unfiltered (gdb_stdlog, -+ _(" no, build-id does not match.\n")); ++ gdb_printf (gdb_stdlog, ++ _(" no, build-id does not match.\n")); + + continue; + } @@ -620,8 +621,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + if (ret_bfd != NULL) { if (separate_debug_file_debug) -- fprintf_unfiltered (gdb_stdlog, _(" no, build-id does not match.\n")); -+ fprintf_unfiltered (gdb_stdlog, _(" yes!\n")); +- gdb_printf (gdb_stdlog, _(" no, build-id does not match.\n")); ++ gdb_printf (gdb_stdlog, _(" yes!\n")); + } + else + { @@ -646,7 +647,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c } - if (separate_debug_file_debug) -- fprintf_unfiltered (gdb_stdlog, _(" yes!\n")); +- gdb_printf (gdb_stdlog, _(" yes!\n")); + if (link_return != NULL) + { + if (ret_bfd != NULL) @@ -664,7 +665,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c } /* Common code for finding BFDs of a given build-id. This function -@@ -131,7 +634,7 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len, +@@ -138,7 +641,7 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len, static gdb_bfd_ref_ptr build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, @@ -673,7 +674,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c { /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will cause "/.build-id/..." lookups. */ -@@ -154,16 +657,17 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, +@@ -161,16 +664,17 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, if (size > 0) { size--; @@ -694,7 +695,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c if (debug_bfd != NULL) return debug_bfd; -@@ -174,7 +678,7 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, +@@ -181,7 +685,7 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, if (!gdb_sysroot.empty ()) { link = gdb_sysroot + link; @@ -703,7 +704,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c if (debug_bfd != NULL) return debug_bfd; } -@@ -183,30 +687,649 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, +@@ -190,31 +694,663 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id, return {}; } @@ -721,6 +722,8 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + return result; +} + ++void debug_flush_missing (void); ++ +#ifdef HAVE_LIBRPM + +#include @@ -1094,20 +1097,26 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + debug_flush_missing -> missing_rpm_list_print ... + + For this reason, we make sure MISSING_RPM_LIST_ENTRIES is zero -+ *before* calling any print function. */ ++ *before* calling any print function. ++ ++ Note: kevinb/2023-02-22: The code below used to call ++ puts_unfiltered() and printf_unfiltered(), but calls to these ++ functions have been replaced by calls to gdb_printf(). The call ++ chain shown above (probably) used to be the case at one time and ++ hopefully something similar is still the case now that ++ gdb_printf() is being used instead. */ + missing_rpm_list_entries = 0; + -+ printf_unfiltered (_("Missing separate debuginfos, use: %s"), ++ gdb_printf (_("Missing separate debuginfos, use: %s"), +#ifdef DNF_DEBUGINFO_INSTALL + "dnf " +#endif + "debuginfo-install"); + for (const char *el : array) + { -+ puts_unfiltered (" "); -+ puts_unfiltered (el); ++ gdb_printf (" %s", el); + } -+ puts_unfiltered ("\n"); ++ gdb_printf ("\n"); + + while (missing_rpm_list != NULL) + { @@ -1214,7 +1223,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c +} + +static void -+debug_print_executable_changed (void) ++debug_print_executable_changed (struct program_space *pspace, bool reload_p) +{ +#ifdef HAVE_LIBRPM + missing_rpm_change (); @@ -1306,16 +1315,21 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c + /* We do not collect and flush these messages as each such message + already requires its own separate lines. */ + -+ fprintf_unfiltered (gdb_stdlog, -+ _("Missing separate debuginfo for %s\n"), binary); -+ if (debug != NULL) -+ fprintf_unfiltered (gdb_stdlog, _("Try: %s %s\n"), ++ gdb_printf (gdb_stdlog, ++ _("Missing separate debuginfo for %s.\n"), binary); ++ if (debug != NULL) ++ { ++ if (access (debug, F_OK) == 0) { ++ gdb_printf (gdb_stdlog, _("Try: %s %s\n"), +#ifdef DNF_DEBUGINFO_INSTALL -+ "dnf" ++ "dnf" +#else -+ "yum" ++ "yum" +#endif -+ " --enablerepo='*debug*' install", debug); ++ " --enablerepo='*debug*' install", debug); ++ } else ++ gdb_printf (gdb_stdlog, _("The debuginfo package for this file is probably broken.\n")); ++ } + } +} + @@ -1345,23 +1359,24 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c /* See build-id.h. */ std::string --find_separate_debug_file_by_buildid (struct objfile *objfile) -+find_separate_debug_file_by_buildid (struct objfile *objfile, -+ gdb::unique_xmalloc_ptr *build_id_filename_return) + find_separate_debug_file_by_buildid (struct objfile *objfile, +- deferred_warnings *warnings) ++ deferred_warnings *warnings, ++ gdb::unique_xmalloc_ptr *build_id_filename_return) { const struct bfd_build_id *build_id; -- build_id = build_id_bfd_get (objfile->obfd); +- build_id = build_id_bfd_get (objfile->obfd.get ()); + if (build_id_filename_return) + *build_id_filename_return = NULL; + -+ build_id = build_id_bfd_shdr_get (objfile->obfd); ++ build_id = build_id_bfd_shdr_get (objfile->obfd.get ()); if (build_id != NULL) { if (separate_debug_file_debug) -@@ -214,8 +1337,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile) - _("\nLooking for separate debug info (build-id) for " - "%s\n"), objfile_name (objfile)); +@@ -222,8 +1358,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile, + _("\nLooking for separate debug info (build-id) for " + "%s\n"), objfile_name (objfile)); + char *build_id_filename_cstr = NULL; gdb_bfd_ref_ptr abfd (build_id_to_debug_bfd (build_id->size, @@ -1382,7 +1397,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c /* Prevent looping on a stripped .debug file. */ if (abfd != NULL && filename_cmp (bfd_get_filename (abfd.get ()), -@@ -228,3 +1364,22 @@ find_separate_debug_file_by_buildid (struct objfile *objfile) +@@ -243,3 +1392,22 @@ find_separate_debug_file_by_buildid (struct objfile *objfile, return std::string (); } @@ -1421,7 +1436,7 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h /* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value. Otherwise, issue a warning and return false. */ -@@ -38,21 +39,26 @@ extern int build_id_verify (bfd *abfd, +@@ -38,14 +39,19 @@ extern int build_id_verify (bfd *abfd, can be found, return NULL. */ extern gdb_bfd_ref_ptr build_id_to_debug_bfd (size_t build_id_len, @@ -1443,35 +1458,35 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h /* Find the separate debug file for OBJFILE, by using the build-id associated with OBJFILE's BFD. If successful, returns the file name for the - separate debug file, otherwise, return an empty string. */ +@@ -58,7 +64,8 @@ extern gdb_bfd_ref_ptr build_id_to_exec_bfd (size_t build_id_len, + will be printed. */ --extern std::string find_separate_debug_file_by_buildid -- (struct objfile *objfile); -+extern std::string find_separate_debug_file_by_buildid (struct objfile *objfile, -+ gdb::unique_xmalloc_ptr *build_id_filename_return); + extern std::string find_separate_debug_file_by_buildid +- (struct objfile *objfile, deferred_warnings *warnings); ++ (struct objfile *objfile, deferred_warnings *warnings, ++ gdb::unique_xmalloc_ptr *build_id_filename_return); /* Return an hex-string representation of BUILD_ID. */ diff --git a/gdb/coffread.c b/gdb/coffread.c --- a/gdb/coffread.c +++ b/gdb/coffread.c -@@ -710,7 +710,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) - /* Try to add separate debug file if no symbols table found. */ - if (!objfile->has_partial_symbols ()) +@@ -729,7 +729,7 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) { -- std::string debugfile = find_separate_debug_file_by_buildid (objfile); -+ std::string debugfile = find_separate_debug_file_by_buildid (objfile, -+ NULL); + deferred_warnings warnings; + std::string debugfile +- = find_separate_debug_file_by_buildid (objfile, &warnings); ++ = find_separate_debug_file_by_buildid (objfile, &warnings, NULL); if (debugfile.empty ()) - debugfile = find_separate_debug_file_by_debuglink (objfile); + debugfile diff --git a/gdb/corelow.c b/gdb/corelow.c --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -22,6 +22,10 @@ #include #include - #include "frame.h" /* required by inferior.h */ + #include "frame.h" +#include "auxv.h" +#include "build-id.h" +#include "elf/common.h" @@ -1479,7 +1494,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c #include "inferior.h" #include "infrun.h" #include "symtab.h" -@@ -356,6 +360,8 @@ add_to_thread_list (asection *asect, asection *reg_sect) +@@ -380,6 +384,8 @@ add_to_thread_list (asection *asect, asection *reg_sect, inferior *inf) switch_to_thread (thr); /* Yes, make it current. */ } @@ -1488,7 +1503,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c /* Issue a message saying we have no core to debug, if FROM_TTY. */ static void -@@ -392,19 +398,26 @@ core_file_command (const char *filename, int from_tty) +@@ -563,12 +569,14 @@ rename_vmcore_idle_reg_sections (bfd *abfd, inferior *inf) static void locate_exec_from_corefile_build_id (bfd *abfd, int from_tty) { @@ -1503,8 +1518,9 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c + = build_id_to_exec_bfd (build_id->size, build_id->data, + &build_id_filename); - if (execbfd != nullptr) + if (execbfd == nullptr) { +@@ -596,7 +604,12 @@ locate_exec_from_corefile_build_id (bfd *abfd, int from_tty) exec_file_attach (bfd_get_filename (execbfd.get ()), from_tty); symbol_file_add_main (bfd_get_filename (execbfd.get ()), symfile_add_flag (from_tty ? SYMFILE_VERBOSE : 0)); @@ -1517,7 +1533,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c } /* See gdbcore.h. */ -@@ -1209,4 +1222,11 @@ _initialize_corelow () +@@ -1506,4 +1519,11 @@ _initialize_corelow () maintenance_print_core_file_backed_mappings, _("Print core file's file-backed mappings."), &maintenanceprintlist); @@ -1532,7 +1548,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo -@@ -21524,6 +21524,27 @@ information files. +@@ -22296,6 +22296,27 @@ information files. @end table @@ -1563,16 +1579,16 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c --- a/gdb/dwarf2/index-cache.c +++ b/gdb/dwarf2/index-cache.c -@@ -97,7 +97,7 @@ index_cache::store (dwarf2_per_objfile *per_objfile) +@@ -96,7 +96,7 @@ index_cache_store_context::index_cache_store_context (const index_cache &ic, return; /* Get build id of objfile. */ -- const bfd_build_id *build_id = build_id_bfd_get (obj->obfd); -+ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd); +- const bfd_build_id *build_id = build_id_bfd_get (per_bfd->obfd); ++ const bfd_build_id *build_id = build_id_bfd_shdr_get (per_bfd->obfd); if (build_id == nullptr) { index_cache_debug ("objfile %s has no build id", -@@ -114,7 +114,8 @@ index_cache::store (dwarf2_per_objfile *per_objfile) +@@ -111,7 +111,8 @@ index_cache_store_context::index_cache_store_context (const index_cache &ic, if (dwz != nullptr) { @@ -1585,16 +1601,16 @@ diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c -@@ -5476,7 +5476,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner) +@@ -3355,7 +3355,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner) static gdb::array_view get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd) { -- const bfd_build_id *build_id = build_id_bfd_get (obj->obfd); -+ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd); +- const bfd_build_id *build_id = build_id_bfd_get (obj->obfd.get ()); ++ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd.get ()); if (build_id == nullptr) return {}; -@@ -5489,7 +5489,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd) +@@ -3368,7 +3368,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd) static gdb::array_view get_gdb_index_contents_from_cache_dwz (objfile *obj, dwz_file *dwz) { @@ -1606,41 +1622,43 @@ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c diff --git a/gdb/elfread.c b/gdb/elfread.c --- a/gdb/elfread.c +++ b/gdb/elfread.c -@@ -1270,7 +1270,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) - && objfile->separate_debug_objfile == NULL - && objfile->separate_debug_objfile_backlink == NULL) +@@ -1220,8 +1220,10 @@ elf_symfile_read_dwarf2 (struct objfile *objfile, { -- std::string debugfile = find_separate_debug_file_by_buildid (objfile); + deferred_warnings warnings; + + gdb::unique_xmalloc_ptr build_id_filename; -+ std::string debugfile -+ = find_separate_debug_file_by_buildid (objfile, &build_id_filename); + std::string debugfile +- = find_separate_debug_file_by_buildid (objfile, &warnings); ++ = find_separate_debug_file_by_buildid (objfile, &warnings, ++ &build_id_filename); if (debugfile.empty ()) - debugfile = find_separate_debug_file_by_debuglink (objfile); -@@ -1285,7 +1287,7 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) - else + debugfile = find_separate_debug_file_by_debuglink (objfile, &warnings); +@@ -1239,7 +1241,7 @@ elf_symfile_read_dwarf2 (struct objfile *objfile, { has_dwarf2 = false; -- const struct bfd_build_id *build_id = build_id_bfd_get (objfile->obfd); -+ const struct bfd_build_id *build_id = build_id_bfd_shdr_get (objfile->obfd); + const struct bfd_build_id *build_id +- = build_id_bfd_get (objfile->obfd.get ()); ++ = build_id_bfd_shdr_get (objfile->obfd.get ()); + const char *filename = bfd_get_filename (objfile->obfd.get ()); if (build_id != nullptr) - { -@@ -1310,6 +1312,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) +@@ -1265,6 +1267,11 @@ elf_symfile_read_dwarf2 (struct objfile *objfile, has_dwarf2 = true; } } + /* Check if any separate debug info has been extracted out. */ -+ else if (bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink") ++ else if (bfd_get_section_by_name (objfile->obfd.get (), ++ ".gnu_debuglink") + != NULL) + debug_print_missing (objfile_name (objfile), build_id_filename.get ()); } } - } + /* If all the methods to collect the debuginfo failed, print the diff --git a/gdb/exec.c b/gdb/exec.c --- a/gdb/exec.c +++ b/gdb/exec.c -@@ -238,7 +238,7 @@ validate_exec_file (int from_tty) +@@ -237,7 +237,7 @@ validate_exec_file (int from_tty) current_exec_file = get_exec_file (0); const bfd_build_id *exec_file_build_id @@ -1649,7 +1667,7 @@ diff --git a/gdb/exec.c b/gdb/exec.c if (exec_file_build_id != nullptr) { /* Prepend the target prefix, to force gdb_bfd_open to open the -@@ -251,7 +251,7 @@ validate_exec_file (int from_tty) +@@ -250,7 +250,7 @@ validate_exec_file (int from_tty) if (abfd != nullptr) { const bfd_build_id *target_exec_file_build_id @@ -1661,8 +1679,8 @@ diff --git a/gdb/exec.c b/gdb/exec.c diff --git a/gdb/objfiles.h b/gdb/objfiles.h --- a/gdb/objfiles.h +++ b/gdb/objfiles.h -@@ -769,6 +769,10 @@ struct objfile - bool skip_jit_symbol_lookup = false; +@@ -884,6 +884,10 @@ struct objfile + bool object_format_has_copy_relocs = false; }; +/* This file was loaded according to the BUILD_ID_CORE_LOADS rules. */ @@ -1675,36 +1693,36 @@ diff --git a/gdb/objfiles.h b/gdb/objfiles.h diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c --- a/gdb/python/py-objfile.c +++ b/gdb/python/py-objfile.c -@@ -132,7 +132,7 @@ objfpy_get_build_id (PyObject *self, void *closure) +@@ -158,7 +158,7 @@ objfpy_get_build_id (PyObject *self, void *closure) try { -- build_id = build_id_bfd_get (objfile->obfd); -+ build_id = build_id_bfd_shdr_get (objfile->obfd); +- build_id = build_id_bfd_get (objfile->obfd.get ()); ++ build_id = build_id_bfd_shdr_get (objfile->obfd.get ()); } catch (const gdb_exception &except) { -@@ -600,7 +600,7 @@ objfpy_lookup_objfile_by_build_id (const char *build_id) - /* Don't return separate debug files. */ - if (objfile->separate_debug_objfile_backlink != NULL) - continue; -- obfd_build_id = build_id_bfd_get (objfile->obfd); -+ obfd_build_id = build_id_bfd_shdr_get (objfile->obfd); - if (obfd_build_id == NULL) - continue; - if (objfpy_build_id_matches (obfd_build_id, build_id)) +@@ -629,7 +629,7 @@ gdbpy_lookup_objfile (PyObject *self, PyObject *args, PyObject *kw) + if (obfd == nullptr) + return 0; + +- const bfd_build_id *obfd_build_id = build_id_bfd_get (obfd); ++ const bfd_build_id *obfd_build_id = build_id_bfd_shdr_get (obfd); + if (obfd_build_id == nullptr) + return 0; + diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c -@@ -45,6 +45,7 @@ +@@ -44,6 +44,7 @@ #include "auxv.h" #include "gdb_bfd.h" #include "probe.h" +#include "build-id.h" - static struct link_map_offsets *svr4_fetch_link_map_offsets (void); - static int svr4_have_link_map_offsets (void); -@@ -1248,9 +1249,51 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, + #include + +@@ -1318,9 +1319,51 @@ svr4_read_so_list (svr4_info *info, CORE_ADDR lm, CORE_ADDR prev_lm, continue; } @@ -1762,19 +1780,19 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c diff --git a/gdb/source.c b/gdb/source.c --- a/gdb/source.c +++ b/gdb/source.c -@@ -1199,7 +1199,7 @@ open_source_file (struct symtab *s) - srcpath += s->filename; +@@ -1167,7 +1167,7 @@ open_source_file (struct symtab *s) } -- const struct bfd_build_id *build_id = build_id_bfd_get (ofp->obfd); -+ const struct bfd_build_id *build_id = build_id_bfd_shdr_get (ofp->obfd); + const struct bfd_build_id *build_id +- = build_id_bfd_get (ofp->obfd.get ()); ++ = build_id_bfd_shdr_get (ofp->obfd.get ()); /* Query debuginfod for the source file. */ if (build_id != nullptr && !srcpath.empty ()) diff --git a/gdb/symfile.h b/gdb/symfile.h --- a/gdb/symfile.h +++ b/gdb/symfile.h -@@ -332,12 +332,18 @@ bool expand_symtabs_matching +@@ -357,12 +357,18 @@ bool expand_symtabs_matching void map_symbol_filenames (gdb::function_view fun, bool need_fullname); @@ -1796,7 +1814,7 @@ diff --git a/gdb/symfile.h b/gdb/symfile.h diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp --- a/gdb/testsuite/gdb.base/corefile.exp +++ b/gdb/testsuite/gdb.base/corefile.exp -@@ -343,3 +343,33 @@ gdb_test_multiple "core-file $corefile" $test { +@@ -347,3 +347,33 @@ gdb_test_multiple "core-file $corefile" $test { pass $test } } @@ -1833,7 +1851,7 @@ diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefi diff --git a/gdb/testsuite/gdb.base/gdbinit-history.exp b/gdb/testsuite/gdb.base/gdbinit-history.exp --- a/gdb/testsuite/gdb.base/gdbinit-history.exp +++ b/gdb/testsuite/gdb.base/gdbinit-history.exp -@@ -185,7 +185,8 @@ proc test_empty_history_filename { } { +@@ -179,7 +179,8 @@ proc test_empty_history_filename { } { global env global gdb_prompt @@ -1857,17 +1875,17 @@ diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp -@@ -141,7 +141,8 @@ if ![info exists INTERNAL_GDBFLAGS] { +@@ -226,7 +226,8 @@ if ![info exists INTERNAL_GDBFLAGS] { "-nx" \ - "-data-directory $BUILD_DATA_DIRECTORY" \ + "-q" \ {-iex "set height 0"} \ - {-iex "set width 0"}]] + {-iex "set width 0"} \ + {-iex "set build-id-verbose 0"}]] - } - # The variable gdb_prompt is a regexp which matches the gdb prompt. -@@ -2200,6 +2201,17 @@ proc default_gdb_start { } { + # If DEBUGINFOD_URLS is set, gdb will try to download sources and + # debug info for f.i. system libraries. Prevent this. +@@ -2434,6 +2435,17 @@ proc default_gdb_start { } { } } @@ -1888,7 +1906,7 @@ diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp -@@ -322,6 +322,16 @@ proc default_mi_gdb_start { args } { +@@ -321,6 +321,16 @@ proc default_mi_gdb_start { { flags {} } } { warning "Couldn't set the width to 0." } } diff --git a/gdb-6.6-bz230000-power6-disassembly-test.patch b/gdb-6.6-bz230000-power6-disassembly-test.patch deleted file mode 100644 index 2b361476f7a7340964f9d30b312fd601607dcd71..0000000000000000000000000000000000000000 --- a/gdb-6.6-bz230000-power6-disassembly-test.patch +++ /dev/null @@ -1,94 +0,0 @@ -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-bz230000-power6-disassembly-test.patch - -;; Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). -;;=fedoratest - -https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000 - -The original testcase - https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=230000#c1 -requires too recent GCC. - -diff --git a/gdb/testsuite/gdb.arch/powerpc-power6.exp b/gdb/testsuite/gdb.arch/powerpc-power6.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/powerpc-power6.exp -@@ -0,0 +1,54 @@ -+# Copyright 2007 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. -+ -+# Test PowerPC Power6 instructions disassembly. -+ -+if {![istarget "powerpc*-*-*"]} then { -+ verbose "Skipping PowerPC Power6 instructions disassembly." -+ return -+} -+ -+set testfile "powerpc-power6" -+set srcfile ${testfile}.s -+set objfile [standard_output_file ${testfile}.o] -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } { -+ untested "PowerPC prologue tests" -+ return -1 -+} -+ -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${objfile} -+ -+# Disassemble the function. -+ -+gdb_test "disass func" ":\tblr\r\n.*" "Basic disassembly" -+ -+gdb_test "disass func" ":\tdcbzl *r8,r9\r\n.*" "Power5 disassembly dcbzl" -+gdb_test "disass func" ":\tfrsqrtes *f10,f11\r\n.*" "Power5 disassembly frsqrtes" -+gdb_test "disass func" ":\tdadd *f1,f2,f1\r\n.*" "Power6 disassembly dadd" -+gdb_test "disass func" ":\tdaddq *f0,f2,f0\r\n.*" "Power6 disassembly daddq" -+gdb_test "disass func" ":\tdsub *f1,f2,f1\r\n.*" "Power6 disassembly dsub" -+gdb_test "disass func" ":\tdsubq *f0,f2,f0\r\n.*" "Power6 disassembly dsubq" -+gdb_test "disass func" ":\tdmul *f1,f2,f1\r\n.*" "Power6 disassembly dmul" -+gdb_test "disass func" ":\tdmulq *f0,f2,f0\r\n.*" "Power6 disassembly dmulq" -+gdb_test "disass func" ":\tddiv *f1,f2,f1\r\n.*" "Power6 disassembly ddiv" -+gdb_test "disass func" ":\tddivq *f0,f2,f0\r\n.*" "Power6 disassembly ddivq" -+gdb_test "disass func" ":\tdcmpu *cr1,f2,f1\r\n.*" "Power6 disassembly dcmpu" -+gdb_test "disass func" ":\tdcmpuq *cr1,f2,f0\r\n.*" "Power6 disassembly dcmpuq" -diff --git a/gdb/testsuite/gdb.arch/powerpc-power6.s b/gdb/testsuite/gdb.arch/powerpc-power6.s -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/powerpc-power6.s -@@ -0,0 +1,16 @@ -+ .text -+ .globl func -+func: -+ blr -+ .long 0x7c284fec /* dcbzl r8,r9 */ -+ .long 0xed405834 /* frsqrtes f10,f11 */ -+ .long 0xec220804 /* dadd f1,f2,f1 */ -+ .long 0xfc020004 /* daddq f0,f2,f0 */ -+ .long 0xec220c04 /* dsub f1,f2,f1 */ -+ .long 0xfc020404 /* dsubq f0,f2,f0 */ -+ .long 0xec220844 /* dmul f1,f2,f1 */ -+ .long 0xfc020044 /* dmulq f0,f2,f0 */ -+ .long 0xec220c44 /* ddiv f1,f2,f1 */ -+ .long 0xfc020444 /* ddivq f0,f2,f0 */ -+ .long 0xec820d04 /* dcmpu cr1,f2,f1 */ -+ .long 0xfc820504 /* dcmpuq cr1,f2,f0 */ diff --git a/gdb-6.6-testsuite-timeouts.patch b/gdb-6.6-testsuite-timeouts.patch index a89631335b84631a82669e584899215a833e4213..9a31a5b7d92cd16ea842ba6677f3e493f9c7bce0 100644 --- a/gdb-6.6-testsuite-timeouts.patch +++ b/gdb-6.6-testsuite-timeouts.patch @@ -9,7 +9,7 @@ Subject: gdb-6.6-testsuite-timeouts.patch diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp --- a/gdb/testsuite/gdb.base/annota1.exp +++ b/gdb/testsuite/gdb.base/annota1.exp -@@ -39,6 +39,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb +@@ -37,6 +37,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb clean_restart ${binfile} @@ -21,7 +21,7 @@ diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1 diff --git a/gdb/testsuite/gdb.base/annota3.exp b/gdb/testsuite/gdb.base/annota3.exp --- a/gdb/testsuite/gdb.base/annota3.exp +++ b/gdb/testsuite/gdb.base/annota3.exp -@@ -38,6 +38,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb +@@ -36,6 +36,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb clean_restart ${binfile} diff --git a/gdb-6.7-charsign-test.patch b/gdb-6.7-charsign-test.patch deleted file mode 100644 index 1a663900e7101b00df8ca75d0c90223732ddc226..0000000000000000000000000000000000000000 --- a/gdb-6.7-charsign-test.patch +++ /dev/null @@ -1,130 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.7-charsign-test.patch - -;; Fix displaying of numeric char arrays as strings (BZ 224128). -;;=fedoratest: But it is failing anyway, one should check the behavior more. - -https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224128 - -2007-01-25 Jan Kratochvil - - * gdb.base/charsign.exp, gdb.base/charsign.c: New files. - [ stripped ] - -2007-10-19 Jan Kratochvil - - Port to GDB-6.7 - only the testcase left, patch has been reverted, - char-vectors restricted. - -diff --git a/gdb/testsuite/gdb.base/charsign.c b/gdb/testsuite/gdb.base/charsign.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/charsign.c -@@ -0,0 +1,37 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2007 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() -+{ -+ return 0; -+} -+ -+char n[]="A"; -+signed char s[]="A"; -+unsigned char u[]="A"; -+ -+typedef char char_n; -+typedef signed char char_s; -+typedef unsigned char char_u; -+ -+char_n n_typed[]="A"; -+char_s s_typed[]="A"; -+char_u u_typed[]="A"; -diff --git a/gdb/testsuite/gdb.base/charsign.exp b/gdb/testsuite/gdb.base/charsign.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/charsign.exp -@@ -0,0 +1,63 @@ -+# Copyright 2007 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. -+ -+set testfile charsign -+set srcfile ${testfile}.c -+set binfile [standard_output_file ${testfile}] -+ -+proc do_test { cflags } { -+ global srcdir -+ global binfile -+ global subdir -+ global srcfile -+ global gdb_prompt -+ -+ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug additional_flags=$cflags]] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+ } -+ -+ # Get things started. -+ -+ gdb_exit -+ gdb_start -+ gdb_reinitialize_dir $srcdir/$subdir -+ gdb_load ${binfile} -+ -+ # For C programs, "start" should stop in main(). -+ -+ gdb_test "p n" \ -+ "= \"A\"" -+ gdb_test "p s" \ -+ "= \\{65 'A', 0 '\\\\0'\\}" -+ gdb_test "p u" \ -+ "= \\{65 'A', 0 '\\\\0'\\}" -+ gdb_test "p n_typed" \ -+ "= \"A\"" -+ gdb_test "p s_typed" \ -+ "= \\{65 'A', 0 '\\\\0'\\}" -+ gdb_test "p u_typed" \ -+ "= \\{65 'A', 0 '\\\\0'\\}" -+} -+ -+# The string identification works despite the compiler flags below due to -+# gdbtypes.c: -+# if (name && strcmp (name, "char") == 0) -+# TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN; -+ -+do_test {} -+do_test {-fsigned-char} -+do_test {-funsigned-char} diff --git a/gdb-6.7-testsuite-stable-results.patch b/gdb-6.7-testsuite-stable-results.patch deleted file mode 100644 index 0eca1a740be05885051dd1591568f32458558ea7..0000000000000000000000000000000000000000 --- a/gdb-6.7-testsuite-stable-results.patch +++ /dev/null @@ -1,104 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Fri, 27 Oct 2017 21:07:50 +0200 -Subject: gdb-6.7-testsuite-stable-results.patch - -;; Testsuite fixes for more stable/comparable results. -;;=fedoratest - -gdb/testsuite/gdb.base/fileio.c: -gdb/testsuite/gdb.base/fileio.exp: -2007-12-08 Jan Kratochvil - - * gdb.base/fileio.c (ROOTSUBDIR): New macro. - (main): CHDIR into ROOTSUBDIR. CHOWN ROOTSUBDIR and CHDIR into - ROOTSUBDIR if we are being run as root. - * gdb.base/fileio.exp: Change the startup and finish cleanup. - Change the test file reference to be into the `fileio.dir' directory. - -sources/gdb/testsuite/gdb.base/dump.exp: -Found on RHEL-5.s390x. - -gdb-6.8.50.20090209/gdb/testsuite/gdb.base/auxv.exp: -random FAIL: gdb.base/auxv.exp: matching auxv data from live and gcore - -gdb-6.8.50.20090209/gdb/testsuite/gdb.base/annota1.exp: -frames-invalid can happen asynchronously. - -diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c ---- a/gdb/testsuite/gdb.base/fileio.c -+++ b/gdb/testsuite/gdb.base/fileio.c -@@ -559,6 +559,28 @@ strerrno (int err) - int - main () - { -+ /* These tests -+ Open for write but no write permission returns EACCES -+ Unlinking a file in a directory w/o write access returns EACCES -+ fail if we are being run as root - drop the privileges here. */ -+ -+ if (geteuid () == 0) -+ { -+ uid_t uid = 99; -+ -+ if (chown (OUTDIR, uid, uid) != 0) -+ { -+ printf ("chown %d.%d %s: %s\n", (int) uid, (int) uid, -+ OUTDIR, strerror (errno)); -+ exit (1); -+ } -+ if (setuid (uid) || geteuid () == 0) -+ { -+ printf ("setuid %d: %s\n", (int) uid, strerror (errno)); -+ exit (1); -+ } -+ } -+ - /* Don't change the order of the calls. They partly depend on each other */ - test_open (); - test_write (); -diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.exp ---- a/gdb/testsuite/gdb.base/fileio.exp -+++ b/gdb/testsuite/gdb.base/fileio.exp -@@ -24,9 +24,9 @@ if [target_info exists gdb,nofileio] { - standard_testfile - - if {[is_remote host]} { -- set outdir . -+ set outdir "fileio.dir" - } else { -- set outdir [standard_output_file {}] -+ set outdir [standard_output_file "fileio.dir"] - } - - if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ -@@ -47,7 +47,8 @@ set dir2 [standard_output_file dir2.fileio.test] - if {[file exists $dir2] && ![file writable $dir2]} { - system "chmod +w $dir2" - } --system "rm -rf [standard_output_file *.fileio.test]" -+system "rm -rf [standard_output_file fileio.dir]" -+system "mkdir -m777 [standard_output_file fileio.dir]" - - set oldtimeout $timeout - set timeout [expr "$timeout + 60"] -@@ -89,7 +90,7 @@ gdb_test continue \ - - gdb_test "continue" ".*" "" - --catch "system \"chmod -f -w [standard_output_file nowrt.fileio.test]\"" -+catch "system \"chmod -f -w [standard_output_file fileio.dir/nowrt.fileio.test]\"" - - gdb_test continue \ - "Continuing\\..*open 5:.*EACCES$stop_msg" \ -@@ -276,9 +277,7 @@ gdb_test continue \ - gdb_exit - - # Make dir2 writable again so rm -rf of a build tree Just Works. --if {[file exists $dir2] && ![file writable $dir2]} { -- system "chmod +w $dir2" --} -+system "chmod -R +w $outdir" - - set timeout $oldtimeout - return 0 diff --git a/gdb-6.8-bz442765-threaded-exec-test.patch b/gdb-6.8-bz442765-threaded-exec-test.patch deleted file mode 100644 index 90685c7dfbcba8ce5e3a247f1d1ba781f05d707f..0000000000000000000000000000000000000000 --- a/gdb-6.8-bz442765-threaded-exec-test.patch +++ /dev/null @@ -1,181 +0,0 @@ -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.8-bz442765-threaded-exec-test.patch - -;; Test various forms of threads tracking across exec() (BZ 442765). -;;=fedoratest - -Test various forms of threads tracking across exec(2). - -diff --git a/gdb/testsuite/gdb.threads/threaded-exec.c b/gdb/testsuite/gdb.threads/threaded-exec.c ---- a/gdb/testsuite/gdb.threads/threaded-exec.c -+++ b/gdb/testsuite/gdb.threads/threaded-exec.c -@@ -18,21 +18,95 @@ - Boston, MA 02111-1307, USA. */ - - #include --#include - #include - #include - #include -+#include - -+#ifdef THREADS -+ -+# include - - static void * - threader (void *arg) - { -- return NULL; -+ return NULL; - } - -+#endif -+ - int --main (void) -+main (int argc, char **argv) - { -+ char *exec_nothreads, *exec_threads, *cmd; -+ int phase; -+ char phase_s[8]; -+ -+ setbuf (stdout, NULL); -+ -+ if (argc != 4) -+ { -+ fprintf (stderr, "%s \n", argv[0]); -+ return 1; -+ } -+ -+#ifdef THREADS -+ puts ("THREADS: Y"); -+#else -+ puts ("THREADS: N"); -+#endif -+ exec_nothreads = argv[1]; -+ printf ("exec_nothreads: %s\n", exec_nothreads); -+ exec_threads = argv[2]; -+ printf ("exec_threads: %s\n", exec_threads); -+ phase = atoi (argv[3]); -+ printf ("phase: %d\n", phase); -+ -+ /* Phases: threading -+ 0: N -> N -+ 1: N -> Y -+ 2: Y -> Y -+ 3: Y -> N -+ 4: N -> exit */ -+ -+ cmd = NULL; -+ -+#ifndef THREADS -+ switch (phase) -+ { -+ case 0: -+ cmd = exec_nothreads; -+ break; -+ case 1: -+ cmd = exec_threads; -+ break; -+ case 2: -+ fprintf (stderr, "%s: We should have threads for phase %d!\n", argv[0], -+ phase); -+ return 1; -+ case 3: -+ fprintf (stderr, "%s: We should have threads for phase %d!\n", argv[0], -+ phase); -+ return 1; -+ case 4: -+ return 0; -+ default: -+ assert (0); -+ } -+#else /* THREADS */ -+ switch (phase) -+ { -+ case 0: -+ fprintf (stderr, "%s: We should not have threads for phase %d!\n", -+ argv[0], phase); -+ return 1; -+ case 1: -+ fprintf (stderr, "%s: We should not have threads for phase %d!\n", -+ argv[0], phase); -+ return 1; -+ case 2: -+ cmd = exec_threads; -+ { - pthread_t t1; - int i; - -@@ -40,7 +114,34 @@ main (void) - assert (i == 0); - i = pthread_join (t1, NULL); - assert (i == 0); -+ } -+ break; -+ case 3: -+ cmd = exec_nothreads; -+ { -+ pthread_t t1; -+ int i; -+ -+ i = pthread_create (&t1, NULL, threader, (void *) NULL); -+ assert (i == 0); -+ i = pthread_join (t1, NULL); -+ assert (i == 0); -+ } -+ break; -+ case 4: -+ fprintf (stderr, "%s: We should not have threads for phase %d!\n", -+ argv[0], phase); -+ return 1; -+ default: -+ assert (0); -+ } -+#endif /* THREADS */ -+ -+ assert (cmd != NULL); -+ -+ phase++; -+ snprintf (phase_s, sizeof phase_s, "%d", phase); - -- execl ("/bin/true", "/bin/true", NULL); -- abort (); -+ execl (cmd, cmd, exec_nothreads, exec_threads, phase_s, NULL); -+ assert (0); - } -diff --git a/gdb/testsuite/gdb.threads/threaded-exec.exp b/gdb/testsuite/gdb.threads/threaded-exec.exp ---- a/gdb/testsuite/gdb.threads/threaded-exec.exp -+++ b/gdb/testsuite/gdb.threads/threaded-exec.exp -@@ -20,9 +20,14 @@ - - set testfile threaded-exec - set srcfile ${testfile}.c --set binfile [standard_output_file ${testfile}] -+set binfile_nothreads [standard_output_file ${testfile}N] -+set binfile_threads [standard_output_file ${testfile}Y] - --if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable []] != "" } { -+if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile_nothreads}" executable {additional_flags=-UTHREADS}] != "" } { -+ return -1 -+} -+ -+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile_threads}" executable {additional_flags=-DTHREADS}] != "" } { - return -1 - } - -@@ -30,9 +35,9 @@ gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - --gdb_load ${binfile} -+gdb_load ${binfile_nothreads} - --gdb_run_cmd -+gdb_run_cmd [list ${binfile_nothreads} ${binfile_threads} 0] - - gdb_test_multiple {} "Program exited" { - -re "\r\n\\\[Inferior .* exited normally\\\]\r\n$gdb_prompt $" { diff --git a/gdb-Handle-Python-3.11-deprecation-of-PySys_SetPath-and-.patch b/gdb-Handle-Python-3.11-deprecation-of-PySys_SetPath-and-.patch deleted file mode 100644 index 11f4a8a3dd968e48b9237eb9f4b2f6eb02f84ca3..0000000000000000000000000000000000000000 --- a/gdb-Handle-Python-3.11-deprecation-of-PySys_SetPath-and-.patch +++ /dev/null @@ -1,256 +0,0 @@ -From eb6d8345fb21aa4eba9b02289645f3265c02175b Mon Sep 17 00:00:00 2001 -From: Kevin Buettner -Date: Thu, 30 Jun 2022 15:40:29 -0700 -Subject: [PATCH] Handle Python 3.11 deprecation of PySys_SetPath and - Py_SetProgramName - -Python 3.11 deprecates PySys_SetPath and Py_SetProgramName. The -PyConfig API replaces these and other functions. This commit uses the -PyConfig API to provide equivalent functionality while also preserving -support for older versions of Python, i.e. those before Python 3.8. - -A beta version of Python 3.11 is available in Fedora Rawhide. Both -Fedora 35 and Fedora 36 use Python 3.10, while Fedora 34 still used -Python 3.9. I've tested these changes on Fedora 34, Fedora 36, and -rawhide, though complete testing was not possible on rawhide due to -a kernel bug. That being the case, I decided to enable the newer -PyConfig API by testing PY_VERSION_HEX against 0x030a0000. This -corresponds to Python 3.10. - -We could try to use the PyConfig API for Python versions as early as 3.8, -but I'm reluctant to do this as there may have been PyConfig related -bugs in earlier versions which have since been fixed. Recent linux -distributions should have support for Python 3.10. This should be -more than adequate for testing the new Python initialization code in -GDB. - -Information about the PyConfig API as well as the motivation behind -deprecating the old interface can be found at these links: - -https://github.com/python/cpython/issues/88279 -https://peps.python.org/pep-0587/ -https://docs.python.org/3.11/c-api/init_config.html - -The v2 commit also addresses several problems that Simon found in -the v1 version. - -In v1, I had used Py_DontWriteBytecodeFlag in the new initialization -code, but Simon pointed out that this global configuration variable -will be deprecated in Python 3.12. This version of the patch no longer -uses Py_DontWriteBytecodeFlag in the new initialization code. -Additionally, both Py_DontWriteBytecodeFlag and Py_IgnoreEnvironmentFlag -will no longer be used when building GDB against Python 3.10 or higher. -While it's true that both of these global configuration variables are -deprecated in Python 3.12, it makes sense to disable their use for -gdb builds against 3.10 and higher since those are the versions for -which the PyConfig API is now being used by GDB. (The PyConfig API -includes different mechanisms for making the same settings afforded -by use of the soon-to-be deprecated global configuration variables.) - -Simon also noted that PyConfig_Clear() would not have be called for -one of the failure paths. I've fixed that problem and also made the -rest of the "bail out" code more direct. In particular, -PyConfig_Clear() will always be called, both for success and failure. - -The v3 patch addresses some rebase conflicts related to module -initialization . Commit 3acd9a692dd ("Make 'import gdb.events' work") -uses PyImport_ExtendInittab instead of PyImport_AppendInittab. That -commit also initializes a struct for each module to import. Both the -initialization and the call to were moved ahead of the ifdefs to avoid -having to replicate (at least some of) the code three times in various -portions of the ifdefs. - -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28668 -Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29287 ---- - gdb/python/python-internal.h | 5 ++ - gdb/python/python.c | 99 +++++++++++++++++++++++++++++------- - 2 files changed, 86 insertions(+), 18 deletions(-) - -diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h -index 84f45ca..70808c9 100644 ---- a/gdb/python/python-internal.h -+++ b/gdb/python/python-internal.h -@@ -199,6 +199,10 @@ gdb_PySys_GetObject (const char *name) - - #define PySys_GetObject gdb_PySys_GetObject - -+/* PySys_SetPath was deprecated in Python 3.11. Disable the deprecated -+ code for Python 3.10 and newer. */ -+#if PY_VERSION_HEX < 0x030a0000 -+ - /* PySys_SetPath's 'path' parameter was missing the 'const' qualifier - before Python 3.6. Hence, we wrap it in a function to avoid errors - when compiled with -Werror. */ -@@ -212,6 +216,7 @@ gdb_PySys_SetPath (const GDB_PYSYS_SETPATH_CHAR *path) - } - - #define PySys_SetPath gdb_PySys_SetPath -+#endif - - /* Wrap PyGetSetDef to allow convenient construction with string - literals. Unfortunately, PyGetSetDef's 'name' and 'doc' members -diff --git a/gdb/python/python.c b/gdb/python/python.c -index e3f2550..97f421d 100644 ---- a/gdb/python/python.c -+++ b/gdb/python/python.c -@@ -1709,8 +1709,14 @@ set_python_ignore_environment (const char *args, int from_tty, - struct cmd_list_element *c) - { - #ifdef HAVE_PYTHON -+ /* Py_IgnoreEnvironmentFlag is deprecated in Python 3.12. Disable -+ its usage in Python 3.10 and above since the PyConfig mechanism -+ is now (also) used in 3.10 and higher. See do_start_initialization() -+ in this file. */ -+#if PY_VERSION_HEX < 0x030a0000 - Py_IgnoreEnvironmentFlag = python_ignore_environment ? 1 : 0; - #endif -+#endif - } - - /* When this is turned on before Python is initialised then Python will -@@ -1738,6 +1744,24 @@ show_python_dont_write_bytecode (struct ui_file *file, int from_tty, - value); - } - -+/* Return value to assign to PyConfig.write_bytecode or, when -+ negated (via !), Py_DontWriteBytecodeFlag. Py_DontWriteBytecodeFlag -+ is deprecated in Python 3.12. */ -+ -+static int -+python_write_bytecode () -+{ -+ int wbc = 0; -+ -+ if (python_dont_write_bytecode == AUTO_BOOLEAN_AUTO) -+ wbc = (!python_ignore_environment -+ && getenv ("PYTHONDONTWRITEBYTECODE") != nullptr) ? 0 : 1; -+ else -+ wbc = python_dont_write_bytecode == AUTO_BOOLEAN_TRUE ? 0 : 1; -+ -+ return wbc; -+} -+ - /* Implement 'set python dont-write-bytecode'. This sets Python's internal - flag no matter when the command is issued, however, if this is used - after Py_Initialize has been called then many modules could already -@@ -1748,13 +1772,13 @@ set_python_dont_write_bytecode (const char *args, int from_tty, - struct cmd_list_element *c) - { - #ifdef HAVE_PYTHON -- if (python_dont_write_bytecode == AUTO_BOOLEAN_AUTO) -- Py_DontWriteBytecodeFlag -- = (!python_ignore_environment -- && getenv ("PYTHONDONTWRITEBYTECODE") != nullptr) ? 1 : 0; -- else -- Py_DontWriteBytecodeFlag -- = python_dont_write_bytecode == AUTO_BOOLEAN_TRUE ? 1 : 0; -+ /* Py_DontWriteBytecodeFlag is deprecated in Python 3.12. Disable -+ its usage in Python 3.10 and above since the PyConfig mechanism -+ is now (also) used in 3.10 and higher. See do_start_initialization() -+ in this file. */ -+#if PY_VERSION_HEX < 0x030a0000 -+ Py_DontWriteBytecodeFlag = !python_write_bytecode (); -+#endif - #endif /* HAVE_PYTHON */ - } - -@@ -1856,6 +1880,18 @@ gdbpy_gdb_exiting (int exit_code) - static bool - do_start_initialization () - { -+ /* Define all internal modules. These are all imported (and thus -+ created) during initialization. */ -+ struct _inittab mods[] = -+ { -+ { "_gdb", init__gdb_module }, -+ { "_gdbevents", gdbpy_events_mod_func }, -+ { nullptr, nullptr } -+ }; -+ -+ if (PyImport_ExtendInittab (mods) < 0) -+ return false; -+ - #ifdef WITH_PYTHON_PATH - /* Work around problem where python gets confused about where it is, - and then can't find its libraries, etc. -@@ -1887,25 +1923,41 @@ do_start_initialization () - } - setlocale (LC_ALL, oldloc.c_str ()); - -+ /* Py_SetProgramName was deprecated in Python 3.11. Use PyConfig -+ mechanisms for Python 3.10 and newer. */ -+#if PY_VERSION_HEX < 0x030a0000 - /* Note that Py_SetProgramName expects the string it is passed to - remain alive for the duration of the program's execution, so - it is not freed after this call. */ - Py_SetProgramName (progname_copy); --#endif -+ Py_Initialize (); -+#else -+ PyConfig config; - -- /* Define all internal modules. These are all imported (and thus -- created) during initialization. */ -- struct _inittab mods[3] = -- { -- { "_gdb", init__gdb_module }, -- { "_gdbevents", gdbpy_events_mod_func }, -- { nullptr, nullptr } -- }; -+ PyConfig_InitPythonConfig (&config); -+ PyStatus status = PyConfig_SetString (&config, &config.program_name, -+ progname_copy); -+ if (PyStatus_Exception (status)) -+ goto init_done; - -- if (PyImport_ExtendInittab (mods) < 0) -- return false; -+ config.write_bytecode = python_write_bytecode (); -+ config.use_environment = !python_ignore_environment; - -+ status = PyConfig_Read (&config); -+ if (PyStatus_Exception (status)) -+ goto init_done; -+ -+ status = Py_InitializeFromConfig (&config); -+ -+init_done: -+ PyConfig_Clear (&config); -+ if (PyStatus_Exception (status)) -+ return false; -+#endif -+#else - Py_Initialize (); -+#endif -+ - #if PY_VERSION_HEX < 0x03090000 - /* PyEval_InitThreads became deprecated in Python 3.9 and will - be removed in Python 3.11. Prior to Python 3.7, this call was -@@ -2210,12 +2262,23 @@ do_initialize (const struct extension_language_defn *extlang) - - sys_path = PySys_GetObject ("path"); - -+ /* PySys_SetPath was deprecated in Python 3.11. Disable this -+ deprecated code for Python 3.10 and newer. Also note that this -+ ifdef eliminates potential initialization of sys.path via -+ PySys_SetPath. My (kevinb's) understanding of PEP 587 suggests -+ that it's not necessary due to module_search_paths being -+ initialized to an empty list following any of the PyConfig -+ initialization functions. If it does turn out that some kind of -+ initialization is still needed, it should be added to the -+ PyConfig-based initialization in do_start_initialize(). */ -+#if PY_VERSION_HEX < 0x030a0000 - /* If sys.path is not defined yet, define it first. */ - if (!(sys_path && PyList_Check (sys_path))) - { - PySys_SetPath (L""); - sys_path = PySys_GetObject ("path"); - } -+#endif - if (sys_path && PyList_Check (sys_path)) - { - gdbpy_ref<> pythondir (PyString_FromString (gdb_pythondir.c_str ())); --- -2.33.0 - diff --git a/gdb-Make-import-gdb.events-work.patch b/gdb-Make-import-gdb.events-work.patch deleted file mode 100644 index 15614dd8f9ee9227518a8b1fdab62e4a4e74a5ea..0000000000000000000000000000000000000000 --- a/gdb-Make-import-gdb.events-work.patch +++ /dev/null @@ -1,192 +0,0 @@ -From 139266420fbff31e3309235ac8e1836d19a065c7 Mon Sep 17 00:00:00 2001 -From: Tom Tromey -Date: Fri, 3 Jun 2022 07:59:49 -0600 -Subject: [PATCH] Make 'import gdb.events' work - -Pierre-Marie noticed that, while gdb.events is a Python module, it -can't be imported. This patch changes how this module is created, so -that it can be imported, while also ensuring that the module is always -visible, just as it was in the past. - -This new approach required one non-obvious change -- when running -gdb.base/warning.exp, where --data-directory is intentionally not -found, the event registries can now be nullptr. Consequently, this -patch probably also requires - - https://sourceware.org/pipermail/gdb-patches/2022-June/189796.html - -Note that this patch obsoletes - - https://sourceware.org/pipermail/gdb-patches/2022-June/189797.html ---- - gdb/python/lib/gdb/__init__.py | 5 +++++ - gdb/python/py-evtregistry.c | 4 +++- - gdb/python/py-evts.c | 28 ++++++++++++-------------- - gdb/python/python-internal.h | 4 ++-- - gdb/python/python.c | 16 +++++++++++---- - gdb/testsuite/gdb.python/py-events.exp | 2 ++ - 6 files changed, 37 insertions(+), 22 deletions(-) - -diff --git a/gdb/python/lib/gdb/__init__.py b/gdb/python/lib/gdb/__init__.py -index a52f6b4..17ee6a1 100644 ---- a/gdb/python/lib/gdb/__init__.py -+++ b/gdb/python/lib/gdb/__init__.py -@@ -27,6 +27,11 @@ else: - - from _gdb import * - -+# Historically, gdb.events was always available, so ensure it's -+# still available without an explicit import. -+import _gdbevents as events -+sys.modules['gdb.events'] = events -+ - - class _GdbFile(object): - # These two are needed in Python 3 -diff --git a/gdb/python/py-evtregistry.c b/gdb/python/py-evtregistry.c -index ef96c48..f3a7f0c 100644 ---- a/gdb/python/py-evtregistry.c -+++ b/gdb/python/py-evtregistry.c -@@ -118,7 +118,9 @@ gdbpy_initialize_eventregistry (void) - bool - evregpy_no_listeners_p (eventregistry_object *registry) - { -- return PyList_Size (registry->callbacks) == 0; -+ /* REGISTRY can be nullptr if gdb failed to find the data directory -+ at startup. */ -+ return registry == nullptr || PyList_Size (registry->callbacks) == 0; - } - - static PyMethodDef eventregistry_object_methods[] = -diff --git a/gdb/python/py-evts.c b/gdb/python/py-evts.c -index 23a5d75..ca9326a 100644 ---- a/gdb/python/py-evts.c -+++ b/gdb/python/py-evts.c -@@ -23,7 +23,7 @@ - static struct PyModuleDef EventModuleDef = - { - PyModuleDef_HEAD_INIT, -- "gdb.events", -+ "_gdbevents", - NULL, - -1, - NULL, -@@ -33,7 +33,8 @@ static struct PyModuleDef EventModuleDef = - NULL - }; - --/* Initialize python events. */ -+/* Helper function to add a single event registry to the events -+ module. */ - - static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION - add_new_registry (eventregistry_object **registryp, const char *name) -@@ -48,24 +49,21 @@ add_new_registry (eventregistry_object **registryp, const char *name) - (PyObject *)(*registryp)); - } - --int --gdbpy_initialize_py_events (void) -+/* Create and populate the _gdbevents module. Note that this is -+ always created, see the base gdb __init__.py. */ -+ -+PyMODINIT_FUNC -+gdbpy_events_mod_func () - { - gdb_py_events.module = PyModule_Create (&EventModuleDef); -+ if (gdb_py_events.module == nullptr) -+ return nullptr; - -- if (!gdb_py_events.module) -- return -1; -- --#define GDB_PY_DEFINE_EVENT(name) \ -+#define GDB_PY_DEFINE_EVENT(name) \ - if (add_new_registry (&gdb_py_events.name, #name) < 0) \ -- return -1; -+ return nullptr; - #include "py-all-events.def" - #undef GDB_PY_DEFINE_EVENT - -- if (gdb_pymodule_addobject (gdb_module, -- "events", -- (PyObject *) gdb_py_events.module) < 0) -- return -1; -- -- return 0; -+ return gdb_py_events.module; - } -diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h -index e3a3fc4..84f45ca 100644 ---- a/gdb/python/python-internal.h -+++ b/gdb/python/python-internal.h -@@ -536,8 +536,6 @@ int gdbpy_initialize_eventregistry (void) - CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION; - int gdbpy_initialize_event (void) - CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION; --int gdbpy_initialize_py_events (void) -- CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION; - int gdbpy_initialize_arch (void) - CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION; - int gdbpy_initialize_registers () -@@ -556,6 +554,8 @@ int gdbpy_initialize_micommands (void) - CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION; - void gdbpy_finalize_micommands (); - -+PyMODINIT_FUNC gdbpy_events_mod_func (); -+ - /* A wrapper for PyErr_Fetch that handles reference counting for the - caller. */ - class gdbpy_err_fetch -diff --git a/gdb/python/python.c b/gdb/python/python.c -index e97bca7..e3f2550 100644 ---- a/gdb/python/python.c -+++ b/gdb/python/python.c -@@ -1891,11 +1891,20 @@ do_start_initialization () - remain alive for the duration of the program's execution, so - it is not freed after this call. */ - Py_SetProgramName (progname_copy); -- -- /* Define _gdb as a built-in module. */ -- PyImport_AppendInittab ("_gdb", init__gdb_module); - #endif - -+ /* Define all internal modules. These are all imported (and thus -+ created) during initialization. */ -+ struct _inittab mods[3] = -+ { -+ { "_gdb", init__gdb_module }, -+ { "_gdbevents", gdbpy_events_mod_func }, -+ { nullptr, nullptr } -+ }; -+ -+ if (PyImport_ExtendInittab (mods) < 0) -+ return false; -+ - Py_Initialize (); - #if PY_VERSION_HEX < 0x03090000 - /* PyEval_InitThreads became deprecated in Python 3.9 and will -@@ -1962,7 +1971,6 @@ do_start_initialization () - || gdbpy_initialize_thread () < 0 - || gdbpy_initialize_inferior () < 0 - || gdbpy_initialize_eventregistry () < 0 -- || gdbpy_initialize_py_events () < 0 - || gdbpy_initialize_event () < 0 - || gdbpy_initialize_arch () < 0 - || gdbpy_initialize_registers () < 0 -diff --git a/gdb/testsuite/gdb.python/py-events.exp b/gdb/testsuite/gdb.python/py-events.exp -index 2fdd216..4feeb02 100644 ---- a/gdb/testsuite/gdb.python/py-events.exp -+++ b/gdb/testsuite/gdb.python/py-events.exp -@@ -42,6 +42,8 @@ clean_restart ${testfile} - - if { [skip_python_tests] } { continue } - -+gdb_test_no_output "python import gdb.events" -+ - set pyfile [gdb_remote_download host ${srcdir}/${subdir}/py-events.py] - gdb_test_no_output "source ${pyfile}" "load python file" - --- -2.33.0 - diff --git a/gdb-Use-bool-for-evregpy_no_listeners_p.patch b/gdb-Use-bool-for-evregpy_no_listeners_p.patch deleted file mode 100644 index 743f959b9e6c741fa04612b870912b4f79b98f20..0000000000000000000000000000000000000000 --- a/gdb-Use-bool-for-evregpy_no_listeners_p.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 907de931f547bd0d6178ee04bdb6496cd66dbdd7 Mon Sep 17 00:00:00 2001 -From: Tom Tromey -Date: Fri, 3 Jun 2022 10:35:30 -0600 -Subject: [PATCH] Use bool for evregpy_no_listeners_p - -I noticed that evregpy_no_listeners_p should return a bool. This -patch makes this change. I'm checking it in. ---- - gdb/python/py-events.h | 2 +- - gdb/python/py-evtregistry.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gdb/python/py-events.h b/gdb/python/py-events.h -index bd4a75c..1680b58 100644 ---- a/gdb/python/py-events.h -+++ b/gdb/python/py-events.h -@@ -52,6 +52,6 @@ struct events_object - extern events_object gdb_py_events; - - extern eventregistry_object *create_eventregistry_object (void); --extern int evregpy_no_listeners_p (eventregistry_object *registry); -+extern bool evregpy_no_listeners_p (eventregistry_object *registry); - - #endif /* PYTHON_PY_EVENTS_H */ -diff --git a/gdb/python/py-evtregistry.c b/gdb/python/py-evtregistry.c -index 003fe44..ef96c48 100644 ---- a/gdb/python/py-evtregistry.c -+++ b/gdb/python/py-evtregistry.c -@@ -115,7 +115,7 @@ gdbpy_initialize_eventregistry (void) - /* Return the number of listeners currently connected to this - registry. */ - --int -+bool - evregpy_no_listeners_p (eventregistry_object *registry) - { - return PyList_Size (registry->callbacks) == 0; --- -2.33.0 - diff --git a/gdb-add-index.patch b/gdb-add-index.patch new file mode 100644 index 0000000000000000000000000000000000000000..50391721beacd16ac73c1b8af6a23c96a2393598 --- /dev/null +++ b/gdb-add-index.patch @@ -0,0 +1,77 @@ +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-add-index.patch + +;; Update gdb-add-index.sh such that, when the GDB environment +;; variable is not set, the script is smarter than just looking for +;; 'gdb' in the $PATH. +;; +;; The actual search order is now: /usr/bin/gdb.minimal, gdb (in the +;; $PATH), then /usr/libexec/gdb. +;; +;; For the rationale of looking for gdb.minimal see: +;; +;; https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot +;; +;;=fedora + +diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh +--- a/gdb/contrib/gdb-add-index.sh ++++ b/gdb/contrib/gdb-add-index.sh +@@ -16,14 +16,52 @@ + # You should have received a copy of the GNU General Public License + # along with this program. If not, see . + +-# This program assumes gdb and objcopy are in $PATH. +-# If not, or you want others, pass the following in the environment +-GDB=${GDB:=gdb} ++# This program assumes objcopy and readelf are in $PATH. If not, or ++# you want others, pass the following in the environment + OBJCOPY=${OBJCOPY:=objcopy} + READELF=${READELF:=readelf} + + myname="${0##*/}" + ++# For GDB itself we need to be a little smarter. If GDB is set in the ++# environment then we will use that. But if GDB is not set in the ++# environment then we have a couple of options that we need to check ++# through. ++# ++# Our default choice is for /usr/bin/gdb.minimal. For an explanation ++# of why this is chosen, check out: ++# https://bugzilla.redhat.com/show_bug.cgi?id=1695015 ++# https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot ++# ++# If gdb.minimal is not found then we look for a 'gdb' executable on ++# the path. ++# ++# And finally, we check for /usr/libexec/gdb. ++# ++# If none of those result in a useable GDB then we give an error and ++# exit. ++if test -z "$GDB"; then ++ for possible_gdb in /usr/bin/gdb.minimal gdb /usr/libexec/gdb; do ++ if ! which "$possible_gdb" >/dev/null 2>&1; then ++ continue ++ fi ++ ++ possible_gdb=$(which "$possible_gdb") ++ ++ if ! test -x "$possible_gdb"; then ++ continue ++ fi ++ ++ GDB="$possible_gdb" ++ break ++ done ++ ++ if test -z "$GDB"; then ++ echo "$myname: Failed to find a useable GDB binary" 1>&2 ++ exit 1 ++ fi ++fi ++ + dwarf5="" + if [ "$1" = "-dwarf-5" ]; then + dwarf5="$1" diff --git a/gdb-bz601887-dwarf4-rh-test.patch b/gdb-bz601887-dwarf4-rh-test.patch deleted file mode 100644 index 966c986e9ecea136b335943454e80ff7a13f03f8..0000000000000000000000000000000000000000 --- a/gdb-bz601887-dwarf4-rh-test.patch +++ /dev/null @@ -1,254 +0,0 @@ -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-bz601887-dwarf4-rh-test.patch - -;; Backport DWARF-4 support (BZ 601887, Tom Tromey). -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.S -@@ -0,0 +1,167 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 3 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, see . */ -+ -+ .file "rh-dwarf4-x86_64.c" -+ .section .debug_abbrev,"",@progbits -+.Ldebug_abbrev0: -+ .section .debug_info,"",@progbits -+.Ldebug_info0: -+ .section .debug_line,"",@progbits -+.Ldebug_line0: -+ .text -+.Ltext0: -+.globl main -+ .type main, @function -+main: -+.LFB0: -+ .file 1 "gdb.dwarf2/rh-dwarf4-x86_64.c" -+ # gdb.dwarf2/rh-dwarf4-x86_64.c:20 -+ .loc 1 20 0 -+ .cfi_startproc -+ # basic block 2 -+ pushq %rbp -+ .cfi_def_cfa_offset 16 -+ movq %rsp, %rbp -+ .cfi_offset 6, -16 -+ .cfi_def_cfa_register 6 -+ # gdb.dwarf2/rh-dwarf4-x86_64.c:21 -+ .loc 1 21 0 -+ movl $0, %eax -+ # gdb.dwarf2/rh-dwarf4-x86_64.c:22 -+ .loc 1 22 0 -+ leave -+ .cfi_def_cfa 7, 8 -+ ret -+ .cfi_endproc -+.LFE0: -+ .size main, .-main -+.Letext0: -+ .section .debug_info -+ .long 0x4e # Length of Compilation Unit Info -+ .value 0x4 # DWARF version number -+ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section -+ .byte 0x8 # Pointer Size (in bytes) -+ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit) -+ .long .LASF0 # DW_AT_producer: "GNU C 4.4.4 20100503 (Red Hat 4.4.4-2)" -+ .byte 0x1 # DW_AT_language -+ .long .LASF1 # DW_AT_name: "gdb.dwarf2/rh-dwarf4-x86_64.c" -+ .long .LASF2 # DW_AT_comp_dir -+ .quad .Ltext0 # DW_AT_low_pc -+ .quad .Letext0 # DW_AT_high_pc -+ .long .Ldebug_line0 # DW_AT_stmt_list -+ .uleb128 0x2 # (DIE (0x2d) DW_TAG_subprogram) -+ # DW_AT_external -+ .long .LASF3 # DW_AT_name: "main" -+ .byte 0x1 # DW_AT_decl_file (gdb.dwarf2/rh-dwarf4-x86_64.c) -+ .byte 0x13 # DW_AT_decl_line -+ # DW_AT_prototyped -+ .long 0x4a # DW_AT_type -+ .quad .LFB0 # DW_AT_low_pc -+ .quad .LFE0 # DW_AT_high_pc -+ .uleb128 0x1 # DW_AT_frame_base -+ .byte 0x9c # DW_OP_call_frame_cfa -+ .uleb128 0x3 # (DIE (0x4a) DW_TAG_base_type) -+ .byte 0x4 # DW_AT_byte_size -+ .byte 0x5 # DW_AT_encoding -+ .ascii "int\0" # DW_AT_name -+ .byte 0x0 # end of children of DIE 0xb -+ .section .debug_abbrev -+ .uleb128 0x1 # (abbrev code) -+ .uleb128 0x11 # (TAG: DW_TAG_compile_unit) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x25 # (DW_AT_producer) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x13 # (DW_AT_language) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x1b # (DW_AT_comp_dir) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x10 # (DW_AT_stmt_list) -+ .uleb128 0x17 # (DW_FORM_sec_offset) -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x2 # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0x0 # DW_children_no -+ .uleb128 0x3f # (DW_AT_external) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x27 # (DW_AT_prototyped) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x40 # (DW_AT_frame_base) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x3 # (abbrev code) -+ .uleb128 0x24 # (TAG: DW_TAG_base_type) -+ .byte 0x0 # DW_children_no -+ .uleb128 0xb # (DW_AT_byte_size) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3e # (DW_AT_encoding) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .byte 0x0 -+ .byte 0x0 -+ .byte 0x0 -+ .section .debug_pubnames,"",@progbits -+ .long 0x17 # Length of Public Names Info -+ .value 0x2 # DWARF Version -+ .long .Ldebug_info0 # Offset of Compilation Unit Info -+ .long 0x52 # Compilation Unit Length -+ .long 0x2d # DIE offset -+ .ascii "main\0" # external name -+ .long 0x0 -+ .section .debug_aranges,"",@progbits -+ .long 0x2c # Length of Address Ranges Info -+ .value 0x2 # DWARF Version -+ .long .Ldebug_info0 # Offset of Compilation Unit Info -+ .byte 0x8 # Size of Address -+ .byte 0x0 # Size of Segment Descriptor -+ .value 0x0 # Pad to 16 byte boundary -+ .value 0x0 -+ .quad .Ltext0 # Address -+ .quad .Letext0-.Ltext0 # Length -+ .quad 0x0 -+ .quad 0x0 -+ .section .debug_str,"MS",@progbits,1 -+.LASF2: -+ .string "." -+.LASF0: -+ .string "GNU C 4.4.4 20100503 (Red Hat 4.4.4-2)" -+.LASF1: -+ .string "gdb.dwarf2/rh-dwarf4-x86_64.c" -+.LASF3: -+ .string "main" -+ .ident "GCC: (GNU) 4.4.4 20100503 (Red Hat 4.4.4-2)" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.c -@@ -0,0 +1,22 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 3 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, see . */ -+ -+int -+main (void) -+{ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/rh-dwarf4-x86_64.exp -@@ -0,0 +1,42 @@ -+# Copyright 2010 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 3 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, see . -+ -+# This test can only be run on targets which support DWARF-2 and use gas. -+# For now pick a sampling of likely targets. -+if {![istarget *-*-linux*] -+ && ![istarget *-*-gnu*] -+ && ![istarget *-*-elf*] -+ && ![istarget *-*-openbsd*] -+ && ![istarget arm-*-eabi*] -+ && ![istarget powerpc-*-eabi*]} { -+ return 0 -+} -+ -+if {![istarget x86_64-*]} { -+ return 0 -+} -+ -+set testfile "rh-dwarf4-x86_64" -+set srcfile ${testfile}.S -+set executable ${testfile}.x -+set binfile [standard_output_file ${executable}] -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } { -+ return -1 -+} -+ -+clean_restart $executable -+ -+gdb_test "ptype main" {type = int \(void\)} diff --git a/gdb-ccache-workaround.patch b/gdb-ccache-workaround.patch deleted file mode 100644 index 802fa2b35d777b6bdff1ba7e4b54472a354615d0..0000000000000000000000000000000000000000 --- a/gdb-ccache-workaround.patch +++ /dev/null @@ -1,26 +0,0 @@ -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-ccache-workaround.patch - -;; Workaround ccache making lineno non-zero for command-line definitions. -;;=fedoratest: ccache is rarely used and it is even fixed now. - -diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp ---- a/gdb/testsuite/gdb.base/macscp.exp -+++ b/gdb/testsuite/gdb.base/macscp.exp -@@ -27,6 +27,14 @@ if { [test_compiler_info "gcc-*"] } { - lappend options additional_flags=-fdebug-macro - } - -+# Workaround ccache making lineno non-zero for command-line definitions. -+if {[find_gcc] == "gcc" && [file executable "/usr/bin/gcc"]} { -+ set result [catch "exec which gcc" output] -+ if {$result == 0 && [string first "/ccache/" $output] > -1} { -+ lappend options "compiler=/usr/bin/gcc" -+ } -+} -+ - # Generate the intermediate object file. This is required by Darwin to - # have access to the .debug_macinfo section. - if {[gdb_compile "${srcdir}/${subdir}/macscp1.c" "${objfile}" \ diff --git a/gdb-container-rh-pkg.patch b/gdb-container-rh-pkg.patch index 618b6214b4bce1af238ccf825a4c5fae627ca75f..7107e5d7aa8d615ad2577774896779a4943d5d12 100644 --- a/gdb-container-rh-pkg.patch +++ b/gdb-container-rh-pkg.patch @@ -9,10 +9,10 @@ Subject: gdb-container-rh-pkg.patch diff --git a/gdb/remote.c b/gdb/remote.c --- a/gdb/remote.c +++ b/gdb/remote.c -@@ -14343,7 +14343,17 @@ remote_target::pid_to_exec_file (int pid) +@@ -14742,7 +14742,17 @@ remote_target::pid_to_exec_file (int pid) char *annex = NULL; - if (packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE) + if (m_features.packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE) - return NULL; + { + warning (_("Remote gdbserver does not support determining executable " diff --git a/gdb-core-open-vdso-warning.patch b/gdb-core-open-vdso-warning.patch index d6f8e0089a26f854aabe18416fef290a4b913090..fdd06fb7f6f749e52866707f5fa721f3d5276a33 100644 --- a/gdb-core-open-vdso-warning.patch +++ b/gdb-core-open-vdso-warning.patch @@ -19,24 +19,22 @@ Date: Wed Sep 25 11:52:50 2013 +0000 diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/solib-symbol.exp --- a/gdb/testsuite/gdb.base/solib-symbol.exp +++ b/gdb/testsuite/gdb.base/solib-symbol.exp -@@ -29,6 +29,7 @@ set testfile "solib-symbol-main" +@@ -27,6 +27,7 @@ set testfile "solib-symbol-main" set srcfile ${srcdir}/${subdir}/${testfile}.c set binfile [standard_output_file ${testfile}] set bin_flags [list debug shlib=${binfile_lib}] +set executable ${testfile} - if [get_compiler_info] { - return -1 -@@ -70,8 +71,26 @@ gdb_test "br foo2" \ + if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != "" + || [gdb_compile ${srcfile} ${binfile} executable $bin_flags] != "" } { +@@ -61,4 +62,28 @@ gdb_test "br foo2" \ "Breakpoint.*: foo2. .2 locations..*" \ "foo2 in mdlib" --gdb_exit +# Test GDB warns for shared libraris which have not been found. - --return 0 ++ +gdb_test "info sharedlibrary" "/${libname}.*" - ++ +clean_restart ${executable} +gdb_breakpoint "main" +gdb_run_cmd @@ -49,10 +47,12 @@ diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/so + pass $test + } +} - ++ +clean_restart ${executable} +gdb_test_no_output "set solib-absolute-prefix /doESnotEXIST" +gdb_breakpoint "main" +gdb_run_cmd +gdb_test "" "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\nBreakpoint \[0-9\]+, main .*" \ + "warning for missing libraries" ++ + gdb_exit diff --git a/gdb-fedora-libncursesw.patch b/gdb-fedora-libncursesw.patch index 7456bf844e4b537789b0d71b30641e323a10faf1..1bb640dcdbea0e863b1f2942e25bd7098eae55b3 100644 --- a/gdb-fedora-libncursesw.patch +++ b/gdb-fedora-libncursesw.patch @@ -12,7 +12,269 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1270534 diff --git a/gdb/configure b/gdb/configure --- a/gdb/configure +++ b/gdb/configure -@@ -9567,6 +9567,7 @@ if test x"$prefer_curses" = xyes; then +@@ -780,9 +780,6 @@ ENABLE_BFD_64_BIT_TRUE + subdirs + RPM_LIBS + RPM_CFLAGS +-PKG_CONFIG_LIBDIR +-PKG_CONFIG_PATH +-PKG_CONFIG + GDB_DATADIR + DEBUGDIR + MAKEINFO_EXTRA_FLAGS +@@ -990,12 +987,12 @@ PKG_CONFIG_PATH + PKG_CONFIG_LIBDIR + MAKEINFO + MAKEINFOFLAGS ++RPM_CFLAGS ++RPM_LIBS + AMD_DBGAPI_CFLAGS + AMD_DBGAPI_LIBS + DEBUGINFOD_CFLAGS + DEBUGINFOD_LIBS +-RPM_CFLAGS +-RPM_LIBS + YACC + YFLAGS + ZSTD_CFLAGS +@@ -1684,11 +1681,11 @@ Optional Packages: + [--with-auto-load-dir] + --without-auto-load-safe-path + do not restrict auto-loaded files locations ++ --with-rpm query rpm database for missing debuginfos (yes/no, ++ def. auto=librpm.so) + --with-amd-dbgapi support for the amd-dbgapi target (yes / no / auto) + --with-debuginfod Enable debuginfo lookups with debuginfod + (auto/yes/no) +- --with-rpm query rpm database for missing debuginfos (yes/no, +- def. auto=librpm.so) + --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets + --with-curses use the curses library instead of the termcap + library +@@ -1761,6 +1758,8 @@ Some influential environment variables: + MAKEINFO Parent configure detects if it is of sufficient version. + MAKEINFOFLAGS + Parameters for MAKEINFO. ++ RPM_CFLAGS C compiler flags for RPM, overriding pkg-config ++ RPM_LIBS linker flags for RPM, overriding pkg-config + AMD_DBGAPI_CFLAGS + C compiler flags for AMD_DBGAPI, overriding pkg-config + AMD_DBGAPI_LIBS +@@ -1769,8 +1768,6 @@ Some influential environment variables: + C compiler flags for DEBUGINFOD, overriding pkg-config + DEBUGINFOD_LIBS + linker flags for DEBUGINFOD, overriding pkg-config +- RPM_CFLAGS C compiler flags for RPM, overriding pkg-config +- RPM_LIBS linker flags for RPM, overriding pkg-config + YACC The `Yet Another Compiler Compiler' implementation to use. + Defaults to the first program found out of: `bison -y', `byacc', + `yacc'. +@@ -11495,7 +11492,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11486 "configure" ++#line 11495 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -11601,7 +11598,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 11592 "configure" ++#line 11601 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -18102,8 +18099,8 @@ $as_echo_n "checking specific librpm version... " >&6; } + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +-as_fn_error "cannot run test program while cross compiling +-See \`config.log' for more details." "$LINENO" 5; } ++as_fn_error $? "cannot run test program while cross compiling ++See \`config.log' for more details" "$LINENO" 5; } + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +@@ -18275,132 +18272,12 @@ $as_echo "#define HAVE_LIBRPM 1" >>confdefs.h + $as_echo "no" >&6; } + LIBS="$save_LIBS" + if $DLOPEN_REQUIRE; then +- as_fn_error "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5 ++ as_fn_error $? "Specific name $LIBRPM was requested but it could not be opened." "$LINENO" 5 + fi + +- +- +- +- +- +- +-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then +- if test -n "$ac_tool_prefix"; then +- # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +-$as_echo_n "checking for $ac_word... " >&6; } +-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : +- $as_echo_n "(cached) " >&6 +-else +- case $PKG_CONFIG in +- [\\/]* | ?:[\\/]*) +- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. +- ;; +- *) +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +- done +-IFS=$as_save_IFS +- +- ;; +-esac +-fi +-PKG_CONFIG=$ac_cv_path_PKG_CONFIG +-if test -n "$PKG_CONFIG"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +-$as_echo "$PKG_CONFIG" >&6; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +- +- +-fi +-if test -z "$ac_cv_path_PKG_CONFIG"; then +- ac_pt_PKG_CONFIG=$PKG_CONFIG +- # Extract the first word of "pkg-config", so it can be a program name with args. +-set dummy pkg-config; ac_word=$2 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +-$as_echo_n "checking for $ac_word... " >&6; } +-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : +- $as_echo_n "(cached) " >&6 +-else +- case $ac_pt_PKG_CONFIG in +- [\\/]* | ?:[\\/]*) +- ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. +- ;; +- *) +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then +- ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +- done +-IFS=$as_save_IFS +- +- ;; +-esac +-fi +-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +-if test -n "$ac_pt_PKG_CONFIG"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +-$as_echo "$ac_pt_PKG_CONFIG" >&6; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +- +- if test "x$ac_pt_PKG_CONFIG" = x; then +- PKG_CONFIG="" +- else +- case $cross_compiling:$ac_tool_warned in +-yes:) +-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +-ac_tool_warned=yes ;; +-esac +- PKG_CONFIG=$ac_pt_PKG_CONFIG +- fi +-else +- PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +-fi +- +-fi +-if test -n "$PKG_CONFIG"; then +- _pkg_min_version=0.9.0 +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } +- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +- PKG_CONFIG="" +- fi +-fi +- + pkg_failed=no +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RPM" >&5 +-$as_echo_n "checking for RPM... " >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rpm" >&5 ++$as_echo_n "checking for rpm... " >&6; } + + if test -n "$RPM_CFLAGS"; then + pkg_cv_RPM_CFLAGS="$RPM_CFLAGS" +@@ -18437,6 +18314,30 @@ fi + pkg_failed=untried + fi + ++if test $pkg_failed = no; then ++ pkg_save_LDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS $pkg_cv_RPM_LIBS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ++else ++ pkg_failed=yes ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++ LDFLAGS=$pkg_save_LDFLAGS ++fi ++ + + + if test $pkg_failed = yes; then +@@ -18531,7 +18432,7 @@ $as_echo "#define HAVE_LIBRPM 1" >>confdefs.h + LIBS="$LIBS $RPM_LIBS" + else + if $RPM_REQUIRE; then +- as_fn_error "$RPM_PKG_ERRORS" "$LINENO" 5 ++ as_fn_error $? "$RPM_PKG_ERRORS" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $RPM_PKG_ERRORS" >&5 + $as_echo "$as_me: WARNING: $RPM_PKG_ERRORS" >&2;} +@@ -21164,6 +21065,7 @@ if test x"$prefer_curses" = xyes; then # search /usr/local/include, if ncurses is installed in /usr/local. A # default installation of ncurses on alpha*-dec-osf* will lead to such # a situation. @@ -20,7 +282,7 @@ diff --git a/gdb/configure b/gdb/configure { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing waddstr" >&5 $as_echo_n "checking for library containing waddstr... " >&6; } if ${ac_cv_search_waddstr+:} false; then : -@@ -9591,7 +9592,7 @@ return waddstr (); +@@ -21188,7 +21090,7 @@ return waddstr (); return 0; } _ACEOF @@ -29,7 +291,7 @@ diff --git a/gdb/configure b/gdb/configure if test -z "$ac_lib"; then ac_res="none required" else -@@ -9665,6 +9666,7 @@ case $host_os in +@@ -21260,6 +21162,7 @@ case $host_os in esac # These are the libraries checked by Readline. @@ -37,7 +299,7 @@ diff --git a/gdb/configure b/gdb/configure { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5 $as_echo_n "checking for library containing tgetent... " >&6; } if ${ac_cv_search_tgetent+:} false; then : -@@ -9689,7 +9691,7 @@ return tgetent (); +@@ -21284,7 +21187,7 @@ return tgetent (); return 0; } _ACEOF @@ -49,17 +311,17 @@ diff --git a/gdb/configure b/gdb/configure diff --git a/gdb/configure.ac b/gdb/configure.ac --- a/gdb/configure.ac +++ b/gdb/configure.ac -@@ -713,7 +713,8 @@ if test x"$prefer_curses" = xyes; then +@@ -749,7 +749,8 @@ if test x"$prefer_curses" = xyes; then # search /usr/local/include, if ncurses is installed in /usr/local. A # default installation of ncurses on alpha*-dec-osf* will lead to such # a situation. -- AC_SEARCH_LIBS(waddstr, [ncursesw ncurses cursesX curses]) +- AC_SEARCH_LIBS(waddstr, [ncursesw ncurses cursesX curses], + # Fedora: Force libncursesw over libncurses to match the includes. -+ AC_SEARCH_LIBS(waddstr, [ncursesw]) - - if test "$ac_cv_search_waddstr" != no; then - curses_found=yes -@@ -755,7 +756,8 @@ case $host_os in ++ AC_SEARCH_LIBS(waddstr, [ncursesw], + [curses_found=yes + AC_DEFINE([HAVE_LIBCURSES], [1], + [Define to 1 if curses is enabled.]) +@@ -789,7 +790,8 @@ case $host_os in esac # These are the libraries checked by Readline. diff --git a/gdb-fortran-frame-string.patch b/gdb-fortran-frame-string.patch deleted file mode 100644 index 4bdd0593fee88636e9c521e54892427d22937536..0000000000000000000000000000000000000000 --- a/gdb-fortran-frame-string.patch +++ /dev/null @@ -1,104 +0,0 @@ -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-fortran-frame-string.patch - -;; Display Fortran strings in backtraces. -;;=fedoratest - -http://sourceware.org/ml/gdb-patches/2014-07/msg00709.html - -Hi, - -for Fortran it fixes displaying normal strings also in frames/backtraces: - -(gdb) frame --> - -The patch is simple and I do not see why it should not be this way. - -For C/C++ TYPE_CODE_STRING is not used. I am not aware of Pascal but that -language is currently not really much supported in GDB anyway. - -This was a part of my archer/jankratochvil/vla branch but it is not a part of -the Intel VLA patchset as it in fact is completely unrelated to "VLA". - -No regressions on {x86_64,x86_64-m32,i686}-fedora22pre-linux-gnu. - -Thanks, -Jan - -diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.exp b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp -@@ -0,0 +1,36 @@ -+# Copyright 2014 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. -+ -+standard_testfile .f90 -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } { -+ return -1 -+} -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+ -+gdb_breakpoint [gdb_get_line_number "s = s"] -+gdb_continue_to_breakpoint "s = s" -+ -+gdb_test "ptype s" {type = character\*3} -+gdb_test "p s" " = 'foo'" -+ -+# Fix rejected upstream: -+# https://sourceware.org/ml/gdb-patches/2014-07/msg00768.html -+setup_kfail "rejected" *-*-* -+gdb_test "frame" { \(s='foo', .*} -diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 -@@ -0,0 +1,28 @@ -+! Copyright 2014 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. -+! -+! Ihis file is the Fortran source file for dynamic.exp. -+! Original file written by Jakub Jelinek . -+! Modified for the GDB testcase by Jan Kratochvil . -+ -+ subroutine f(s) -+ character*3 s -+ s = s -+ end -+ -+ program main -+ call f ('foo') -+ end diff --git a/gdb-ftbs-swapped-calloc-args.patch b/gdb-ftbs-swapped-calloc-args.patch new file mode 100644 index 0000000000000000000000000000000000000000..3486c8e4e77188784913dad16b146e72edf00899 --- /dev/null +++ b/gdb-ftbs-swapped-calloc-args.patch @@ -0,0 +1,42 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Kevin Buettner +Date: Wed, 17 Jan 2024 12:53:53 -0700 +Subject: gdb-ftbs-swapped-calloc-args.patch + +Backport upstream commit 54195469c18ec9873cc5ba6907f768509473fa9b +which fixes a build problem in which arguments to calloc were swapped. + +[opcodes] ARC + PPC: Fix -Walloc-size warnings + +Recently, -Walloc-size warnings started to kick in. Fix these two +calloc() calls to match the intended usage pattern. + +opcodes/ChangeLog: + + * arc-dis.c (init_arc_disasm_info): Fix calloc() call. + * ppc-dis.c (powerpc_init_dialect): Ditto. + +diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c +--- a/opcodes/arc-dis.c ++++ b/opcodes/arc-dis.c +@@ -147,7 +147,7 @@ static bool + init_arc_disasm_info (struct disassemble_info *info) + { + struct arc_disassemble_info *arc_infop +- = calloc (sizeof (*arc_infop), 1); ++ = calloc (1, sizeof (*arc_infop)); + + if (arc_infop == NULL) + return false; +diff --git a/opcodes/ppc-dis.c b/opcodes/ppc-dis.c +--- a/opcodes/ppc-dis.c ++++ b/opcodes/ppc-dis.c +@@ -348,7 +348,7 @@ powerpc_init_dialect (struct disassemble_info *info) + { + ppc_cpu_t dialect = 0; + ppc_cpu_t sticky = 0; +- struct dis_private *priv = calloc (sizeof (*priv), 1); ++ struct dis_private *priv = calloc (1, sizeof (*priv)); + + if (priv == NULL) + return; diff --git a/gdb-initialize-the-data_head-variable-to-eliminate-c.patch b/gdb-initialize-the-data_head-variable-to-eliminate-c.patch deleted file mode 100644 index 1861a3fc9c895e7f78a831e1e345df43710e12e9..0000000000000000000000000000000000000000 --- a/gdb-initialize-the-data_head-variable-to-eliminate-c.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 44ca285b73b68f6a8fa3e89004b510d6b7d98e91 Mon Sep 17 00:00:00 2001 -From: Enze Li -Date: Sat, 11 Jun 2022 18:36:48 +0800 -Subject: [PATCH] gdb: initialize the data_head variable to eliminate - compilation warnings -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -On a machine with gcc 12, I get this warning: - - CXX nat/linux-btrace.o -In function ‘btrace_error linux_read_bts(btrace_data_bts*, btrace_target_info*, btrace_read_type)’, - inlined from ‘btrace_error linux_read_btrace(btrace_data*, btrace_target_info*, btrace_read_type)’ at ../gdb/nat/linux-btrace.c:935:29: -../gdb/nat/linux-btrace.c:865:21: warning: ‘data_head’ may be used uninitialized [-Wmaybe-uninitialized] - 865 | pevent->last_head = data_head; - | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ -../gdb/nat/linux-btrace.c: In function ‘btrace_error linux_read_btrace(btrace_data*, btrace_target_info*, btrace_read_type)’: -../gdb/nat/linux-btrace.c:792:9: note: ‘data_head’ was declared here - 792 | __u64 data_head, data_tail; - | ^~~~~~~~~ - -Fix this by initializing the 'data_head' variable. - -Tested by rebuilding on x86_64 openSUSE Tumbleweed with gcc 12. ---- - gdb/nat/linux-btrace.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/nat/linux-btrace.c b/gdb/nat/linux-btrace.c -index b0d6dcd7cf1..c31fb5ffe43 100644 ---- a/gdb/nat/linux-btrace.c -+++ b/gdb/nat/linux-btrace.c -@@ -789,7 +789,7 @@ linux_read_bts (struct btrace_data_bts *btrace, - struct perf_event_buffer *pevent; - const uint8_t *begin, *end, *start; - size_t buffer_size, size; -- __u64 data_head, data_tail; -+ __u64 data_head = 0, data_tail; - unsigned int retries = 5; - - pevent = &tinfo->variant.bts.bts; --- -2.33.0 - diff --git a/gdb-libctf-update-regexp-to-allow-makeinfo-to-build-docu.patch b/gdb-libctf-update-regexp-to-allow-makeinfo-to-build-docu.patch deleted file mode 100644 index 39e234e8fafbb897ac0c0f99422a65ce474d1605..0000000000000000000000000000000000000000 --- a/gdb-libctf-update-regexp-to-allow-makeinfo-to-build-docu.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 24669c55aed712c192b80456295cce122c7d5f73 Mon Sep 17 00:00:00 2001 -From: Enze Li -Date: Sat, 14 Jan 2023 11:33:48 +0800 -Subject: [PATCH] libctf: update regexp to allow makeinfo to build document - -While trying to build gdb on latest openSUSE Tumbleweed, I noticed the -following warning, - - checking for makeinfo... makeinfo --split-size=5000000 - configure: WARNING: - *** Makeinfo is too old. Info documentation will not be built. - -then I checked the version of makeinfo, it said, -====== -$ makeinfo --version -texi2any (GNU texinfo) 7.0.1 - -Copyright (C) 2022 Free Software Foundation, Inc. -License GPLv3+: GNU GPL version 3 or later -This is free software: you are free to change and redistribute it. -There is NO WARRANTY, to the extent permitted by law. -====== - -After digging a little bit, it became quite obvious that a dot is -missing in regexp that makes it impossible to match versions higher than -7.0, and here's the solution: - -- | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9])' >/dev/null 2>&1; then -+ | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]\.[0-9])' >/dev/null 2>&1; then - -However, Eli pointed out that the solution above has another problem: it -will stop working when Texinfo 10.1 will be released. Meanwhile, he -suggested to solve this problem permanently. That is, we don't care -about the minor version for Texinfo > 6.9, we only care about the major -version. - -In this way, the problem will be resolved permanently, thanks to Eli. - -libctf/ChangeLog: - - * configure: Regenerated. - * configure.ac: Update regexp to match versions higher than 7.0. ---- - libctf/configure | 2 +- - libctf/configure.ac | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libctf/configure b/libctf/configure -index c22f7dffd2c..a0e40f49a80 100755 ---- a/libctf/configure -+++ b/libctf/configure -@@ -14864,7 +14864,7 @@ esac - # We require texinfo to be 6.3 or later, for a working synindex - # and validatemenus: otherwise we fall back to /bin/true. - if ${MAKEINFO} --version \ -- | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9])' >/dev/null 2>&1; then -+ | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]|[1-6][0-9])' >/dev/null 2>&1; then - build_info=yes - else - build_info= -diff --git a/libctf/configure.ac b/libctf/configure.ac -index 1d0cf4d0fa5..6a5eade1855 100644 ---- a/libctf/configure.ac -+++ b/libctf/configure.ac -@@ -184,7 +184,7 @@ changequote(,) - # We require texinfo to be 6.3 or later, for a working synindex - # and validatemenus: otherwise we fall back to /bin/true. - if ${MAKEINFO} --version \ -- | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9])' >/dev/null 2>&1; then -+ | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]|[1-6][0-9])' >/dev/null 2>&1; then - build_info=yes - else - build_info= --- -2.33.0 - diff --git a/gdb-libexec-add-index.patch b/gdb-libexec-add-index.patch deleted file mode 100644 index 19f6b5489a21ab67a96acdbaf0b9b25326a5400c..0000000000000000000000000000000000000000 --- a/gdb-libexec-add-index.patch +++ /dev/null @@ -1,37 +0,0 @@ -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-libexec-add-index.patch - -;; Fix gdb-headless /usr/bin/ executables (BZ 1390251). -;; -;; Also, make /usr/bin/gdb.minimal be the default GDB used, if it's -;; present. For rationale, see: -;; -;; https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot -;;=fedora - -diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh ---- a/gdb/contrib/gdb-add-index.sh -+++ b/gdb/contrib/gdb-add-index.sh -@@ -22,6 +22,20 @@ GDB=${GDB:=gdb} - OBJCOPY=${OBJCOPY:=objcopy} - READELF=${READELF:=readelf} - -+GDB2=/usr/libexec/gdb -+if test -x $GDB2 && ! which $GDB &>/dev/null; then -+ GDB=$GDB2 -+fi -+ -+# We default to using /usr/bin/gdb.minimal if it's present. See -+# https://bugzilla.redhat.com/show_bug.cgi?id=1695015 and -+# https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot for -+# explanations. -+GDB3=/usr/bin/gdb.minimal -+if test -x $GDB3; then -+ GDB=$GDB3 -+fi -+ - myname="${0##*/}" - - dwarf5="" diff --git a/gdb-lineno-makeup-test.patch b/gdb-lineno-makeup-test.patch deleted file mode 100644 index 4b96286bcf9fb3ba6180561c6c81c4a6d19fd78b..0000000000000000000000000000000000000000 --- a/gdb-lineno-makeup-test.patch +++ /dev/null @@ -1,165 +0,0 @@ -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-lineno-makeup-test.patch - -;; Testcase for "Do not make up line information" fix by Daniel Jacobowitz. -;;=fedoratest - -New testcase for: -https://bugzilla.redhat.com/show_bug.cgi?id=466222 - (for the first / customer recommended fix) -and the upstream fix: -http://sourceware.org/ml/gdb-patches/2006-11/msg00253.html - [rfc] Do not make up line information -http://sourceware.org/ml/gdb-cvs/2006-11/msg00127.html - -diff --git a/gdb/testsuite/gdb.base/lineno-makeup-func.c b/gdb/testsuite/gdb.base/lineno-makeup-func.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/lineno-makeup-func.c -@@ -0,0 +1,21 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2009 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 3 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, see . */ -+ -+void -+func (void) -+{ -+} -diff --git a/gdb/testsuite/gdb.base/lineno-makeup.c b/gdb/testsuite/gdb.base/lineno-makeup.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/lineno-makeup.c -@@ -0,0 +1,35 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2009 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 3 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, see . */ -+ -+/* DW_AT_low_pc-DW_AT_high_pc should cover the function without line number -+ information (.debug_line) so we cannot use an external object file. -+ -+ It must not be just a label as it would alias on the next function even for -+ correct GDB. Therefore some stub data must be placed there. -+ -+ We need to provide a real stub function body as at least s390 -+ (s390_analyze_prologue) would skip the whole body till reaching `main'. */ -+ -+extern void func (void); -+asm ("func: .incbin \"" BINFILENAME "\""); -+ -+int -+main (void) -+{ -+ func (); -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.base/lineno-makeup.exp b/gdb/testsuite/gdb.base/lineno-makeup.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/lineno-makeup.exp -@@ -0,0 +1,78 @@ -+# Copyright 2009 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 3 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, see . -+ -+set testfile "lineno-makeup" -+set srcfuncfile ${testfile}-func.c -+set srcfile ${testfile}.c -+set objfuncfile [standard_output_file ${testfile}-func.o] -+set binfuncfile [standard_output_file ${testfile}-func.bin] -+set binfile [standard_output_file ${testfile}] -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfuncfile}" "${objfuncfile}" object {}] != "" } { -+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -+} -+ -+set objcopy [catch "exec objcopy -O binary --only-section .text ${objfuncfile} ${binfuncfile}" output] -+verbose -log "objcopy=$objcopy: $output" -+if { $objcopy != 0 } { -+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -+} -+set binfuncfilesize [file size $binfuncfile] -+verbose -log "file size $binfuncfile = $binfuncfilesize" -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug additional_flags=-DBINFILENAME=\"$binfuncfile\"]] != "" } { -+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+set b_addr "" -+set test "break func" -+gdb_test_multiple $test $test { -+ -re "Breakpoint \[0-9\]+ at (0x\[0-9a-f\]+)\r\n$gdb_prompt $" { -+ set b_addr $expect_out(1,string) -+ pass $test -+ } -+ -re "Breakpoint \[0-9\]+ at (0x\[0-9a-f\]+): .*\r\n$gdb_prompt $" { -+ set b_addr $expect_out(1,string) -+ fail $test -+ } -+} -+verbose -log "b_addr=<$b_addr>" -+ -+set p_addr "" -+set test "print func" -+gdb_test_multiple $test $test { -+ -re "\\$\[0-9\]+ = {} (0x\[0-9a-f\]+) \r\n$gdb_prompt $" { -+ set p_addr $expect_out(1,string) -+ pass $test -+ } -+} -+verbose -log "p_addr=<$p_addr>" -+ -+set test "break address belongs to func" -+if {$b_addr == $p_addr} { -+ pass "$test (exact match)" -+} else { -+ set skip [expr $b_addr - $p_addr] -+ if {$skip > 0 && $skip < $binfuncfilesize} { -+ pass "$test (prologue skip by $skip bytes)" -+ } else { -+ fail $test -+ } -+} diff --git a/gdb-linux_perf-bundle.patch b/gdb-linux_perf-bundle.patch index a2e443d3649290d2db1fa594761a21dfe01f0edc..bb6fb6a9c370017f48bf57fc76043a5caf22cee2 100644 --- a/gdb-linux_perf-bundle.patch +++ b/gdb-linux_perf-bundle.patch @@ -9,9 +9,9 @@ Subject: gdb-linux_perf-bundle.patch diff --git a/gdb/gdb.c b/gdb/gdb.c --- a/gdb/gdb.c +++ b/gdb/gdb.c -@@ -20,11 +20,19 @@ - #include "main.h" +@@ -21,6 +21,10 @@ #include "interps.h" + #include "run-on-main-thread.h" +#ifdef PERF_ATTR_SIZE_VER5_BUNDLE +extern "C" void __libipt_init(void); @@ -20,6 +20,8 @@ diff --git a/gdb/gdb.c b/gdb/gdb.c int main (int argc, char **argv) { +@@ -32,6 +36,10 @@ main (int argc, char **argv) + struct captured_main_args args; +#ifdef PERF_ATTR_SIZE_VER5_BUNDLE @@ -32,7 +34,7 @@ diff --git a/gdb/gdb.c b/gdb/gdb.c diff --git a/gdb/nat/linux-btrace.h b/gdb/nat/linux-btrace.h --- a/gdb/nat/linux-btrace.h +++ b/gdb/nat/linux-btrace.h -@@ -27,6 +27,177 @@ +@@ -28,6 +28,177 @@ # include #endif @@ -213,7 +215,7 @@ diff --git a/gdb/nat/linux-btrace.h b/gdb/nat/linux-btrace.h diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4 --- a/gdbsupport/common.m4 +++ b/gdbsupport/common.m4 -@@ -156,7 +156,7 @@ AC_DEFUN([GDB_AC_COMMON], [ +@@ -168,7 +168,7 @@ AC_DEFUN([GDB_AC_COMMON], [ AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ #include #ifndef PERF_ATTR_SIZE_VER5 diff --git a/gdb-physname-pr11734-test.patch b/gdb-physname-pr11734-test.patch deleted file mode 100644 index 835e18c99bf91bb2c8dfc9205a10bf077f610500..0000000000000000000000000000000000000000 --- a/gdb-physname-pr11734-test.patch +++ /dev/null @@ -1,229 +0,0 @@ -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-physname-pr11734-test.patch - -;; Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). -;;=fedoratest - -http://sourceware.org/ml/gdb-patches/2010-12/msg00263.html - -diff --git a/gdb/testsuite/gdb.cp/pr11734-1.cc b/gdb/testsuite/gdb.cp/pr11734-1.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/pr11734-1.cc -@@ -0,0 +1,29 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 3 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, see . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@gnu.org */ -+ -+#include "pr11734.h" -+ -+int -+main () -+{ -+ pr11734 *p = new pr11734; -+ p->foo (); -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.cp/pr11734-2.cc b/gdb/testsuite/gdb.cp/pr11734-2.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/pr11734-2.cc -@@ -0,0 +1,26 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 3 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, see . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@gnu.org */ -+ -+#include "pr11734.h" -+ -+void -+pr11734::foo(void) -+{ -+} -diff --git a/gdb/testsuite/gdb.cp/pr11734-3.cc b/gdb/testsuite/gdb.cp/pr11734-3.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/pr11734-3.cc -@@ -0,0 +1,26 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 3 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, see . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@gnu.org */ -+ -+#include "pr11734.h" -+ -+void -+pr11734::foo (int a) -+{ -+} -diff --git a/gdb/testsuite/gdb.cp/pr11734-4.cc b/gdb/testsuite/gdb.cp/pr11734-4.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/pr11734-4.cc -@@ -0,0 +1,26 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 3 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, see . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@gnu.org */ -+ -+#include "pr11734.h" -+ -+void -+pr11734::foo (char *a) -+{ -+} -diff --git a/gdb/testsuite/gdb.cp/pr11734.exp b/gdb/testsuite/gdb.cp/pr11734.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/pr11734.exp -@@ -0,0 +1,55 @@ -+# Copyright 2010 Free Software Foundation, Inc. -+# -+# Contributed by Red Hat, originally written by Keith Seitz. -+# -+# 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 3 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, see . -+ -+# This file is part of the gdb testsuite. -+ -+if { [skip_cplus_tests] } { continue } -+ -+set testfile "pr11734" -+set class $testfile -+ -+set srcfiles {} -+for {set i 1} {$i < 5} {incr i} { -+ lappend srcfiles $testfile-$i.cc -+} -+ -+prepare_for_testing pr11734 $testfile $srcfiles {c++ debug} -+ -+if {![runto_main]} { -+ perror "couldn't run to breakpoint" -+ continue -+} -+ -+# An array holding the overload types for the method pr11734::foo. The -+# first element is the overloaded method parameter. The second element -+# is the expected source file number, e.g. "pr11734-?.cc". -+array set tests { -+ "char*" 4 -+ "int" 3 -+ "" 2 -+} -+ -+# Test each overload instance twice: once quoted, once unquoted -+foreach ovld [array names tests] { -+ set method "${class}::foo\($ovld\)" -+ set result "Breakpoint (\[0-9\]).*file .*/$class-$tests($ovld).*" -+ gdb_test "break $method" $result -+ gdb_test "break '$method'" $result -+} -+ -+gdb_exit -+return 0 -diff --git a/gdb/testsuite/gdb.cp/pr11734.h b/gdb/testsuite/gdb.cp/pr11734.h -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/pr11734.h -@@ -0,0 +1,27 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 3 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, see . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@gnu.org */ -+ -+class pr11734 -+{ -+ public: -+ void foo (); -+ void foo (int); -+ void foo (char *); -+}; diff --git a/gdb-physname-pr12273-test.patch b/gdb-physname-pr12273-test.patch deleted file mode 100644 index 6c943ad89e9c451bc88dd577b94cc8c6f3af2fdd..0000000000000000000000000000000000000000 --- a/gdb-physname-pr12273-test.patch +++ /dev/null @@ -1,103 +0,0 @@ -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-physname-pr12273-test.patch - -;; Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). -;;=fedoratest - -http://sourceware.org/ml/gdb-patches/2010-12/msg00264.html - -diff --git a/gdb/testsuite/gdb.cp/pr12273.cc b/gdb/testsuite/gdb.cp/pr12273.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/pr12273.cc -@@ -0,0 +1,37 @@ -+/* This test case is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 3 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, see . */ -+ -+template -+class GDB -+{ -+ public: -+ static int simple (void) { return 0; } -+ static int harder (T a) { return 1; } -+ template -+ static X even_harder (T a) { return static_cast (a); } -+ int operator == (GDB const& other) -+ { return 1; } -+}; -+ -+int main(int argc, char **argv) -+{ -+ GDB a, b; -+ if (a == b) -+ return GDB::harder('a') + GDB::harder(3) -+ + GDB::even_harder ('a'); -+ return GDB::simple (); -+} -diff --git a/gdb/testsuite/gdb.cp/pr12273.exp b/gdb/testsuite/gdb.cp/pr12273.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/pr12273.exp -@@ -0,0 +1,46 @@ -+# Copyright 2010 Free Software Foundation, Inc. -+# -+# Contributed by Red Hat, originally written by Keith Seitz. -+# -+# 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 3 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, see . -+ -+# This file is part of the gdb testsuite. -+ -+if {[skip_cplus_tests]} { continue } -+ -+set testfile "pr12273" -+# Do NOT compile with debug flag. -+prepare_for_testing pr12273 $testfile $testfile.cc {c++} -+ -+gdb_test_no_output "set language c++" -+ -+# A list of minimal symbol names to check. -+# Note that GDB::even_harder(char) is quoted and includes -+# the return type. This is necessary because this is the demangled name -+# of the minimal symbol. -+set min_syms [list \ -+ "GDB::operator ==" \ -+ "GDB::operator==(GDB const&)" \ -+ "GDB::harder(char)" \ -+ "GDB::harder(int)" \ -+ {"int GDB::even_harder(char)"} \ -+ "GDB::simple()"] -+ -+foreach sym $min_syms { -+ if {[gdb_breakpoint $sym]} { -+ pass "setting breakpoint at $sym" -+ } -+} -+ -+gdb_exit diff --git a/gdb-ppc-power7-test.patch b/gdb-ppc-power7-test.patch deleted file mode 100644 index c8b22cf0c29bc4229605a97e961eb5f19d5bf0c3..0000000000000000000000000000000000000000 --- a/gdb-ppc-power7-test.patch +++ /dev/null @@ -1,303 +0,0 @@ -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-ppc-power7-test.patch - -;; Test power7 ppc disassembly. -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.arch/powerpc-power7rh.exp b/gdb/testsuite/gdb.arch/powerpc-power7rh.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/powerpc-power7rh.exp -@@ -0,0 +1,178 @@ -+# Copyright 2009 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. -+ -+# Test PowerPC Power7 instructions disassembly. -+ -+if {![istarget "powerpc*-*-*"]} then { -+ verbose "Skipping PowerPC Power7 instructions disassembly." -+ return -+} -+ -+set testfile "powerpc-power7rh" -+set srcfile ${testfile}.s -+set objfile [standard_output_file ${testfile}.o] -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } { -+ untested "PowerPC Power7 instructions disassembly" -+ return -1 -+} -+ -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${objfile} -+ -+ -+# Disassemble the function. -+ -+set test "disass func" -+gdb_test_multiple $test $test { -+ -re "\r\nDump of assembler code for function func:(\r\n.*\r\n)End of assembler dump.\r\n$gdb_prompt $" { -+ set func $expect_out(1,string) -+ pass $test -+ } -+} -+ -+proc instr_to_patt {offset instr} { -+ # 0x0000000000000018 : stxvd2x vs43,r4,r5 -+ return ".*\r\n\[ \t\]*[string map {0x 0x0*} $offset] <(func)?\\+?\[0-9\]*>:\[ \t\]*[string map [list { } "\[ \t\]+" . {\.}] $instr]\[ \t\]*\r\n.*" -+} -+ -+# KFAIL strings would not exist if -Many would print the same as -Mpower7. -+# That means the power7 form should be the preferred one. -+# http://sourceware.org/ml/gdb-patches/2009-03/threads.html#00020 -+ -+proc func_check {offset instr {kfail ""}} { -+ global func -+ -+ set test "Found $offset: $instr" -+ if [regexp -nocase -line [instr_to_patt $offset $instr] $func] { -+ pass $test -+ } elseif {$kfail != "" && [regexp -nocase -line [instr_to_patt $offset $kfail] $func]} { -+ kfail gdb/NNNN $test -+ } else { -+ fail $test -+ } -+} -+ -+func_check 0x0 "lxvd2x vs3,r4,r5" -+# [PATCH] Remove support for POWER7 VSX load/store with update instructions -+# http://sourceware.org/ml/binutils/2009-09/msg00680.html -+# http://sourceware.org/ml/binutils-cvs/2009-09/msg00331.html -+func_check 0x4 "lxvb16x vs3,r4,r5" -+func_check 0x8 "lxvd2x vs43,r4,r5" -+func_check 0xc "lxvb16x vs43,r4,r5" -+func_check 0x10 "stxvd2x vs3,r4,r5" -+func_check 0x14 "stxvb16x vs3,r4,r5" -+func_check 0x18 "stxvd2x vs43,r4,r5" -+func_check 0x1c "stxvb16x vs43,r4,r5" -+func_check 0x20 "xxmrghd vs3,vs4,vs5" -+func_check 0x24 "xxmrghd vs43,vs44,vs45" -+func_check 0x28 "xxmrgld vs3,vs4,vs5" -+func_check 0x2c "xxmrgld vs43,vs44,vs45" -+func_check 0x30 "xxmrghd vs3,vs4,vs5" -+func_check 0x34 "xxmrghd vs43,vs44,vs45" -+func_check 0x38 "xxmrgld vs3,vs4,vs5" -+func_check 0x3c "xxmrgld vs43,vs44,vs45" -+func_check 0x40 "xxpermdi vs3,vs4,vs5,1" -+func_check 0x44 "xxpermdi vs43,vs44,vs45,1" -+func_check 0x48 "xxpermdi vs3,vs4,vs5,2" -+func_check 0x4c "xxpermdi vs43,vs44,vs45,2" -+func_check 0x50 "xvmovdp vs3,vs4" -+func_check 0x54 "xvmovdp vs43,vs44" -+func_check 0x58 "xvmovdp vs3,vs4" -+func_check 0x5c "xvmovdp vs43,vs44" -+func_check 0x60 "xvcpsgndp vs3,vs4,vs5" -+func_check 0x64 "xvcpsgndp vs43,vs44,vs45" -+func_check 0x68 "wait" -+func_check 0x6c "wait" -+func_check 0x70 "waitrsv" -+func_check 0x74 "waitrsv" -+func_check 0x78 "waitimpl" -+func_check 0x7c "waitimpl" -+func_check 0x80 "doze" -+func_check 0x84 "nap" -+func_check 0x88 "sleep" -+func_check 0x8c "rvwinkle" -+func_check 0x90 "prtyw r3,r4" -+func_check 0x94 "prtyd r13,r14" -+func_check 0x98 "mfcfar r10" "mfspr r10,28" -+func_check 0x9c "mtcfar r11" "mtspr 28,r11" -+func_check 0xa0 "cmpb r3,r4,r5" -+func_check 0xa4 "lwzcix r10,r11,r12" -+func_check 0xa8 "dadd f16,f17,f18" -+func_check 0xac "daddq f20,f22,f24" -+func_check 0xb0 "dss 3" -+func_check 0xb4 "dssall" -+func_check 0xb8 "dst r5,r4,1" -+func_check 0xbc "dstt r8,r7,0" -+func_check 0xc0 "dstst r5,r6,3" -+func_check 0xc4 "dststt r4,r5,2" -+func_check 0xc8 "divwe r10,r11,r12" -+func_check 0xcc "divwe. r11,r12,r13" -+func_check 0xd0 "divweo r12,r13,r14" -+func_check 0xd4 "divweo. r13,r14,r15" -+func_check 0xd8 "divweu r10,r11,r12" -+func_check 0xdc "divweu. r11,r12,r13" -+func_check 0xe0 "divweuo r12,r13,r14" -+func_check 0xe4 "divweuo. r13,r14,r15" -+func_check 0xe8 "bpermd r7,r17,r27" -+func_check 0xec "popcntw r10,r20" -+func_check 0xf0 "popcntd r10,r20" -+func_check 0xf4 "ldbrx r20,r21,r22" -+func_check 0xf8 "stdbrx r20,r21,r22" -+func_check 0xfc "lfiwzx f10,0,r10" -+func_check 0x100 "lfiwzx f10,r9,r10" -+func_check 0x104 "fcfids f4,f5" -+func_check 0x108 "fcfids. f4,f5" -+func_check 0x10c "fcfidus f4,f5" -+func_check 0x110 "fcfidus. f4,f5" -+func_check 0x114 "fctiwu f4,f5" -+func_check 0x118 "fctiwu. f4,f5" -+func_check 0x11c "fctiwuz f4,f5" -+func_check 0x120 "fctiwuz. f4,f5" -+func_check 0x124 "fctidu f4,f5" -+func_check 0x128 "fctidu. f4,f5" -+func_check 0x12c "fctiduz f4,f5" -+func_check 0x130 "fctiduz. f4,f5" -+func_check 0x134 "fcfidu f4,f5" -+func_check 0x138 "fcfidu. f4,f5" -+func_check 0x13c "ftdiv cr0,f10,f11" -+func_check 0x140 "ftdiv cr7,f10,f11" -+func_check 0x144 "ftsqrt cr0,f10" -+func_check 0x148 "ftsqrt cr7,f10" -+func_check 0x14c "dcbtt r8,r9" "dcbt 16,r8,r9" -+func_check 0x150 "dcbtstt r8,r9" "dcbtst 16,r8,r9" -+func_check 0x154 "dcffix f10,f12" -+func_check 0x158 "dcffix. f20,f22" -+func_check 0x15c "lbarx r10,r11,r12" -+func_check 0x160 "lbarx r10,r11,r12" -+func_check 0x164 "lbarx r10,r11,r12,1" -+func_check 0x168 "lharx r20,r21,r22" -+func_check 0x16c "lharx r20,r21,r22" -+func_check 0x170 "lharx r20,r21,r22,1" -+func_check 0x174 "stbcx. r10,r11,r12" -+func_check 0x178 "sthcx. r10,r11,r12" -+func_check 0x17c "fre f14,f15" -+func_check 0x180 "fre. f14,f15" -+func_check 0x184 "fres f14,f15" -+func_check 0x188 "fres. f14,f15" -+func_check 0x18c "frsqrte f14,f15" -+func_check 0x190 "frsqrte. f14,f15" -+func_check 0x194 "frsqrtes f14,f15" -+func_check 0x198 "frsqrtes. f14,f15" -+func_check 0x19c "isel r2,r3,r4,28" -diff --git a/gdb/testsuite/gdb.arch/powerpc-power7rh.s b/gdb/testsuite/gdb.arch/powerpc-power7rh.s -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/powerpc-power7rh.s -@@ -0,0 +1,107 @@ -+ .text -+ .globl func -+func: -+ .long 0x7c642e98 /* 0: lxvd2x vs3,r4,r5 */ -+ .long 0x7c642ed8 /* 4: lxvd2ux vs3,r4,r5 */ -+ .long 0x7d642e99 /* 8: lxvd2x vs43,r4,r5 */ -+ .long 0x7d642ed9 /* c: lxvd2ux vs43,r4,r5 */ -+ .long 0x7c642f98 /* 10: stxvd2x vs3,r4,r5 */ -+ .long 0x7c642fd8 /* 14: stxvd2ux vs3,r4,r5 */ -+ .long 0x7d642f99 /* 18: stxvd2x vs43,r4,r5 */ -+ .long 0x7d642fd9 /* 1c: stxvd2ux vs43,r4,r5 */ -+ .long 0xf0642850 /* 20: xxmrghd vs3,vs4,vs5 */ -+ .long 0xf16c6857 /* 24: xxmrghd vs43,vs44,vs45 */ -+ .long 0xf0642b50 /* 28: xxmrgld vs3,vs4,vs5 */ -+ .long 0xf16c6b57 /* 2c: xxmrgld vs43,vs44,vs45 */ -+ .long 0xf0642850 /* 30: xxmrghd vs3,vs4,vs5 */ -+ .long 0xf16c6857 /* 34: xxmrghd vs43,vs44,vs45 */ -+ .long 0xf0642b50 /* 38: xxmrgld vs3,vs4,vs5 */ -+ .long 0xf16c6b57 /* 3c: xxmrgld vs43,vs44,vs45 */ -+ .long 0xf0642950 /* 40: xxpermdi vs3,vs4,vs5,1 */ -+ .long 0xf16c6957 /* 44: xxpermdi vs43,vs44,vs45,1 */ -+ .long 0xf0642a50 /* 48: xxpermdi vs3,vs4,vs5,2 */ -+ .long 0xf16c6a57 /* 4c: xxpermdi vs43,vs44,vs45,2 */ -+ .long 0xf0642780 /* 50: xvmovdp vs3,vs4 */ -+ .long 0xf16c6787 /* 54: xvmovdp vs43,vs44 */ -+ .long 0xf0642780 /* 58: xvmovdp vs3,vs4 */ -+ .long 0xf16c6787 /* 5c: xvmovdp vs43,vs44 */ -+ .long 0xf0642f80 /* 60: xvcpsgndp vs3,vs4,vs5 */ -+ .long 0xf16c6f87 /* 64: xvcpsgndp vs43,vs44,vs45 */ -+ .long 0x7c00007c /* 68: wait */ -+ .long 0x7c00007c /* 6c: wait */ -+ .long 0x7c20007c /* 70: waitrsv */ -+ .long 0x7c20007c /* 74: waitrsv */ -+ .long 0x7c40007c /* 78: waitimpl */ -+ .long 0x7c40007c /* 7c: waitimpl */ -+ .long 0x4c000324 /* 80: doze */ -+ .long 0x4c000364 /* 84: nap */ -+ .long 0x4c0003a4 /* 88: sleep */ -+ .long 0x4c0003e4 /* 8c: rvwinkle */ -+ .long 0x7c830134 /* 90: prtyw r3,r4 */ -+ .long 0x7dcd0174 /* 94: prtyd r13,r14 */ -+ .long 0x7d5c02a6 /* 98: mfcfar r10 */ -+ .long 0x7d7c03a6 /* 9c: mtcfar r11 */ -+ .long 0x7c832bf8 /* a0: cmpb r3,r4,r5 */ -+ .long 0x7d4b662a /* a4: lwzcix r10,r11,r12 */ -+ .long 0xee119004 /* a8: dadd f16,f17,f18 */ -+ .long 0xfe96c004 /* ac: daddq f20,f22,f24 */ -+ .long 0x7c60066c /* b0: dss 3 */ -+ .long 0x7e00066c /* b4: dssall */ -+ .long 0x7c2522ac /* b8: dst r5,r4,1 */ -+ .long 0x7e083aac /* bc: dstt r8,r7,0 */ -+ .long 0x7c6532ec /* c0: dstst r5,r6,3 */ -+ .long 0x7e442aec /* c4: dststt r4,r5,2 */ -+ .long 0x7d4b6356 /* c8: divwe r10,r11,r12 */ -+ .long 0x7d6c6b57 /* cc: divwe. r11,r12,r13 */ -+ .long 0x7d8d7756 /* d0: divweo r12,r13,r14 */ -+ .long 0x7dae7f57 /* d4: divweo. r13,r14,r15 */ -+ .long 0x7d4b6316 /* d8: divweu r10,r11,r12 */ -+ .long 0x7d6c6b17 /* dc: divweu. r11,r12,r13 */ -+ .long 0x7d8d7716 /* e0: divweuo r12,r13,r14 */ -+ .long 0x7dae7f17 /* e4: divweuo. r13,r14,r15 */ -+ .long 0x7e27d9f8 /* e8: bpermd r7,r17,r27 */ -+ .long 0x7e8a02f4 /* ec: popcntw r10,r20 */ -+ .long 0x7e8a03f4 /* f0: popcntd r10,r20 */ -+ .long 0x7e95b428 /* f4: ldbrx r20,r21,r22 */ -+ .long 0x7e95b528 /* f8: stdbrx r20,r21,r22 */ -+ .long 0x7d4056ee /* fc: lfiwzx f10,0,r10 */ -+ .long 0x7d4956ee /* 100: lfiwzx f10,r9,r10 */ -+ .long 0xec802e9c /* 104: fcfids f4,f5 */ -+ .long 0xec802e9d /* 108: fcfids. f4,f5 */ -+ .long 0xec802f9c /* 10c: fcfidus f4,f5 */ -+ .long 0xec802f9d /* 110: fcfidus. f4,f5 */ -+ .long 0xfc80291c /* 114: fctiwu f4,f5 */ -+ .long 0xfc80291d /* 118: fctiwu. f4,f5 */ -+ .long 0xfc80291e /* 11c: fctiwuz f4,f5 */ -+ .long 0xfc80291f /* 120: fctiwuz. f4,f5 */ -+ .long 0xfc802f5c /* 124: fctidu f4,f5 */ -+ .long 0xfc802f5d /* 128: fctidu. f4,f5 */ -+ .long 0xfc802f5e /* 12c: fctiduz f4,f5 */ -+ .long 0xfc802f5f /* 130: fctiduz. f4,f5 */ -+ .long 0xfc802f9c /* 134: fcfidu f4,f5 */ -+ .long 0xfc802f9d /* 138: fcfidu. f4,f5 */ -+ .long 0xfc0a5900 /* 13c: ftdiv cr0,f10,f11 */ -+ .long 0xff8a5900 /* 140: ftdiv cr7,f10,f11 */ -+ .long 0xfc005140 /* 144: ftsqrt cr0,f10 */ -+ .long 0xff805140 /* 148: ftsqrt cr7,f10 */ -+ .long 0x7e084a2c /* 14c: dcbtt r8,r9 */ -+ .long 0x7e0849ec /* 150: dcbtstt r8,r9 */ -+ .long 0xed406644 /* 154: dcffix f10,f12 */ -+ .long 0xee80b645 /* 158: dcffix. f20,f22 */ -+ .long 0x7d4b6068 /* 15c: lbarx r10,r11,r12 */ -+ .long 0x7d4b6068 /* 160: lbarx r10,r11,r12 */ -+ .long 0x7d4b6069 /* 164: lbarx r10,r11,r12,1 */ -+ .long 0x7e95b0e8 /* 168: lharx r20,r21,r22 */ -+ .long 0x7e95b0e8 /* 16c: lharx r20,r21,r22 */ -+ .long 0x7e95b0e9 /* 170: lharx r20,r21,r22,1 */ -+ .long 0x7d4b656d /* 174: stbcx. r10,r11,r12 */ -+ .long 0x7d4b65ad /* 178: sthcx. r10,r11,r12 */ -+ .long 0xfdc07830 /* 17c: fre f14,f15 */ -+ .long 0xfdc07831 /* 180: fre. f14,f15 */ -+ .long 0xedc07830 /* 184: fres f14,f15 */ -+ .long 0xedc07831 /* 188: fres. f14,f15 */ -+ .long 0xfdc07834 /* 18c: frsqrte f14,f15 */ -+ .long 0xfdc07835 /* 190: frsqrte. f14,f15 */ -+ .long 0xedc07834 /* 194: frsqrtes f14,f15 */ -+ .long 0xedc07835 /* 198: frsqrtes. f14,f15 */ -+ .long 0x7c43271e /* 19c: isel r2,r3,r4,28 */ diff --git a/gdb-python-remove-Python-2-support.patch b/gdb-python-remove-Python-2-support.patch deleted file mode 100644 index 6aa36981bc09e6476751db8c6446d1aabf7ba520..0000000000000000000000000000000000000000 --- a/gdb-python-remove-Python-2-support.patch +++ /dev/null @@ -1,1375 +0,0 @@ -From 18a8874936fb0701086108c4dddf26c3072b6bb0 Mon Sep 17 00:00:00 2001 -From: Simon Marchi -Date: Thu, 23 Dec 2021 20:20:46 -0500 -Subject: [PATCH] gdb/python: remove Python 2 support - -New in this version: - - - Add a PY_MAJOR_VERSION check in configure.ac / AC_TRY_LIBPYTHON. If - the user passes --with-python=python2, this will cause a configure - failure saying that GDB only supports Python 3. - -Support for Python 2 is a maintenance burden for any patches touching -Python support. Among others, the differences between Python 2 and 3 -string and integer types are subtle. It requires a lot of effort and -thinking to get something that behaves correctly on both. And that's if -the author and reviewer of the patch even remember to test with Python -2. - -See this thread for an example: - - https://sourceware.org/pipermail/gdb-patches/2021-December/184260.html - -So, remove Python 2 support. Update the documentation to state that GDB -can be built against Python 3 (as opposed to Python 2 or 3). - -Update all the spots that use: - - - sys.version_info - - IS_PY3K - - PY_MAJOR_VERSION - - gdb_py_is_py3k - -... to only keep the Python 3 portions and drop the use of some -now-removed compatibility macros. - -I did not update the configure script more than just removing the -explicit references to Python 2. We could maybe do more there, like -check the Python version and reject it if that version is not -supported. Otherwise (with this patch), things will only fail at -compile time, so it won't really be clear to the user that they are -trying to use an unsupported Python version. But I'm a bit lost in the -configure code that checks for Python, so I kept that for later. - -Change-Id: I75b0f79c148afbe3c07ac664cfa9cade052c0c62 ---- - gdb/NEWS | 3 + - gdb/README | 2 +- - gdb/configure | 78 +------------------ - gdb/configure.ac | 18 ++--- - gdb/doc/python.texi | 2 - - gdb/python/lib/gdb/__init__.py | 2 +- - gdb/python/lib/gdb/command/explore.py | 22 +++--- - gdb/python/lib/gdb/printer/bound_registers.py | 7 +- - gdb/python/lib/gdb/printing.py | 9 +-- - gdb/python/lib/gdb/xmethod.py | 8 +- - gdb/python/py-arch.c | 6 -- - gdb/python/py-evts.c | 6 -- - gdb/python/py-framefilter.c | 6 +- - gdb/python/py-membuf.c | 73 +---------------- - gdb/python/py-param.c | 8 -- - gdb/python/py-record-btrace.c | 17 +--- - gdb/python/py-type.c | 13 ---- - gdb/python/py-utils.c | 47 +---------- - gdb/python/py-value.c | 66 ---------------- - gdb/python/python-internal.h | 10 --- - gdb/python/python.c | 19 ----- - gdb/testsuite/gdb.python/py-inferior.exp | 6 +- - .../py-mi-var-info-path-expression.py | 12 +-- - gdb/testsuite/gdb.python/py-record-btrace.exp | 6 +- - gdb/testsuite/gdb.python/py-send-packet.py | 58 ++++---------- - gdb/testsuite/gdb.python/py-shared.exp | 7 +- - gdb/testsuite/gdb.python/py-value.exp | 40 +--------- - gdb/testsuite/lib/gdb.exp | 12 --- - 28 files changed, 61 insertions(+), 502 deletions(-) - -diff --git a/gdb/NEWS b/gdb/NEWS -index 501ace1..c80bf39 100644 ---- a/gdb/NEWS -+++ b/gdb/NEWS -@@ -180,6 +180,9 @@ GNU/Linux/LoongArch loongarch*-*-linux* - - S+core score-*-* - -+* Remove support for building against Python 2, it is now only possible to -+ build GDB against Python 3. -+ - * Python API - - ** New function gdb.add_history(), which takes a gdb.Value object -diff --git a/gdb/README b/gdb/README -index e65c5ea..bd5a88f 100644 ---- a/gdb/README -+++ b/gdb/README -@@ -506,7 +506,7 @@ more obscure GDB `configure' options are not listed here. - GDB scripting much more powerful than the restricted CLI - scripting language. If your host does not have Python installed, - you can find it on `http://www.python.org/download/'. The oldest -- version of Python supported by GDB is 2.6. The optional argument -+ version of Python supported by GDB is 3.2. The optional argument - PYTHON is used to find the Python headers and libraries. It can - be either the name of a Python executable, or the name of the - directory in which Python is installed. -diff --git a/gdb/configure b/gdb/configure -index ac372e3..1e955a5 100755 ---- a/gdb/configure -+++ b/gdb/configure -@@ -11764,81 +11764,12 @@ $as_echo_n "checking for python... " >&6; } - int - main () - { --Py_Initialize (); -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_link "$LINENO"; then : -- have_libpython=yes -- found_usable_python=yes -- PYTHON_CPPFLAGS=$new_CPPFLAGS -- PYTHON_LIBS=$new_LIBS --fi --rm -f core conftest.err conftest.$ac_objext \ -- conftest$ac_exeext conftest.$ac_ext -- CPPFLAGS=$save_CPPFLAGS -- LIBS=$save_LIBS -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${found_usable_python}" >&5 --$as_echo "${found_usable_python}" >&6; } -- -- elif test "${have_python_config}" != failed; then -- if test "${have_libpython}" = no; then -- -- -- new_CPPFLAGS=${python_includes} -- new_LIBS="-lpython2.7 ${python_libs}" -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python" >&5 --$as_echo_n "checking for python... " >&6; } -- save_CPPFLAGS=$CPPFLAGS -- save_LIBS=$LIBS -- CPPFLAGS="$CPPFLAGS $new_CPPFLAGS" -- LIBS="$new_LIBS $LIBS" -- found_usable_python=no -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ --#include "Python.h" --int --main () --{ --Py_Initialize (); -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_link "$LINENO"; then : -- have_libpython=yes -- found_usable_python=yes -- PYTHON_CPPFLAGS=$new_CPPFLAGS -- PYTHON_LIBS=$new_LIBS --fi --rm -f core conftest.err conftest.$ac_objext \ -- conftest$ac_exeext conftest.$ac_ext -- CPPFLAGS=$save_CPPFLAGS -- LIBS=$save_LIBS -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${found_usable_python}" >&5 --$as_echo "${found_usable_python}" >&6; } - -- fi -- if test "${have_libpython}" = no; then -+ #if PY_MAJOR_VERSION != 3 -+ # error "We only support Python 3" -+ #endif -+ Py_Initialize (); - -- -- new_CPPFLAGS=${python_includes} -- new_LIBS="-lpython2.6 ${python_libs}" -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python" >&5 --$as_echo_n "checking for python... " >&6; } -- save_CPPFLAGS=$CPPFLAGS -- save_LIBS=$LIBS -- CPPFLAGS="$CPPFLAGS $new_CPPFLAGS" -- LIBS="$new_LIBS $LIBS" -- found_usable_python=no -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ --#include "Python.h" --int --main () --{ --Py_Initialize (); - ; - return 0; - } -@@ -11856,7 +11787,6 @@ rm -f core conftest.err conftest.$ac_objext \ - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${found_usable_python}" >&5 - $as_echo "${found_usable_python}" >&6; } - -- fi - fi - - if test "${have_libpython}" = no; then -diff --git a/gdb/configure.ac b/gdb/configure.ac -index f7d6c61..771a54b 100644 ---- a/gdb/configure.ac -+++ b/gdb/configure.ac -@@ -912,7 +912,12 @@ AC_DEFUN([AC_TRY_LIBPYTHON], - LIBS="$new_LIBS $LIBS" - found_usable_python=no - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "Python.h"]], -- [[Py_Initialize ();]])], -+ [[ -+ #if PY_MAJOR_VERSION != 3 -+ # error "We only support Python 3" -+ #endif -+ Py_Initialize (); -+ ]])], - [have_libpython_var=yes - found_usable_python=yes - PYTHON_CPPFLAGS=$new_CPPFLAGS -@@ -928,7 +933,6 @@ dnl no - Don't include python support. - dnl yes - Include python support, error if it's missing. - dnl If we find python in $PATH, use it to fetch configure options, - dnl otherwise assume the compiler can find it with no help from us. --dnl Python 2.7 and 2.6 are tried in turn. - dnl auto - Same as "yes", but if python is missing from the system, - dnl fall back to "no". - dnl /path/to/python/exec-prefix - -@@ -937,7 +941,6 @@ dnl If /path/to/python/exec-prefix/bin/python exists, use it to find - dnl the compilation parameters. Otherwise use - dnl -I/path/to/python/exec-prefix/include, - dnl -L/path/to/python/exec-prefix/lib. --dnl Python 2.7 and 2.6 are tried in turn. - dnl NOTE: This case is historical. It is what was done for 7.0/7.1 - dnl but is deprecated. - dnl /path/to/python/executable - -@@ -1072,15 +1075,6 @@ else - if test "${have_python_config}" = yes; then - AC_TRY_LIBPYTHON(have_libpython, - ${python_includes}, ${python_libs}) -- elif test "${have_python_config}" != failed; then -- if test "${have_libpython}" = no; then -- AC_TRY_LIBPYTHON(have_libpython, -- ${python_includes}, "-lpython2.7 ${python_libs}") -- fi -- if test "${have_libpython}" = no; then -- AC_TRY_LIBPYTHON(have_libpython, -- ${python_includes}, "-lpython2.6 ${python_libs}") -- fi - fi - - if test "${have_libpython}" = no; then -diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi -index 918418b..220f90e 100644 ---- a/gdb/doc/python.texi -+++ b/gdb/doc/python.texi -@@ -18,8 +18,6 @@ - You can extend @value{GDBN} using the @uref{http://www.python.org/, - Python programming language}. This feature is available only if - @value{GDBN} was configured using @option{--with-python}. --@value{GDBN} can be built against either Python 2 or Python 3; which --one you have depends on this configure-time option. - - @cindex python directory - Python scripts used by @value{GDBN} should be installed in -diff --git a/gdb/python/lib/gdb/__init__.py b/gdb/python/lib/gdb/__init__.py -index 5f63bce..a52f6b4 100644 ---- a/gdb/python/lib/gdb/__init__.py -+++ b/gdb/python/lib/gdb/__init__.py -@@ -22,7 +22,7 @@ from contextlib import contextmanager - # Python 3 moved "reload" - if sys.version_info >= (3, 4): - from importlib import reload --elif sys.version_info[0] > 2: -+else: - from imp import reload - - from _gdb import * -diff --git a/gdb/python/lib/gdb/command/explore.py b/gdb/python/lib/gdb/command/explore.py -index ea49c38..c03bef3 100644 ---- a/gdb/python/lib/gdb/command/explore.py -+++ b/gdb/python/lib/gdb/command/explore.py -@@ -19,10 +19,6 @@ - import gdb - import sys - --if sys.version_info[0] > 2: -- # Python 3 renamed raw_input to input -- raw_input = input -- - - class Explorer(object): - """Internal class which invokes other explorers.""" -@@ -172,7 +168,7 @@ class Explorer(object): - so that the exploration session can shift back to the parent value. - Useful when exploring values. - """ -- raw_input("\nPress enter to return to parent value: ") -+ input("\nPress enter to return to parent value: ") - - @staticmethod - def return_to_enclosing_type(): -@@ -187,7 +183,7 @@ class Explorer(object): - so that the exploration session can shift back to the enclosing type. - Useful when exploring types. - """ -- raw_input("\nPress enter to return to enclosing type: ") -+ input("\nPress enter to return to enclosing type: ") - - - class ScalarExplorer(object): -@@ -244,7 +240,7 @@ class PointerExplorer(object): - "'%s' is a pointer to a value of type '%s'" - % (expr, str(value.type.target())) - ) -- option = raw_input( -+ option = input( - "Continue exploring it as a pointer to a single " "value [y/n]: " - ) - if option == "y": -@@ -264,13 +260,13 @@ class PointerExplorer(object): - ) - return False - -- option = raw_input("Continue exploring it as a pointer to an " "array [y/n]: ") -+ option = input("Continue exploring it as a pointer to an " "array [y/n]: ") - if option == "y": - while True: - index = 0 - try: - index = int( -- raw_input( -+ input( - "Enter the index of the element you " - "want to explore in '%s': " % expr - ) -@@ -338,7 +334,7 @@ class ArrayExplorer(object): - index = 0 - try: - index = int( -- raw_input( -+ input( - "Enter the index of the element you want to " - "explore in '%s': " % expr - ) -@@ -354,7 +350,7 @@ class ArrayExplorer(object): - str(element) - except gdb.MemoryError: - print("Cannot read value at index %d." % index) -- raw_input("Press enter to continue... ") -+ input("Press enter to continue... ") - return True - - Explorer.explore_expr( -@@ -474,7 +470,7 @@ class CompoundExplorer(object): - print("") - - if has_explorable_fields: -- choice = raw_input("Enter the field number of choice: ") -+ choice = input("Enter the field number of choice: ") - if choice in choice_to_compound_field_map: - Explorer.explore_expr( - choice_to_compound_field_map[choice][0], -@@ -550,7 +546,7 @@ class CompoundExplorer(object): - print("") - - if len(choice_to_compound_field_map) > 0: -- choice = raw_input("Enter the field number of choice: ") -+ choice = input("Enter the field number of choice: ") - if choice in choice_to_compound_field_map: - if is_child: - new_name = "%s '%s' of %s" % ( -diff --git a/gdb/python/lib/gdb/printer/bound_registers.py b/gdb/python/lib/gdb/printer/bound_registers.py -index f8ce9ea..7cb6e8f 100644 ---- a/gdb/python/lib/gdb/printer/bound_registers.py -+++ b/gdb/python/lib/gdb/printer/bound_registers.py -@@ -18,11 +18,6 @@ import sys - - import gdb.printing - --if sys.version_info[0] > 2: -- # Python 3 removed basestring and long -- basestring = str -- long = int -- - - class MpxBound128Printer: - """Adds size field to a mpx __gdb_builtin_type_bound128 type.""" -@@ -33,7 +28,7 @@ class MpxBound128Printer: - def to_string(self): - upper = self.val["ubound"] - lower = self.val["lbound"] -- size = (long)((upper) - (lower)) -+ size = upper - lower - if size > -1: - size = size + 1 - result = "{lbound = %s, ubound = %s} : size %s" % (lower, upper, size) -diff --git a/gdb/python/lib/gdb/printing.py b/gdb/python/lib/gdb/printing.py -index 93d61f1..e208e88 100644 ---- a/gdb/python/lib/gdb/printing.py -+++ b/gdb/python/lib/gdb/printing.py -@@ -21,11 +21,6 @@ import gdb.types - import re - import sys - --if sys.version_info[0] > 2: -- # Python 3 removed basestring and long -- basestring = str -- long = int -- - - class PrettyPrinter(object): - """A basic pretty-printer. -@@ -132,7 +127,7 @@ def register_pretty_printer(obj, printer, replace=False): - # Printers implemented as functions are old-style. In order to not risk - # breaking anything we do not check __name__ here. - if hasattr(printer, "name"): -- if not isinstance(printer.name, basestring): -+ if not isinstance(printer.name, str): - raise TypeError("printer name is not a string") - # If printer provides a name, make sure it doesn't contain ";". - # Semicolon is used by the info/enable/disable pretty-printer commands -@@ -232,7 +227,7 @@ class _EnumInstance: - - def to_string(self): - flag_list = [] -- v = long(self.val) -+ v = int(self.val) - any_found = False - for (e_name, e_value) in self.enumerators: - if v & e_value != 0: -diff --git a/gdb/python/lib/gdb/xmethod.py b/gdb/python/lib/gdb/xmethod.py -index 4c3a522..c69ea99 100644 ---- a/gdb/python/lib/gdb/xmethod.py -+++ b/gdb/python/lib/gdb/xmethod.py -@@ -21,12 +21,6 @@ import re - import sys - - --if sys.version_info[0] > 2: -- # Python 3 removed basestring and long -- basestring = str -- long = int -- -- - class XMethod(object): - """Base class (or a template) for an xmethod description. - -@@ -223,7 +217,7 @@ def _validate_xmethod_matcher(matcher): - return TypeError("Xmethod matcher is missing attribute: name") - if not hasattr(matcher, "enabled"): - return TypeError("Xmethod matcher is missing attribute: enabled") -- if not isinstance(matcher.name, basestring): -+ if not isinstance(matcher.name, str): - return TypeError("Attribute 'name' of xmethod matcher is not a " "string") - if matcher.name.find(";") >= 0: - return ValueError("Xmethod matcher name cannot contain ';' in it") -diff --git a/gdb/python/py-arch.c b/gdb/python/py-arch.c -index 0f273b3..e87881a 100644 ---- a/gdb/python/py-arch.c -+++ b/gdb/python/py-arch.c -@@ -139,12 +139,6 @@ archpy_disassemble (PyObject *self, PyObject *args, PyObject *kw) - conversion process. */ - if (PyLong_Check (end_obj)) - end = PyLong_AsUnsignedLongLong (end_obj); --#if PY_MAJOR_VERSION == 2 -- else if (PyInt_Check (end_obj)) -- /* If the end_pc value is specified without a trailing 'L', end_obj will -- be an integer and not a long integer. */ -- end = PyInt_AsLong (end_obj); --#endif - else - { - PyErr_SetString (PyExc_TypeError, -diff --git a/gdb/python/py-evts.c b/gdb/python/py-evts.c -index 457825c..23a5d75 100644 ---- a/gdb/python/py-evts.c -+++ b/gdb/python/py-evts.c -@@ -20,7 +20,6 @@ - #include "defs.h" - #include "py-events.h" - --#ifdef IS_PY3K - static struct PyModuleDef EventModuleDef = - { - PyModuleDef_HEAD_INIT, -@@ -33,7 +32,6 @@ static struct PyModuleDef EventModuleDef = - NULL, - NULL - }; --#endif - - /* Initialize python events. */ - -@@ -53,11 +51,7 @@ add_new_registry (eventregistry_object **registryp, const char *name) - int - gdbpy_initialize_py_events (void) - { --#ifdef IS_PY3K - gdb_py_events.module = PyModule_Create (&EventModuleDef); --#else -- gdb_py_events.module = Py_InitModule ("events", NULL); --#endif - - if (!gdb_py_events.module) - return -1; -diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c -index e6eb1ec..0170fe6 100644 ---- a/gdb/python/py-framefilter.c -+++ b/gdb/python/py-framefilter.c -@@ -920,11 +920,7 @@ py_print_frame (PyObject *filter, frame_filter_flags flags, - - function = function_to_free.get (); - } -- else if (PyLong_Check (py_func.get ()) --#if PY_MAJOR_VERSION == 2 -- || PyInt_Check (py_func.get ()) --#endif -- ) -+ else if (PyLong_Check (py_func.get ())) - { - CORE_ADDR addr; - struct bound_minimal_symbol msymbol; -diff --git a/gdb/python/py-membuf.c b/gdb/python/py-membuf.c -index 74cc0fb..348dfa3 100644 ---- a/gdb/python/py-membuf.c -+++ b/gdb/python/py-membuf.c -@@ -54,15 +54,7 @@ gdbpy_buffer_to_membuf (gdb::unique_xmalloc_ptr buffer, - membuf_obj->addr = address; - membuf_obj->length = length; - -- PyObject *result; --#ifdef IS_PY3K -- result = PyMemoryView_FromObject ((PyObject *) membuf_obj.get ()); --#else -- result = PyBuffer_FromReadWriteObject ((PyObject *) membuf_obj.get (), 0, -- Py_END_OF_BUFFER); --#endif -- -- return result; -+ return PyMemoryView_FromObject ((PyObject *) membuf_obj.get ()); - } - - /* Destructor for gdb.Membuf objects. */ -@@ -88,8 +80,6 @@ which is %s bytes long."), - pulongest (membuf_obj->length)); - } - --#ifdef IS_PY3K -- - static int - get_buffer (PyObject *self, Py_buffer *buf, int flags) - { -@@ -107,54 +97,6 @@ get_buffer (PyObject *self, Py_buffer *buf, int flags) - return ret; - } - --#else -- --static Py_ssize_t --get_read_buffer (PyObject *self, Py_ssize_t segment, void **ptrptr) --{ -- membuf_object *membuf_obj = (membuf_object *) self; -- -- if (segment) -- { -- PyErr_SetString (PyExc_SystemError, -- _("The memory buffer supports only one segment.")); -- return -1; -- } -- -- *ptrptr = membuf_obj->buffer; -- -- return membuf_obj->length; --} -- --static Py_ssize_t --get_write_buffer (PyObject *self, Py_ssize_t segment, void **ptrptr) --{ -- return get_read_buffer (self, segment, ptrptr); --} -- --static Py_ssize_t --get_seg_count (PyObject *self, Py_ssize_t *lenp) --{ -- if (lenp) -- *lenp = ((membuf_object *) self)->length; -- -- return 1; --} -- --static Py_ssize_t --get_char_buffer (PyObject *self, Py_ssize_t segment, char **ptrptr) --{ -- void *ptr = nullptr; -- Py_ssize_t ret; -- -- ret = get_read_buffer (self, segment, &ptr); -- *ptrptr = (char *) ptr; -- -- return ret; --} -- --#endif /* IS_PY3K */ -- - /* General Python initialization callback. */ - - int -@@ -168,24 +110,11 @@ gdbpy_initialize_membuf (void) - (PyObject *) &membuf_object_type); - } - --#ifdef IS_PY3K -- - static PyBufferProcs buffer_procs = - { - get_buffer - }; - --#else -- --static PyBufferProcs buffer_procs = { -- get_read_buffer, -- get_write_buffer, -- get_seg_count, -- get_char_buffer --}; -- --#endif /* IS_PY3K */ -- - PyTypeObject membuf_object_type = { - PyVarObject_HEAD_INIT (nullptr, 0) - "gdb.Membuf", /*tp_name*/ -diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c -index 00f917e..6be771c 100644 ---- a/gdb/python/py-param.c -+++ b/gdb/python/py-param.c -@@ -126,11 +126,7 @@ static PyObject * - get_attr (PyObject *obj, PyObject *attr_name) - { - if (PyString_Check (attr_name) --#ifdef IS_PY3K - && ! PyUnicode_CompareWithASCIIString (attr_name, "value")) --#else -- && ! strcmp (PyString_AsString (attr_name), "value")) --#endif - { - parmpy_object *self = (parmpy_object *) obj; - -@@ -313,11 +309,7 @@ static int - set_attr (PyObject *obj, PyObject *attr_name, PyObject *val) - { - if (PyString_Check (attr_name) --#ifdef IS_PY3K - && ! PyUnicode_CompareWithASCIIString (attr_name, "value")) --#else -- && ! strcmp (PyString_AsString (attr_name), "value")) --#endif - { - if (!val) - { -diff --git a/gdb/python/py-record-btrace.c b/gdb/python/py-record-btrace.c -index 2a0e89d..bee17e0 100644 ---- a/gdb/python/py-record-btrace.c -+++ b/gdb/python/py-record-btrace.c -@@ -28,16 +28,6 @@ - #include "disasm.h" - #include "gdbarch.h" - --#if defined (IS_PY3K) -- --#define BTPY_PYSLICE(x) (x) -- --#else -- --#define BTPY_PYSLICE(x) ((PySliceObject *) x) -- --#endif -- - /* Python object for btrace record lists. */ - - struct btpy_list_object { -@@ -295,12 +285,7 @@ recpy_bt_insn_data (PyObject *self, void *closure) - if (object == NULL) - return NULL; - --#ifdef IS_PY3K - return PyMemoryView_FromObject (object); --#else -- return PyBuffer_FromObject (object, 0, Py_END_OF_BUFFER); --#endif -- - } - - /* Implementation of RecordInstruction.decoded [str] for btrace. -@@ -500,7 +485,7 @@ btpy_list_slice (PyObject *self, PyObject *value) - if (!PySlice_Check (value)) - return PyErr_Format (PyExc_TypeError, _("Index must be int or slice.")); - -- if (0 != PySlice_GetIndicesEx (BTPY_PYSLICE (value), length, &start, &stop, -+ if (0 != PySlice_GetIndicesEx (value, length, &start, &stop, - &step, &slicelength)) - return NULL; - -diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c -index 7be3f32..8838884 100644 ---- a/gdb/python/py-type.c -+++ b/gdb/python/py-type.c -@@ -1610,9 +1610,6 @@ static PyNumberMethods type_object_as_number = { - NULL, /* nb_add */ - NULL, /* nb_subtract */ - NULL, /* nb_multiply */ --#ifndef IS_PY3K -- NULL, /* nb_divide */ --#endif - NULL, /* nb_remainder */ - NULL, /* nb_divmod */ - NULL, /* nb_power */ -@@ -1626,19 +1623,9 @@ static PyNumberMethods type_object_as_number = { - NULL, /* nb_and */ - NULL, /* nb_xor */ - NULL, /* nb_or */ --#ifdef IS_PY3K - NULL, /* nb_int */ - NULL, /* reserved */ --#else -- NULL, /* nb_coerce */ -- NULL, /* nb_int */ -- NULL, /* nb_long */ --#endif - NULL, /* nb_float */ --#ifndef IS_PY3K -- NULL, /* nb_oct */ -- NULL /* nb_hex */ --#endif - }; - - static PyMappingMethods typy_mapping = { -diff --git a/gdb/python/py-utils.c b/gdb/python/py-utils.c -index 838853c..e7b147c 100644 ---- a/gdb/python/py-utils.c -+++ b/gdb/python/py-utils.c -@@ -45,14 +45,10 @@ python_string_to_unicode (PyObject *obj) - unicode_str = obj; - Py_INCREF (obj); - } --#ifndef IS_PY3K -- else if (PyString_Check (obj)) -- unicode_str = PyUnicode_FromEncodedObject (obj, host_charset (), NULL); --#endif - else - { - PyErr_SetString (PyExc_TypeError, -- _("Expected a string or unicode object.")); -+ _("Expected a string object.")); - unicode_str = NULL; - } - -@@ -166,11 +162,7 @@ host_string_to_python_string (const char *str) - int - gdbpy_is_string (PyObject *obj) - { --#ifdef IS_PY3K - return PyUnicode_Check (obj); --#else -- return PyString_Check (obj) || PyUnicode_Check (obj); --#endif - } - - /* Return the string representation of OBJ, i.e., str (obj). -@@ -182,17 +174,7 @@ gdbpy_obj_to_string (PyObject *obj) - gdbpy_ref<> str_obj (PyObject_Str (obj)); - - if (str_obj != NULL) -- { -- gdb::unique_xmalloc_ptr msg; -- --#ifdef IS_PY3K -- msg = python_string_to_host_string (str_obj.get ()); --#else -- msg.reset (xstrdup (PyString_AsString (str_obj.get ()))); --#endif -- -- return msg; -- } -+ return python_string_to_host_string (str_obj.get ()); - - return NULL; - } -@@ -296,20 +278,9 @@ get_addr_from_python (PyObject *obj, CORE_ADDR *addr) - gdbpy_ref<> - gdb_py_object_from_longest (LONGEST l) - { --#ifdef IS_PY3K - if (sizeof (l) > sizeof (long)) - return gdbpy_ref<> (PyLong_FromLongLong (l)); - return gdbpy_ref<> (PyLong_FromLong (l)); --#else --#ifdef HAVE_LONG_LONG /* Defined by Python. */ -- /* If we have 'long long', and the value overflows a 'long', use a -- Python Long; otherwise use a Python Int. */ -- if (sizeof (l) > sizeof (long) -- && (l > PyInt_GetMax () || l < (- (LONGEST) PyInt_GetMax ()) - 1)) -- return gdbpy_ref<> (PyLong_FromLongLong (l)); --#endif -- return gdbpy_ref<> (PyInt_FromLong (l)); --#endif - } - - /* Convert a ULONGEST to the appropriate Python object -- either an -@@ -318,23 +289,9 @@ gdb_py_object_from_longest (LONGEST l) - gdbpy_ref<> - gdb_py_object_from_ulongest (ULONGEST l) - { --#ifdef IS_PY3K - if (sizeof (l) > sizeof (unsigned long)) - return gdbpy_ref<> (PyLong_FromUnsignedLongLong (l)); - return gdbpy_ref<> (PyLong_FromUnsignedLong (l)); --#else --#ifdef HAVE_LONG_LONG /* Defined by Python. */ -- /* If we have 'long long', and the value overflows a 'long', use a -- Python Long; otherwise use a Python Int. */ -- if (sizeof (l) > sizeof (unsigned long) && l > PyInt_GetMax ()) -- return gdbpy_ref<> (PyLong_FromUnsignedLongLong (l)); --#endif -- -- if (l > PyInt_GetMax ()) -- return gdbpy_ref<> (PyLong_FromUnsignedLong (l)); -- -- return gdbpy_ref<> (PyInt_FromLong (l)); --#endif - } - - /* Like PyInt_AsLong, but returns 0 on failure, 1 on success, and puts -diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c -index b546344..e779f49 100644 ---- a/gdb/python/py-value.c -+++ b/gdb/python/py-value.c -@@ -1695,41 +1695,6 @@ valpy_richcompare (PyObject *self, PyObject *other, int op) - Py_RETURN_FALSE; - } - --#ifndef IS_PY3K --/* Implements conversion to int. */ --static PyObject * --valpy_int (PyObject *self) --{ -- struct value *value = ((value_object *) self)->value; -- struct type *type = value_type (value); -- LONGEST l = 0; -- -- try -- { -- if (is_floating_value (value)) -- { -- type = builtin_type_pylong; -- value = value_cast (type, value); -- } -- -- if (!is_integral_type (type) -- && type->code () != TYPE_CODE_PTR) -- error (_("Cannot convert value to int.")); -- -- l = value_as_long (value); -- } -- catch (const gdb_exception &except) -- { -- GDB_PY_HANDLE_EXCEPTION (except); -- } -- -- if (type->is_unsigned ()) -- return gdb_py_object_from_ulongest (l).release (); -- else -- return gdb_py_object_from_longest (l).release (); --} --#endif -- - /* Implements conversion to long. */ - static PyObject * - valpy_long (PyObject *self) -@@ -1914,15 +1879,6 @@ convert_value_from_python (PyObject *obj) - else - value = value_from_longest (builtin_type_pylong, l); - } --#if PY_MAJOR_VERSION == 2 -- else if (PyInt_Check (obj)) -- { -- long l = PyInt_AsLong (obj); -- -- if (! PyErr_Occurred ()) -- value = value_from_longest (builtin_type_pyint, l); -- } --#endif - else if (PyFloat_Check (obj)) - { - double d = PyFloat_AsDouble (obj); -@@ -1948,14 +1904,8 @@ convert_value_from_python (PyObject *obj) - value = value_copy (((value_object *) result)->value); - } - else --#ifdef IS_PY3K - PyErr_Format (PyExc_TypeError, - _("Could not convert Python object: %S."), obj); --#else -- PyErr_Format (PyExc_TypeError, -- _("Could not convert Python object: %s."), -- PyString_AsString (PyObject_Str (obj))); --#endif - } - catch (const gdb_exception &except) - { -@@ -2176,9 +2126,6 @@ static PyNumberMethods value_object_as_number = { - valpy_add, - valpy_subtract, - valpy_multiply, --#ifndef IS_PY3K -- valpy_divide, --#endif - valpy_remainder, - NULL, /* nb_divmod */ - valpy_power, /* nb_power */ -@@ -2192,25 +2139,12 @@ static PyNumberMethods value_object_as_number = { - valpy_and, /* nb_and */ - valpy_xor, /* nb_xor */ - valpy_or, /* nb_or */ --#ifdef IS_PY3K - valpy_long, /* nb_int */ - NULL, /* reserved */ --#else -- NULL, /* nb_coerce */ -- valpy_int, /* nb_int */ -- valpy_long, /* nb_long */ --#endif - valpy_float, /* nb_float */ --#ifndef IS_PY3K -- NULL, /* nb_oct */ -- NULL, /* nb_hex */ --#endif - NULL, /* nb_inplace_add */ - NULL, /* nb_inplace_subtract */ - NULL, /* nb_inplace_multiply */ --#ifndef IS_PY3K -- NULL, /* nb_inplace_divide */ --#endif - NULL, /* nb_inplace_remainder */ - NULL, /* nb_inplace_power */ - NULL, /* nb_inplace_lshift */ -diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h -index 098d913..e3a3fc4 100644 ---- a/gdb/python/python-internal.h -+++ b/gdb/python/python-internal.h -@@ -87,11 +87,6 @@ - #include - #include "py-ref.h" - --#if PY_MAJOR_VERSION >= 3 --#define IS_PY3K 1 --#endif -- --#ifdef IS_PY3K - #define Py_TPFLAGS_CHECKTYPES 0 - - #define PyInt_Check PyLong_Check -@@ -102,7 +97,6 @@ - #define PyString_Decode PyUnicode_Decode - #define PyString_FromFormat PyUnicode_FromFormat - #define PyString_Check PyUnicode_Check --#endif - - /* If Python.h does not define WITH_THREAD, then the various - GIL-related functions will not be defined. However, -@@ -209,11 +203,7 @@ gdb_PySys_GetObject (const char *name) - before Python 3.6. Hence, we wrap it in a function to avoid errors - when compiled with -Werror. */ - --#ifdef IS_PY3K - # define GDB_PYSYS_SETPATH_CHAR wchar_t --#else --# define GDB_PYSYS_SETPATH_CHAR char --#endif - - static inline void - gdb_PySys_SetPath (const GDB_PYSYS_SETPATH_CHAR *path) -diff --git a/gdb/python/python.c b/gdb/python/python.c -index 91636ef..e97bca7 100644 ---- a/gdb/python/python.c -+++ b/gdb/python/python.c -@@ -317,11 +317,6 @@ eval_python_command (const char *command) - if (v == NULL) - return -1; - --#ifndef IS_PY3K -- if (Py_FlushLine ()) -- PyErr_Clear (); --#endif -- - return 0; - } - -@@ -1803,7 +1798,6 @@ finalize_python (void *ignore) - restore_active_ext_lang (previous_active); - } - --#ifdef IS_PY3K - static struct PyModuleDef python_GdbModuleDef = - { - PyModuleDef_HEAD_INIT, -@@ -1826,7 +1820,6 @@ init__gdb_module (void) - { - return PyModule_Create (&python_GdbModuleDef); - } --#endif - - /* Emit a gdb.GdbExitingEvent, return a negative value if there are any - errors, otherwise, return 0. */ -@@ -1873,7 +1866,6 @@ do_start_initialization () - gdb::unique_xmalloc_ptr progname - (concat (ldirname (python_libdir.c_str ()).c_str (), SLASH_STRING, "bin", - SLASH_STRING, "python", (char *) NULL)); --#ifdef IS_PY3K - /* Python documentation indicates that the memory given - to Py_SetProgramName cannot be freed. However, it seems that - at least Python 3.7.4 Py_SetProgramName takes a copy of the -@@ -1902,9 +1894,6 @@ do_start_initialization () - - /* Define _gdb as a built-in module. */ - PyImport_AppendInittab ("_gdb", init__gdb_module); --#else -- Py_SetProgramName (progname.release ()); --#endif - #endif - - Py_Initialize (); -@@ -1915,11 +1904,7 @@ do_start_initialization () - PyEval_InitThreads (); - #endif - --#ifdef IS_PY3K - gdb_module = PyImport_ImportModule ("_gdb"); --#else -- gdb_module = Py_InitModule ("_gdb", python_GdbMethods); --#endif - if (gdb_module == NULL) - return false; - -@@ -2220,11 +2205,7 @@ do_initialize (const struct extension_language_defn *extlang) - /* If sys.path is not defined yet, define it first. */ - if (!(sys_path && PyList_Check (sys_path))) - { --#ifdef IS_PY3K - PySys_SetPath (L""); --#else -- PySys_SetPath (""); --#endif - sys_path = PySys_GetObject ("path"); - } - if (sys_path && PyList_Check (sys_path)) -diff --git a/gdb/testsuite/gdb.python/py-inferior.exp b/gdb/testsuite/gdb.python/py-inferior.exp -index aa78a15..552f9b1 100644 ---- a/gdb/testsuite/gdb.python/py-inferior.exp -+++ b/gdb/testsuite/gdb.python/py-inferior.exp -@@ -77,11 +77,7 @@ gdb_py_test_silent_cmd "python addr = gdb.selected_frame ().read_var ('str')" \ - "read str address" 0 - gdb_py_test_silent_cmd "python str = gdb.inferiors()\[0\].read_memory (addr, 5); print(str)" \ - "read str contents" 1 --if { $gdb_py_is_py3k == 0 } { -- gdb_py_test_silent_cmd "python a = 'a'" "" 0 --} else { -- gdb_py_test_silent_cmd "python a = bytes('a', 'ascii')" "" 0 --} -+gdb_py_test_silent_cmd "python a = bytes('a', 'ascii')" "" 0 - gdb_py_test_silent_cmd "python str\[1\] = a" "change str" 0 - gdb_py_test_silent_cmd "python gdb.inferiors()\[0\].write_memory (addr, str)" \ - "write str" 1 -diff --git a/gdb/testsuite/gdb.python/py-mi-var-info-path-expression.py b/gdb/testsuite/gdb.python/py-mi-var-info-path-expression.py -index dfc2ebd..035478f 100644 ---- a/gdb/testsuite/gdb.python/py-mi-var-info-path-expression.py -+++ b/gdb/testsuite/gdb.python/py-mi-var-info-path-expression.py -@@ -17,27 +17,23 @@ import sys - import gdb - import gdb.types - --# Following is for Python 3 compatibility... --if sys.version_info[0] > 2: -- long = int -- - - class cons_pp(object): - def __init__(self, val): - self._val = val - - def to_string(self): -- if long(self._val) == 0: -+ if int(self._val) == 0: - return "nil" -- elif long(self._val["type"]) == 0: -+ elif int(self._val["type"]) == 0: - return "( . )" - else: - return "%d" % self._val["atom"]["ival"] - - def children(self): -- if long(self._val) == 0: -+ if int(self._val) == 0: - return [] -- elif long(self._val["type"]) == 0: -+ elif int(self._val["type"]) == 0: - return [("atom", self._val["atom"])] - else: - return [ -diff --git a/gdb/testsuite/gdb.python/py-record-btrace.exp b/gdb/testsuite/gdb.python/py-record-btrace.exp -index 8204577..e9fdd06 100644 ---- a/gdb/testsuite/gdb.python/py-record-btrace.exp -+++ b/gdb/testsuite/gdb.python/py-record-btrace.exp -@@ -85,11 +85,7 @@ with_test_prefix "instruction " { - gdb_test "python print(i.number)" "1" - gdb_test "python print(i.sal)" "symbol and line for .*" - gdb_test "python print(i.pc)" "$decimal" -- if { $gdb_py_is_py3k == 0 } { -- gdb_test "python print(repr(i.data))" "" -- } else { -- gdb_test "python print(repr(i.data))" "" -- } -+ gdb_test "python print(repr(i.data))" "" - gdb_test "python print(i.decoded)" ".*" - gdb_test "python print(i.size)" "$decimal" - gdb_test "python print(i.is_speculative)" "False" -diff --git a/gdb/testsuite/gdb.python/py-send-packet.py b/gdb/testsuite/gdb.python/py-send-packet.py -index 4966688..a6adc82 100644 ---- a/gdb/testsuite/gdb.python/py-send-packet.py -+++ b/gdb/testsuite/gdb.python/py-send-packet.py -@@ -81,17 +81,9 @@ def run_send_packet_test(): - # the 'maint packet' command so that the output from the two sources - # can be compared. - def bytes_to_string(byte_array): -- -- # Python 2/3 compatibility. We need a function that can give us -- # the value of a single element in BYTE_ARRAY as an integer. -- if sys.version_info[0] > 2: -- value_of_single_byte = int -- else: -- value_of_single_byte = ord -- - res = "" - for b in byte_array: -- b = value_of_single_byte(b) -+ b = int(b) - if b >= 32 and b <= 126: - res = res + ("%c" % b) - else: -@@ -136,39 +128,23 @@ def run_set_global_var_test(): - res = conn.send_packet(b"X%x,4:\x02\x02\x02\x02" % addr) - assert isinstance(res, bytes) - check_global_var(0x02020202) -- if sys.version_info[0] > 2: -- # On Python 3 this first attempt will not work as we're -- # passing a Unicode string containing non-ascii characters. -- saw_error = False -- try: -- res = conn.send_packet("X%x,4:\xff\xff\xff\xff" % addr) -- except UnicodeError: -- saw_error = True -- except: -- assert False -- assert saw_error -- check_global_var(0x02020202) -- # Now we pass a bytes object, which will work. -- res = conn.send_packet(b"X%x,4:\xff\xff\xff\xff" % addr) -- check_global_var(0xFFFFFFFF) -- else: -- # On Python 2 we need to force the creation of a Unicode -- # string, but, with that done, we expect to see the same error -- # as on Python 3; the unicode string contains non-ascii -- # characters. -- saw_error = False -- try: -- res = conn.send_packet(unicode("X%x,4:\xff\xff\xff\xff") % addr) -- except UnicodeError: -- saw_error = True -- except: -- assert False -- assert saw_error -- check_global_var(0x02020202) -- # Now we pass a plain string, which, on Python 2, is the same -- # as a bytes object, this, we expect to work. -+ -+ # This first attempt will not work as we're passing a Unicode string -+ # containing non-ascii characters. -+ saw_error = False -+ try: - res = conn.send_packet("X%x,4:\xff\xff\xff\xff" % addr) -- check_global_var(0xFFFFFFFF) -+ except UnicodeError: -+ saw_error = True -+ except: -+ assert False -+ -+ assert saw_error -+ check_global_var(0x02020202) -+ # Now we pass a bytes object, which will work. -+ res = conn.send_packet(b"X%x,4:\xff\xff\xff\xff" % addr) -+ check_global_var(0xFFFFFFFF) -+ - print("set global_var test passed") - - -diff --git a/gdb/testsuite/gdb.python/py-shared.exp b/gdb/testsuite/gdb.python/py-shared.exp -index 61c057a..2d33902 100644 ---- a/gdb/testsuite/gdb.python/py-shared.exp -+++ b/gdb/testsuite/gdb.python/py-shared.exp -@@ -57,14 +57,11 @@ runto [gdb_get_line_number "Break to end."] - # Test gdb.solib_name - gdb_test "p &func1" "" "func1 address" - gdb_py_test_silent_cmd "python func1 = gdb.history(0)" "Aquire func1 address" 1 --if { $gdb_py_is_py3k == 1 } { -- gdb_py_test_silent_cmd "python long = int" "" 0 --} --gdb_test "python print (gdb.solib_name(long(func1)))" "py-shared-sl.sl" "test func1 solib location" -+gdb_test "python print (gdb.solib_name(int(func1)))" "py-shared-sl.sl" "test func1 solib location" - - gdb_test "p &main" "" "main address" - gdb_py_test_silent_cmd "python main = gdb.history(0)" "Aquire main address" 1 --gdb_test "python print (gdb.solib_name(long(main)))" "None" "test main solib location" -+gdb_test "python print (gdb.solib_name(int(main)))" "None" "test main solib location" - - if {[is_lp64_target]} { - gdb_test "python print (len(\[gdb.solib_name(0xffffffffffffffff)\]))" "1" -diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp -index 2ea8363..b88c451 100644 ---- a/gdb/testsuite/gdb.python/py-value.exp -+++ b/gdb/testsuite/gdb.python/py-value.exp -@@ -47,33 +47,19 @@ proc build_inferior {exefile lang} { - - proc test_value_creation {} { - global gdb_prompt -- global gdb_py_is_py3k - - gdb_py_test_silent_cmd "python i = gdb.Value (True)" "create boolean value" 1 - gdb_py_test_silent_cmd "python i = gdb.Value (5)" "create integer value" 1 - gdb_py_test_silent_cmd "python i = gdb.Value (3,None)" "create integer value, with None type" 1 -- if { $gdb_py_is_py3k == 0 } { -- gdb_py_test_silent_cmd "python i = gdb.Value (5L)" "create long value" 1 -- } - - gdb_py_test_silent_cmd "python l = gdb.Value(0xffffffff12345678)" "create large unsigned 64-bit value" 1 -- if { $gdb_py_is_py3k == 0 } { -- gdb_test "python print long(l)" "18446744069720004216" "large unsigned 64-bit int conversion to python" -- } else { -- gdb_test "python print (int(l))" "18446744069720004216" "large unsigned 64-bit int conversion to python" -- } -+ gdb_test "python print (int(l))" "18446744069720004216" "large unsigned 64-bit int conversion to python" - - gdb_py_test_silent_cmd "python f = gdb.Value (1.25)" "create double value" 1 - gdb_py_test_silent_cmd "python a = gdb.Value ('string test')" "create 8-bit string value" 1 - gdb_test "python print (a)" "\"string test\"" "print 8-bit string" - gdb_test "python print (a.__class__)" "<(type|class) 'gdb.Value'>" "verify type of 8-bit string" - -- if { $gdb_py_is_py3k == 0 } { -- gdb_py_test_silent_cmd "python a = gdb.Value (u'unicode test')" "create unicode value" 1 -- gdb_test "python print (a)" "\"unicode test\"" "print Unicode string" -- gdb_test "python print (a.__class__)" "<(type|class) 'gdb.Value'>" "verify type of unicode string" -- } -- - # Test address attribute is None in a non-addressable value - gdb_test "python print ('result = %s' % i.address)" "= None" "test address attribute in non-addressable value" - -@@ -95,7 +81,6 @@ proc test_value_reinit {} { - - proc test_value_numeric_ops {} { - global gdb_prompt -- global gdb_py_is_py3k - - gdb_py_test_silent_cmd "python i = gdb.Value (5)" "create first integer value" 0 - gdb_py_test_silent_cmd "python j = gdb.Value (2)" "create second integer value" 0 -@@ -147,9 +132,6 @@ proc test_value_numeric_ops {} { - gdb_test_no_output "python b = gdb.history (0)" "" - - gdb_test "python print(int(b))" "5" "convert pointer to int" -- if {!$gdb_py_is_py3k} { -- gdb_test "python print(long(b))" "5" "convert pointer to long" -- } - - gdb_test "python print ('result = ' + str(a+5))" " = 0x7( <.*>)?" "add pointer value with python integer" - gdb_test "python print ('result = ' + str(b-2))" " = 0x3( <.*>)?" "subtract python integer from pointer value" -@@ -159,17 +141,11 @@ proc test_value_numeric_ops {} { - "result = r" "use value as string index" - gdb_test "python print ('result = ' + str((1,2,3)\[gdb.Value(0)\]))" \ - "result = 1" "use value as tuple index" -- if {!$gdb_py_is_py3k} { -- gdb_test "python print ('result = ' + str(\[1,2,3\]\[gdb.Value(0)\]))" \ -- "result = 1" "use value as array index" -- } -+ gdb_test "python print ('result = ' + str(\[1,2,3\]\[gdb.Value(0)\]))" \ -+ "result = 1" "use value as array index" - - gdb_test "python print('%x' % int(gdb.parse_and_eval('-1ull')))" \ - "f+" "int conversion respect type sign" -- if {!$gdb_py_is_py3k} { -- gdb_test "python print('%x' % long(gdb.parse_and_eval('-1ull')))" \ -- "f+" "long conversion respect type sign" -- } - - # Test some invalid operations. - -@@ -245,7 +221,6 @@ proc test_value_compare {} { - proc test_value_in_inferior {} { - global gdb_prompt - global testfile -- global gdb_py_is_py3k - - gdb_breakpoint [gdb_get_line_number "break to inspect struct and union"] - gdb_continue_to_breakpoint "break to inspect struct and union" -@@ -256,9 +231,6 @@ proc test_value_in_inferior {} { - gdb_py_test_silent_cmd "python s = gdb.history (0)" "get value s from history" 1 - - gdb_test "python print ('result = ' + str(s\['a'\]))" " = 3" "access element inside struct using 8-bit string name" -- if { $gdb_py_is_py3k == 0 } { -- gdb_test "python print ('result = ' + str(s\[u'a'\]))" " = 3" "access element inside struct using unicode name" -- } - - # Test dereferencing the argv pointer - -@@ -536,13 +508,8 @@ proc test_value_hash {} { - } - - proc test_float_conversion {} { -- global gdb_py_is_py3k - gdb_test "python print(int(gdb.Value(0)))" "0" - gdb_test "python print(int(gdb.Value(2.5)))" "2" -- if {!$gdb_py_is_py3k} { -- gdb_test "python print(long(gdb.Value(0)))" "0" -- gdb_test "python print(long(gdb.Value(2.5)))" "2" -- } - gdb_test "python print(float(gdb.Value(2.5)))" "2\\.5" - gdb_test "python print(float(gdb.Value(0)))" "0\\.0" - } -@@ -568,7 +535,6 @@ proc prepare_type_and_buffer {} { - - proc test_value_from_buffer {} { - global gdb_prompt -- global gdb_py_is_py3k - - prepare_type_and_buffer - gdb_test "python v=gdb.Value(b,tp); print(v)" "1" \ -diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index efe1c39..ba8b930 100644 ---- a/gdb/testsuite/lib/gdb.exp -+++ b/gdb/testsuite/lib/gdb.exp -@@ -2340,8 +2340,6 @@ proc skip_rust_tests {} { - # PROMPT_REGEXP is the expected prompt. - - proc skip_python_tests_prompt { prompt_regexp } { -- global gdb_py_is_py3k -- - gdb_test_multiple "python print ('test')" "verify python support" \ - -prompt "$prompt_regexp" { - -re "not supported.*$prompt_regexp" { -@@ -2351,16 +2349,6 @@ proc skip_python_tests_prompt { prompt_regexp } { - -re "$prompt_regexp" {} - } - -- gdb_test_multiple "python print (sys.version_info\[0\])" "check if python 3" \ -- -prompt "$prompt_regexp" { -- -re "3.*$prompt_regexp" { -- set gdb_py_is_py3k 1 -- } -- -re ".*$prompt_regexp" { -- set gdb_py_is_py3k 0 -- } -- } -- - return 0 - } - --- -2.33.0 - diff --git a/gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch b/gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch new file mode 100644 index 0000000000000000000000000000000000000000..1d6e1fb0f105d13386c9efb18768b6eaceba4f26 --- /dev/null +++ b/gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch @@ -0,0 +1,264 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Sat, 25 Nov 2023 10:35:37 +0000 +Subject: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch + +;; Back-port upstream commit acc117b57f7 as part of a fix for +;; non-deterministic gdb-index generation (RH BZ 2232086). + +gdb: C++-ify mapped_symtab from dwarf2/index-write.c + +Make static the functions add_index_entry, find_slot, and hash_expand, +member functions of the mapped_symtab class. + +Fold an additional snippet of code from write_gdbindex into +mapped_symtab::minimize, this code relates to minimisation, so this +seems like a good home for it. + +Make the n_elements, data, and m_string_obstack member variables of +mapped_symtab private. Provide a new obstack() member function to +provide access to the obstack when needed, and also add member +functions begin(), end(), cbegin(), and cend() so that the +mapped_symtab class can be treated like a contained and iterated +over. + +I've also taken this opportunity to split out the logic for whether +the hash table (m_data) needs expanding, this is the new function +hash_needs_expanding. This will be useful in a later commit. + +There should be no user visible changes after this commit. + +Approved-By: Tom Tromey + +diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c +--- a/gdb/dwarf2/index-write.c ++++ b/gdb/dwarf2/index-write.c +@@ -187,86 +187,135 @@ struct mapped_symtab + { + mapped_symtab () + { +- data.resize (1024); ++ m_data.resize (1024); + } + +- /* Minimize each entry in the symbol table, removing duplicates. */ ++ /* If there are no elements in the symbol table, then reduce the table ++ size to zero. Otherwise call symtab_index_entry::minimize each entry ++ in the symbol table. */ ++ + void minimize () + { +- for (symtab_index_entry &item : data) ++ if (m_element_count == 0) ++ m_data.resize (0); ++ ++ for (symtab_index_entry &item : m_data) + item.minimize (); + } + +- offset_type n_elements = 0; +- std::vector data; ++ /* Add an entry to SYMTAB. NAME is the name of the symbol. CU_INDEX is ++ the index of the CU in which the symbol appears. IS_STATIC is one if ++ the symbol is static, otherwise zero (global). */ ++ ++ void add_index_entry (const char *name, int is_static, ++ gdb_index_symbol_kind kind, offset_type cu_index); ++ ++ /* Access the obstack. */ ++ struct obstack *obstack () ++ { return &m_string_obstack; } ++ ++private: ++ ++ /* Find a slot in SYMTAB for the symbol NAME. Returns a reference to ++ the slot. ++ ++ Function is used only during write_hash_table so no index format ++ backward compatibility is needed. */ ++ ++ symtab_index_entry &find_slot (const char *name); ++ ++ /* Expand SYMTAB's hash table. */ ++ ++ void hash_expand (); ++ ++ /* Return true if the hash table in data needs to grow. */ ++ ++ bool hash_needs_expanding () const ++ { return 4 * m_element_count / 3 >= m_data.size (); } ++ ++ /* A vector that is used as a hash table. */ ++ std::vector m_data; ++ ++ /* The number of elements stored in the m_data hash. */ ++ offset_type m_element_count = 0; + + /* Temporary storage for names. */ + auto_obstack m_string_obstack; +-}; + +-/* Find a slot in SYMTAB for the symbol NAME. Returns a reference to +- the slot. ++public: ++ using iterator = decltype (m_data)::iterator; ++ using const_iterator = decltype (m_data)::const_iterator; + +- Function is used only during write_hash_table so no index format backward +- compatibility is needed. */ ++ iterator begin () ++ { return m_data.begin (); } + +-static symtab_index_entry & +-find_slot (struct mapped_symtab *symtab, const char *name) ++ iterator end () ++ { return m_data.end (); } ++ ++ const_iterator cbegin () ++ { return m_data.cbegin (); } ++ ++ const_iterator cend () ++ { return m_data.cend (); } ++}; ++ ++/* See class definition. */ ++ ++symtab_index_entry & ++mapped_symtab::find_slot (const char *name) + { + offset_type index, step, hash = mapped_index_string_hash (INT_MAX, name); + +- index = hash & (symtab->data.size () - 1); +- step = ((hash * 17) & (symtab->data.size () - 1)) | 1; ++ index = hash & (m_data.size () - 1); ++ step = ((hash * 17) & (m_data.size () - 1)) | 1; + + for (;;) + { +- if (symtab->data[index].name == NULL +- || strcmp (name, symtab->data[index].name) == 0) +- return symtab->data[index]; +- index = (index + step) & (symtab->data.size () - 1); ++ if (m_data[index].name == NULL ++ || strcmp (name, m_data[index].name) == 0) ++ return m_data[index]; ++ index = (index + step) & (m_data.size () - 1); + } + } + +-/* Expand SYMTAB's hash table. */ ++/* See class definition. */ + +-static void +-hash_expand (struct mapped_symtab *symtab) ++void ++mapped_symtab::hash_expand () + { +- auto old_entries = std::move (symtab->data); ++ auto old_entries = std::move (m_data); + +- symtab->data.clear (); +- symtab->data.resize (old_entries.size () * 2); ++ gdb_assert (m_data.size () == 0); ++ m_data.resize (old_entries.size () * 2); + + for (auto &it : old_entries) + if (it.name != NULL) + { +- auto &ref = find_slot (symtab, it.name); ++ auto &ref = this->find_slot (it.name); + ref = std::move (it); + } + } + +-/* Add an entry to SYMTAB. NAME is the name of the symbol. +- CU_INDEX is the index of the CU in which the symbol appears. +- IS_STATIC is one if the symbol is static, otherwise zero (global). */ ++/* See class definition. */ + +-static void +-add_index_entry (struct mapped_symtab *symtab, const char *name, +- int is_static, gdb_index_symbol_kind kind, +- offset_type cu_index) ++void ++mapped_symtab::add_index_entry (const char *name, int is_static, ++ gdb_index_symbol_kind kind, ++ offset_type cu_index) + { +- symtab_index_entry *slot = &find_slot (symtab, name); ++ symtab_index_entry *slot = &this->find_slot (name); + if (slot->name == NULL) + { + /* This is a new element in the hash table. */ +- ++symtab->n_elements; ++ ++this->m_element_count; + + /* We might need to grow the hash table. */ +- if (4 * symtab->n_elements / 3 >= symtab->data.size ()) ++ if (this->hash_needs_expanding ()) + { +- hash_expand (symtab); ++ this->hash_expand (); + + /* This element will have a different slot in the new table. */ +- slot = &find_slot (symtab, name); ++ slot = &this->find_slot (name); + + /* But it should still be a new element in the hash table. */ + gdb_assert (slot->name == nullptr); +@@ -387,7 +436,7 @@ write_hash_table (mapped_symtab *symtab, data_buf &output, data_buf &cpool) + + /* We add all the index vectors to the constant pool first, to + ensure alignment is ok. */ +- for (symtab_index_entry &entry : symtab->data) ++ for (symtab_index_entry &entry : *symtab) + { + if (entry.name == NULL) + continue; +@@ -416,7 +465,7 @@ write_hash_table (mapped_symtab *symtab, data_buf &output, data_buf &cpool) + + /* Now write out the hash table. */ + std::unordered_map str_table; +- for (const auto &entry : symtab->data) ++ for (const auto &entry : *symtab) + { + offset_type str_off, vec_off; + +@@ -1151,7 +1200,7 @@ write_cooked_index (cooked_index *table, + const auto it = cu_index_htab.find (entry->per_cu); + gdb_assert (it != cu_index_htab.cend ()); + +- const char *name = entry->full_name (&symtab->m_string_obstack); ++ const char *name = entry->full_name (symtab->obstack ()); + + if (entry->per_cu->lang () == language_ada) + { +@@ -1159,7 +1208,7 @@ write_cooked_index (cooked_index *table, + gdb, it has to use the encoded name, with any + suffixes stripped. */ + std::string encoded = ada_encode (name, false); +- name = obstack_strdup (&symtab->m_string_obstack, ++ name = obstack_strdup (symtab->obstack (), + encoded.c_str ()); + } + else if (entry->per_cu->lang () == language_cplus +@@ -1191,8 +1240,8 @@ write_cooked_index (cooked_index *table, + else + kind = GDB_INDEX_SYMBOL_KIND_TYPE; + +- add_index_entry (symtab, name, (entry->flags & IS_STATIC) != 0, +- kind, it->second); ++ symtab->add_index_entry (name, (entry->flags & IS_STATIC) != 0, ++ kind, it->second); + } + } + +@@ -1267,8 +1316,6 @@ write_gdbindex (dwarf2_per_bfd *per_bfd, cooked_index *table, + symtab.minimize (); + + data_buf symtab_vec, constant_pool; +- if (symtab.n_elements == 0) +- symtab.data.resize (0); + + write_hash_table (&symtab, symtab_vec, constant_pool); + diff --git a/gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch b/gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch new file mode 100644 index 0000000000000000000000000000000000000000..e9b0b9e3c1e09c413e0f264e5501ce38e1d7c8a1 --- /dev/null +++ b/gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch @@ -0,0 +1,101 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Mon, 27 Nov 2023 13:19:39 +0000 +Subject: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch + +;; Back-port upstream commit 3644f41dc80 as part of a fix for +;; non-deterministic gdb-index generation (RH BZ 2232086). + +gdb: generate dwarf-5 index identically as worker-thread count changes + +Similar to the previous commit, this commit ensures that the dwarf-5 +index files are generated identically as the number of worker-threads +changes. + +Building the dwarf-5 index makes use of a closed hash table, the +bucket_hash local within debug_names::build(). Entries are added to +bucket_hash from m_name_to_value_set, which, in turn, is populated +by calls to debug_names::insert() in write_debug_names. The insert +calls are ordered based on the entries within the cooked_index, and +the ordering within cooked_index depends on the number of worker +threads that GDB is using. + +My proposal is to sort each chain within the bucket_hash closed hash +table prior to using this to build the dwarf-5 index. + +The buckets within bucket_hash will always have the same ordering (for +a given GDB build with a given executable), and by sorting the chains +within each bucket, we can be sure that GDB will see each entry in a +deterministic order. + +I've extended the index creation test to cover this case. + +Approved-By: Tom Tromey + +diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c +--- a/gdb/dwarf2/index-write.c ++++ b/gdb/dwarf2/index-write.c +@@ -452,6 +452,11 @@ class c_str_view + return strcmp (m_cstr, other.m_cstr) == 0; + } + ++ bool operator< (const c_str_view &other) const ++ { ++ return strcmp (m_cstr, other.m_cstr) < 0; ++ } ++ + /* Return the underlying C string. Note, the returned string is + only a reference with lifetime of this object. */ + const char *c_str () const +@@ -771,10 +776,18 @@ class debug_names + } + for (size_t bucket_ix = 0; bucket_ix < bucket_hash.size (); ++bucket_ix) + { +- const std::forward_list &hashitlist +- = bucket_hash[bucket_ix]; ++ std::forward_list &hashitlist = bucket_hash[bucket_ix]; + if (hashitlist.empty ()) + continue; ++ ++ /* Sort the items within each bucket. This ensures that the ++ generated index files will be the same no matter the order in ++ which symbols were added into the index. */ ++ hashitlist.sort ([] (const hash_it_pair &a, const hash_it_pair &b) ++ { ++ return a.it->first < b.it->first; ++ }); ++ + uint32_t &bucket_slot = m_bucket_table[bucket_ix]; + /* The hashes array is indexed starting at 1. */ + store_unsigned_integer (reinterpret_cast (&bucket_slot), +diff --git a/gdb/testsuite/gdb.gdb/index-file.exp b/gdb/testsuite/gdb.gdb/index-file.exp +--- a/gdb/testsuite/gdb.gdb/index-file.exp ++++ b/gdb/testsuite/gdb.gdb/index-file.exp +@@ -47,6 +47,9 @@ remote_exec host "mkdir -p ${dir1}" + with_timeout_factor $timeout_factor { + gdb_test_no_output "save gdb-index $dir1" \ + "create gdb-index file" ++ ++ gdb_test_no_output "save gdb-index -dwarf-5 $dir1" \ ++ "create dwarf-index files" + } + + # Close GDB. +@@ -143,13 +146,16 @@ if { $worker_threads > 1 } { + with_timeout_factor $timeout_factor { + gdb_test_no_output "save gdb-index $dir2" \ + "create second gdb-index file" ++ ++ gdb_test_no_output "save gdb-index -dwarf-5 $dir2" \ ++ "create second dwarf-index files" + } + + # Close GDB. + gdb_exit + + # Now check that the index files are identical. +- foreach suffix { gdb-index } { ++ foreach suffix { gdb-index debug_names debug_str } { + set result \ + [remote_exec host \ + "cmp -s \"$dir1/${index_filename_base}.${suffix}\" \"$dir2/${index_filename_base}.${suffix}\""] diff --git a/gdb-rhbz-2232086-generate-gdb-index-consistently.patch b/gdb-rhbz-2232086-generate-gdb-index-consistently.patch new file mode 100644 index 0000000000000000000000000000000000000000..d6917ec465ad5bf5bb16282cba4be5d604d6e712 --- /dev/null +++ b/gdb-rhbz-2232086-generate-gdb-index-consistently.patch @@ -0,0 +1,230 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Fri, 24 Nov 2023 12:04:36 +0000 +Subject: gdb-rhbz-2232086-generate-gdb-index-consistently.patch + +;; Back-port upstream commit aff250145af as part of a fix for +;; non-deterministic gdb-index generation (RH BZ 2232086). + +gdb: generate gdb-index identically regardless of work thread count + +It was observed that changing the number of worker threads that GDB +uses (maintenance set worker-threads NUM) would have an impact on the +layout of the generated gdb-index. + +The cause seems to be how the CU are distributed between threads, and +then symbols that appear in multiple CU can be encountered earlier or +later depending on whether a particular CU moves between threads. + +I certainly found this behaviour was reproducible when generating an +index for GDB itself, like: + + gdb -q -nx -nh -batch \ + -eiex 'maint set worker-threads NUM' \ + -ex 'save gdb-index /tmp/' + +And then setting different values for NUM will change the generated +index. + +Now, the question is: does this matter? + +I would like to suggest that yes, this does matter. At Red Hat we +generate a gdb-index as part of the build process, and we would +ideally like to have reproducible builds: for the same source, +compiled with the same tool-chain, we should get the exact same output +binary. And we do .... except for the index. + +Now we could simply force GDB to only use a single worker thread when +we build the index, but, I don't think the idea of reproducible builds +is that strange, so I think we should ensure that our generated +indexes are always reproducible. + +To achieve this, I propose that we add an extra step when building the +gdb-index file. After constructing the initial symbol hash table +contents, we will pull all the symbols out of the hash, sort them, +then re-insert them in sorted order. This will ensure that the +structure of the generated hash will remain consistent (given the same +set of symbols). + +I've extended the existing index-file test to check that the generated +index doesn't change if we adjust the number of worker threads used. +Given that this test is already rather slow, I've only made one change +to the worker-thread count. Maybe this test should be changed to use +a smaller binary, which is quicker to load, and for which we could +then try many different worker thread counts. + +Approved-By: Tom Tromey + +diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c +--- a/gdb/dwarf2/index-write.c ++++ b/gdb/dwarf2/index-write.c +@@ -210,6 +210,13 @@ struct mapped_symtab + void add_index_entry (const char *name, int is_static, + gdb_index_symbol_kind kind, offset_type cu_index); + ++ /* When entries are originally added into the data hash the order will ++ vary based on the number of worker threads GDB is configured to use. ++ This function will rebuild the hash such that the final layout will be ++ deterministic regardless of the number of worker threads used. */ ++ ++ void sort (); ++ + /* Access the obstack. */ + struct obstack *obstack () + { return &m_string_obstack; } +@@ -296,6 +303,65 @@ mapped_symtab::hash_expand () + } + } + ++/* See mapped_symtab class declaration. */ ++ ++void mapped_symtab::sort () ++{ ++ /* Move contents out of this->data vector. */ ++ std::vector original_data = std::move (m_data); ++ ++ /* Restore the size of m_data, this will avoid having to expand the hash ++ table (and rehash all elements) when we reinsert after sorting. ++ However, we do reset the element count, this allows for some sanity ++ checking asserts during the reinsert phase. */ ++ gdb_assert (m_data.size () == 0); ++ m_data.resize (original_data.size ()); ++ m_element_count = 0; ++ ++ /* Remove empty entries from ORIGINAL_DATA, this makes sorting quicker. */ ++ auto it = std::remove_if (original_data.begin (), original_data.end (), ++ [] (const symtab_index_entry &entry) -> bool ++ { ++ return entry.name == nullptr; ++ }); ++ original_data.erase (it, original_data.end ()); ++ ++ /* Sort the existing contents. */ ++ std::sort (original_data.begin (), original_data.end (), ++ [] (const symtab_index_entry &a, ++ const symtab_index_entry &b) -> bool ++ { ++ /* Return true if A is before B. */ ++ gdb_assert (a.name != nullptr); ++ gdb_assert (b.name != nullptr); ++ ++ return strcmp (a.name, b.name) < 0; ++ }); ++ ++ /* Re-insert each item from the sorted list. */ ++ for (auto &entry : original_data) ++ { ++ /* We know that ORIGINAL_DATA contains no duplicates, this data was ++ taken from a hash table that de-duplicated entries for us, so ++ count this as a new item. ++ ++ As we retained the original size of m_data (see above) then we ++ should never need to grow m_data_ during this re-insertion phase, ++ assert that now. */ ++ ++m_element_count; ++ gdb_assert (!this->hash_needs_expanding ()); ++ ++ /* Lookup a slot. */ ++ symtab_index_entry &slot = this->find_slot (entry.name); ++ ++ /* As discussed above, we should not find duplicates. */ ++ gdb_assert (slot.name == nullptr); ++ ++ /* Move this item into the slot we found. */ ++ slot = std::move (entry); ++ } ++} ++ + /* See class definition. */ + + void +@@ -1311,6 +1377,9 @@ write_gdbindex (dwarf2_per_bfd *per_bfd, cooked_index *table, + for (auto map : table->get_addrmaps ()) + write_address_map (map, addr_vec, cu_index_htab); + ++ /* Ensure symbol hash is built domestically. */ ++ symtab.sort (); ++ + /* Now that we've processed all symbols we can shrink their cu_indices + lists. */ + symtab.minimize (); +diff --git a/gdb/testsuite/gdb.gdb/index-file.exp b/gdb/testsuite/gdb.gdb/index-file.exp +--- a/gdb/testsuite/gdb.gdb/index-file.exp ++++ b/gdb/testsuite/gdb.gdb/index-file.exp +@@ -38,6 +38,9 @@ with_timeout_factor $timeout_factor { + clean_restart $filename + } + ++# Record how many worker threads GDB is using. ++set worker_threads [gdb_get_worker_threads] ++ + # Generate an index file. + set dir1 [standard_output_file "index_1"] + remote_exec host "mkdir -p ${dir1}" +@@ -116,3 +119,41 @@ proc check_symbol_table_usage { filename } { + + set index_filename_base [file tail $filename] + check_symbol_table_usage "$dir1/${index_filename_base}.gdb-index" ++ ++# If GDB is using more than 1 worker thread then reduce the number of ++# worker threads, regenerate the index, and check that we get the same ++# index file back. At one point the layout of the index would vary ++# based on the number of worker threads used. ++if { $worker_threads > 1 } { ++ # Start GDB, but don't load a file yet. ++ clean_restart ++ ++ # Adjust the number of threads to use. ++ set reduced_threads [expr $worker_threads / 2] ++ gdb_test_no_output "maint set worker-threads $reduced_threads" ++ ++ with_timeout_factor $timeout_factor { ++ # Now load the test binary. ++ gdb_file_cmd $filename ++ } ++ ++ # Generate an index file. ++ set dir2 [standard_output_file "index_2"] ++ remote_exec host "mkdir -p ${dir2}" ++ with_timeout_factor $timeout_factor { ++ gdb_test_no_output "save gdb-index $dir2" \ ++ "create second gdb-index file" ++ } ++ ++ # Close GDB. ++ gdb_exit ++ ++ # Now check that the index files are identical. ++ foreach suffix { gdb-index } { ++ set result \ ++ [remote_exec host \ ++ "cmp -s \"$dir1/${index_filename_base}.${suffix}\" \"$dir2/${index_filename_base}.${suffix}\""] ++ gdb_assert { [lindex $result 0] == 0 } \ ++ "$suffix files are identical" ++ } ++} +diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp +--- a/gdb/testsuite/lib/gdb.exp ++++ b/gdb/testsuite/lib/gdb.exp +@@ -10033,6 +10033,21 @@ proc is_target_non_stop { {testname ""} } { + return $is_non_stop + } + ++# Return the number of worker threads that GDB is currently using. ++ ++proc gdb_get_worker_threads { {testname ""} } { ++ set worker_threads "UNKNOWN" ++ gdb_test_multiple "maintenance show worker-threads" $testname { ++ -wrap -re "The number of worker threads GDB can use is unlimited \\(currently ($::decimal)\\)\\." { ++ set worker_threads $expect_out(1,string) ++ } ++ -wrap -re "The number of worker threads GDB can use is ($::decimal)\\." { ++ set worker_threads $expect_out(1,string) ++ } ++ } ++ return $worker_threads ++} ++ + # Check if the compiler emits epilogue information associated + # with the closing brace or with the last statement line. + # diff --git a/gdb-rhbz-2232086-reduce-size-of-gdb-index.patch b/gdb-rhbz-2232086-reduce-size-of-gdb-index.patch new file mode 100644 index 0000000000000000000000000000000000000000..9eaf61556726cea387440dd3e1885a54b99c2758 --- /dev/null +++ b/gdb-rhbz-2232086-reduce-size-of-gdb-index.patch @@ -0,0 +1,222 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Andrew Burgess +Date: Fri, 24 Nov 2023 11:50:35 +0000 +Subject: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch + +;; Back-port upstream commit aa19bc1d259 as part of a fix for +;; non-deterministic gdb-index generation (RH BZ 2232086). + +gdb: reduce size of generated gdb-index file + +I noticed in passing that out algorithm for generating the gdb-index +file is incorrect. When building the hash table in add_index_entry we +count every incoming entry rehash when the number of entries gets too +large. However, some of the incoming entries will be duplicates, +which don't actually result in new items being added to the hash +table. + +As a result, we grow the gdb-index hash table far too often. + +With an unmodified GDB, generating a gdb-index for GDB, I see a file +size of 90M, with a hash usage (in the generated index file) of just +2.6%. + +With a patched GDB, generating a gdb-index for the _same_ GDB binary, +I now see a gdb-index file size of 30M, with a hash usage of 41.9%. + +This is a 67% reduction in gdb-index file size. + +Obviously, not every gdb-index file is going to see such big savings, +however, the larger a program, and the more symbols that are +duplicated between compilation units, the more GDB would over count, +and so, over-grow the index. + +The gdb-index hash table we create has a minimum size of 1024, and +then we grow the hash when it is 75% full, doubling the hash table at +that time. Given this, then we expect that either: + + a. The hash table is size 1024, and less than 75% full, or + b. The hash table is between 37.5% and 75% full. + +I've include a test that checks some of these constraints -- I've not +bothered to check the upper limit, and over full hash table isn't +really a problem here, but if the fill percentage is less than 37.5% +then this indicates that we've done something wrong (obviously, I also +check for the 1024 minimum size). + +Approved-By: Tom Tromey + +diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c +--- a/gdb/dwarf2/index-write.c ++++ b/gdb/dwarf2/index-write.c +@@ -254,20 +254,29 @@ add_index_entry (struct mapped_symtab *symtab, const char *name, + int is_static, gdb_index_symbol_kind kind, + offset_type cu_index) + { +- offset_type cu_index_and_attrs; ++ symtab_index_entry *slot = &find_slot (symtab, name); ++ if (slot->name == NULL) ++ { ++ /* This is a new element in the hash table. */ ++ ++symtab->n_elements; + +- ++symtab->n_elements; +- if (4 * symtab->n_elements / 3 >= symtab->data.size ()) +- hash_expand (symtab); ++ /* We might need to grow the hash table. */ ++ if (4 * symtab->n_elements / 3 >= symtab->data.size ()) ++ { ++ hash_expand (symtab); + +- symtab_index_entry &slot = find_slot (symtab, name); +- if (slot.name == NULL) +- { +- slot.name = name; ++ /* This element will have a different slot in the new table. */ ++ slot = &find_slot (symtab, name); ++ ++ /* But it should still be a new element in the hash table. */ ++ gdb_assert (slot->name == nullptr); ++ } ++ ++ slot->name = name; + /* index_offset is set later. */ + } + +- cu_index_and_attrs = 0; ++ offset_type cu_index_and_attrs = 0; + DW2_GDB_INDEX_CU_SET_VALUE (cu_index_and_attrs, cu_index); + DW2_GDB_INDEX_SYMBOL_STATIC_SET_VALUE (cu_index_and_attrs, is_static); + DW2_GDB_INDEX_SYMBOL_KIND_SET_VALUE (cu_index_and_attrs, kind); +@@ -279,7 +288,7 @@ add_index_entry (struct mapped_symtab *symtab, const char *name, + the last entry pushed), but a symbol could have multiple kinds in one CU. + To keep things simple we don't worry about the duplication here and + sort and uniquify the list after we've processed all symbols. */ +- slot.cu_indices.push_back (cu_index_and_attrs); ++ slot->cu_indices.push_back (cu_index_and_attrs); + } + + /* See symtab_index_entry. */ +diff --git a/gdb/testsuite/gdb.gdb/index-file.exp b/gdb/testsuite/gdb.gdb/index-file.exp +new file mode 100644 +--- /dev/null ++++ b/gdb/testsuite/gdb.gdb/index-file.exp +@@ -0,0 +1,118 @@ ++# Copyright 2023 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 3 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, see . ++ ++# Load the GDB executable, and then 'save gdb-index', and make some ++# checks of the generated index file. ++ ++load_lib selftest-support.exp ++ ++# Can't save an index with readnow. ++if {[readnow]} { ++ untested "cannot create an index when readnow is in use" ++ return -1 ++} ++ ++# A multiplier used to ensure slow tasks are less likely to timeout. ++set timeout_factor 20 ++ ++set filename [selftest_prepare] ++if { $filename eq "" } { ++ unsupported "${gdb_test_file_name}.exp" ++ return -1 ++} ++ ++with_timeout_factor $timeout_factor { ++ # Start GDB, load FILENAME. ++ clean_restart $filename ++} ++ ++# Generate an index file. ++set dir1 [standard_output_file "index_1"] ++remote_exec host "mkdir -p ${dir1}" ++with_timeout_factor $timeout_factor { ++ gdb_test_no_output "save gdb-index $dir1" \ ++ "create gdb-index file" ++} ++ ++# Close GDB. ++gdb_exit ++ ++# Validate that the index-file FILENAME has made efficient use of its ++# symbol hash table. Calculate the number of symbols in the hash ++# table and the total hash table size. The hash table starts with ++# 1024 entries, and then doubles each time it is filled to 75%. At ++# 75% filled, doubling the size takes it to 37.5% filled. ++# ++# Thus, the hash table is correctly filled if: ++# 1. Its size is 1024 (i.e. it has not yet had its first doubling), or ++# 2. Its filled percentage is over 37% ++# ++# We could check that it is not over filled, but I don't as that's not ++# really an issue. But we did once have a bug where the table was ++# doubled incorrectly, in which case we'd see a filled percentage of ++# around 2% in some cases, which is a huge waste of disk space. ++proc check_symbol_table_usage { filename } { ++ # Open the file in binary mode and read-only mode. ++ set fp [open $filename rb] ++ ++ # Configure the channel to use binary translation. ++ fconfigure $fp -translation binary ++ ++ # Read the first 8 bytes of the file, which contain the header of ++ # the index section. ++ set header [read $fp [expr 7 * 4]] ++ ++ # Scan the header to get the version, the CU list offset, and the ++ # types CU list offset. ++ binary scan $header iiiiii version \ ++ _ _ _ symbol_table_offset shortcut_offset ++ ++ # The length of the symbol hash table (in entries). ++ set len [expr ($shortcut_offset - $symbol_table_offset) / 8] ++ ++ # Now walk the hash table and count how many entries are in use. ++ set offset $symbol_table_offset ++ set count 0 ++ while { $offset < $shortcut_offset } { ++ seek $fp $offset ++ set entry [read $fp 8] ++ binary scan $entry ii name_ptr flags ++ if { $name_ptr != 0 } { ++ incr count ++ } ++ ++ incr offset 8 ++ } ++ ++ # Close the file. ++ close $fp ++ ++ # Calculate how full the cache is. ++ set pct [expr (100 * double($count)) / $len] ++ ++ # Write our results out to the gdb.log. ++ verbose -log "Hash table size: $len" ++ verbose -log "Hash table entries: $count" ++ verbose -log "Percentage usage: $pct%" ++ ++ # The minimum fill percentage is actually 37.5%, but we give TCL a ++ # little flexibility in case the FP maths give a result a little ++ # off. ++ gdb_assert { $len == 1024 || $pct > 37 } \ ++ "symbol hash table usage" ++} ++ ++set index_filename_base [file tail $filename] ++check_symbol_table_usage "$dir1/${index_filename_base}.gdb-index" diff --git a/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch b/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch deleted file mode 100644 index 21a1a082d58f6cba0f96c6dc18e020fcd7ff5eb9..0000000000000000000000000000000000000000 --- a/gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch +++ /dev/null @@ -1,135 +0,0 @@ -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-rhbz1186476-internal-error-unqualified-name-re-set-test.patch - -;; Fix 'backport GDB 7.4 fix to RHEL 6.6 GDB' [Original Sourceware bug -;; description: 'C++ (and objc): Internal error on unqualified name -;; re-set', PR 11657] (RH BZ 1186476). -;;=fedoratest - -Comments from Sergio Durigan Junior: - - The "proper" fix for this whole problem would be to backport the - "ambiguous linespec" patch series. However, it is really not - recommended to do that for RHEL GDB, because the patch series is too - big and could introduce unwanted regressions. Instead, what we - chose to do was to replace the gdb_assert call by a warning (which - allows the user to continue the debugging session), and tell the - user that, although more than one location was found for his/her - breakpoint, only one will be used. - -diff --git a/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set-main.cc -@@ -0,0 +1,22 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2015 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 3 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, see . */ -+ -+int -+main (int argc, char *argv[]) -+{ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.cc -@@ -0,0 +1,26 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2015 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 3 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, see . */ -+ -+class C -+ { -+ public: -+ C () {} -+ C (int x) {} -+ }; -+ -+C a; -+C b (1); -diff --git a/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/gdb-rhbz1186476-internal-error-unqualified-name-re-set.exp -@@ -0,0 +1,51 @@ -+# Copyright 2015 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 3 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, see . -+ -+if { [skip_cplus_tests] } { continue } -+if { [skip_shlib_tests] } { continue } -+if { [is_remote target] } { continue } -+if { [target_info exists use_gdb_stub] } { continue } -+ -+set testfile gdb-rhbz1186476-internal-error-unqualified-name-re-set-main -+set srcfile $testfile.cc -+set executable $testfile -+set binfile [standard_output_file $executable] -+ -+set libtestfile gdb-rhbz1186476-internal-error-unqualified-name-re-set -+set libsrcfile $libtestfile.cc -+set sofile [standard_output_file lib$libtestfile.so] -+ -+# Create and source the file that provides information about the compiler -+# used to compile the test case. -+if [get_compiler_info "c++"] { -+ return -1 -+} -+ -+if { [gdb_compile_shlib $srcdir/$subdir/$libsrcfile $sofile {debug c++ "additional_flags=-fPIC"}] != "" -+ || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list additional_flags=-Wl,-rpath,[file dirname ${sofile}] "c++" shlib=${sofile} ]] != ""} { -+ untested $libtestfile.exp -+ return -1 -+} -+ -+clean_restart $executable -+ -+gdb_test_no_output "set breakpoint pending on" -+# gdb_breakpoint would print a failure because of some warning messages -+gdb_test "break C::C" "Breakpoint $decimal \\(C::C\\) pending." -+ -+#gdb_test "run" "warning: Found more than one location for breakpoint #$decimal; only the first location will be used.(\r\n)+Breakpoint $decimal, C::C.*" -+gdb_test "run" -+ -+gdb_test "info break" " in C::C\\(\\) at .* in C::C\\(int\\) at .*" diff --git a/gdb-rhbz1325795-framefilters-test.patch b/gdb-rhbz1325795-framefilters-test.patch deleted file mode 100644 index cfe309d970889951a284734387c7a165a518ad1e..0000000000000000000000000000000000000000 --- a/gdb-rhbz1325795-framefilters-test.patch +++ /dev/null @@ -1,176 +0,0 @@ -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-rhbz1325795-framefilters-test.patch - -;; New test for Python "Cannot locate object file for block" (for RH BZ 1325795). -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.python/py-framefilter-thread.c b/gdb/testsuite/gdb.python/py-framefilter-thread.c -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.python/py-framefilter-thread.c -@@ -0,0 +1,39 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2016 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 3 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, see . */ -+ -+#include -+#include -+ -+static void * -+start (void *arg) -+{ -+ return arg; /* Backtrace end breakpoint */ -+} -+ -+int -+main (void) -+{ -+ pthread_t thread1; -+ int i; -+ -+ i = pthread_create (&thread1, NULL, start, NULL); -+ assert (i == 0); -+ i = pthread_join (thread1, NULL); -+ assert (i == 0); -+ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.python/py-framefilter-thread.exp b/gdb/testsuite/gdb.python/py-framefilter-thread.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.python/py-framefilter-thread.exp -@@ -0,0 +1,54 @@ -+# Copyright (C) 2016 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 3 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, see . -+ -+load_lib gdb-python.exp -+ -+standard_testfile -+ -+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug pthreads}]} { -+ return -1 -+} -+ -+# Skip all tests if Python scripting is not enabled. -+if { [skip_python_tests] } { continue } -+ -+if ![runto_main] then { -+ return -+} -+gdb_test_no_output "set python print-stack full" \ -+ "Set python print-stack to full" -+ -+# Load global frame-filters -+set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py] -+gdb_test_no_output "python exec (open ('${remote_python_file}').read ())" \ -+ "Load python file" -+ -+gdb_breakpoint [gdb_get_line_number "Backtrace end breakpoint"] -+gdb_continue_to_breakpoint "Backtrace end breakpoint" -+ -+# #2 0x00007ffff75f228d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113^M -+gdb_test "bt no-filters" " in (\\.?_*clone|thread_start) \[^\r\n\]*" "bt no-filters" -+ -+# #2 0x00007ffff75f228d in 941595343737041 () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113^M -+# vs. -+# #2 0x00007ffff75f228d in 941595343737041Traceback (most recent call last): -+# File "/home/jkratoch/redhat/rhel/gdb/rhel-7.3/gdb-7.6.1/gdb/testsuite/../data-directory/python/gdb/FrameDecorator.py", line 145, in frame_args -+# return self._base.frame_args() -+# File "/home/jkratoch/redhat/rhel/gdb/rhel-7.3/gdb-7.6.1/gdb/testsuite/../data-directory/python/gdb/FrameDecorator.py", line 152, in frame_args -+# return args.fetch_frame_args() -+# File "/home/jkratoch/redhat/rhel/gdb/rhel-7.3/gdb-7.6.1/gdb/testsuite/../data-directory/python/gdb/FrameDecorator.py", line 276, in fetch_frame_args -+# block = self.frame.block() -+# RuntimeError: Cannot locate object file for block. -+gdb_test "bt" " in \[0-9\]+ \[^\r\n\]*" "bt with filters" -diff --git a/gdb/testsuite/gdb.python/py-framefilter-thread.py b/gdb/testsuite/gdb.python/py-framefilter-thread.py -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.python/py-framefilter-thread.py -@@ -0,0 +1,60 @@ -+# Copyright (C) 2016 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 3 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, see . -+ -+# This file is part of the GDB testsuite. It tests Python-based -+# frame-filters. -+ -+# This test is specifically crafted for RH BZ 1197665. -+ -+import gdb -+import itertools -+from gdb.FrameDecorator import FrameDecorator -+import copy -+ -+class Reverse_Function (FrameDecorator): -+ -+ def __init__(self, fobj): -+ super(Reverse_Function, self).__init__(fobj) -+ self.fobj = fobj -+ -+ def function (self): -+ # This function call should not fail. -+ gdb.target_charset () -+ -+ fname = str (self.fobj.function()) -+ if (fname == None or fname == ""): -+ return None -+ else: -+ fname = fname[::-1] -+ return fname -+ -+class FrameFilter (): -+ -+ def __init__ (self): -+ self.name = "Reverse" -+ self.priority = 100 -+ self.enabled = True -+ gdb.frame_filters [self.name] = self -+ -+ def filter (self, frame_iter): -+ # Python 3.x moved the itertools.imap functionality to map(), -+ # so check if it is available. -+ if hasattr(itertools, "imap"): -+ frame_iter = itertools.imap (Reverse_Function, frame_iter) -+ else: -+ frame_iter = map (Reverse_Function, frame_iter) -+ return frame_iter -+ -+FrameFilter() diff --git a/gdb-rhbz1350436-type-printers-error.patch b/gdb-rhbz1350436-type-printers-error.patch deleted file mode 100644 index 33223276cebd9b84af21e5488c451c58d00d49e0..0000000000000000000000000000000000000000 --- a/gdb-rhbz1350436-type-printers-error.patch +++ /dev/null @@ -1,83 +0,0 @@ -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-rhbz1350436-type-printers-error.patch - -;; Test 'info type-printers' Python error (RH BZ 1350436). -;;=fedoratest - -Typo in Python support breaks info type-printers command -https://bugzilla.redhat.com/show_bug.cgi?id=1350436 - -[testsuite patch] PR python/17136: 'info type-printers' causes an exception when there are per-objfile printers -https://sourceware.org/ml/gdb-patches/2016-06/msg00455.html - -diff --git a/gdb/testsuite/gdb.python/py-typeprint.cc b/gdb/testsuite/gdb.python/py-typeprint.cc ---- a/gdb/testsuite/gdb.python/py-typeprint.cc -+++ b/gdb/testsuite/gdb.python/py-typeprint.cc -@@ -31,6 +31,12 @@ templ s; - - basic_string bs; - -+class Other -+{ -+}; -+ -+Other ovar; -+ - int main() - { - return 0; -diff --git a/gdb/testsuite/gdb.python/py-typeprint.exp b/gdb/testsuite/gdb.python/py-typeprint.exp ---- a/gdb/testsuite/gdb.python/py-typeprint.exp -+++ b/gdb/testsuite/gdb.python/py-typeprint.exp -@@ -50,3 +50,7 @@ gdb_test_no_output "enable type-printer string" - gdb_test "whatis bs" "string" "whatis with enabled printer" - - gdb_test "whatis s" "templ" -+ -+gdb_test "info type-printers" "Type printers for \[^\r\n\]*/py-typeprint:\r\n *other\r\n.*" \ -+ "info type-printers for other" -+gdb_test "whatis ovar" "type = Another" -diff --git a/gdb/testsuite/gdb.python/py-typeprint.py b/gdb/testsuite/gdb.python/py-typeprint.py ---- a/gdb/testsuite/gdb.python/py-typeprint.py -+++ b/gdb/testsuite/gdb.python/py-typeprint.py -@@ -15,8 +15,7 @@ - - import gdb - -- --class Recognizer(object): -+class StringRecognizer(object): - def __init__(self): - self.enabled = True - -@@ -32,7 +31,27 @@ class StringTypePrinter(object): - self.enabled = True - - def instantiate(self): -- return Recognizer() -+ return StringRecognizer() - - - gdb.type_printers.append(StringTypePrinter()) -+ -+class OtherRecognizer(object): -+ def __init__(self): -+ self.enabled = True -+ -+ def recognize(self, type_obj): -+ if type_obj.tag == 'Other': -+ return 'Another' -+ return None -+ -+class OtherTypePrinter(object): -+ def __init__(self): -+ self.name = 'other' -+ self.enabled = True -+ -+ def instantiate(self): -+ return OtherRecognizer() -+ -+import gdb.types -+gdb.types.register_type_printer(gdb.objfiles()[0], OtherTypePrinter()) diff --git a/gdb-rhbz1398387-tab-crash-test.patch b/gdb-rhbz1398387-tab-crash-test.patch deleted file mode 100644 index d0555c06111f28eda829324390223e871e874ec7..0000000000000000000000000000000000000000 --- a/gdb-rhbz1398387-tab-crash-test.patch +++ /dev/null @@ -1,454 +0,0 @@ -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-rhbz1398387-tab-crash-test.patch - -;; New testcase for: Fix -completion crash (Gary Benson, RH BZ 1398387). -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.base/tab-crash.bz2.uu b/gdb/testsuite/gdb.base/tab-crash.bz2.uu -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/tab-crash.bz2.uu -@@ -0,0 +1,393 @@ -+begin 644 /tmp/libgcc_s-6.3.1-20161221.so.1-objcopyR.debug.bz2 -+M0EIH.3%!6293622@"44`>Q=_____________________________________ -+M________X#\<>SD#OM[7/HAP:R]\H#D"=!/";NP7!]OOJG>U[N;WW'KVV?9I -+M[[,[X.\/;%2U``[[NUM7P^T[U617V#12M]6M7W;M7CZU<=!]/8WL[LI=AZZ> -+MJ5XW;QP]W]DVHY@]/6RS= -+M8[:2][W/F01Z:GIID,IC$GHU-HR$:@T0F -+M@$PC($P"`$PF)D9-&IZFCT-4\$TRI^330-$TR>32>FFF@F!H0GJ>TD_*9!E, -+MR3Q3/11M-,%#T-3:-3T9(P-3T3TT@;1ZD>C1E,AM0:`@@303"`(Q*>FGHU)Z -+MGDFR8FFJ'L5/1C313R3U/*?JF]&35-J!Y3U/TI^1$\IZGFBGJ>HVF4>H])ZA -+MZC)ZFT)H>IH]0>H!H&RC0,F0T9E!HT-`TT`)-1(A$R&J?J3T80]313\F0GHC -+MU3:90\H]$]3:C93U-!LH\IIZ$]0R>:D>329J--`/4_5'I-`TT9#3U!ZC0>H# -+M0])H!H9!Z@#30VH#30-/4T'J`]09%$!4\)A3R,-1'J`S2#0--,$:/$C9-3TG -+MH:FR9-(T>D\4],HT'I`/4`>HVFIIZFR:FR:)Y,3*/3*;"FT:(VIYJC:FF)Z: -+MCTFAIZCTAH:#U!F*")1`0!`"9#4Q-,FT(R33R-4VFE/U&TU-3RGZ1FJ>&H]2 -+M;U38GJ-J3TQ0Q'DU-'J?JF]2&30-'J:>H,FC1HWJ@#RFC0!Z#2-/4T&&4T-/ -+M2:&(>D'J,5#"1JH5B["KJTH:1R2I95!0TXN8+PQ'&*+8%8JVQCC/1G1D0A-S -+M91MLJJLK];M*G>^]MGIW=W7E>KL -+M)MXKMO7VV\M77ANM3H=6LGI)+AR&CF'#<66)4&4S6:;*26:S5DUQGS$+>97< -+M!3.,U$LQELITU,X3Y5[GW>0?IM4(5>Z!^AE04E8=:H(X[7T$U.`@QRT\Z]_" -+M7?`4-8Q_UDP"AQ@$1,B`G(D*S"^7Z%ABZ-%T6MS+#&8M+G -+M)M>_Y9ME3-K"RMO>,UK^9/4HYU5!3:6'45^1-AA23JG7FH&=KT9ZK-!6>?\- -+M;_HD;$V3C,[X\-20B*R?`.(:CK$3A&J2!XYI6TW[U*HI*560[F!42LB.:FO9 -+MT2S-`KC"H/^S^JJFC(54?*/HIBKH,!73^2++62,G98Y/*,\,%R,Y08$R@$&L -+MC#"P#E53*YTZS&>L\]4*"<8&2^]*I?02,46;3.V(P+2P`3$>F+HNTY/(%Z<` -+MM.P&I]6,NED[M1J4`O?!J@8`&>?1 -+M%!8/]>.7UF-'?ZO,O??);\\L:3X7JN-O^ZWAPV:'ONI*N$I2REEE+$\Q47N6 -+M)NB0W\O.LZ)TMD[9VG1NS+?94@_.$$=!P2#U2(8;*%.99OOW:1@#`W]ZV:OR -+M1IWEL,R4\*2Y2^>SP[^QB -+M_,U-)GY3;9KT/P=Q.GX.7G"Q:>QK&9"$ -+M[#-J-&>2W>*T.XDRFC(,4I`"ED(D0(($(R0#&6;D6H(.:&R(R,:JBHZ!54G< -+M11T9V@K&&$`@8+T3IN#,:<5@P(RTBD1%(JP%55$2*#^!4E,%ER22`*-**JU6 -+MJZII6%N>*+(`*J_?LDI@")%A1D1`@0D?O:UXU=+B+/%.C.3P3935G@9N(=B( -+M39SA1$,K(<1`/."P@;M&4XI&*(9N(H[,#92F)PFDD,V:;%@V(`6%EHV(`6$+T`+00*I0;U -+M`+6F`+<5+:@OPH!:+<%V-Y:H6@0ST6@@$DQO&U0"]M7&.2N,;AN4`HP8H!<7 -+MT;QP4`N;A(R`&`P88BZ-&+V-:04?;20GS/LL>$_B,!&RT)$%@$(*)!"$E!7/ -+M#&8("!8N/9=K.,FB'MY.._/VD>C9#^`XS.XJ/S:XR1TI^MMN1AER0/FI,QI< -+MI!S/-3&8!4S2B>DK$=5/`G2Z><=$L7)SB`(%.`?MXB?J?H_!K]]%1:Q0>>D5 -+M@*,0!$21@`8Q[N?N_7_H;4[#S/![4O,^[NUOC?7F"'Z'YMMYO*;_)-K^K9([W=II7_32_/>'@"M-U3'I3>\5F/7!,>LN:H3*N!L;; -+M")']UU7>>-S\,?K65#!/&(542)(!76C2F<92T@@7G-NX#D][M'6*;YS)AF7< -+M!W7=#3Y1,RGT_`:&!`EU8>JEM/&JEI"+[5?4O\_]DT0",,XH95*#$@#=L,AO4L+ -+M1BB(3Q$X?C1IAS!$AY.>_%4]AI=*'&F6&\>U;\YG,QV14-HP9\BY30H/3].G -+MTW36AQ.N"4&8U(-$CSEJ:IAKE6J,KC=.U9$\H:1I/5!WK37"2WTTCL+"6YJD -+MVV8?W_`MAI=@)]J^U-YAOBS;:'(S4SPBJP))LEQ'+GK;<]US[@5VN)U.SEI] -+M@B6(>WE8&UNN(Z_Y^_U`>?=I*[4=\'V/"\YOXXU=RH7$2P -+MZ8AP5/2@#F" -+M^(R"5",K@5=:R=P=>/%\_!=LCS0>*ISX$*;G?\$9(P-<"734Z=7:V/E#,EJ3 -+MR#)DN].):$0+S";E13Q8UADO"%],GD)5UBLWUDCN34&A3.I3U+69_K:PL#9:%6F) -+M[AU5/05TLKLJ2*QB0,US:"U%(#G!9N81MN&'7T1O*J^]%%^#HV->-]LNGN*= -+M"C%H8>WG7$,^&0"244E4:#V6Y!289:<&E<<-ZGKH1[>$BW"MUU,#SL;,,),V -+M565B6/E!Z,H8E#]WD=(P%@X(,/C7GD0D -+MP-:,NZ$0>8GQY;JN=^^\XXXN0&5=W>Z5]AZ1HYC%E&S'8*.!D@5[<8]"EYC) -+M7*.I"&7-3RH1V#K4>$VO7@MZ*G*`]>M6049!\$(C%$3O$(">"B@IT'Y=.=H)`'G -+MP?T,;OF2.6;FQ;,.#Y<(PT)/0+73.OI!]&#-""F[4ST51A!FJDN2B3PA -+MCB(Q@J)!V14/5@R7:FG%FN\:RY!,K%>T32S-L$$!!OM9<,*\;?V9^D]EW* -+MBQ6*UR5PQ\J=9&)2U[%%,*&2VK(M$(BHTDQO)TV^76K`\E7:.HV99X,B$L68 -+MSG"]BK3]QP^-(JA!,M42_#=-`S`(@)8T4R,S_Y[7P__.8YW/0JJJJJJJNK8X -+M-=3PO'T&C*J9)`]F0`%K%$*P$#"""'MX"\OETF6EW>4IT9RN8.;PY_?U:<^? -+M*X$4&<5`%`1414BR`"1@4.DH8`QG9@#`TT7)^C&:7C@IA^%"_<3WTX+Q5*-=*7Y#/IE(_)_ -+MYYO52X/>^`A8NS+]GQ6$%J!9HFB5*_*22UE#*>TYS.T"1U[AFR44'A(ZIZ$N -+M7O')DXRK49/4T!7XG8#F7\)CF+,TPJAPV;\#4,AD7,Z/*?9D2DQDGR.^]LB( -+M%[`,/\]CK_:F,LN`#`T>]RT?A*WQ[K='\FN+&[/YKKD[GOG)".MPK9KOE&2> -+M4312<,\Y^C:>3=S-OHU-R)^F^*9H5Q"=7^-'_#GT?0V-ZX-3_S"6N2Q?O;7: -+M=G#ZR=L/JQG[ -+MO\_!J];07#9:XP=/JNC6V$KW5]`_.82T05/S?='X=WG0YS.[I94'X$?S()[N -+M#_Y@OQH(_`@/2399*2&\0*8=X^IVZ-3#*-44=7^#1YU#@<+A<&%:']\FNF[I -+M29_6J&Z$R.&H/.2,M8LDC$UZC*6*@F7SBW:"GQ3@-&AS/D'%[PAX*Z.!&Q`! -+MK?M_?V/CA,ZX91WMR-A0992O)T0BR^HF9=VIA-3&20"GDL&" -+M2O*AJJ$K`'3#X"@L61'"0N\_-&J])J,%%(*O_R0A*R3X>_<_]4=+TNCF/6?< -+M]IGY%UQ&M/IX7^;)C'TSL++)C1,MUVW257A0K(-$P.$V@S/RDA=MA.W#)`^< -+MI.1!C(@-*E;AB)^IQOD_^YWQ:2]K^31Z+%2J$@W$OT7PD.02BH.>E@'022(E -+M3@Y$+>HD)''I -+MK!<&,1@9T",6@FYM(V?[Q8KX6%]RJ`*8F:0\/6K-)X%%08$0"I?TTOH7J&:2 -+MP"RV[FF`@B!MYU]ZA5,A0DG2_Q)37"OW#@@D%P1P53,Y9BTRN'V=+Z4!-QP> -+M0Y0QJ(A,6"07X?-ZWOBHFM&@L1]UFNEG^IKIM+R/9>.LI"N99-[D[:+A+S@] -+M9SU/\?K]_\Q%2,`!A(D20!4>@D8$G;HBBL(!"(2`J'98-5R/N2MRE[9.N+,! -+MO"/VT9Y%Q@(TM(/8\%_VL"*'2P^*D+N2,C?4!XXM?3VL;&:5WJ^+#L>F7!H_,N -+MIUM`#L5Y[#M_O]A6"9J&&AI_78:(A$4RYACP^Q[,#B9?EORFBL,[/%'C)]'[ -+M.CACW"3O$#=`(=[_-\UU>&,/=25L+C^"'BK/E0!N1^$_"JB+_JPA`*]8CO(: -+M`,.^+BG;`ZF7BV09<[-_][:8^4KLHF.(1`0<SWGYJ3I.3K!0![LX-.34%X -+MKYZ.+[/.9+T`A+UD=Y@88X+WRYRQ#Z.0GAL_X^DU8%6CXLM.6/V<%ZXA\X\>Z?;"LR((5^)BH[ -+M9YVM6QCU[L+>4:^0@[(+A[*2R473>#_#80G05=[MO!0B83]S4Y#69SL\FU;, -+MM[%]++>'XGB[M<9CU9H/*ZY^J8LEQ/Y>=4H#=D -+M076@OV1*HU!09+VY&I##%336?/5%)M>9>5%%"0;X0^D(!5LP%ZR;J#4AL2A( -+MVL=+2L3>4N`V%1T%AG`R@("$$@E`4)0]>@`6#Y_ -+M!?KZ5D(#B^G8"OV,(-.'8LE-"R&W?C;5W&U,*%TS9#DQGG02?LI;-V'6_'VD:/[B\[^!BK._+R4O,AIRU>SJ67X@ -+M9BGP5'Z*.")D_)5(1^2U>5IE7MC^?6;KS0@W,1]%[_1Q>7T[6YJ6XJQ.^W;Y -+M/EBI?KRW$W[U(3Z"^#'K&C9:437[_,^`K\[(S?[&%\T)U''KMU:$5SAVI&?1 -+MO)WDB92)(QL1_:14'+!3-4<$"%!A'EL*M:SVOPL/C22OB0/^XF -+MK<69BJ[(VD8/"J7=>==O$-;WW//)P10\;N+6!'EH$U.A3!PVG>^?[V.QP)[E -+MM#M7!J:JJ5FI.V-&A9([(@[VAQ'!<$'(1S;SN=_.6>^5#L1AQ&_D'TL&-9`/ -+M68$)7J_190&=D@#5'\F^+AINR/5:*)DDUZ[PNR9<+9KN3=Z?U+GOLD3<33S= -+MITE&9$Q@::(*8DUSZ<4:QI+(U)BWK2;WBIFENWDW[`N'(FMFG:Z>V\N0-.!C -+M]U#!U]T8<9HC9P8<^B_][RM5^;"??IE6G\((HDSM:T1.%M7\:[:DU2F*_DM4 -+MYS/(B9,$-F_^*?"5:RW^<#:*&>C'":.!%4R6T1D?:_G=$H[JG;^K-&;DAU5X -+M&\$R"F*J1F;BV>]?N_E7K/--@V7(QI0@&I.NR=19-&!(=T.&_,X7T=/'`?1* -+M%W!R_DXWII`J:7?>BE$CIAWG*'YBZ$Q'_%_<27$JIQGYCU"!+X5C(PDS@W[\ -+M7\*E`_CB_W[+#`2HNE+Z5(.40BX]1`,]W]9L2=-5S\JMIA,-W<&@; -+M^[8^O76V>0CBYD0'SW%)\GD[WPO%X,)C%,*J;0T`C:JCB'+92>O:H';H,-[R -+M=DRZ#I]-'NVA`SO3(FDOZW8P4EL?@9A=5^0Y7FCDLWBFFUTVRG&%.[D2V^=` -+M5#K.+)QE0NXQY^M7*(C1-,N?>U93STMV@CGTY>&R$>RPK3'2R2*?5I5(24S/ -+M3K0$S`PJ(?/0Q9_SG%)RTTU3HP8:\7'A72DJ57`^O/MG`YY><>SSD?WAH=M: -+M"RO5HS+T!`\:(`9QAYB=#3-8"F2'/%UT1%Q3?D&F$[TQ2-M#%>'(OH`!2E./ -+M)389QV:(LHH6GG+(3N1L[?82L*K4K0&9XD2X6@M+0N,)U%K,T-":?/Y]\MK5 -+MK_Z:_I>'2UZ7+0:AKH\.K%VYPA6E!DHVG,PO?KU25M)+DT,P/AGJ<1$85R9% -+MPF!G=#T]U45@%VRRB)A-TW^ZQ(Q_ZZED+F:K/ -+M%[7I:0$4UD$#WL$0]Y40\#A.AW7;\'O>+#S^/JY/1OZ/3K>4XW>>[AD]#5PU -+M:AAQU[/W.(AMMJ>4Q`29&#B9U_*;%>_:VI]+:'MP6ICV=R&`\X8;_^^!.GMS -+M[CNN,)<#02E3:J,LVK(;7-QHKD@J'][T+:HKY^3V'XE@FQ3YWDML=KUMVS9T -+M--UE*6'ES*\2LIZ+T;BH^&&6:[X%`OG)G&&W,6 -+M)H$T1"14@OL:/PY6'YT^RE4`/70$D`%\6*J_[>]LELD`/3H$FC6R':]3T>]R:N[G/F>L^-Z8W(@05",604",9-Y"A3TN;K^7U_D?5 -+M]+)>,!C#_7R<;\D\CX1PL]S$^X[C@`P,/0"-31'T61;6DR@][DZ>GRX>I6>`E\3;J]#&J;J-QZDEZ -+MN`Z"S<>Q9D;G8V4DQ'4T:78NL=:(*1TE&S_R-!0N)EE'3[0&B*! -+MXQ*NL=1!1^MME#CP3"#Z\>EWS"6?=]^))"@K:@'@@WDG:-N)I=7TH:&]V:HU#$8H@2H7&5C!B8/< -+M>+*R`ZN=[,`1\>^V(NU#+I]][;J]J$$)=@@8!C&8F38Z2ZYW@!C;&*7UJH?S -+MQ*8,+&MJ!D'$H2WJ"=:##R1L!V.SV:FBB#KMJZ-A8U=P'F)%DBD+Y(]`W<76 -+M0"B`P'7/I#2C1W`Q//G]JRCF4N!U6V.,:6B(^'F_PM]?37_I^G\>W:F,#`!L -+M#$,?SLN]D@92+./&PT_IX_D\#C]]P.?H=A[GX8-3>EHG#-5Y:9#51"%*"@8, -+MR,#P4(,M6C4*U0!009;_,O-S^;=Q%1U4]/RN)VFLJGPB`SJ%?B]A6)UT%0>\ -+M7?CM)8U>&P!P_@=A7"`%&/ZL=2/B:J/Z>/Q_QN./XO]HL>FR%6\R]CX<7IV1 -+MM0K6BSY&M4Q1/\^R5ZB<#`'BZ1KJHV!@LE\&)<,`$827-VNZ1PXSI0/%T;N2 -+M:'A7:2NQC\#-SZFY*DG.9SA'QL/C0XYFJ`..@)-DDV29VD5#RDE>]G8Q^3VW -+ML)IY;;C3C--_D9B/%?0-[\A)B^]1S.A,'R5))?(UTRN%AZ[R=7^#1>8QD6;? -+M\\>9'WS7+Q2MMQB$4G'&LKKE_5:P6VHX=!IXC/A?V!&;E12BA`S"D%5]>PD& -+MLS[;Q-_NX\>E1,6!J!`.E>BKU-7><]ML_>YUY`*]=J1"%3^'=ZG#M`_=FP\5 -+M_1@U\L5HC!6/M^AK=6RKL$<4WMRZ#=/)WD-JE[^K[$5:2F,WF$W:PM9.*M4Y -+M,1F3/&3Z4AKF[0P[+OYJE&NVX5N("$H-U)M)Q]U1O+/^/[+5!F0AOSIW)JO1 -+M-W"XB@\FPFF^^+'I5<9E=\R":I,J$XM:0Y$V!"D*0/[J>C4]94.6F>7>N3E^ -+MZS4N7`.VR=BDAPI]W\W2SM;LA4L[C%P*HES%0]GNJ_4,L#<[Z^]\A0P/G_9< -+M-GJDQ,;U!M7+G$4.Q774HG@<3ZR^,@.(C5#=9R1V,1BJ>G;B^X1G8:0*J9PI -+M0O;M#TOG'I,BH@=IM=C3M.?3S+JKI7#,9^+T0K`E=MSFF.*<'F(&]5Y[G99G -+M$Q0MHQB/4_,W&S73.T(4?>X?VDZ)REP[?IQJS%,A"CV=$(_EC6+=\=C[AZ^L -+MT6_?WU:<<"*P,*F!BTVR-7-UZ8R*<(0Z,?*JV<():T68@T1[:_##<>AN:?DT -+MFK>X6UN;;41]M,=73:_5`8T)T.!>[ADD@M$)!&9DX4_BU5+'$2![3L[L]J^Z -+MNB>(E(74J3W"%&E0J0Z!0A1"@K/[XD5C,*BGM#&WV3BL+08N0>"'P6\JH&%[ -+M_'ONYQUCK5P8Z@\6BSVU0/@G(./1*RH.1^?4F$S2GX":4R%3D!X_,0:@()!, -+MX.-/LI6"D^5H9QOY(BMN;Y[FTCO5U^=_V]-005[^R6@N"H]!I"@*J2I9445_ -+M?LM+4&A$:4*A`@3/(K`5895(TB768N-]$Y",C9W-PTE8>7<6FSV_800?X^2Q -+ML6'"\!JHI4"AC#]EJ"+343WC0"P%!X6Z=Z+>/#;E\:3H -+M*J9Z)ZHG?FL$!@@([X%`13X]*>3\4W=4+!:?80*1;@X_:7`V2$",%O%+Y;NW -+MSK?IH.1]7FZJ%F6T;`NP\"[HC>M:RB9@9CM -+MN5V'C^C]SZ+:[B[]+=^EM]A+]F_!\*>SA;M^^UT*,[^Z802/D8,&I$20.*F'Q/!Z_P-@_2/8^OT^"0@))K'@?MU`W<04B($7/6DU3`./KY -+M:1.?^/Y_JBD3"%"(29.P4)IHI_DA+0R?6Z%LR#'D>>-RY]_<[&]";4S'N9LZ -+M"Y_Z2\H5#%Z.7J?>2_*H\+?3*3@?E2>)5$*M1;0//-@K!L7>5:>)F4[WO4.>,LM,94O5/E$SMAZ>H -+M\![?H>XT]I?,L*YE4(_XY&?7:=O,PS0::.'M8IM8F#)34%%76)^HW?:5.S=Y6&,4AE,AE@%G2V47(DXEPJT)0 -+M..PL_..*EQ-^+I,4 -+M56.:ST1Q#2EAT>"]%8+(?\>5O`*'!.B37T7>L6.7PW*[?5@`6%UD\A!('2L+ -+M.$R'/6!C>GKC#<5U,GN3M%F9WZDL`#J-4OYO1/K#W'8/.+L-B!CG -+MX>C5+"2X.U^#\@\X%#M@H7^B?UMO@_`IC<6<>OX?O"ZMQ?_D-P]Z(A[$]Z_% -+M+`/EE#J)UQ1L@*%@C[$1"K]>"A+B&;O@8'Q?I;)U?/;1OP=SD7X(0+@/D`C -+M/D>5DIGL#VVM`4V40(D($48(AZH0`3N`(J^_Z7C^-$K2C]+3I-44+?CE2BE: -+M#.]`(@$(E,*(A?*OS&D'J%0$X>>2#.C>W]UAB?==P[^@X@.USAH$4HVQ5N0` -+MZODUS#,W(T.=7,.=4Z"1PJ7D&>!D_"SMO9HN>!IEBHY@LWU&4`A2C*%!*P@F -+M8:NPEZZ1OJ+8!2PM4`I5D,(BM2`%DHF4@!@-D)G$G;9"2$@VMR@%5`*C5O"T -+M4`BYZ*`8%I9>WMXV(`8>GP<;"C@H!&EW$,0`H)-61KVF4`"BE8`&6*P(T5MY -+M[,,;ND@P0:%;$:!6,4@"?R*`@&(I`?/V.OR$P*:HNV,TP%#5A;Z`2JI_A9J' -+M][V!`!.$/:?0EGVF8TSR<_YI`4.0%0RB(=X"A!$/`!0OJ`)50["B$$0M!0I0 -+M2"H11'R04*J-04+S-FYJBAX210"0]YV;I/?,69?B1'DF7D;]MP`1`).+&>KUBK4B?4=S:MC<=XWW$U4KM[G[J2EVCN; -+M/@/-;<73F[?O[4P!0W`4.`%#R=[`2!W.O9K37>X]!V]56Z^)X;I9Q1+C!41$ -+MA)"20]?3*9`AEP?L?*3)N`Q3!3D0`LC0"E*)%1I%>]!0VP4.J"ALW`8GBTD@ -+M#L^)$P#&[CW_!W%E/`IFIAB>S2DGPA)&9)!F9F`A"*L=/@R,)LXZQI19P9&2 -+M15")D#(0,00(D`:\P,X<1RJ9G3.Q+U&^0G`B'FW@#<8A8&_T9K"I@@00;!0V -+MFV+(\9;GZW-.K6N_:8*<.7D+*!;[0KZ.DM+/;Q1#DO]1P=U0K$SDMIB"0,=)TI=B1D1`&1@9+]015`AUX.G%YCZTQSMP&.NF[Q2D -+MLFF^%S/`X*6,"GT/\-3\I.+EJ[:-C*DVU%JVK?RT55HA5M -+M=IL\W`ZX8X'%R6G6UJ($"HG#NPH6)[9)5#I>#661&#'.,(R#0BA?#,(=4P<9 -+MC849O*SG1$]L9,1UH*!1HCV=J7?)NP'\_L2T\!H*$(67:P!AE18K\Z$!Z8K# -+M3**H"OOKTP&`WF3K!\@2',QTC=T"G1R-J+][XLV -+M(+8U@=`1MFP\,V/E5"&F8=JAMA>ST4A8R]DFB-V.8J;>MYL^"G(IU)_!1T1S -+M1ZKUQC]A"6W+L==(4)^N[[/IW.W'V>OI3ZQ3I)5#=,;"[4`WYH:H"EIO#QP] -+MSLR@!H'@:TL;M]IPBL<^H8]HE8\TV##;I=QSPY_]QF;P -+MM/>O"3T)[*80=VMJ@'7HE+(S=H(%<+PY^)\@S]_< -+M;HPZ-X4BF#W(*'(0`K;8HF.\+K,J(@7U(\$0%_L?>;GX@ZBQQ8+SQM-(KZ,T -+M9C:"/-1$LP6-!UB!H'J`"Z[BU1&&*B])JICY7IM$"$[=1A]Z(`N00(;F^!CC -+M5^P%&$;?H8DTT347F=$+184JBY0.(9!0,+$N[M:9UZ'XN^`PG`&KU$+X:VQP^/6EA!K$],NI#&V[..-H-1%"/>\UILE?@CGDZ_->"R,B!V.L@$ -+M\&)YAC4=[_/OLTGHN.\HM45P\AYL%3UTXX8UK89FA0IA!,I6./VBK\XR="PY -+MX$>0E!].'NBXP53HL[#=M+887P^KJ$O*\J%%R3%HS53F3>PW"W)RE^0XP`&B -+MX5S4FXKO7KFF=!'B*40SE(LCGE4:[%<'28D=N(EZTAK?KT,J8/+0;J:&KD4Q -+MB[OTEDH1OBO+GDKUP8>/$/I/K&79VH!DW(/A#%O11Q,@?43>'>UDD\ER#*FT -+M')J(=2J>5.VW66K+2X(DT)IN(PK1W!R2F&OY&3M18,?"*L,:G@I^8P.Q>&WF -+M#.EZ:?20E*9N80_^%7)T'JNIOAM2U8J7U%SQ!5SP<%>O\CD:[T#9,"[%5=`GHARQIT -+M%\QD4*(FQ4)1^"94)MT,<05.QG++X<\&]/K$6S/WCS493!P1"*-:=F<4IPIN -+M/+HA_?]9K12Z4?9#B^ZG``&8)YPC&'J`:.$+6*I=A&GX74>)[[HP]&G1Q'WD -+M&I$34#4[D:E&0X>6!PZ:3'B0^W>(,D=*^/92`7Q>Q9-VAPUEQY3OTL_HZO#; -+M>#LA+:6P2J`"-2V,RA8$1Z7F[]*K)3,'CQHY$78K\B']@`8P%]=;,/U'E7#N -+M*&)X?MY1EQ%FK,8H:9K>;;!S?'N^@'EQ,87%WG+>)!%3C>! -+MPG)6ZNZG!P'@4%04Y;)`BM,$\7AB]3RL4:\XW7W00(".LJFSTKGT*M2TN^L7 -+M%@0`B`(A<`$"(1N!QX5FD\?@KO;H<;O.81WCXCX0Q*/U9@/0C -+M%(`V()O@A7*8\:4@&#F)EC0I05R7\PBCBCE#2XF,#"KCFN@W -+M>X>>N2Q1:\ZY(2F0,Q?:''2/&A[N9<9W,W"C.BFA"X6`#S/>PH?FQ$NZU?L5 -+M:%KJY31\`:46RYB8I12>4+@=KUF'V84*AZ9)<=+3`TMQSW!&4&1 -+MOVK3F)P\F'+M>@6I@UR)FR&V&]@54]WN43U=;>HIBQ14'9V"IBLL3##*Q],) -+M]QWNQWGS@"VU^,'ZK(O"&XX73+[$P:JK;=PJN[)=#R\,!3RVIIE4%#$M#M:[T;+*^L[L\_E->?;7GBTF.WV'SA^,C -+MI_(U5I*^F0K_A\E2M,7C("1S"";,76BQS-J0\@"(!@A7K8LPYTN8I$"81B%1 -+M`2=VC#?M08HPA"!^5`AU)@H2LH%WI7IIQW$(44H5I@A&_(*0&2]9BH$/S424 -+MA[ID(4F0PG+%CL8%'F96&M\T#-$984"5((`GI9O\^J`G)"3 -+MF$F&UPO%T7I"-_4@?=<7448N.,D(T:\SOC/B0Q[.&;'-BYP3#<._R"(7]"@2 -+MB;[:-2ACE"YUZ)"\@RP@*&P7C0%#GO?PG1Z($QPJPJX;0J% -+MM77KK\]``=R#J10T14"4D%<\6L+ME\?UG3^>^5U.OD!0]L0`3B!0@@KR<9-P -+MXQ-;L=B_?>*S;KP@@@<.\Z#.-M"Q%IPM$S$,EA?"(H)'AE%@E>(`38$0KENH -+M]!A=)P]Y_=LLSAE$R%+").Z_8;-;K9`DT\WCWG0Y"P]#];[*TR"=W$V,V91A -+M71,P*$:G9H`TMG,HETJ\/!38KNF;OK\P*&5H!OJJO>I!4(\(*&-IF"F@%#?: -+MYPX,&FHI(<=[S*;`*%BV3+ -+M@P&<#C!ZMB!2%%`=4,*!O.H4S#`@H%NK\B\5#*>?XGQMCF8W'\*G4SGM?J3$ -+M.[`K2U%`44!BQ&16V,KX'0*3KCCC(@8G90&TX@*';F\]9.BEPZ+322R/-M10 -+MR5`$IZ@@N9>,I984,W=;)`QC)JX*%>Y?0&'-AM15=<-%!(&;ZK>!O.*&]IL/,LNP44\D;(=EVWGN. -+M<:*;Y.R9TN"O:[A73N%1/,)PN)6#(&+%6B&Y"2A!;:[G-0( -+M^-\(=F/B/>'L(+-)POFTHV%?R5\SNC[ABBN!J7%-YELS%@L5(H5@58P5D`B` -+MQ/D!-HQ7,::HBH&,@RH3&"0PAK<0`BHRSV)WVT<&3@">YM+7(7/6<0U33JH% -+MFYS:'!VWP`!*]J2!E)"0B0B*((HQ$11B/WIB!1L2$UPD9"-3(1C`4W^Z@.T2 -+M$RV=VM%5165C3(]7JSZ`N=#Z<"=NM9G/\83I['_K/4_HWCFKHWV:J:Y?Y'7A -+M?DI$1`BM`$0%(``A]#ENPDS3Z^)MN7]3\W6%.*Z'<&R.8+:@@0!@(0% -+M"09`0($!0@H)Q;WT=+2$%0GCY,%V.FV#8+C555,5:JE1I*&A64J4TRPD#?A"`A7A?E=V;H^5^.-Z -+M6;9:`B>RV7/ZWMF<\GFAL7@"0.W=<"A9CT-E%!,43[^,@)S]'FB,H9"!IZQH -+MH1S!EM)#>P@B%+J@H=P:#%`(H!&-^E\:4(U/%V"IIP!0VP4,!8N3#&7E(4*% -+M)0E+QR`H8:"X`T;-Y?41POCSN=O=DYGW<]63['4"AD9$])!#N0$%Y%49R1H] -+M6*"?%YJ!HJ9E39'VPG`9;O/EH#D8L95,.A8F&DHX/>60794`1,M0S,&B"%^> -+M[P>L"]1T,P1:P($'TD0"Y41OAU@4,@*&P>W@],!U&R'%CMFQ:HY5&CU!-N[: -+M:`]:H6HH)F;`H[WL[.Z[\^9ZZ[8.CHFX(ZCAF4T3E@H1&D:F)3>UXW%).3O] -+MRT3:,VU>!F(A42\]S]WA?`OT/W'0ZPB&3&:)2,V*VM25/IZA($,I-Z0HI"08 -+M-.R5&JC:35G(%UE`@`EGDP"BC`(HW^#4+@4(!-L%"/8+F@V"(0E!$*(9H2M" -+MHPD"AN&[" -+MHYN6'+C&PP%&S;A:II;HDMNP,&X`2"C@&373*.8%#/6+@=`;!$.`>9,UQMY*T*=9H'VFCSJY7!1 -+MH?-G*%!;>7G+:^;0H7;MI8I6M-//XE"IS@R@H7E -+MY\2C1W-"$VZCS`4,FYEC"$C)Q.UJUX'2_3P_3?C7Y81 -+MP,^I,KDUEX*'2RG3Z1TR=K[S57UI`^G-6<@AIA:KW**=FLHRLF,>RE9I:;CV -+M4C_OU2_?Z=CQ.71PKA'F+1J.K@V'#!L0F\Q=I##\/`0="-8S0ZE_`R/TQF'CHT4`W8<[TPTZU!0+[.[FW,VK1354`PU6:N@I$Y -+M1)%S)K0='IB5-T]&)5RK!@S/9"_3E$4!NNR>F!0@9T1/(CV^`DDA/[34!0RQ -+M%#(P6<\X#56L2%-:EHOT6QP7!X.0;!#X&/ASC>:8LLPWEBS*LKKB9-)5-!59 -+M;6UU`W:U?"X$VMI5J-"JJM33NIPX&OL!*OGM;9XNSKN6C=V;OA4M:TIL8[8* -+M%^J)980DA-L3E:P4-XO,2W1]3!ORDA(8FT"AA0@TH(;+`IJ,.ZW.(-U!^J\((H=5D)E'S]CYGC\FGS[,.=D#, -+M(@6/J18(LK%TQ`B`(48]'1WW<%0RDAXIVF(Y#P3)VT/;XM?VC8[E<)6]2F'B^O^_4N,>`RGOW`@G[W'RU`?#%[PDA$DU(]^8A?^ -+MDQ/MS"1D8>ER,>3H3/'H7"ZZZZZ8`23.A,Z?;PB*/NR+C\>IA[S;IO[X\L(U -+M*8+6$!40?^>X!1K^-^)7O8>D0_%NKYCSHZS]:)( -+M#/7AQ%$8&:1AS>,M=[MMCGM6%&D&#F`2`,8!0\5[J>,"A_;L#]"=R+AE/7]C -+M8_=MCV(DO(2>>\_GL\JRX/G?045JAA`"?.G7@>0?@4#[;Q3V6/>^I+CR_SZ/ -+M,QH'S_0_0J>U@>)/_$/5:-1JY7&7'UTX3B"P`2@J&]3PK1Y37045.-[&RU@C -+MRZE!QRM1S7R%'CX/#[_R-&9Z3/H$A9[*ITAY+H87N/MQ^XRSN=4GN]8J"*9T -+M4R?\IT_Z'OD_W1@',I\5%O.?>V!^_>KA%_VPS55;10&&]E*IK?KLI,/7_/>L -+M^UO:R&]I_AK"3J+\;_ -+M27^:>[[K:'0_IRO#AY]*0D\W_]V,W?7WO7[;][\4N]4J;74]OKR#I("ZF)[\D.+7[JW<1M_S+T\R07]^.GHN2N_V9W^UAH/?M6L(]G=;K8`^ -+MNGF*OQV7S(P>`QF$K9K.8#_/:_`86%)Q#=W]L'PKE*TZ/Q/>W0X:[]Z!=MVAGZ3XE^R4@7Z<;!&Y2#\_ -+MZ)!2!?*E\$B%&8XI)1DC5[YX0Q.D!U5!X>T_#9.<7W8\W8*\2(#[7OKPL/%P -+MMCZ'U_NJ)T\='S>((D_7A^ELI=U(3,[P-9[+TT'PWDE'"$\!X=_\_).ROW^? -+MC=.S-W,8.>T2CBVG&3T>S'H/R==M"JX)?-VOP7GM- -+M?2\':;;5N;OB<3>9^20W4&3S:/LW:AARVH-G6TXL -+MDV\!)L(@OU(`.H@8<80FQRK)$PE(T\YV=T-QZICXH'U:!W.%:XYY4M:_.D`5 -+M6YB":A=D94"H`(#`W"$#%A,')0]-U:>&S":X@W%\BOH3^V+%,$"HQKE""HB- -+M0A!C@V((WR@$O#G3>I#[/G[2P@U&5UR47BO1?WMZ5$;Y`0%V0?IONU7!O;OQ -+M$->N4W#HL,OL_MU_I-KT.>\Z;3O>4:*LX#Q,&CM7">7Z$\6]4ZMY7I=NTYM% -+MZ)IY48P2K*WEJ^2V-(B`/`IKS(?6MQ2E'=>U[*5&>8($I,!YRH*,FI%59T3G -+MCT@9#11"[,IUXXTZJ=+@L^BO,#!,@8`B,,'D:[,(IRKJN!N(PCUN7ETFMNQ> -+MT.M,<5L4#9FB*%?$W!57FM?/^ZBA@2T-7E"Z%F;\[:8XR0<6)_+$E*H!FF8. -+M-XG<(8#8^U:S%08IU0*`6B3A$>0E<[+JG_>:@;>-`Y1E`&`8=(RYUE')]1`TYY(A:#RB0FG3$PE+)8S -+MGU.@!,R[6^+K@E&1>47'U:5Y9^H"9N$SLJ5J?%:_%JV9"PQ"#C%I;C:?MTG) -+M<_+^*U#T[J#O`$?NA$H`J5@CT><;M?J"+89:J5'/N15EU7F7>F1"I0/G+">Y -+M3+-@8%+J^"D)LAGHE1:IW4%D>L70=!S'KQZ=T/&:X3,<[QS#1;Q0:L.Y4(WR -+MIS8('-XK,_=EA`C,5^$HZS9@[X!)(&TP;5L0+F9IIL:86^R:&;<$8IY<9"=$ -+M980D2B%BWIQ8MF1**D]I;;CK69[X^A0WPLO@0K_*(X]F;<'PTXE7 -+M=W36:V(H)-CY_U'(8WEH]4NH>1WYRQ+BR@4% -+M$1U.K,)S+4!]61]+Q!Q];=1<:0H&&9F^&`@320!JS8'6STZ[:=E*IZ;&BDC7 -+M0Z/7-5O>MY:IK*BM/5>;X56^9&U^#42.H)OFI54HV1)`TJC7_B33GAVXJ]7O -+M;?1"OI([IPP,[MV,/M;SJ$X)F]1/8&A&510:&ID)5D![*U)9=_1^5X(."9$3 -+MAKAD3Q"G(58]/R>7K9'EWM'SQL4<(VSXPXG5&YKMU-_C3ND*S57\G4:0+B9, -+MJ5UN=Z]5!0TZS\:=[S.J>H-)[0]6K0B-@S.BC387!M -+M$S)!YJMA-!`JT[;'[Z^+^[0R-)::%H%GHKM=7G#8VW_]:.U^;<&A9&M/6UP?W""!BY%` -+M#![EE,U-#7?W49=0ZXLS<=KZ:P-?Z3.X9G9?7W,9U.N2TLZ.@I-#Z@G7\7TV -+MWHSA0AEJ*,1,`G^Y-'RV*AEKF,/?,:P^UZ&F<"J&#J0NMG0&<\V@F>9R#G`8 -+M8"2$M4:2?X:&&W[K8\*=>CQHL8G]'<]@CN1F#'"X-ZO8\(=;X+BJT=]2+C:H -+M4PL_D99">XRIU6^@S@B;6=;A"S6J!DD&;F8.@CY3\G*1J,;%1,\3U?C65;#&*>6OE! -+MFVJJJM,IDRO),/K661%M4\6#1,IBT04O9HXN64;!]\FH*H#<46AK6%-'LCF9 -+MR+1L24TY4/W_$$4`;*4R6-)=-<[!3VX70!7=GKY%5A/>5U.!KP4`/^X".'H%Q?;P',T8(,[(O1T\\K!%">*#TZ3L)AZ$/:3# -+MN#L_''38,`!CF+]:(8[7>H+[G4L`8'8$'2;(;A-TB>Y-?`Z0SHGO<-&]>=?1 -+M.%\D]#]-"\?6"0!S,$=]"\WZJKFWW+0,KN8@H5#,P4JO+2[I8+)K.GE;OZ'7 -+MW6^-;6=X]"-%4;W@V9C.#*N(]M'VAWIC7&N_#'E;W?3^T'>]-2-X=9B^4;U\ -+MT'*-(H-.>>8:,Q(3.V46OUD]TQT7D-PM+!C5]1&$A5_.0$FU.WL(&AB[^J(W -+MC9_.U;3@%I%C#)%M;R_(%(ZBT`U7Z%$^2K53FF"->R$&0GTQ1HJCRC*ZNL1@ -+M;F!0>FK6OK[E(YYHF^=GYS,F>9DC+2@>J2@N@/>\BL^-6Z=!H*-?OLIAZ_NK -+MLDN"E,GB8]*I2!;=UH7JBS.6AF88^:>-ZOR=_N7A"M\B,YE=CKV?B(2%+;-$FTH0P@=0=)7(@D5HIYCOV$EW.MZP_:HB -+M&,OED]W=BZGUITM#NKAC8,`1SO"V/<*,?4Q+AGF/V=O(_QZ9Q08'TG;(.%W> -+M3QI"^R0+9F25\+`V81V6@)V/X&8HAATY-]YTO.V[=I1-2`X6_"5%@0JCBP0? -+M!4@"!(7#-S*G*12#Q7ISP]OR(^?&&48%!EP>;\@B($4F'_XNY(IPH2!)0!** -+` -+end -diff --git a/gdb/testsuite/gdb.base/tab-crash.exp b/gdb/testsuite/gdb.base/tab-crash.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/tab-crash.exp -@@ -0,0 +1,43 @@ -+# This testcase is part of GDB, the GNU debugger. -+ -+# Copyright 2017 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 3 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, see . -+ -+if { ![istarget x86_64-*-* ] || ![is_lp64_target] } { -+ return -+} -+ -+standard_testfile -+ -+# gcc-base-debuginfo-6.3.1-1.fc25.x86_64 -+# /usr/lib/debug/lib64/libgcc_s-6.3.1-20161221.so.1.debug -+# objcopy -R .debug_loc -R .debug_ranges -R .debug_info -R .debug_abbrev -R .debug_aranges -R .debug_str -R .comment ... -+ -+set debugfilebz2uu ${srcdir}/${subdir}/${testfile}.bz2.uu -+set debugfile [standard_output_file ${testfile}] -+ -+if {[catch "system \"uudecode -o - ${debugfilebz2uu} | bzip2 -dc >${debugfile}\""] != 0} { -+ untested "failed uudecode or bzip2" -+ return -1 -+} -+file stat ${debugfile} debugfilestat -+if {$debugfilestat(size) != 71936} { -+ untested "uudecode or bzip2 produce invalid result" -+ return -1 -+} -+ -+clean_restart ${debugfile} -+ -+gdb_test "complete p si" "complete p si\r\np size_of_encoded_value" diff --git a/gdb-rhbz1553104-s390x-arch12-test.patch b/gdb-rhbz1553104-s390x-arch12-test.patch deleted file mode 100644 index 2cb15e5b25fddfc2bec064b5009d8d273e87286c..0000000000000000000000000000000000000000 --- a/gdb-rhbz1553104-s390x-arch12-test.patch +++ /dev/null @@ -1,81 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Jan Kratochvil -Date: Fri, 23 Mar 2018 20:42:44 +0100 -Subject: gdb-rhbz1553104-s390x-arch12-test.patch - -;; [s390x] Backport arch12 instructions decoding (RH BZ 1553104). -;; =fedoratest - -diff --git a/gdb/testsuite/gdb.arch/s390x-arch12.S b/gdb/testsuite/gdb.arch/s390x-arch12.S -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/s390x-arch12.S -@@ -0,0 +1,4 @@ -+.text -+.globl load_guarded -+load_guarded: -+.byte 0xeb,0xbf,0xf0,0x58,0x00,0x24,0xe3,0xf0,0xff,0x50,0xff,0x71,0xb9,0x04,0x00,0xbf,0xe3,0x20,0xb0,0xa0,0x00,0x24,0xe3,0x10,0xb0,0xa0,0x00,0x04,0xe3,0x10,0x10,0x00,0x00,0x4c,0xe3,0x10,0xb0,0xa8,0x00,0x24,0xe3,0x10,0xb0,0xa8,0x00,0x04,0xb9,0x04,0x00,0x21,0xe3,0x40,0xb1,0x20,0x00,0x04,0xeb,0xbf,0xb1,0x08,0x00,0x04,0x07,0xf4 -diff --git a/gdb/testsuite/gdb.arch/s390x-arch12.exp b/gdb/testsuite/gdb.arch/s390x-arch12.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/s390x-arch12.exp -@@ -0,0 +1,34 @@ -+# Copyright 2018 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 3 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, see . -+ -+#if { ![istarget s390x-*linux-*] || ![is_lp64_target] } { -+# verbose "Skipping s390x-prologue-skip.exp" -+# return -+#} -+ -+set testfile "s390x-arch12" -+set uufile "${srcdir}/${subdir}/${testfile}.o.uu" -+set ofile "${srcdir}/${subdir}/${testfile}.o" -+ -+if { [catch "system \"uudecode -o ${ofile} ${uufile}\"" ] != 0 } { -+ untested "failed uudecode" -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_load $ofile -+ -+gdb_test "disas load_guarded" " <\\+28>:\tlgg\t%r1,0\\(%r1\\)\r\n\[^\r\n\]* <\\+34>:\tstg\t%r1,168\\(%r11\\)\r\n.*" -diff --git a/gdb/testsuite/gdb.arch/s390x-arch12.o.uu b/gdb/testsuite/gdb.arch/s390x-arch12.o.uu -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/s390x-arch12.o.uu -@@ -0,0 +1,20 @@ -+begin 644 s390x-arch12.o -+M?T5,1@("`0`````````````!`!8````!```````````````````````````` -+M``$X``````!```````!```<`!.N_\%@`)./P_U#_<;D$`+_C(+"@`"3C$+"@ -+M``3C$!```$SC$+"H`"3C$+"H``2Y!``AXT"Q(``$Z[^Q"``$!_0`+G-Y;71A -+M8@`N +Date: Fri, 24 Nov 2023 11:10:08 +0000 +Subject: gdb-rhbz2232086-refactor-selftest-support.patch + +;; Back-port upstream commit 1f0fab7ff86 as part of a fix for +;; non-deterministic gdb-index generation (RH BZ 2232086). + +gdb/testsuite: small refactor in selftest-support.exp + +Split out the code that makes a copy of the GDB executable ready for +self testing into a new proc. A later commit in this series wants to +load the GDB executable into GDB (for creating an on-disk debug +index), but doesn't need to make use of the full do_self_tests proc. + +There should be no changes in what is tested after this commit. + +Approved-By: Tom Tromey + +diff --git a/gdb/testsuite/lib/selftest-support.exp b/gdb/testsuite/lib/selftest-support.exp +--- a/gdb/testsuite/lib/selftest-support.exp ++++ b/gdb/testsuite/lib/selftest-support.exp +@@ -92,11 +92,13 @@ proc selftest_setup { executable function } { + return 0 + } + +-# A simple way to run some self-tests. +- +-proc do_self_tests {function body} { +- global GDB tool +- ++# Prepare for running a self-test by moving the GDB executable to a ++# location where we can use it as the inferior. Return the filename ++# of the new location. ++# ++# If the current testing setup is not suitable for running a ++# self-test, then return an empty string. ++proc selftest_prepare {} { + # Are we testing with a remote board? In that case, the target + # won't have access to the GDB's auxilliary data files + # (data-directory, etc.). It's simpler to just skip. +@@ -120,19 +122,31 @@ proc do_self_tests {function body} { + # Run the test with self. Copy the file executable file in case + # this OS doesn't like to edit its own text space. + +- set GDB_FULLPATH [find_gdb $GDB] ++ set gdb_fullpath [find_gdb $::GDB] + + if {[is_remote host]} { +- set xgdb x$tool ++ set xgdb x$::tool + } else { +- set xgdb [standard_output_file x$tool] ++ set xgdb [standard_output_file x$::tool] + } + + # Remove any old copy lying around. + remote_file host delete $xgdb + ++ set filename [remote_download host $gdb_fullpath $xgdb] ++ ++ return $filename ++} ++ ++# A simple way to run some self-tests. ++ ++proc do_self_tests {function body} { ++ set file [selftest_prepare] ++ if { $file eq "" } { ++ return ++ } ++ + gdb_start +- set file [remote_download host $GDB_FULLPATH $xgdb] + + # When debugging GDB with GDB, some operations can take a relatively long + # time, especially if the build is non-optimized. Bump the timeout for the diff --git a/gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch b/gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch new file mode 100644 index 0000000000000000000000000000000000000000..1997ef96dadde24261f748ebad889038222e7bce --- /dev/null +++ b/gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch @@ -0,0 +1,48 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexandra=20H=C3=A1jkov=C3=A1?= +Date: Mon, 8 Jan 2024 13:24:05 +0100 +Subject: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch + +gdb/python: avoid use of _PyOS_ReadlineTState + +In python/py-gdb-readline.c we make use of _PyOS_ReadlineTState, +however, this variable is no longer public in Python 3.13, and so GDB +no longer builds. + +We are making use of _PyOS_ReadlineTState in order to re-acquire the +Python Global Interpreter Lock (GIL). The _PyOS_ReadlineTState +variable is set in Python's outer readline code prior to calling the +user (GDB) supplied readline callback function, which for us is +gdbpy_readline_wrapper. The gdbpy_readline_wrapper function is called +without the GIL held. + +Instead of using _PyOS_ReadlineTState, I propose that we switch to +calling PyGILState_Ensure() and PyGILState_Release(). These functions +will acquire the GIL based on the current thread. I think this should +be sufficient; I can't imagine why we'd be running +gdbpy_readline_wrapper on one thread on behalf of a different Python +thread.... that would be unexpected I think. + +Approved-By: Tom Tromey + +diff --git a/gdb/python/py-gdb-readline.c b/gdb/python/py-gdb-readline.c +--- a/gdb/python/py-gdb-readline.c ++++ b/gdb/python/py-gdb-readline.c +@@ -56,13 +56,11 @@ gdbpy_readline_wrapper (FILE *sys_stdin, FILE *sys_stdout, + if (except.reason == RETURN_QUIT) + return NULL; + +- /* The thread state is nulled during gdbpy_readline_wrapper, +- with the original value saved in the following undocumented +- variable (see Python's Parser/myreadline.c and +- Modules/readline.c). */ +- PyEval_RestoreThread (_PyOS_ReadlineTState); ++ ++ /* This readline callback is called without the GIL held. */ ++ gdbpy_gil gil; ++ + gdbpy_convert_exception (except); +- PyEval_SaveThread (); + return NULL; + } + diff --git a/gdb-rhbz2250652-gdbpy_gil.patch b/gdb-rhbz2250652-gdbpy_gil.patch new file mode 100644 index 0000000000000000000000000000000000000000..a72c35002756616f5bc2500cdf288fed3f2d2307 --- /dev/null +++ b/gdb-rhbz2250652-gdbpy_gil.patch @@ -0,0 +1,81 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alexandra=20H=C3=A1jkov=C3=A1?= +Date: Mon, 8 Jan 2024 13:12:15 +0100 +Subject: gdb-rhbz2250652-gdbpy_gil.patch + +gdb: move gdbpy_gil into python-internal.h + +Move gdbpy_gil class into python-internal.h, the next +commit wants to make use of this class from a file other +than python.c. + +Approved-By: Tom Tromey + +diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h +--- a/gdb/python/python-internal.h ++++ b/gdb/python/python-internal.h +@@ -754,6 +754,30 @@ class gdbpy_allow_threads + PyThreadState *m_save; + }; + ++/* A helper class to save and restore the GIL, but without touching ++ the other globals that are handled by gdbpy_enter. */ ++ ++class gdbpy_gil ++{ ++public: ++ ++ gdbpy_gil () ++ : m_state (PyGILState_Ensure ()) ++ { ++ } ++ ++ ~gdbpy_gil () ++ { ++ PyGILState_Release (m_state); ++ } ++ ++ DISABLE_COPY_AND_ASSIGN (gdbpy_gil); ++ ++private: ++ ++ PyGILState_STATE m_state; ++}; ++ + /* Use this after a TRY_EXCEPT to throw the appropriate Python + exception. */ + #define GDB_PY_HANDLE_EXCEPTION(Exception) \ +diff --git a/gdb/python/python.c b/gdb/python/python.c +--- a/gdb/python/python.c ++++ b/gdb/python/python.c +@@ -257,30 +257,6 @@ gdbpy_enter::finalize () + python_gdbarch = target_gdbarch (); + } + +-/* A helper class to save and restore the GIL, but without touching +- the other globals that are handled by gdbpy_enter. */ +- +-class gdbpy_gil +-{ +-public: +- +- gdbpy_gil () +- : m_state (PyGILState_Ensure ()) +- { +- } +- +- ~gdbpy_gil () +- { +- PyGILState_Release (m_state); +- } +- +- DISABLE_COPY_AND_ASSIGN (gdbpy_gil); +- +-private: +- +- PyGILState_STATE m_state; +-}; +- + /* Set the quit flag. */ + + static void diff --git a/gdb-opcodes-clflushopt-test.patch b/gdb-rhbz2257562-cp-namespace-null-ptr-check.patch similarity index 41% rename from gdb-opcodes-clflushopt-test.patch rename to gdb-rhbz2257562-cp-namespace-null-ptr-check.patch index f95999e9cfcba50d9266d42bef5edece0a076348..f868e6f770ea7c34a61583633a919e0d4235c634 100644 --- a/gdb-opcodes-clflushopt-test.patch +++ b/gdb-rhbz2257562-cp-namespace-null-ptr-check.patch @@ -1,17 +1,51 @@ 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-opcodes-clflushopt-test.patch +From: Kevin Buettner +Date: Tue, 16 Jan 2024 20:07:53 -0700 +Subject: gdb-rhbz2257562-cp-namespace-null-ptr-check.patch -;; Test clflushopt instruction decode (for RH BZ 1262471). -;;=fedoratest +;; Backport potential fix for RH BZ 2257562. -diff --git a/gdb/testsuite/gdb.arch/amd64-clflushopt.S b/gdb/testsuite/gdb.arch/amd64-clflushopt.S +Fix printing of global variable stubs if no inferior is running + +Since 3c45e9f915ae4aeab7312d6fc55a947859057572 gdb crashes when trying +to print a global variable stub without a running inferior, because of +a missing nullptr-check (the block_scope function took care of that +check before it was converted to a method). + +With this check it works again: +``` +(gdb) print s +$1 = +``` + +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31128 +Approved-By: Tom Tromey +(cherry picked from commit 576745e26c0ec76a53ba45b20af464628a50b3e4) + +diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c +--- a/gdb/cp-namespace.c ++++ b/gdb/cp-namespace.c +@@ -1026,7 +1026,11 @@ cp_lookup_transparent_type (const char *name) + + /* If that doesn't work and we're within a namespace, look there + instead. */ +- scope = get_selected_block (0)->scope (); ++ const block *block = get_selected_block (0); ++ if (block == nullptr) ++ return nullptr; ++ ++ scope = block->scope (); + + if (scope[0] == '\0') + return NULL; +diff --git a/gdb/testsuite/gdb.cp/print-global-stub.cc b/gdb/testsuite/gdb.cp/print-global-stub.cc new file mode 100644 --- /dev/null -+++ b/gdb/testsuite/gdb.arch/amd64-clflushopt.S -@@ -0,0 +1,19 @@ -+/* Copyright 2016 Free Software Foundation, Inc. ++++ b/gdb/testsuite/gdb.cp/print-global-stub.cc +@@ -0,0 +1,31 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2023 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 @@ -24,18 +58,28 @@ new file mode 100644 + 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, see . ++ along with this program. If not, see . */ ++ ++struct S ++{ ++ S (int); ++ virtual ~S (); + -+ This file is part of the gdb testsuite. */ ++ int m_i; ++}; + -+_start: .globl _start -+ clflushopt (%edi) -diff --git a/gdb/testsuite/gdb.arch/amd64-clflushopt.exp b/gdb/testsuite/gdb.arch/amd64-clflushopt.exp ++S s (5); ++ ++int main () ++{ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.cp/print-global-stub.exp b/gdb/testsuite/gdb.cp/print-global-stub.exp new file mode 100644 --- /dev/null -+++ b/gdb/testsuite/gdb.arch/amd64-clflushopt.exp -@@ -0,0 +1,25 @@ -+# Copyright 2016 Free Software Foundation, Inc. ++++ b/gdb/testsuite/gdb.cp/print-global-stub.exp +@@ -0,0 +1,32 @@ ++# Copyright (C) 2023 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 @@ -50,13 +94,20 @@ new file mode 100644 +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + -+if { ![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"] } then { -+ verbose "Skipping amd64 clflushopt test." -+ return -+} ++# This file is part of the GDB testsuite. ++# It tests printing of a global stub without inferior. + -+if [prepare_for_testing amd64-clflushopt.exp amd64-clflushopt amd64-clflushopt.S [list debug "additional_flags=-nostdlib"]] { ++require allow_cplus_tests ++ ++standard_testfile .cc ++set objfile [standard_output_file ${testfile}.o] ++ ++if { [gdb_compile $srcdir/$subdir/$srcfile $objfile object \ ++ {c++ debug}] != "" } { ++ untested "failed to compile" + return -1 +} + -+gdb_test "disas _start" "Dump of assembler code for function _start:\r\n *0x\[0-9a-f\]+ <\[+\]0>:\tclflushopt \\(%edi\\)\r\nEnd of assembler dump\\." "clflushopt" ++clean_restart $objfile ++ ++gdb_test "print s" " = " diff --git a/gdb-rhel5.9-testcase-xlf-var-inside-mod.patch b/gdb-rhel5.9-testcase-xlf-var-inside-mod.patch deleted file mode 100644 index b130d1f677eb03883ee33ba9af62842abfd486e2..0000000000000000000000000000000000000000 --- a/gdb-rhel5.9-testcase-xlf-var-inside-mod.patch +++ /dev/null @@ -1,731 +0,0 @@ -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-rhel5.9-testcase-xlf-var-inside-mod.patch - -;; Include testcase for `Unable to see a variable inside a module (XLF)' (BZ 823789). -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.fortran/xlf-variable.S b/gdb/testsuite/gdb.fortran/xlf-variable.S -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/xlf-variable.S -@@ -0,0 +1,638 @@ -+/* Copyright (C) 2012 Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ 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 3 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, see . */ -+ -+/* This file has been generated from the file named `xlf-variable.f', which -+ should be present in this directory. The command used to generate this -+ file was: -+ -+ xlf -qnoopt -g9 -S xlf-variable.f -o xlf-variable.S -+ -+ After issuing this command, you must hand-edit this file and remove the -+ mentions for `_xlfExit', since it is only present in XLF-specific -+ libraries. You must also make sure to remove the file named `mod1.mod' -+ which will be created in the compilation directory. -+ -+ In order to generated this file, the following XLF package was used: -+ -+ xlf.14.1.0.0.linux.eval.tar.gz -+ -+ These instructions may be different for different versions of the XLF -+ compiler. */ -+ -+.set r0,0; .set SP,1; .set RTOC,2; .set r3,3; .set r4,4 -+.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9 -+.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14 -+.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19 -+.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24 -+.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29 -+.set r30,30; .set r31,31 -+.set fp0,0; .set fp1,1; .set fp2,2; .set fp3,3; .set fp4,4 -+.set fp5,5; .set fp6,6; .set fp7,7; .set fp8,8; .set fp9,9 -+.set fp10,10; .set fp11,11; .set fp12,12; .set fp13,13; .set fp14,14 -+.set fp15,15; .set fp16,16; .set fp17,17; .set fp18,18; .set fp19,19 -+.set fp20,20; .set fp21,21; .set fp22,22; .set fp23,23; .set fp24,24 -+.set fp25,25; .set fp26,26; .set fp27,27; .set fp28,28; .set fp29,29 -+.set fp30,30; .set fp31,31 -+.set v0,0; .set v1,1; .set v2,2; .set v3,3; .set v4,4 -+.set v5,5; .set v6,6; .set v7,7; .set v8,8; .set v9,9 -+.set v10,10; .set v11,11; .set v12,12; .set v13,13; .set v14,14 -+.set v15,15; .set v16,16; .set v17,17; .set v18,18; .set v19,19 -+.set v20,20; .set v21,21; .set v22,22; .set v23,23; .set v24,24 -+.set v25,25; .set v26,26; .set v27,27; .set v28,28; .set v29,29 -+.set v30,30; .set v31,31 -+.set q0,0; .set q1,1; .set q2,2; .set q3,3; .set q4,4 -+.set q5,5; .set q6,6; .set q7,7; .set q8,8; .set q9,9 -+.set q10,10; .set q11,11; .set q12,12; .set q13,13; .set q14,14 -+.set q15,15; .set q16,16; .set q17,17; .set q18,18; .set q19,19 -+.set q20,20; .set q21,21; .set q22,22; .set q23,23; .set q24,24 -+.set q25,25; .set q26,26; .set q27,27; .set q28,28; .set q29,29 -+.set q30,30; .set q31,31 -+.set MQ,0; .set XER,1; .set FROM_RTCU,4; .set FROM_RTCL,5; .set FROM_DEC,6 -+.set LR,8; .set CTR,9; .set TID,17; .set DSISR,18; .set DAR,19; .set TO_RTCU,20 -+.set TO_RTCL,21; .set TO_DEC,22; .set SDR_0,24; .set SDR_1,25; .set SRR_0,26 -+.set SRR_1,27 -+.set BO_dCTR_NZERO_AND_NOT,0; .set BO_dCTR_NZERO_AND_NOT_1,1 -+.set BO_dCTR_ZERO_AND_NOT,2; .set BO_dCTR_ZERO_AND_NOT_1,3 -+.set BO_IF_NOT,4; .set BO_IF_NOT_1,5; .set BO_IF_NOT_2,6 -+.set BO_IF_NOT_3,7; .set BO_dCTR_NZERO_AND,8; .set BO_dCTR_NZERO_AND_1,9 -+.set BO_dCTR_ZERO_AND,10; .set BO_dCTR_ZERO_AND_1,11; .set BO_IF,12 -+.set BO_IF_1,13; .set BO_IF_2,14; .set BO_IF_3,15; .set BO_dCTR_NZERO,16 -+.set BO_dCTR_NZERO_1,17; .set BO_dCTR_ZERO,18; .set BO_dCTR_ZERO_1,19 -+.set BO_ALWAYS,20; .set BO_ALWAYS_1,21; .set BO_ALWAYS_2,22 -+.set BO_ALWAYS_3,23; .set BO_dCTR_NZERO_8,24; .set BO_dCTR_NZERO_9,25 -+.set BO_dCTR_ZERO_8,26; .set BO_dCTR_ZERO_9,27; .set BO_ALWAYS_8,28 -+.set BO_ALWAYS_9,29; .set BO_ALWAYS_10,30; .set BO_ALWAYS_11,31 -+.set CR0_LT,0; .set CR0_GT,1; .set CR0_EQ,2; .set CR0_SO,3 -+.set CR1_FX,4; .set CR1_FEX,5; .set CR1_VX,6; .set CR1_OX,7 -+.set CR2_LT,8; .set CR2_GT,9; .set CR2_EQ,10; .set CR2_SO,11 -+.set CR3_LT,12; .set CR3_GT,13; .set CR3_EQ,14; .set CR3_SO,15 -+.set CR4_LT,16; .set CR4_GT,17; .set CR4_EQ,18; .set CR4_SO,19 -+.set CR5_LT,20; .set CR5_GT,21; .set CR5_EQ,22; .set CR5_SO,23 -+.set CR6_LT,24; .set CR6_GT,25; .set CR6_EQ,26; .set CR6_SO,27 -+.set CR7_LT,28; .set CR7_GT,29; .set CR7_EQ,30; .set CR7_SO,31 -+.set TO_LT,16; .set TO_GT,8; .set TO_EQ,4; .set TO_LLT,2; .set TO_LGT,1 -+ -+ .file "xlf-variable.f" -+ .globl __mod1_NMOD_____mod1 -+ .type __mod1_NMOD_____mod1,@function -+ .size __mod1_NMOD_____mod1,32 -+ .globl main -+ .type main,@function -+ .size main,68 -+ .globl __mod1_NMOD_sub1 -+ .type __mod1_NMOD_sub1,@function -+ .size __mod1_NMOD_sub1,136 -+ .globl _main -+ .type _main,@function -+ .size _main,68 -+ -+ .section ".text" -+ .align 7 -+.LC.text: -+__mod1_NMOD_____mod1: -+ stwu SP,-32(SP) -+ stw r31,28(SP) -+ or r31,SP,SP -+ b $+0x4 -+ addi r11,r31,32 -+ lwz r31,-4(r11) -+ or SP,r11,r11 -+ bclr BO_ALWAYS,CR0_LT -+.LC.text32: -+ -+__mod1_NMOD_sub1: -+ stwu SP,-32(SP) -+ stw r31,28(SP) -+ stw r30,24(SP) -+ or r31,SP,SP -+ addis r30,r0,.const_dr@ha -+ addi r30,r30,.const_dr@l -+ addis r3,r0,__N_mod1@ha -+ addi r3,r3,__N_mod1@l -+ addi r0,r0,1 -+ stb r0,4(r3) -+ addi r4,r0,14 -+ stb r4,5(r3) -+ stb r0,7(r3) -+ addis r5,r0,__N__mod1@ha -+ addi r5,r5,__N__mod1@l -+ stw r5,0(r3) -+ lbz r5,6(r3) -+ rlwinm r5,r5,0,25,25 -+ ori r5,r5,0x0040 -+ stb r5,6(r3) -+ lwz r5,0(r3) -+ lfs fp0,0(r30) -+ stfs fp0,0(r5) -+ stb r0,4(r3) -+ stb r4,5(r3) -+ addi r4,r0,0 -+ stb r4,6(r3) -+ stb r0,7(r3) -+ b $+0x4 -+ addi r11,r31,32 -+ lwz r30,-8(r11) -+ lwz r31,-4(r11) -+ or SP,r11,r11 -+ bclr BO_ALWAYS,CR0_LT -+.LC.text168: -+ .long 0 -+ .skip 0x54 -+.LC.text256: -+ -+main: -+_main: -+ mfspr r0,LR -+ stwu SP,-32(SP) -+ stw r31,28(SP) -+ stw r0,36(SP) -+ or r31,SP,SP -+ bl __mod1_NMOD_sub1 -+ addi r3,r0,0 -+.LC.text288: -+ -+ tw TO_EQ,r14,r14 -+ addi r3,r0,0 -+ b $+0x4 -+ addi r11,r31,32 -+ lwz r31,-4(r11) -+ lwz r0,4(r11) -+ mtspr LR,r0 -+ or SP,r11,r11 -+ bclr BO_ALWAYS,CR0_LT -+.LC.text324: -+ -+ -+ .section ".rodata","a" -+ .align 2 -+.LC.rodata: -+ .type .const_dr,@object -+ .size .const_dr,4 -+.const_dr: -+ .long 0x40400000 -+ -+ .section ".eh_frame","wa" -+ .align 2 -+.LC.eh_frame: -+ .long 0x0000000c -+ .long 0x00000000 -+ .long 0x0100047c -+ .long 0x410c0100 -+ .long 0x0000001c -+ .long 0x00000014 -+ .long .LC.text -+ .long 0x00000020 -+ .long 0x410e2041 -+ .long 0x9f01410d -+ .long 0x1f410a42 -+ .long 0xdf420b00 -+ .long 0x00000020 -+ .long 0x00000034 -+ .long .LC.text32 -+ .long 0x00000088 -+ .long 0x410e2041 -+ .long 0x9f01419e -+ .long 0x02410d1f -+ .long 0x590a42de -+ .long 0x41df420b -+ .long 0x0000000c -+ .long 0x00000000 -+ .long 0x0100047c -+ .long 0x410c0100 -+ .long 0x00000020 -+ .long 0x00000014 -+ .long .LC.text256 -+ .long 0x00000044 -+ .long 0x420e2041 -+ .long 0x9f014111 -+ .long 0x417f410d -+ .long 0x1f460a42 -+ .long 0xdf440b00 -+ -+ .section ".data","wa" -+ .align 4 -+.LC.data: -+ .globl __N_mod1 -+ .type __N_mod1,@object -+ .size __N_mod1,8 -+__N_mod1: -+ .long 0x00000000 -+ .long 0x01000001 -+ -+ .section ".except.1","wa" -+ .align 1 -+.LC.except.1: -+ .long .LC.text288 -+ .byte 0x01 -+ .byte 0x09 -+ -+ .ident "Fri Jun 15 16:35:45 2012 .IBM XL Fortran for Linux, V14.1 (5765-J05, 5725-C75) Version 14.01.0000.0000.Fri Jun 15 16:35:45 2012 .IBM XL Fortran for Linux, V14.1 (5765-J05, 5725-C75) Version 14.01.0000.0000." -+ -+ .section ".debug_aranges" -+ .align 0 -+.LC.debug_aranges: -+ .long 0x0000001c -+ .byte 0x00 -+ .byte 0x02 -+ .long .LC.debug_info -+ .long 0x04000000 -+ .byte 0x00 -+ .byte 0x00 -+ .long .LC.text -+ .long 0x000000a8 -+ .long 0x00000000 -+ .long 0x00000000 -+ .long 0x0000001c -+ .byte 0x00 -+ .byte 0x02 -+ .long .LC.debug_info273 -+ .long 0x04000000 -+ .byte 0x00 -+ .byte 0x00 -+ .long .LC.text256 -+ .long 0x00000044 -+ .long 0x00000000 -+ .long 0x00000000 -+ -+ .section ".debug_pubnames" -+ .align 0 -+.LC.debug_pubnames: -+ .long 0x0000002f -+ .byte 0x00 -+ .byte 0x02 -+ .long .LC.debug_info -+ .long 0x00000111 -+ .long 0x000000dc -+ .long 0x79000000 -+ .long 0x00ec7a00 -+ .long 0x000000fc -+ .long 0x5f5f6d6f -+ .long 0x64315f4e -+ .long 0x4d4f445f -+ .long 0x73756231 -+ .long 0x00000000 -+ .long 0x00000000 -+ .byte 0x18 -+ .byte 0x00 -+ .byte 0x02 -+ .long .LC.debug_info273 -+ .long 0x00000127 -+ .long 0x0000010f -+ .long 0x5f6d6169 -+ .long 0x6e000000 -+ .byte 0x00 -+ .byte 0x00 -+ -+ .section ".debug_info" -+ .align 0 -+.LC.debug_info: -+ .long 0x0000010d -+ .byte 0x00 -+ .byte 0x02 -+ .long .LC.debug_abbrev -+ .long 0x0401786c -+ .long 0x662d7661 -+ .long 0x72696162 -+ .long 0x6c652e66 -+ .byte 0x00 -+ .long .LC.debug_line -+ .long .LC.text -+ .long .LC.text168 -+ .long 0x082f726f -+ .long 0x6f742f73 -+ .long 0x65726769 -+ .long 0x6f646a2f -+ .long 0x6764622d -+ .long 0x372e302e -+ .long 0x312d3432 -+ .long 0x2e656c35 -+ .long 0x2f676462 -+ .long 0x2d372e30 -+ .long 0x2e312f67 -+ .long 0x64622f74 -+ .long 0x65737473 -+ .long 0x75697465 -+ .long 0x2f676462 -+ .long 0x2e666f72 -+ .long 0x7472616e -+ .long 0x0049424d -+ .long 0x20584c20 -+ .long 0x466f7274 -+ .long 0x72616e20 -+ .long 0x666f7220 -+ .long 0x4c696e75 -+ .long 0x782c2056 -+ .long 0x31342e31 -+ .long 0x20283537 -+ .long 0x36352d4a -+ .long 0x30352c20 -+ .long 0x35373235 -+ .long 0x2d433735 -+ .long 0x29205665 -+ .long 0x7273696f -+ .long 0x6e203134 -+ .long 0x2e30312e -+ .long 0x30303030 -+ .long 0x2e303030 -+ .long 0x30000249 -+ .long 0x4e544547 -+ .long 0x45520004 -+ .long 0x05030005 -+ .long 0x02524541 -+ .long 0x4c000404 -+ .long 0x04050000 -+ .long 0x0000c706 -+ .long 0x6d6f6431 -+ .long 0x00070503 -+ .long __N_mod1 -+ .long 0x79000100 -+ .long 0x01000000 -+ .long 0xd0070503 -+ .long __N__mod1 -+ .long 0x7a000100 -+ .long 0x01000000 -+ .long 0xc7087375 -+ .byte 0x62 -+ .byte 0x31 -+ .byte 0x00 -+ .long .LC.text32 -+ .long .LC.text168 -+ .long 0x01180101 -+ .byte 0x6f -+ .byte 0x00 -+ .byte 0x00 -+.LC.debug_info273: -+ .long 0x00000123 -+ .byte 0x00 -+ .byte 0x02 -+ .long .LC.debug_abbrev97 -+ .long 0x0401786c -+ .long 0x662d7661 -+ .long 0x72696162 -+ .long 0x6c652e66 -+ .byte 0x00 -+ .long .LC.debug_line98 -+ .long .LC.text256 -+ .long .LC.text324 -+ .long 0x082f726f -+ .long 0x6f742f73 -+ .long 0x65726769 -+ .long 0x6f646a2f -+ .long 0x6764622d -+ .long 0x372e302e -+ .long 0x312d3432 -+ .long 0x2e656c35 -+ .long 0x2f676462 -+ .long 0x2d372e30 -+ .long 0x2e312f67 -+ .long 0x64622f74 -+ .long 0x65737473 -+ .long 0x75697465 -+ .long 0x2f676462 -+ .long 0x2e666f72 -+ .long 0x7472616e -+ .long 0x0049424d -+ .long 0x20584c20 -+ .long 0x466f7274 -+ .long 0x72616e20 -+ .long 0x666f7220 -+ .long 0x4c696e75 -+ .long 0x782c2056 -+ .long 0x31342e31 -+ .long 0x20283537 -+ .long 0x36352d4a -+ .long 0x30352c20 -+ .long 0x35373235 -+ .long 0x2d433735 -+ .long 0x29205665 -+ .long 0x7273696f -+ .long 0x6e203134 -+ .long 0x2e30312e -+ .long 0x30303030 -+ .long 0x2e303030 -+ .long 0x30000249 -+ .long 0x4e544547 -+ .long 0x45520004 -+ .long 0x05030005 -+ .long 0x02524541 -+ .long 0x4c000404 -+ .long 0x04000000 -+ .long 0xb9050000 -+ .long 0x0000c706 -+ .long 0x000000f4 -+ .long 0x26264e26 -+ .long 0x6d6f6431 -+ .long 0x00080779 -+ .long 0x00022300 -+ .long 0x000000d4 -+ .long 0x00060000 -+ .long 0x010f2626 -+ .long 0x4e26266d -+ .long 0x6f643100 -+ .long 0x04077a00 -+ .long 0x02230000 -+ .long 0x0000c700 -+ .long 0x085f6d61 -+ .byte 0x69 -+ .byte 0x6e -+ .byte 0x00 -+ .long .LC.text256 -+ .long .LC.text324 -+ .long 0x0201016f -+ .long 0x000000b9 -+ .byte 0x00 -+ -+ .section ".debug_abbrev" -+ .align 0 -+.LC.debug_abbrev: -+ .long 0x01110103 -+ .long 0x08100611 -+ .long 0x01120113 -+ .long 0x0b1b0825 -+ .long 0x08000002 -+ .long 0x24000308 -+ .long 0x0b0b3e0b -+ .long 0x00000324 -+ .long 0x000b0b3e -+ .long 0x0b000004 -+ .long 0x15000000 -+ .long 0x050f0033 -+ .long 0x0b491300 -+ .long 0x00061e01 -+ .long 0x03080000 -+ .long 0x07340002 -+ .long 0x0a03083a -+ .long 0x0b3b0b3f -+ .long 0x0c491300 -+ .long 0x00082e00 -+ .long 0x03081101 -+ .long 0x12013a0b -+ .long 0x3b0b3f0c -+ .long 0x400a0000 -+ .byte 0x00 -+.LC.debug_abbrev97: -+ .long 0x01110103 -+ .long 0x08100611 -+ .long 0x01120113 -+ .long 0x0b1b0825 -+ .long 0x08000002 -+ .long 0x24000308 -+ .long 0x0b0b3e0b -+ .long 0x00000324 -+ .long 0x000b0b3e -+ .long 0x0b000004 -+ .long 0x15004913 -+ .long 0x0000050f -+ .long 0x00330b49 -+ .long 0x13000006 -+ .long 0x13010113 -+ .long 0x03080b0b -+ .long 0x0000070d -+ .long 0x00030838 -+ .long 0x0a491300 -+ .long 0x00082e00 -+ .long 0x03081101 -+ .long 0x1201360b -+ .long 0x3f0c400a -+ .long 0x49130000 -+ .byte 0x00 -+ -+ .section ".debug_line" -+ .align 0 -+.LC.debug_line: -+ .long 0x0000005e -+ .long 0x00020000 -+ .long 0x00220101 -+ .long 0x9cdc0a00 -+ .long 0x01010101 -+ .long 0x00000001 -+ .long 0x00786c66 -+ .long 0x2d766172 -+ .long 0x6961626c -+ .long 0x652e6600 -+ .long 0x00000000 -+ .long 0x04010005 -+ .byte 0x02 -+ .long .LC.text -+ .long 0x03130109 -+ .long 0x000c0309 -+ .long 0x01090014 -+ .long 0x037b0109 -+ .long 0x00180301 -+ .long 0x01090038 -+ .long 0x03010109 -+ .long 0x000c0301 -+ .long 0x01090014 -+ .long 0x03010109 -+ .long 0x00180001 -+ .byte 0x01 -+.LC.debug_line98: -+ .long 0x00000046 -+ .long 0x00020000 -+ .long 0x00220101 -+ .long 0x9cdc0a00 -+ .long 0x01010101 -+ .long 0x00000001 -+ .long 0x00786c66 -+ .long 0x2d766172 -+ .long 0x6961626c -+ .long 0x652e6600 -+ .long 0x00000000 -+ .long 0x04010005 -+ .byte 0x02 -+ .long .LC.text256 -+ .long 0x031f0109 -+ .long 0x00140300 -+ .long 0x01090004 -+ .long 0x03010109 -+ .long 0x002c0001 -+ .byte 0x01 -+ -+ .section ".debug_frame" -+ .align 0 -+.LC.debug_frame: -+ .long 0x0000000c -+ .long 0xffffffff -+ .long 0x0100047c -+ .long 0x410c0100 -+ .long 0x0000001c -+ .long .LC.debug_frame -+ .long .LC.text -+ .long 0x00000020 -+ .long 0x410e2041 -+ .long 0x9f01410d -+ .long 0x1f410a42 -+ .long 0xdf420b00 -+ .long 0x00000020 -+ .long .LC.debug_frame -+ .long .LC.text32 -+ .long 0x00000088 -+ .long 0x410e2041 -+ .long 0x9f01419e -+ .long 0x02410d1f -+ .long 0x590a42de -+ .long 0x41df420b -+.LC.debug_frame84: -+ .long 0x0000000c -+ .long 0xffffffff -+ .long 0x0100047c -+ .long 0x410c0100 -+ .long 0x00000020 -+ .long .LC.debug_frame84 -+ .long .LC.text256 -+ .long 0x00000044 -+ .long 0x420e2041 -+ .long 0x9f014111 -+ .long 0x417f410d -+ .long 0x1f460a42 -+ .long 0xdf440b00 -+ -+ .section ".debug_pubtypes" -+ .align 0 -+.LC.debug_pubtypes: -+ .long 0x00000023 -+ .byte 0x00 -+ .byte 0x02 -+ .long .LC.debug_info -+ .long 0x00000111 -+ .long 0x000000b9 -+ .long 0x494e5445 -+ .long 0x47455200 -+ .long 0x000000c7 -+ .long 0x5245414c -+ .long 0x00000000 -+ .long 0x00000000 -+ .byte 0x3e -+ .byte 0x00 -+ .byte 0x02 -+ .long .LC.debug_info273 -+ .long 0x00000127 -+ .long 0x000000b9 -+ .long 0x494e5445 -+ .long 0x47455200 -+ .long 0x000000c7 -+ .long 0x5245414c -+ .long 0x00000000 -+ .long 0xda26264e -+ .long 0x266d6f64 -+ .long 0x31000000 -+ .long 0x00f42626 -+ .long 0x4e26266d -+ .long 0x6f643100 -+ .long 0x00000000 -+ -+ .comm __N__mod1,4,16 -diff --git a/gdb/testsuite/gdb.fortran/xlf-variable.exp b/gdb/testsuite/gdb.fortran/xlf-variable.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/xlf-variable.exp -@@ -0,0 +1,37 @@ -+# Copyright 2012 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 3 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, see . -+ -+# This test can only be run on PPC64 machines. -+ -+if { ![istarget powerpc64-*] || ![is_ilp32_target] } { -+ return -1 -+} -+ -+set testfile "xlf-variable" -+set srcfile ${testfile}.S -+ -+if { [prepare_for_testing $testfile.exp $testfile $srcfile] } { -+ return -1 -+} -+ -+if { ![runto_main] } { -+ return -1 -+} -+ -+gdb_test "step" ".*y => z.*" "y => z" -+gdb_test "step" ".*y = 3\.0.*" "y = 3.0" -+gdb_test "step" ".*nullify \\(y\\).*" "nullify (y)" -+gdb_test "print z" "= 3" "z = 3" -+gdb_test "ptype z" "= REAL" "z is REAL" -diff --git a/gdb/testsuite/gdb.fortran/xlf-variable.f b/gdb/testsuite/gdb.fortran/xlf-variable.f -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/xlf-variable.f -@@ -0,0 +1,33 @@ -+c Copyright 2012 Free Software Foundation, Inc. -+c -+c This program is free software; you can redistribute it and/or modify -+c it under the terms of the GNU General Public License as published by -+c the Free Software Foundation; either version 3 of the License, or -+c (at your option) any later version. -+c -+c This program is distributed in the hope that it will be useful, -+c but WITHOUT ANY WARRANTY; without even the implied warranty of -+c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+c GNU General Public License for more details. -+c -+c You should have received a copy of the GNU General Public License -+c along with this program. If not, see . -+ -+c This file is the Fortran source file for xlf-variable.f. -+c It was used to generate the assembly output called xlf-variable.S, -+c which was generated using IBM's XLF compiler. -+ -+ module mod1 -+ real, pointer :: y -+ real, target :: z -+ contains -+ subroutine sub1 -+ y => z -+ y = 3.0 -+ nullify (y) -+ end subroutine -+ end module -+ -+ use mod1 -+ call sub1 -+ end diff --git a/gdb-runtest-pie-override.patch b/gdb-runtest-pie-override.patch deleted file mode 100644 index 25c2bb864871408c9223224b8590384f9c4360d8..0000000000000000000000000000000000000000 --- a/gdb-runtest-pie-override.patch +++ /dev/null @@ -1,49 +0,0 @@ -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-runtest-pie-override.patch - -;; Hack for proper PIE run of the testsuite. -;;=fedoratest - -make check//unix/-fPIE/-pie RUNTESTFLAGS=solib-display.exp - -gcc -fpic -c -fPIE -pie -o x.o x.c -/usr/lib/gcc/x86_64-redhat-linux/4.6.1/../../../../lib64/Scrt1.o: In function `_start': -(.text+0x20): undefined reference to `main' - -=> Change the order for overrides. - -One has to also use -fPIC rather than -fPIE, -fPIC is stronger. - -The correct way would be: -make check//unix RUNTESTFLAGS='CC_FOR_TARGET=gcc\ -fPIC\ -pie CXX_FOR_TARGET=g++\ -fPIC\ -pie solib-display.exp' - -But there is a problem with testsuite.unix non-unique subdir name and also -a problem with make -j parallelization of the testsuite. - -diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp ---- a/gdb/testsuite/lib/future.exp -+++ b/gdb/testsuite/lib/future.exp -@@ -197,6 +197,10 @@ proc gdb_default_target_compile_1 {source destfile type options} { - set ldflags "" - set dest [target_info name] - -+ if {[board_info $dest exists multilib_flags]} { -+ append add_flags " [board_info $dest multilib_flags]" -+ } -+ - if {[info exists CFLAGS_FOR_TARGET]} { - append add_flags " $CFLAGS_FOR_TARGET" - } -@@ -531,10 +535,6 @@ proc gdb_default_target_compile_1 {source destfile type options} { - } - } - -- if {[board_info $dest exists multilib_flags]} { -- append add_flags " [board_info $dest multilib_flags]" -- } -- - verbose "doing compile" - - set sources "" diff --git a/gdb-sw22395-constify-target_desc.patch b/gdb-sw22395-constify-target_desc.patch deleted file mode 100644 index 9a3c1287734c4111a6e9f222d373dd93760558dd..0000000000000000000000000000000000000000 --- a/gdb-sw22395-constify-target_desc.patch +++ /dev/null @@ -1,1153 +0,0 @@ -From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 -From: Keith Seitz -Date: Fri, 2 Sep 2022 12:43:03 -0700 -Subject: gdb-sw22395-constify-target_desc.patch - -;; Constify target_desc to fix PPC ODR violations. -;; (Keith Seitz, build/22395) - -cleanup: Add missing feature/ XML files to Makefile - - This patch adds some missing .xml files to features/Makefile so that when the - directory's C files are regenerated, all files are appropriately remade. - - This has demonstrated that there have been several "misses" in regenerating - files in this directory. Namely, arm-secext.c and sparc{32,64}-solaris.c. For - the former case, there was what essentially amounts to a typo regarding the - create feature function's name. In the later case, this file has missed at least - one important update in July, 2020, when allocate_target_description was - changed to return a unique pointer. - - Those corrections are included. - -Constify target_desc declarations - - This patch changes various global target_desc declarations to const, thereby - correcting a prominent source of ODR violations in PowerPC-related target code. - The majority of files/changes are mechanical const-ifications accomplished by - regenerating the C files in features/. - - This also required manually updating mips-linux-tdep.h, s390-linux-tdep.h, - nios2-tdep.h, s390-tdep.h, arch/ppc-linux-tdesc.h, arch/ppc-linux-common.c, - and rs6000-tdep.c. - - Patch tested against the sourceware trybot, and fully regression tested against - our (Red Hat's) internal test infrastructure on Rawhide aarch64, s390x, x86_64, - and powerpcle. - - With this patch, I can finally enable LTO in our GDB package builds. [Tested - with a rawhide scratch build containing this patch.] - - Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=22395 - -diff --git a/gdb/arch/ppc-linux-common.c b/gdb/arch/ppc-linux-common.c ---- a/gdb/arch/ppc-linux-common.c -+++ b/gdb/arch/ppc-linux-common.c -@@ -46,7 +46,7 @@ ppc_linux_has_isa205 (CORE_ADDR hwcap) - const struct target_desc * - ppc_linux_match_description (struct ppc_linux_features features) - { -- struct target_desc *tdesc = NULL; -+ const struct target_desc *tdesc = NULL; - - if (features.wordsize == 8) - { -diff --git a/gdb/arch/ppc-linux-tdesc.h b/gdb/arch/ppc-linux-tdesc.h ---- a/gdb/arch/ppc-linux-tdesc.h -+++ b/gdb/arch/ppc-linux-tdesc.h -@@ -22,25 +22,25 @@ - - struct target_desc; - --extern struct target_desc *tdesc_powerpc_32l; --extern struct target_desc *tdesc_powerpc_altivec32l; --extern struct target_desc *tdesc_powerpc_vsx32l; --extern struct target_desc *tdesc_powerpc_isa205_32l; --extern struct target_desc *tdesc_powerpc_isa205_altivec32l; --extern struct target_desc *tdesc_powerpc_isa205_vsx32l; --extern struct target_desc *tdesc_powerpc_isa205_ppr_dscr_vsx32l; --extern struct target_desc *tdesc_powerpc_isa207_vsx32l; --extern struct target_desc *tdesc_powerpc_isa207_htm_vsx32l; --extern struct target_desc *tdesc_powerpc_e500l; -- --extern struct target_desc *tdesc_powerpc_64l; --extern struct target_desc *tdesc_powerpc_altivec64l; --extern struct target_desc *tdesc_powerpc_vsx64l; --extern struct target_desc *tdesc_powerpc_isa205_64l; --extern struct target_desc *tdesc_powerpc_isa205_altivec64l; --extern struct target_desc *tdesc_powerpc_isa205_vsx64l; --extern struct target_desc *tdesc_powerpc_isa205_ppr_dscr_vsx64l; --extern struct target_desc *tdesc_powerpc_isa207_vsx64l; --extern struct target_desc *tdesc_powerpc_isa207_htm_vsx64l; -+extern const struct target_desc *tdesc_powerpc_32l; -+extern const struct target_desc *tdesc_powerpc_altivec32l; -+extern const struct target_desc *tdesc_powerpc_vsx32l; -+extern const struct target_desc *tdesc_powerpc_isa205_32l; -+extern const struct target_desc *tdesc_powerpc_isa205_altivec32l; -+extern const struct target_desc *tdesc_powerpc_isa205_vsx32l; -+extern const struct target_desc *tdesc_powerpc_isa205_ppr_dscr_vsx32l; -+extern const struct target_desc *tdesc_powerpc_isa207_vsx32l; -+extern const struct target_desc *tdesc_powerpc_isa207_htm_vsx32l; -+extern const struct target_desc *tdesc_powerpc_e500l; -+ -+extern const struct target_desc *tdesc_powerpc_64l; -+extern const struct target_desc *tdesc_powerpc_altivec64l; -+extern const struct target_desc *tdesc_powerpc_vsx64l; -+extern const struct target_desc *tdesc_powerpc_isa205_64l; -+extern const struct target_desc *tdesc_powerpc_isa205_altivec64l; -+extern const struct target_desc *tdesc_powerpc_isa205_vsx64l; -+extern const struct target_desc *tdesc_powerpc_isa205_ppr_dscr_vsx64l; -+extern const struct target_desc *tdesc_powerpc_isa207_vsx64l; -+extern const struct target_desc *tdesc_powerpc_isa207_htm_vsx64l; - - #endif /* ARCH_PPC_LINUX_TDESC_H */ -diff --git a/gdb/features/Makefile b/gdb/features/Makefile ---- a/gdb/features/Makefile -+++ b/gdb/features/Makefile -@@ -74,6 +74,7 @@ mips-dsp-expedite = r29,pc - mips64-expedite = r29,pc - mips64-dsp-expedite = r29,pc - nios2-linux-expedite = sp,pc -+or1k-expedite = r1,npc - powerpc-expedite = r1,pc - s390-linux32-expedite = r14,r15,pswa - s390-linux32v1-expedite = r14,r15,pswa -@@ -108,6 +109,7 @@ XMLTOC = \ - nds32.xml \ - nios2.xml \ - or1k.xml \ -+ or1k-linux.xml \ - rs6000/powerpc-32.xml \ - rs6000/powerpc-32l.xml \ - rs6000/powerpc-403.xml \ -@@ -164,6 +166,8 @@ XMLTOC = \ - s390x-vx-linux64.xml \ - s390-gs-linux64.xml \ - s390x-gs-linux64.xml \ -+ sparc/sparc32-solaris.xml \ -+ sparc/sparc64-solaris.xml \ - z80.xml - - TDESC_CFILES = $(patsubst %.xml,%.c,$(XMLTOC)) -diff --git a/gdb/features/microblaze-with-stack-protect.c b/gdb/features/microblaze-with-stack-protect.c ---- a/gdb/features/microblaze-with-stack-protect.c -+++ b/gdb/features/microblaze-with-stack-protect.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_microblaze_with_stack_protect; -+const struct target_desc *tdesc_microblaze_with_stack_protect; - static void - initialize_tdesc_microblaze_with_stack_protect (void) - { -diff --git a/gdb/features/microblaze.c b/gdb/features/microblaze.c ---- a/gdb/features/microblaze.c -+++ b/gdb/features/microblaze.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_microblaze; -+const struct target_desc *tdesc_microblaze; - static void - initialize_tdesc_microblaze (void) - { -diff --git a/gdb/features/mips-dsp-linux.c b/gdb/features/mips-dsp-linux.c ---- a/gdb/features/mips-dsp-linux.c -+++ b/gdb/features/mips-dsp-linux.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_mips_dsp_linux; -+const struct target_desc *tdesc_mips_dsp_linux; - static void - initialize_tdesc_mips_dsp_linux (void) - { -diff --git a/gdb/features/mips-linux.c b/gdb/features/mips-linux.c ---- a/gdb/features/mips-linux.c -+++ b/gdb/features/mips-linux.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_mips_linux; -+const struct target_desc *tdesc_mips_linux; - static void - initialize_tdesc_mips_linux (void) - { -diff --git a/gdb/features/mips64-dsp-linux.c b/gdb/features/mips64-dsp-linux.c ---- a/gdb/features/mips64-dsp-linux.c -+++ b/gdb/features/mips64-dsp-linux.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_mips64_dsp_linux; -+const struct target_desc *tdesc_mips64_dsp_linux; - static void - initialize_tdesc_mips64_dsp_linux (void) - { -diff --git a/gdb/features/mips64-linux.c b/gdb/features/mips64-linux.c ---- a/gdb/features/mips64-linux.c -+++ b/gdb/features/mips64-linux.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_mips64_linux; -+const struct target_desc *tdesc_mips64_linux; - static void - initialize_tdesc_mips64_linux (void) - { -diff --git a/gdb/features/nds32.c b/gdb/features/nds32.c ---- a/gdb/features/nds32.c -+++ b/gdb/features/nds32.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_nds32; -+const struct target_desc *tdesc_nds32; - static void - initialize_tdesc_nds32 (void) - { -diff --git a/gdb/features/nios2.c b/gdb/features/nios2.c ---- a/gdb/features/nios2.c -+++ b/gdb/features/nios2.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_nios2; -+const struct target_desc *tdesc_nios2; - static void - initialize_tdesc_nios2 (void) - { -diff --git a/gdb/features/or1k-linux.c b/gdb/features/or1k-linux.c ---- a/gdb/features/or1k-linux.c -+++ b/gdb/features/or1k-linux.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_or1k_linux; -+const struct target_desc *tdesc_or1k_linux; - static void - initialize_tdesc_or1k_linux (void) - { -diff --git a/gdb/features/or1k.c b/gdb/features/or1k.c ---- a/gdb/features/or1k.c -+++ b/gdb/features/or1k.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_or1k; -+const struct target_desc *tdesc_or1k; - static void - initialize_tdesc_or1k (void) - { -diff --git a/gdb/features/rs6000/powerpc-32.c b/gdb/features/rs6000/powerpc-32.c ---- a/gdb/features/rs6000/powerpc-32.c -+++ b/gdb/features/rs6000/powerpc-32.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_32; -+const struct target_desc *tdesc_powerpc_32; - static void - initialize_tdesc_powerpc_32 (void) - { -diff --git a/gdb/features/rs6000/powerpc-32l.c b/gdb/features/rs6000/powerpc-32l.c ---- a/gdb/features/rs6000/powerpc-32l.c -+++ b/gdb/features/rs6000/powerpc-32l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_32l; -+const struct target_desc *tdesc_powerpc_32l; - static void - initialize_tdesc_powerpc_32l (void) - { -diff --git a/gdb/features/rs6000/powerpc-403.c b/gdb/features/rs6000/powerpc-403.c ---- a/gdb/features/rs6000/powerpc-403.c -+++ b/gdb/features/rs6000/powerpc-403.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_403; -+const struct target_desc *tdesc_powerpc_403; - static void - initialize_tdesc_powerpc_403 (void) - { -diff --git a/gdb/features/rs6000/powerpc-403gc.c b/gdb/features/rs6000/powerpc-403gc.c ---- a/gdb/features/rs6000/powerpc-403gc.c -+++ b/gdb/features/rs6000/powerpc-403gc.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_403gc; -+const struct target_desc *tdesc_powerpc_403gc; - static void - initialize_tdesc_powerpc_403gc (void) - { -diff --git a/gdb/features/rs6000/powerpc-405.c b/gdb/features/rs6000/powerpc-405.c ---- a/gdb/features/rs6000/powerpc-405.c -+++ b/gdb/features/rs6000/powerpc-405.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_405; -+const struct target_desc *tdesc_powerpc_405; - static void - initialize_tdesc_powerpc_405 (void) - { -diff --git a/gdb/features/rs6000/powerpc-505.c b/gdb/features/rs6000/powerpc-505.c ---- a/gdb/features/rs6000/powerpc-505.c -+++ b/gdb/features/rs6000/powerpc-505.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_505; -+const struct target_desc *tdesc_powerpc_505; - static void - initialize_tdesc_powerpc_505 (void) - { -diff --git a/gdb/features/rs6000/powerpc-601.c b/gdb/features/rs6000/powerpc-601.c ---- a/gdb/features/rs6000/powerpc-601.c -+++ b/gdb/features/rs6000/powerpc-601.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_601; -+const struct target_desc *tdesc_powerpc_601; - static void - initialize_tdesc_powerpc_601 (void) - { -diff --git a/gdb/features/rs6000/powerpc-602.c b/gdb/features/rs6000/powerpc-602.c ---- a/gdb/features/rs6000/powerpc-602.c -+++ b/gdb/features/rs6000/powerpc-602.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_602; -+const struct target_desc *tdesc_powerpc_602; - static void - initialize_tdesc_powerpc_602 (void) - { -diff --git a/gdb/features/rs6000/powerpc-603.c b/gdb/features/rs6000/powerpc-603.c ---- a/gdb/features/rs6000/powerpc-603.c -+++ b/gdb/features/rs6000/powerpc-603.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_603; -+const struct target_desc *tdesc_powerpc_603; - static void - initialize_tdesc_powerpc_603 (void) - { -diff --git a/gdb/features/rs6000/powerpc-604.c b/gdb/features/rs6000/powerpc-604.c ---- a/gdb/features/rs6000/powerpc-604.c -+++ b/gdb/features/rs6000/powerpc-604.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_604; -+const struct target_desc *tdesc_powerpc_604; - static void - initialize_tdesc_powerpc_604 (void) - { -diff --git a/gdb/features/rs6000/powerpc-64.c b/gdb/features/rs6000/powerpc-64.c ---- a/gdb/features/rs6000/powerpc-64.c -+++ b/gdb/features/rs6000/powerpc-64.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_64; -+const struct target_desc *tdesc_powerpc_64; - static void - initialize_tdesc_powerpc_64 (void) - { -diff --git a/gdb/features/rs6000/powerpc-64l.c b/gdb/features/rs6000/powerpc-64l.c ---- a/gdb/features/rs6000/powerpc-64l.c -+++ b/gdb/features/rs6000/powerpc-64l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_64l; -+const struct target_desc *tdesc_powerpc_64l; - static void - initialize_tdesc_powerpc_64l (void) - { -diff --git a/gdb/features/rs6000/powerpc-7400.c b/gdb/features/rs6000/powerpc-7400.c ---- a/gdb/features/rs6000/powerpc-7400.c -+++ b/gdb/features/rs6000/powerpc-7400.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_7400; -+const struct target_desc *tdesc_powerpc_7400; - static void - initialize_tdesc_powerpc_7400 (void) - { -diff --git a/gdb/features/rs6000/powerpc-750.c b/gdb/features/rs6000/powerpc-750.c ---- a/gdb/features/rs6000/powerpc-750.c -+++ b/gdb/features/rs6000/powerpc-750.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_750; -+const struct target_desc *tdesc_powerpc_750; - static void - initialize_tdesc_powerpc_750 (void) - { -diff --git a/gdb/features/rs6000/powerpc-860.c b/gdb/features/rs6000/powerpc-860.c ---- a/gdb/features/rs6000/powerpc-860.c -+++ b/gdb/features/rs6000/powerpc-860.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_860; -+const struct target_desc *tdesc_powerpc_860; - static void - initialize_tdesc_powerpc_860 (void) - { -diff --git a/gdb/features/rs6000/powerpc-altivec32.c b/gdb/features/rs6000/powerpc-altivec32.c ---- a/gdb/features/rs6000/powerpc-altivec32.c -+++ b/gdb/features/rs6000/powerpc-altivec32.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_altivec32; -+const struct target_desc *tdesc_powerpc_altivec32; - static void - initialize_tdesc_powerpc_altivec32 (void) - { -diff --git a/gdb/features/rs6000/powerpc-altivec32l.c b/gdb/features/rs6000/powerpc-altivec32l.c ---- a/gdb/features/rs6000/powerpc-altivec32l.c -+++ b/gdb/features/rs6000/powerpc-altivec32l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_altivec32l; -+const struct target_desc *tdesc_powerpc_altivec32l; - static void - initialize_tdesc_powerpc_altivec32l (void) - { -diff --git a/gdb/features/rs6000/powerpc-altivec64.c b/gdb/features/rs6000/powerpc-altivec64.c ---- a/gdb/features/rs6000/powerpc-altivec64.c -+++ b/gdb/features/rs6000/powerpc-altivec64.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_altivec64; -+const struct target_desc *tdesc_powerpc_altivec64; - static void - initialize_tdesc_powerpc_altivec64 (void) - { -diff --git a/gdb/features/rs6000/powerpc-altivec64l.c b/gdb/features/rs6000/powerpc-altivec64l.c ---- a/gdb/features/rs6000/powerpc-altivec64l.c -+++ b/gdb/features/rs6000/powerpc-altivec64l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_altivec64l; -+const struct target_desc *tdesc_powerpc_altivec64l; - static void - initialize_tdesc_powerpc_altivec64l (void) - { -diff --git a/gdb/features/rs6000/powerpc-e500.c b/gdb/features/rs6000/powerpc-e500.c ---- a/gdb/features/rs6000/powerpc-e500.c -+++ b/gdb/features/rs6000/powerpc-e500.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_e500; -+const struct target_desc *tdesc_powerpc_e500; - static void - initialize_tdesc_powerpc_e500 (void) - { -diff --git a/gdb/features/rs6000/powerpc-e500l.c b/gdb/features/rs6000/powerpc-e500l.c ---- a/gdb/features/rs6000/powerpc-e500l.c -+++ b/gdb/features/rs6000/powerpc-e500l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_e500l; -+const struct target_desc *tdesc_powerpc_e500l; - static void - initialize_tdesc_powerpc_e500l (void) - { -diff --git a/gdb/features/rs6000/powerpc-isa205-32l.c b/gdb/features/rs6000/powerpc-isa205-32l.c ---- a/gdb/features/rs6000/powerpc-isa205-32l.c -+++ b/gdb/features/rs6000/powerpc-isa205-32l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_isa205_32l; -+const struct target_desc *tdesc_powerpc_isa205_32l; - static void - initialize_tdesc_powerpc_isa205_32l (void) - { -diff --git a/gdb/features/rs6000/powerpc-isa205-64l.c b/gdb/features/rs6000/powerpc-isa205-64l.c ---- a/gdb/features/rs6000/powerpc-isa205-64l.c -+++ b/gdb/features/rs6000/powerpc-isa205-64l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_isa205_64l; -+const struct target_desc *tdesc_powerpc_isa205_64l; - static void - initialize_tdesc_powerpc_isa205_64l (void) - { -diff --git a/gdb/features/rs6000/powerpc-isa205-altivec32l.c b/gdb/features/rs6000/powerpc-isa205-altivec32l.c ---- a/gdb/features/rs6000/powerpc-isa205-altivec32l.c -+++ b/gdb/features/rs6000/powerpc-isa205-altivec32l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_isa205_altivec32l; -+const struct target_desc *tdesc_powerpc_isa205_altivec32l; - static void - initialize_tdesc_powerpc_isa205_altivec32l (void) - { -diff --git a/gdb/features/rs6000/powerpc-isa205-altivec64l.c b/gdb/features/rs6000/powerpc-isa205-altivec64l.c ---- a/gdb/features/rs6000/powerpc-isa205-altivec64l.c -+++ b/gdb/features/rs6000/powerpc-isa205-altivec64l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_isa205_altivec64l; -+const struct target_desc *tdesc_powerpc_isa205_altivec64l; - static void - initialize_tdesc_powerpc_isa205_altivec64l (void) - { -diff --git a/gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.c b/gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.c ---- a/gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.c -+++ b/gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_isa205_ppr_dscr_vsx32l; -+const struct target_desc *tdesc_powerpc_isa205_ppr_dscr_vsx32l; - static void - initialize_tdesc_powerpc_isa205_ppr_dscr_vsx32l (void) - { -diff --git a/gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.c b/gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.c ---- a/gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.c -+++ b/gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_isa205_ppr_dscr_vsx64l; -+const struct target_desc *tdesc_powerpc_isa205_ppr_dscr_vsx64l; - static void - initialize_tdesc_powerpc_isa205_ppr_dscr_vsx64l (void) - { -diff --git a/gdb/features/rs6000/powerpc-isa205-vsx32l.c b/gdb/features/rs6000/powerpc-isa205-vsx32l.c ---- a/gdb/features/rs6000/powerpc-isa205-vsx32l.c -+++ b/gdb/features/rs6000/powerpc-isa205-vsx32l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_isa205_vsx32l; -+const struct target_desc *tdesc_powerpc_isa205_vsx32l; - static void - initialize_tdesc_powerpc_isa205_vsx32l (void) - { -diff --git a/gdb/features/rs6000/powerpc-isa205-vsx64l.c b/gdb/features/rs6000/powerpc-isa205-vsx64l.c ---- a/gdb/features/rs6000/powerpc-isa205-vsx64l.c -+++ b/gdb/features/rs6000/powerpc-isa205-vsx64l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_isa205_vsx64l; -+const struct target_desc *tdesc_powerpc_isa205_vsx64l; - static void - initialize_tdesc_powerpc_isa205_vsx64l (void) - { -diff --git a/gdb/features/rs6000/powerpc-isa207-htm-vsx32l.c b/gdb/features/rs6000/powerpc-isa207-htm-vsx32l.c ---- a/gdb/features/rs6000/powerpc-isa207-htm-vsx32l.c -+++ b/gdb/features/rs6000/powerpc-isa207-htm-vsx32l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_isa207_htm_vsx32l; -+const struct target_desc *tdesc_powerpc_isa207_htm_vsx32l; - static void - initialize_tdesc_powerpc_isa207_htm_vsx32l (void) - { -diff --git a/gdb/features/rs6000/powerpc-isa207-htm-vsx64l.c b/gdb/features/rs6000/powerpc-isa207-htm-vsx64l.c ---- a/gdb/features/rs6000/powerpc-isa207-htm-vsx64l.c -+++ b/gdb/features/rs6000/powerpc-isa207-htm-vsx64l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_isa207_htm_vsx64l; -+const struct target_desc *tdesc_powerpc_isa207_htm_vsx64l; - static void - initialize_tdesc_powerpc_isa207_htm_vsx64l (void) - { -diff --git a/gdb/features/rs6000/powerpc-isa207-vsx32l.c b/gdb/features/rs6000/powerpc-isa207-vsx32l.c ---- a/gdb/features/rs6000/powerpc-isa207-vsx32l.c -+++ b/gdb/features/rs6000/powerpc-isa207-vsx32l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_isa207_vsx32l; -+const struct target_desc *tdesc_powerpc_isa207_vsx32l; - static void - initialize_tdesc_powerpc_isa207_vsx32l (void) - { -diff --git a/gdb/features/rs6000/powerpc-isa207-vsx64l.c b/gdb/features/rs6000/powerpc-isa207-vsx64l.c ---- a/gdb/features/rs6000/powerpc-isa207-vsx64l.c -+++ b/gdb/features/rs6000/powerpc-isa207-vsx64l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_isa207_vsx64l; -+const struct target_desc *tdesc_powerpc_isa207_vsx64l; - static void - initialize_tdesc_powerpc_isa207_vsx64l (void) - { -diff --git a/gdb/features/rs6000/powerpc-vsx32.c b/gdb/features/rs6000/powerpc-vsx32.c ---- a/gdb/features/rs6000/powerpc-vsx32.c -+++ b/gdb/features/rs6000/powerpc-vsx32.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_vsx32; -+const struct target_desc *tdesc_powerpc_vsx32; - static void - initialize_tdesc_powerpc_vsx32 (void) - { -diff --git a/gdb/features/rs6000/powerpc-vsx32l.c b/gdb/features/rs6000/powerpc-vsx32l.c ---- a/gdb/features/rs6000/powerpc-vsx32l.c -+++ b/gdb/features/rs6000/powerpc-vsx32l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_vsx32l; -+const struct target_desc *tdesc_powerpc_vsx32l; - static void - initialize_tdesc_powerpc_vsx32l (void) - { -diff --git a/gdb/features/rs6000/powerpc-vsx64.c b/gdb/features/rs6000/powerpc-vsx64.c ---- a/gdb/features/rs6000/powerpc-vsx64.c -+++ b/gdb/features/rs6000/powerpc-vsx64.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_vsx64; -+const struct target_desc *tdesc_powerpc_vsx64; - static void - initialize_tdesc_powerpc_vsx64 (void) - { -diff --git a/gdb/features/rs6000/powerpc-vsx64l.c b/gdb/features/rs6000/powerpc-vsx64l.c ---- a/gdb/features/rs6000/powerpc-vsx64l.c -+++ b/gdb/features/rs6000/powerpc-vsx64l.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_powerpc_vsx64l; -+const struct target_desc *tdesc_powerpc_vsx64l; - static void - initialize_tdesc_powerpc_vsx64l (void) - { -diff --git a/gdb/features/rs6000/rs6000.c b/gdb/features/rs6000/rs6000.c ---- a/gdb/features/rs6000/rs6000.c -+++ b/gdb/features/rs6000/rs6000.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_rs6000; -+const struct target_desc *tdesc_rs6000; - static void - initialize_tdesc_rs6000 (void) - { -diff --git a/gdb/features/rx.c b/gdb/features/rx.c ---- a/gdb/features/rx.c -+++ b/gdb/features/rx.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_rx; -+const struct target_desc *tdesc_rx; - static void - initialize_tdesc_rx (void) - { -diff --git a/gdb/features/s390-gs-linux64.c b/gdb/features/s390-gs-linux64.c ---- a/gdb/features/s390-gs-linux64.c -+++ b/gdb/features/s390-gs-linux64.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390_gs_linux64; -+const struct target_desc *tdesc_s390_gs_linux64; - static void - initialize_tdesc_s390_gs_linux64 (void) - { -diff --git a/gdb/features/s390-linux32.c b/gdb/features/s390-linux32.c ---- a/gdb/features/s390-linux32.c -+++ b/gdb/features/s390-linux32.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390_linux32; -+const struct target_desc *tdesc_s390_linux32; - static void - initialize_tdesc_s390_linux32 (void) - { -diff --git a/gdb/features/s390-linux32v1.c b/gdb/features/s390-linux32v1.c ---- a/gdb/features/s390-linux32v1.c -+++ b/gdb/features/s390-linux32v1.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390_linux32v1; -+const struct target_desc *tdesc_s390_linux32v1; - static void - initialize_tdesc_s390_linux32v1 (void) - { -diff --git a/gdb/features/s390-linux32v2.c b/gdb/features/s390-linux32v2.c ---- a/gdb/features/s390-linux32v2.c -+++ b/gdb/features/s390-linux32v2.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390_linux32v2; -+const struct target_desc *tdesc_s390_linux32v2; - static void - initialize_tdesc_s390_linux32v2 (void) - { -diff --git a/gdb/features/s390-linux64.c b/gdb/features/s390-linux64.c ---- a/gdb/features/s390-linux64.c -+++ b/gdb/features/s390-linux64.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390_linux64; -+const struct target_desc *tdesc_s390_linux64; - static void - initialize_tdesc_s390_linux64 (void) - { -diff --git a/gdb/features/s390-linux64v1.c b/gdb/features/s390-linux64v1.c ---- a/gdb/features/s390-linux64v1.c -+++ b/gdb/features/s390-linux64v1.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390_linux64v1; -+const struct target_desc *tdesc_s390_linux64v1; - static void - initialize_tdesc_s390_linux64v1 (void) - { -diff --git a/gdb/features/s390-linux64v2.c b/gdb/features/s390-linux64v2.c ---- a/gdb/features/s390-linux64v2.c -+++ b/gdb/features/s390-linux64v2.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390_linux64v2; -+const struct target_desc *tdesc_s390_linux64v2; - static void - initialize_tdesc_s390_linux64v2 (void) - { -diff --git a/gdb/features/s390-te-linux64.c b/gdb/features/s390-te-linux64.c ---- a/gdb/features/s390-te-linux64.c -+++ b/gdb/features/s390-te-linux64.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390_te_linux64; -+const struct target_desc *tdesc_s390_te_linux64; - static void - initialize_tdesc_s390_te_linux64 (void) - { -diff --git a/gdb/features/s390-tevx-linux64.c b/gdb/features/s390-tevx-linux64.c ---- a/gdb/features/s390-tevx-linux64.c -+++ b/gdb/features/s390-tevx-linux64.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390_tevx_linux64; -+const struct target_desc *tdesc_s390_tevx_linux64; - static void - initialize_tdesc_s390_tevx_linux64 (void) - { -diff --git a/gdb/features/s390-vx-linux64.c b/gdb/features/s390-vx-linux64.c ---- a/gdb/features/s390-vx-linux64.c -+++ b/gdb/features/s390-vx-linux64.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390_vx_linux64; -+const struct target_desc *tdesc_s390_vx_linux64; - static void - initialize_tdesc_s390_vx_linux64 (void) - { -diff --git a/gdb/features/s390x-gs-linux64.c b/gdb/features/s390x-gs-linux64.c ---- a/gdb/features/s390x-gs-linux64.c -+++ b/gdb/features/s390x-gs-linux64.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390x_gs_linux64; -+const struct target_desc *tdesc_s390x_gs_linux64; - static void - initialize_tdesc_s390x_gs_linux64 (void) - { -diff --git a/gdb/features/s390x-linux64.c b/gdb/features/s390x-linux64.c ---- a/gdb/features/s390x-linux64.c -+++ b/gdb/features/s390x-linux64.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390x_linux64; -+const struct target_desc *tdesc_s390x_linux64; - static void - initialize_tdesc_s390x_linux64 (void) - { -diff --git a/gdb/features/s390x-linux64v1.c b/gdb/features/s390x-linux64v1.c ---- a/gdb/features/s390x-linux64v1.c -+++ b/gdb/features/s390x-linux64v1.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390x_linux64v1; -+const struct target_desc *tdesc_s390x_linux64v1; - static void - initialize_tdesc_s390x_linux64v1 (void) - { -diff --git a/gdb/features/s390x-linux64v2.c b/gdb/features/s390x-linux64v2.c ---- a/gdb/features/s390x-linux64v2.c -+++ b/gdb/features/s390x-linux64v2.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390x_linux64v2; -+const struct target_desc *tdesc_s390x_linux64v2; - static void - initialize_tdesc_s390x_linux64v2 (void) - { -diff --git a/gdb/features/s390x-te-linux64.c b/gdb/features/s390x-te-linux64.c ---- a/gdb/features/s390x-te-linux64.c -+++ b/gdb/features/s390x-te-linux64.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390x_te_linux64; -+const struct target_desc *tdesc_s390x_te_linux64; - static void - initialize_tdesc_s390x_te_linux64 (void) - { -diff --git a/gdb/features/s390x-tevx-linux64.c b/gdb/features/s390x-tevx-linux64.c ---- a/gdb/features/s390x-tevx-linux64.c -+++ b/gdb/features/s390x-tevx-linux64.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390x_tevx_linux64; -+const struct target_desc *tdesc_s390x_tevx_linux64; - static void - initialize_tdesc_s390x_tevx_linux64 (void) - { -diff --git a/gdb/features/s390x-vx-linux64.c b/gdb/features/s390x-vx-linux64.c ---- a/gdb/features/s390x-vx-linux64.c -+++ b/gdb/features/s390x-vx-linux64.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_s390x_vx_linux64; -+const struct target_desc *tdesc_s390x_vx_linux64; - static void - initialize_tdesc_s390x_vx_linux64 (void) - { -diff --git a/gdb/features/sparc/sparc32-solaris.c b/gdb/features/sparc/sparc32-solaris.c ---- a/gdb/features/sparc/sparc32-solaris.c -+++ b/gdb/features/sparc/sparc32-solaris.c -@@ -5,18 +5,18 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_sparc32_solaris; -+const struct target_desc *tdesc_sparc32_solaris; - static void - initialize_tdesc_sparc32_solaris (void) - { -- struct target_desc *result = allocate_target_description (); -- struct tdesc_feature *feature; -+ target_desc_up result = allocate_target_description (); -+ set_tdesc_architecture (result.get (), bfd_scan_arch ("sparc")); - -- set_tdesc_architecture (result, bfd_scan_arch ("sparc")); -+ set_tdesc_osabi (result.get (), osabi_from_tdesc_string ("Solaris")); - -- set_tdesc_osabi (result, osabi_from_tdesc_string ("Solaris")); -+ struct tdesc_feature *feature; - -- feature = tdesc_create_feature (result, "org.gnu.gdb.sparc.cpu"); -+ feature = tdesc_create_feature (result.get (), "org.gnu.gdb.sparc.cpu"); - tdesc_create_reg (feature, "g0", 0, 1, NULL, 32, "uint32"); - tdesc_create_reg (feature, "g1", 1, 1, NULL, 32, "uint32"); - tdesc_create_reg (feature, "g2", 2, 1, NULL, 32, "uint32"); -@@ -50,7 +50,7 @@ initialize_tdesc_sparc32_solaris (void) - tdesc_create_reg (feature, "fp", 30, 1, NULL, 32, "uint32"); - tdesc_create_reg (feature, "i7", 31, 1, NULL, 32, "uint32"); - -- feature = tdesc_create_feature (result, "org.gnu.gdb.sparc.cp0"); -+ feature = tdesc_create_feature (result.get (), "org.gnu.gdb.sparc.cp0"); - tdesc_create_reg (feature, "y", 64, 1, NULL, 32, "uint32"); - tdesc_create_reg (feature, "psr", 65, 1, NULL, 32, "uint32"); - tdesc_create_reg (feature, "wim", 66, 1, NULL, 32, "uint32"); -@@ -60,7 +60,7 @@ initialize_tdesc_sparc32_solaris (void) - tdesc_create_reg (feature, "fsr", 70, 1, NULL, 32, "uint32"); - tdesc_create_reg (feature, "csr", 71, 1, NULL, 32, "uint32"); - -- feature = tdesc_create_feature (result, "org.gnu.gdb.sparc.fpu"); -+ feature = tdesc_create_feature (result.get (), "org.gnu.gdb.sparc.fpu"); - tdesc_create_reg (feature, "f0", 32, 1, NULL, 32, "ieee_single"); - tdesc_create_reg (feature, "f1", 33, 1, NULL, 32, "ieee_single"); - tdesc_create_reg (feature, "f2", 34, 1, NULL, 32, "ieee_single"); -@@ -94,5 +94,5 @@ initialize_tdesc_sparc32_solaris (void) - tdesc_create_reg (feature, "f30", 62, 1, NULL, 32, "ieee_single"); - tdesc_create_reg (feature, "f31", 63, 1, NULL, 32, "ieee_single"); - -- tdesc_sparc_solaris = result; -+ tdesc_sparc32_solaris = result.release (); - } -diff --git a/gdb/features/sparc/sparc64-solaris.c b/gdb/features/sparc/sparc64-solaris.c ---- a/gdb/features/sparc/sparc64-solaris.c -+++ b/gdb/features/sparc/sparc64-solaris.c -@@ -5,18 +5,18 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_sparc64_solaris; -+const struct target_desc *tdesc_sparc64_solaris; - static void - initialize_tdesc_sparc64_solaris (void) - { -- struct target_desc *result = allocate_target_description (); -- struct tdesc_feature *feature; -+ target_desc_up result = allocate_target_description (); -+ set_tdesc_architecture (result.get (), bfd_scan_arch ("sparc:v9")); - -- set_tdesc_architecture (result, bfd_scan_arch ("sparc")); -+ set_tdesc_osabi (result.get (), osabi_from_tdesc_string ("Solaris")); - -- set_tdesc_osabi (result, osabi_from_tdesc_string ("Solaris")); -+ struct tdesc_feature *feature; - -- feature = tdesc_create_feature (result, "org.gnu.gdb.sparc.cpu"); -+ feature = tdesc_create_feature (result.get (), "org.gnu.gdb.sparc.cpu"); - tdesc_create_reg (feature, "g0", 0, 1, NULL, 64, "uint64"); - tdesc_create_reg (feature, "g1", 1, 1, NULL, 64, "uint64"); - tdesc_create_reg (feature, "g2", 2, 1, NULL, 64, "uint64"); -@@ -47,18 +47,18 @@ initialize_tdesc_sparc64_solaris (void) - tdesc_create_reg (feature, "i3", 27, 1, NULL, 64, "uint64"); - tdesc_create_reg (feature, "i4", 28, 1, NULL, 64, "uint64"); - tdesc_create_reg (feature, "i5", 29, 1, NULL, 64, "uint64"); -- tdesc_create_reg (feature, "fp", 30, 1, NULL, 32, "uint64"); -+ tdesc_create_reg (feature, "fp", 30, 1, NULL, 64, "uint64"); - tdesc_create_reg (feature, "i7", 31, 1, NULL, 64, "uint64"); - -- feature = tdesc_create_feature (result, "org.gnu.gdb.sparc.cp0"); -+ feature = tdesc_create_feature (result.get (), "org.gnu.gdb.sparc.cp0"); - tdesc_create_reg (feature, "pc", 80, 1, NULL, 64, "code_ptr"); - tdesc_create_reg (feature, "npc", 81, 1, NULL, 64, "code_ptr"); - tdesc_create_reg (feature, "state", 82, 1, NULL, 64, "uint64"); -- tdesc_create_reg (feature, "fsr", 83, 1, NULL, 32, "ieee_single"); -- tdesc_create_reg (feature, "fprs", 84, 1, NULL, 32, "ieee_single"); -+ tdesc_create_reg (feature, "fsr", 83, 1, NULL, 64, "uint64"); -+ tdesc_create_reg (feature, "fprs", 84, 1, NULL, 64, "uint64"); - tdesc_create_reg (feature, "y", 85, 1, NULL, 64, "uint64"); - -- feature = tdesc_create_feature (result, "org.gnu.gdb.sparc.fpu"); -+ feature = tdesc_create_feature (result.get (), "org.gnu.gdb.sparc.fpu"); - tdesc_create_reg (feature, "f0", 32, 1, NULL, 32, "ieee_single"); - tdesc_create_reg (feature, "f1", 33, 1, NULL, 32, "ieee_single"); - tdesc_create_reg (feature, "f2", 34, 1, NULL, 32, "ieee_single"); -@@ -108,5 +108,5 @@ initialize_tdesc_sparc64_solaris (void) - tdesc_create_reg (feature, "f60", 78, 1, NULL, 64, "ieee_double"); - tdesc_create_reg (feature, "f62", 79, 1, NULL, 64, "ieee_double"); - -- tdesc_sparc64_solaris = result; -+ tdesc_sparc64_solaris = result.release (); - } -diff --git a/gdb/features/z80.c b/gdb/features/z80.c ---- a/gdb/features/z80.c -+++ b/gdb/features/z80.c -@@ -5,7 +5,7 @@ - #include "osabi.h" - #include "target-descriptions.h" - --struct target_desc *tdesc_z80; -+const struct target_desc *tdesc_z80; - static void - initialize_tdesc_z80 (void) - { -diff --git a/gdb/mips-linux-tdep.h b/gdb/mips-linux-tdep.h ---- a/gdb/mips-linux-tdep.h -+++ b/gdb/mips-linux-tdep.h -@@ -108,9 +108,9 @@ enum { - int mips_linux_restart_reg_p (struct gdbarch *gdbarch); - - /* Target descriptions. */ --extern struct target_desc *tdesc_mips_linux; --extern struct target_desc *tdesc_mips64_linux; --extern struct target_desc *tdesc_mips_dsp_linux; --extern struct target_desc *tdesc_mips64_dsp_linux; -+extern const struct target_desc *tdesc_mips_linux; -+extern const struct target_desc *tdesc_mips64_linux; -+extern const struct target_desc *tdesc_mips_dsp_linux; -+extern const struct target_desc *tdesc_mips64_dsp_linux; - - #endif /* MIPS_LINUX_TDEP_H */ -diff --git a/gdb/nios2-tdep.h b/gdb/nios2-tdep.h ---- a/gdb/nios2-tdep.h -+++ b/gdb/nios2-tdep.h -@@ -84,7 +84,7 @@ struct nios2_gdbarch_tdep : gdbarch_tdep - int jb_pc = 0; - }; - --extern struct target_desc *tdesc_nios2_linux; --extern struct target_desc *tdesc_nios2; -+extern const struct target_desc *tdesc_nios2_linux; -+extern const struct target_desc *tdesc_nios2; - - #endif /* NIOS2_TDEP_H */ -diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c ---- a/gdb/rs6000-tdep.c -+++ b/gdb/rs6000-tdep.c -@@ -3466,7 +3466,7 @@ struct ppc_variant - unsigned long mach; - - /* Target description for this variant. */ -- struct target_desc **tdesc; -+ const struct target_desc **tdesc; - }; - - static struct ppc_variant variants[] = -diff --git a/gdb/s390-linux-tdep.h b/gdb/s390-linux-tdep.h ---- a/gdb/s390-linux-tdep.h -+++ b/gdb/s390-linux-tdep.h -@@ -48,20 +48,20 @@ extern const struct regset s390_gs_regset; - extern const struct regset s390_gsbc_regset; - - /* GNU/Linux target descriptions. */ --extern struct target_desc *tdesc_s390_linux32v1; --extern struct target_desc *tdesc_s390_linux32v2; --extern struct target_desc *tdesc_s390_linux64; --extern struct target_desc *tdesc_s390_linux64v1; --extern struct target_desc *tdesc_s390_linux64v2; --extern struct target_desc *tdesc_s390_te_linux64; --extern struct target_desc *tdesc_s390_vx_linux64; --extern struct target_desc *tdesc_s390_tevx_linux64; --extern struct target_desc *tdesc_s390_gs_linux64; --extern struct target_desc *tdesc_s390x_linux64v1; --extern struct target_desc *tdesc_s390x_linux64v2; --extern struct target_desc *tdesc_s390x_te_linux64; --extern struct target_desc *tdesc_s390x_vx_linux64; --extern struct target_desc *tdesc_s390x_tevx_linux64; --extern struct target_desc *tdesc_s390x_gs_linux64; -+extern const struct target_desc *tdesc_s390_linux32v1; -+extern const struct target_desc *tdesc_s390_linux32v2; -+extern const struct target_desc *tdesc_s390_linux64; -+extern const struct target_desc *tdesc_s390_linux64v1; -+extern const struct target_desc *tdesc_s390_linux64v2; -+extern const struct target_desc *tdesc_s390_te_linux64; -+extern const struct target_desc *tdesc_s390_vx_linux64; -+extern const struct target_desc *tdesc_s390_tevx_linux64; -+extern const struct target_desc *tdesc_s390_gs_linux64; -+extern const struct target_desc *tdesc_s390x_linux64v1; -+extern const struct target_desc *tdesc_s390x_linux64v2; -+extern const struct target_desc *tdesc_s390x_te_linux64; -+extern const struct target_desc *tdesc_s390x_vx_linux64; -+extern const struct target_desc *tdesc_s390x_tevx_linux64; -+extern const struct target_desc *tdesc_s390x_gs_linux64; - - #endif /* S390_LINUX_TDEP_H */ -diff --git a/gdb/s390-tdep.h b/gdb/s390-tdep.h ---- a/gdb/s390-tdep.h -+++ b/gdb/s390-tdep.h -@@ -317,7 +317,7 @@ extern struct value *s390_trad_frame_prev_register - (struct frame_info *this_frame, struct trad_frame_saved_reg saved_regs[], - int regnum); - --extern struct target_desc *tdesc_s390_linux32; --extern struct target_desc *tdesc_s390x_linux64; -+extern const struct target_desc *tdesc_s390_linux32; -+extern const struct target_desc *tdesc_s390x_linux64; - - #endif /* S390_TDEP_H */ -diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c ---- a/gdb/target-descriptions.c -+++ b/gdb/target-descriptions.c -@@ -1367,7 +1367,7 @@ class print_c_tdesc : public tdesc_element_visitor - printf_filtered ("#include \"target-descriptions.h\"\n"); - printf_filtered ("\n"); - -- printf_filtered ("struct target_desc *tdesc_%s;\n", m_function); -+ printf_filtered ("const struct target_desc *tdesc_%s;\n", m_function); - printf_filtered ("static void\n"); - printf_filtered ("initialize_tdesc_%s (void)\n", m_function); - printf_filtered ("{\n"); diff --git a/gdb-test-expr-cumulative-archer.patch b/gdb-test-expr-cumulative-archer.patch deleted file mode 100644 index 28a903dd9b4c7b65f8967b43b6154f863c0b234b..0000000000000000000000000000000000000000 --- a/gdb-test-expr-cumulative-archer.patch +++ /dev/null @@ -1,223 +0,0 @@ -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-test-expr-cumulative-archer.patch - -;; [archer-keiths-expr-cumulative+upstream] Import C++ testcases. -;;=fedoratest - -archer archer-keiths-expr-cumulative -b5a7497340b24199f0c7ba7fdf0d54d4df44d6bc - -diff --git a/gdb/testsuite/gdb.cp/namespace-nested-imports.cc b/gdb/testsuite/gdb.cp/namespace-nested-imports.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/namespace-nested-imports.cc -@@ -0,0 +1,36 @@ -+namespace A -+{ -+ namespace B -+ { -+ int ab = 11; -+ } -+} -+ -+namespace C -+{ -+ namespace D -+ { -+ using namespace A::B; -+ -+ int -+ second() -+ { -+ ab; -+ return 0; -+ } -+ } -+ -+ int -+ first() -+ { -+ //ab; -+ return D::second(); -+ } -+} -+ -+int -+main() -+{ -+ //ab; -+ return C::first(); -+} -diff --git a/gdb/testsuite/gdb.cp/namespace-nested-imports.exp b/gdb/testsuite/gdb.cp/namespace-nested-imports.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/namespace-nested-imports.exp -@@ -0,0 +1,50 @@ -+# 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 3 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, see . -+ -+set testfile namespace-nested-imports -+set srcfile ${testfile}.cc -+set binfile [standard_output_file ${testfile}] -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+# Get things started. -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+############################################ -+if ![runto_main] then { -+ perror "couldn't run to breakpoint main" -+ continue -+} -+ -+gdb_test "print ab" "No symbol .* in current context." -+ -+############################################ -+gdb_breakpoint C::first -+gdb_continue_to_breakpoint "C::first" -+ -+gdb_test "print ab" "No symbol .* in current context." -+gdb_test "print C::D::ab" "= 11" -+ -+############################################ -+gdb_breakpoint C::D::second -+gdb_continue_to_breakpoint "C::D::second" -+ -+gdb_test "print ab" "= 11" -diff --git a/gdb/testsuite/gdb.cp/namespace-no-imports.cc b/gdb/testsuite/gdb.cp/namespace-no-imports.cc -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/namespace-no-imports.cc -@@ -0,0 +1,37 @@ -+ -+namespace A -+{ -+ int _a = 11; -+ -+ namespace B{ -+ -+ int ab = 22; -+ -+ namespace C{ -+ -+ int abc = 33; -+ -+ int second(){ -+ return 0; -+ } -+ -+ } -+ -+ int first(){ -+ _a; -+ ab; -+ C::abc; -+ return C::second(); -+ } -+ } -+} -+ -+ -+int -+main() -+{ -+ A::_a; -+ A::B::ab; -+ A::B::C::abc; -+ return A::B::first(); -+} -diff --git a/gdb/testsuite/gdb.cp/namespace-no-imports.exp b/gdb/testsuite/gdb.cp/namespace-no-imports.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.cp/namespace-no-imports.exp -@@ -0,0 +1,69 @@ -+# 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 3 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, see . -+ -+set testfile namespace-no-imports -+set srcfile ${testfile}.cc -+set binfile [standard_output_file ${testfile}] -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+# Get things started. -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+############################################ -+if ![runto_main] then { -+ perror "couldn't run to breakpoint main" -+ continue -+} -+ -+gdb_test "print A::_a" "= 11" -+gdb_test "print A::B::ab" "= 22" -+gdb_test "print A::B::C::abc" "= 33" -+ -+gdb_test "print _a" "No symbol .* in current context." -+gdb_test "print ab" "No symbol .* in current context." -+gdb_test "print abc" "No symbol .* in current context." -+ -+############################################ -+gdb_breakpoint A::B::first -+gdb_continue_to_breakpoint "A::B::first" -+ -+gdb_test "print A::_a" "= 11" -+gdb_test "print A::B::ab" "= 22" -+gdb_test "print A::B::C::abc" "= 33" -+ -+gdb_test "print _a" "= 11" -+gdb_test "print ab" "= 22" -+gdb_test "print C::abc" "= 33" -+ -+gdb_test "print abc" "No symbol .* in current context." -+ -+############################################ -+gdb_breakpoint A::B::C::second -+gdb_continue_to_breakpoint "A::B::C::second" -+ -+gdb_test "print A::_a" "= 11" -+gdb_test "print A::B::ab" "= 22" -+gdb_test "print A::B::C::abc" "= 33" -+ -+gdb_test "print _a" "= 11" -+gdb_test "print ab" "= 22" -+gdb_test "print abc" "= 33" diff --git a/gdb-test-ivy-bridge.patch b/gdb-test-ivy-bridge.patch deleted file mode 100644 index ed827897bb8d6497d3960ec04a4393e53e98314f..0000000000000000000000000000000000000000 --- a/gdb-test-ivy-bridge.patch +++ /dev/null @@ -1,468 +0,0 @@ -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-test-ivy-bridge.patch - -;; Test GDB opcodes/ disassembly of Intel Ivy Bridge instructions (BZ 696890). -;;=fedoratest - -diff --git a/gdb/testsuite/gdb.arch/amd64-ivy-bridge.S b/gdb/testsuite/gdb.arch/amd64-ivy-bridge.S -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/amd64-ivy-bridge.S -@@ -0,0 +1,98 @@ -+/* Copyright 2011 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 3 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, see . -+ -+ This file is part of the gdb testsuite. */ -+ -+ .globl _start -+_start: .text -+ -+/* gas/i386/x86-64-rdrnd.s */ -+ .att_syntax prefix -+ rdrand %bx -+ rdrand %ebx -+ rdrand %rbx -+ rdrand %r8w -+ rdrand %r8d -+ rdrand %r8 -+ -+ .intel_syntax noprefix -+ rdrand bx -+ rdrand ebx -+ rdrand rbx -+ rdrand r8w -+ rdrand r8d -+ rdrand r8 -+ -+/* gas/i386/x86-64-f16c.s */ -+ .att_syntax prefix -+ vcvtph2ps %xmm4,%ymm4 -+ vcvtph2ps (%r8),%ymm8 -+ vcvtph2ps %xmm4,%xmm6 -+ vcvtph2ps (%rcx),%xmm4 -+ vcvtps2ph $0x2,%ymm4,%xmm4 -+ vcvtps2ph $0x2,%ymm8,(%r8) -+ vcvtps2ph $0x2,%xmm4,%xmm4 -+ vcvtps2ph $0x2,%xmm4,(%rcx) -+ -+ .intel_syntax noprefix -+ vcvtph2ps ymm4,xmm4 -+ vcvtph2ps ymm8,XMMWORD PTR [r8] -+ vcvtph2ps ymm4,[rcx] -+ vcvtph2ps xmm6,xmm4 -+ vcvtph2ps xmm4,QWORD PTR [rcx] -+ vcvtph2ps xmm4,[rcx] -+ vcvtps2ph xmm4,ymm4,0x2 -+ vcvtps2ph XMMWORD PTR [rcx],ymm4,0x2 -+ vcvtps2ph [rcx],ymm4,0x2 -+ vcvtps2ph xmm4,xmm4,0x2 -+ vcvtps2ph QWORD PTR [r8],xmm8,0x2 -+ vcvtps2ph [rcx],xmm4,0x2 -+ -+/* gas/i386/x86-64-fsgs.s */ -+ .att_syntax prefix -+ rdfsbase %ebx -+ rdfsbase %rbx -+ rdfsbase %r8d -+ rdfsbase %r8 -+ rdgsbase %ebx -+ rdgsbase %rbx -+ rdgsbase %r8d -+ rdgsbase %r8 -+ wrfsbase %ebx -+ wrfsbase %rbx -+ wrfsbase %r8d -+ wrfsbase %r8 -+ wrgsbase %ebx -+ wrgsbase %rbx -+ wrgsbase %r8d -+ wrgsbase %r8 -+ -+ .intel_syntax noprefix -+ rdfsbase ebx -+ rdfsbase rbx -+ rdfsbase r8d -+ rdfsbase r8 -+ rdgsbase ebx -+ rdgsbase rbx -+ rdgsbase r8d -+ rdgsbase r8 -+ wrfsbase ebx -+ wrfsbase rbx -+ wrfsbase r8d -+ wrfsbase r8 -+ wrgsbase ebx -+ wrgsbase rbx -+ wrgsbase r8d -+ wrgsbase r8 -diff --git a/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp b/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp -@@ -0,0 +1,170 @@ -+# Copyright 2011 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 3 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, see . -+ -+if {![istarget "x86_64-*-*"]} then { -+ return -+} -+ -+set testfile amd64-ivy-bridge -+set test compilation -+if [prepare_for_testing ${testfile}.exp ${testfile}.x ${testfile}.S [list debug "additional_flags=-m64 -nostdlib"]] { -+ unsupported $test -+ return -1 -+} -+pass $test -+ -+gdb_test_no_output "set disassembly-flavor att" -+# gas/i386/x86-64-rdrnd.d -+# gas/i386/x86-64-f16c.d -+# gas/i386/x86-64-fsgs.d -+gdb_test "disassemble/r _start" "\r -+Dump of assembler code for function _start:\r -+\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand %bx\r -+\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand %ebx\r -+\[^\r\n\]+:\t48 0f c7 f3\t\( \)?rdrand %rbx\r -+\[^\r\n\]+:\t66 41 0f c7 f0\t\( \)?rdrand %r8w\r -+\[^\r\n\]+:\t41 0f c7 f0\t\( \)?rdrand %r8d\r -+\[^\r\n\]+:\t49 0f c7 f0\t\( \)?rdrand %r8\r -+\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand %bx\r -+\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand %ebx\r -+\[^\r\n\]+:\t48 0f c7 f3\t\( \)?rdrand %rbx\r -+\[^\r\n\]+:\t66 41 0f c7 f0\t\( \)?rdrand %r8w\r -+\[^\r\n\]+:\t41 0f c7 f0\t\( \)?rdrand %r8d\r -+\[^\r\n\]+:\t49 0f c7 f0\t\( \)?rdrand %r8\r -+\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps %xmm4,%ymm4\r -+\[^\r\n\]+:\tc4 42 7d 13 00\t\( \)?vcvtph2ps \\(%r8\\),%ymm8\r -+\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps %xmm4,%xmm6\r -+\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%rcx\\),%xmm4\r -+\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,%xmm4\r -+\[^\r\n\]+:\tc4 43 7d 1d 00 02\t\( \)?vcvtps2ph \\\$0x2,%ymm8,\\(%r8\\)\r -+\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,%xmm4\r -+\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,\\(%rcx\\)\r -+\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps %xmm4,%ymm4\r -+\[^\r\n\]+:\tc4 42 7d 13 00\t\( \)?vcvtph2ps \\(%r8\\),%ymm8\r -+\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps \\(%rcx\\),%ymm4\r -+\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps %xmm4,%xmm6\r -+\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%rcx\\),%xmm4\r -+\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%rcx\\),%xmm4\r -+\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,%xmm4\r -+\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,\\(%rcx\\)\r -+\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,\\(%rcx\\)\r -+\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,%xmm4\r -+\[^\r\n\]+:\tc4 43 79 1d 00 02\t\( \)?vcvtps2ph \\\$0x2,%xmm8,\\(%r8\\)\r -+\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,\\(%rcx\\)\r -+\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase %ebx\r -+\[^\r\n\]+:\tf3 48 0f ae c3\t\( \)?rdfsbase %rbx\r -+\[^\r\n\]+:\tf3 41 0f ae c0\t\( \)?rdfsbase %r8d\r -+\[^\r\n\]+:\tf3 49 0f ae c0\t\( \)?rdfsbase %r8\r -+\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase %ebx\r -+\[^\r\n\]+:\tf3 48 0f ae cb\t\( \)?rdgsbase %rbx\r -+\[^\r\n\]+:\tf3 41 0f ae c8\t\( \)?rdgsbase %r8d\r -+\[^\r\n\]+:\tf3 49 0f ae c8\t\( \)?rdgsbase %r8\r -+\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase %ebx\r -+\[^\r\n\]+:\tf3 48 0f ae d3\t\( \)?wrfsbase %rbx\r -+\[^\r\n\]+:\tf3 41 0f ae d0\t\( \)?wrfsbase %r8d\r -+\[^\r\n\]+:\tf3 49 0f ae d0\t\( \)?wrfsbase %r8\r -+\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase %ebx\r -+\[^\r\n\]+:\tf3 48 0f ae db\t\( \)?wrgsbase %rbx\r -+\[^\r\n\]+:\tf3 41 0f ae d8\t\( \)?wrgsbase %r8d\r -+\[^\r\n\]+:\tf3 49 0f ae d8\t\( \)?wrgsbase %r8\r -+\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase %ebx\r -+\[^\r\n\]+:\tf3 48 0f ae c3\t\( \)?rdfsbase %rbx\r -+\[^\r\n\]+:\tf3 41 0f ae c0\t\( \)?rdfsbase %r8d\r -+\[^\r\n\]+:\tf3 49 0f ae c0\t\( \)?rdfsbase %r8\r -+\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase %ebx\r -+\[^\r\n\]+:\tf3 48 0f ae cb\t\( \)?rdgsbase %rbx\r -+\[^\r\n\]+:\tf3 41 0f ae c8\t\( \)?rdgsbase %r8d\r -+\[^\r\n\]+:\tf3 49 0f ae c8\t\( \)?rdgsbase %r8\r -+\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase %ebx\r -+\[^\r\n\]+:\tf3 48 0f ae d3\t\( \)?wrfsbase %rbx\r -+\[^\r\n\]+:\tf3 41 0f ae d0\t\( \)?wrfsbase %r8d\r -+\[^\r\n\]+:\tf3 49 0f ae d0\t\( \)?wrfsbase %r8\r -+\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase %ebx\r -+\[^\r\n\]+:\tf3 48 0f ae db\t\( \)?wrgsbase %rbx\r -+\[^\r\n\]+:\tf3 41 0f ae d8\t\( \)?wrgsbase %r8d\r -+\[^\r\n\]+:\tf3 49 0f ae d8\t\( \)?wrgsbase %r8\r -+End of assembler dump\\." "att" -+ -+gdb_test_no_output "set disassembly-flavor intel" -+# gas/i386/x86-64-rdrnd-intel.d -+# gas/i386/x86-64-f16c-intel.d -+# gas/i386/x86-64-fsgs-intel.d -+gdb_test "disassemble/r _start" "\r -+Dump of assembler code for function _start:\r -+\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand bx\r -+\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand ebx\r -+\[^\r\n\]+:\t48 0f c7 f3\t\( \)?rdrand rbx\r -+\[^\r\n\]+:\t66 41 0f c7 f0\t\( \)?rdrand r8w\r -+\[^\r\n\]+:\t41 0f c7 f0\t\( \)?rdrand r8d\r -+\[^\r\n\]+:\t49 0f c7 f0\t\( \)?rdrand r8\r -+\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand bx\r -+\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand ebx\r -+\[^\r\n\]+:\t48 0f c7 f3\t\( \)?rdrand rbx\r -+\[^\r\n\]+:\t66 41 0f c7 f0\t\( \)?rdrand r8w\r -+\[^\r\n\]+:\t41 0f c7 f0\t\( \)?rdrand r8d\r -+\[^\r\n\]+:\t49 0f c7 f0\t\( \)?rdrand r8\r -+\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps ymm4,xmm4\r -+\[^\r\n\]+:\tc4 42 7d 13 00\t\( \)?vcvtph2ps ymm8,XMMWORD PTR \\\[r8\\\]\r -+\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps xmm6,xmm4\r -+\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[rcx\\\]\r -+\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph xmm4,ymm4,0x2\r -+\[^\r\n\]+:\tc4 43 7d 1d 00 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[r8\\\],ymm8,0x2\r -+\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph xmm4,xmm4,0x2\r -+\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph QWORD PTR \\\[rcx\\\],xmm4,0x2\r -+\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps ymm4,xmm4\r -+\[^\r\n\]+:\tc4 42 7d 13 00\t\( \)?vcvtph2ps ymm8,XMMWORD PTR \\\[r8\\\]\r -+\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps ymm4,XMMWORD PTR \\\[rcx\\\]\r -+\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps xmm6,xmm4\r -+\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[rcx\\\]\r -+\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[rcx\\\]\r -+\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph xmm4,ymm4,0x2\r -+\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[rcx\\\],ymm4,0x2\r -+\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[rcx\\\],ymm4,0x2\r -+\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph xmm4,xmm4,0x2\r -+\[^\r\n\]+:\tc4 43 79 1d 00 02\t\( \)?vcvtps2ph QWORD PTR \\\[r8\\\],xmm8,0x2\r -+\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph QWORD PTR \\\[rcx\\\],xmm4,0x2\r -+\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase ebx\r -+\[^\r\n\]+:\tf3 48 0f ae c3\t\( \)?rdfsbase rbx\r -+\[^\r\n\]+:\tf3 41 0f ae c0\t\( \)?rdfsbase r8d\r -+\[^\r\n\]+:\tf3 49 0f ae c0\t\( \)?rdfsbase r8\r -+\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase ebx\r -+\[^\r\n\]+:\tf3 48 0f ae cb\t\( \)?rdgsbase rbx\r -+\[^\r\n\]+:\tf3 41 0f ae c8\t\( \)?rdgsbase r8d\r -+\[^\r\n\]+:\tf3 49 0f ae c8\t\( \)?rdgsbase r8\r -+\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase ebx\r -+\[^\r\n\]+:\tf3 48 0f ae d3\t\( \)?wrfsbase rbx\r -+\[^\r\n\]+:\tf3 41 0f ae d0\t\( \)?wrfsbase r8d\r -+\[^\r\n\]+:\tf3 49 0f ae d0\t\( \)?wrfsbase r8\r -+\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase ebx\r -+\[^\r\n\]+:\tf3 48 0f ae db\t\( \)?wrgsbase rbx\r -+\[^\r\n\]+:\tf3 41 0f ae d8\t\( \)?wrgsbase r8d\r -+\[^\r\n\]+:\tf3 49 0f ae d8\t\( \)?wrgsbase r8\r -+\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase ebx\r -+\[^\r\n\]+:\tf3 48 0f ae c3\t\( \)?rdfsbase rbx\r -+\[^\r\n\]+:\tf3 41 0f ae c0\t\( \)?rdfsbase r8d\r -+\[^\r\n\]+:\tf3 49 0f ae c0\t\( \)?rdfsbase r8\r -+\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase ebx\r -+\[^\r\n\]+:\tf3 48 0f ae cb\t\( \)?rdgsbase rbx\r -+\[^\r\n\]+:\tf3 41 0f ae c8\t\( \)?rdgsbase r8d\r -+\[^\r\n\]+:\tf3 49 0f ae c8\t\( \)?rdgsbase r8\r -+\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase ebx\r -+\[^\r\n\]+:\tf3 48 0f ae d3\t\( \)?wrfsbase rbx\r -+\[^\r\n\]+:\tf3 41 0f ae d0\t\( \)?wrfsbase r8d\r -+\[^\r\n\]+:\tf3 49 0f ae d0\t\( \)?wrfsbase r8\r -+\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase ebx\r -+\[^\r\n\]+:\tf3 48 0f ae db\t\( \)?wrgsbase rbx\r -+\[^\r\n\]+:\tf3 41 0f ae d8\t\( \)?wrgsbase r8d\r -+\[^\r\n\]+:\tf3 49 0f ae d8\t\( \)?wrgsbase r8\r -+End of assembler dump\\." "intel" -diff --git a/gdb/testsuite/gdb.arch/i386-ivy-bridge.S b/gdb/testsuite/gdb.arch/i386-ivy-bridge.S -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/i386-ivy-bridge.S -@@ -0,0 +1,66 @@ -+/* Copyright 2011 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 3 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, see . -+ -+ This file is part of the gdb testsuite. */ -+ -+ .globl _start -+_start: .text -+ -+/* gas/i386/rdrnd.s */ -+ .att_syntax prefix -+ rdrand %bx -+ rdrand %ebx -+ -+ .intel_syntax noprefix -+ rdrand bx -+ rdrand ebx -+ -+/* gas/i386/f16c.s */ -+ .att_syntax prefix -+ vcvtph2ps %xmm4,%ymm4 -+ vcvtph2ps (%ecx),%ymm4 -+ vcvtph2ps %xmm4,%xmm6 -+ vcvtph2ps (%ecx),%xmm4 -+ vcvtps2ph $0x2,%ymm4,%xmm4 -+ vcvtps2ph $0x2,%ymm4,(%ecx) -+ vcvtps2ph $0x2,%xmm4,%xmm4 -+ vcvtps2ph $0x2,%xmm4,(%ecx) -+ -+ .intel_syntax noprefix -+ vcvtph2ps ymm4,xmm4 -+ vcvtph2ps ymm4,XMMWORD PTR [ecx] -+ vcvtph2ps ymm4,[ecx] -+ vcvtph2ps xmm6,xmm4 -+ vcvtph2ps xmm4,QWORD PTR [ecx] -+ vcvtph2ps xmm4,[ecx] -+ vcvtps2ph xmm4,ymm4,0x2 -+ vcvtps2ph XMMWORD PTR [ecx],ymm4,0x2 -+ vcvtps2ph [ecx],ymm4,0x2 -+ vcvtps2ph xmm4,xmm4,0x2 -+ vcvtps2ph QWORD PTR [ecx],xmm4,0x2 -+ vcvtps2ph [ecx],xmm4,0x2 -+ -+/* gas/i386/fsgs.s */ -+ .att_syntax prefix -+ rdfsbase %ebx -+ rdgsbase %ebx -+ wrfsbase %ebx -+ wrgsbase %ebx -+ -+ .intel_syntax noprefix -+ rdfsbase ebx -+ rdgsbase ebx -+ wrfsbase ebx -+ wrgsbase ebx -diff --git a/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp b/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp -@@ -0,0 +1,106 @@ -+# Copyright 2011 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 3 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, see . -+ -+if {![istarget "x86_64-*-*"] && ![istarget "i?86-*-*"]} then { -+ return -+} -+ -+set testfile i386-ivy-bridge -+set test compilation -+if [prepare_for_testing ${testfile}.exp ${testfile}.x ${testfile}.S [list debug "additional_flags=-m32 -nostdlib"]] { -+ fail $test -+ return -1 -+} -+pass $test -+ -+gdb_test_no_output "set disassembly-flavor att" -+# gas/i386/rdrnd.d -+# gas/i386/f16c.d -+# gas/i386/fsgs.d -+gdb_test "disassemble/r _start" "\r -+Dump of assembler code for function _start:\r -+\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand %bx\r -+\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand %ebx\r -+\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand %bx\r -+\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand %ebx\r -+\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps %xmm4,%ymm4\r -+\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%ymm4\r -+\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps %xmm4,%xmm6\r -+\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%xmm4\r -+\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,%xmm4\r -+\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,\\(%ecx\\)\r -+\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,%xmm4\r -+\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,\\(%ecx\\)\r -+\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps %xmm4,%ymm4\r -+\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%ymm4\r -+\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%ymm4\r -+\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps %xmm4,%xmm6\r -+\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%xmm4\r -+\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps \\(%ecx\\),%xmm4\r -+\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,%xmm4\r -+\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,\\(%ecx\\)\r -+\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%ymm4,\\(%ecx\\)\r -+\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,%xmm4\r -+\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,\\(%ecx\\)\r -+\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph \\\$0x2,%xmm4,\\(%ecx\\)\r -+\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase %ebx\r -+\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase %ebx\r -+\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase %ebx\r -+\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase %ebx\r -+\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase %ebx\r -+\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase %ebx\r -+\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase %ebx\r -+\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase %ebx\r -+End of assembler dump\\." "att" -+ -+gdb_test_no_output "set disassembly-flavor intel" -+# gas/i386/rdrnd-intel.d -+# gas/i386/f16c-intel.d -+# gas/i386/fsgs-intel.d -+gdb_test "disassemble/r _start" "\r -+Dump of assembler code for function _start:\r -+\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand bx\r -+\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand ebx\r -+\[^\r\n\]+:\t66 0f c7 f3\t\( \)?rdrand bx\r -+\[^\r\n\]+:\t0f c7 f3\t\( \)?rdrand ebx\r -+\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps ymm4,xmm4\r -+\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps ymm4,XMMWORD PTR \\\[ecx\\\]\r -+\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps xmm6,xmm4\r -+\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[ecx\\\]\r -+\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph xmm4,ymm4,0x2\r -+\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[ecx\\\],ymm4,0x2\r -+\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph xmm4,xmm4,0x2\r -+\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph QWORD PTR \\\[ecx\\\],xmm4,0x2\r -+\[^\r\n\]+:\tc4 e2 7d 13 e4\t\( \)?vcvtph2ps ymm4,xmm4\r -+\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps ymm4,XMMWORD PTR \\\[ecx\\\]\r -+\[^\r\n\]+:\tc4 e2 7d 13 21\t\( \)?vcvtph2ps ymm4,XMMWORD PTR \\\[ecx\\\]\r -+\[^\r\n\]+:\tc4 e2 79 13 f4\t\( \)?vcvtph2ps xmm6,xmm4\r -+\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[ecx\\\]\r -+\[^\r\n\]+:\tc4 e2 79 13 21\t\( \)?vcvtph2ps xmm4,QWORD PTR \\\[ecx\\\]\r -+\[^\r\n\]+:\tc4 e3 7d 1d e4 02\t\( \)?vcvtps2ph xmm4,ymm4,0x2\r -+\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[ecx\\\],ymm4,0x2\r -+\[^\r\n\]+:\tc4 e3 7d 1d 21 02\t\( \)?vcvtps2ph XMMWORD PTR \\\[ecx\\\],ymm4,0x2\r -+\[^\r\n\]+:\tc4 e3 79 1d e4 02\t\( \)?vcvtps2ph xmm4,xmm4,0x2\r -+\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph QWORD PTR \\\[ecx\\\],xmm4,0x2\r -+\[^\r\n\]+:\tc4 e3 79 1d 21 02\t\( \)?vcvtps2ph QWORD PTR \\\[ecx\\\],xmm4,0x2\r -+\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase ebx\r -+\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase ebx\r -+\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase ebx\r -+\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase ebx\r -+\[^\r\n\]+:\tf3 0f ae c3\t\( \)?rdfsbase ebx\r -+\[^\r\n\]+:\tf3 0f ae cb\t\( \)?rdgsbase ebx\r -+\[^\r\n\]+:\tf3 0f ae d3\t\( \)?wrfsbase ebx\r -+\[^\r\n\]+:\tf3 0f ae db\t\( \)?wrgsbase ebx\r -+End of assembler dump\\." "intel" diff --git a/gdb-test-pid0-core.patch b/gdb-test-pid0-core.patch deleted file mode 100644 index fea4defa99a4226390c2a75a2c17f3297136f18e..0000000000000000000000000000000000000000 --- a/gdb-test-pid0-core.patch +++ /dev/null @@ -1,92 +0,0 @@ -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-test-pid0-core.patch - -;; New test gdb.arch/x86_64-pid0-core.exp for kernel PID 0 cores (BZ 611435). -;;=fedoratest - -https://bugzilla.redhat.com/show_bug.cgi?id=611435 - -Fix: -Re: [RFA]corelow.c: Add tid to add_to_thread_list -http://sourceware.org/ml/gdb-patches/2010-08/msg00085.html -http://sourceware.org/ml/gdb-cvs/2010-08/msg00026.html -2e5bcfdef1ec3883d48c3f87a4be5c0dff25e17e - -diff --git a/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu b/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu -@@ -0,0 +1,20 @@ -+begin 600 x86_64-pid0-core.core.bz2 -+M0EIH.3%!629362,CA>P!$/'_____^*#EZ-A!SP36P&_:G0#=14``04A&8,'U -+M2*9`>$$)P`*RN"#*;#4R()IJ8C$TT&FC3$&@`T`#:C1H8C0T,@,FC,D"4T2! -+M"/2CU'B90]31ZAD#U`&AZF@/4:``!HT&F@!H<`#0-`-#0``#3$-&F@```#0R -+M``#")2FD]2>4]0TTT-!HTT--,0,"#$`R!I@AD`#1H,3&GZT.4TO$#H40/`0C -+M2$IRXS,<55!8T,&&,R.Z441"?J9I%G6GUA2!.[]Z"C5S[&19,%VS7E6[3"60 -+M@`-*2G)QEQ(;?0Y<=MK]/U?Q)LB%+F37TJ9BI*46)H'*Z@V"`"$"P7]&XZ:JE0E<*:#1M$P3G]>VCI)(A!O$64`5$4`E$$-.``7&(09`8HO`B6K!Q^& -+M562%N)2+0@*HB@%D@5$%!*0!L1&0D4D6\:-$A`)`+<6D82PP*H(J(H!?F;0$ -+M%PXB7N!2D4!44`W7"ADEQM6O9TBO5,_]1) -+M($Q2))#),UE,QQK)E$,3D\W.>!4)QO8A_@^Z_SXS4;Q8=HV6[:&$@2$@$R29IBW)K%3"O` -+M9^Y0YJ&BXY1U2HTZ5)2H-V\_(.DZHWE+C#WS($(!I"3CUH2#(+(OWUV"*<<9 -+MJ%A!J[%O.P&V%GI.`L7<1@0>,^1F\MY=V5UT,&NOG%7TTZ[03!@BHB@&)P` -+` -+end -diff --git a/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp b/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp -new file mode 100644 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp -@@ -0,0 +1,46 @@ -+# This testcase is part of GDB, the GNU debugger. -+# -+# Copyright 2010 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. -+ -+# Some kernel core files have PID 0 - for the idle task. -+ -+if ![istarget "x86_64-*-*"] { -+ verbose "Skipping x86_64-pid0-core test." -+ return -+} -+ -+set testfile "x86_64-pid0-core" -+set corebz2uufile ${srcdir}/${subdir}/${testfile}.core.bz2.uu -+set corefile [standard_output_file ${testfile}.core] -+ -+if {[catch "system \"uudecode -o - ${corebz2uufile} | bzip2 -dc >${corefile}\""] != 0} { -+ untested "failed uudecode or bzip2" -+ return -1 -+} -+file stat ${corefile} corestat -+if {$corestat(size) != 8798208} { -+ untested "uudecode or bzip2 produce invalid result" -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+ -+# Former crash was: -+# thread.c:884: internal-error: switch_to_thread: Assertion `inf != NULL' failed. -+gdb_test "core-file ${corefile}" "Program terminated with signal (11|SIGSEGV), Segmentation fault\\.\r\n.*" diff --git a/gdb.spec b/gdb.spec index 00f86ea9e0f9e8ab7a9e9a319398890a5fa85744..998ad4d39c0bd43f6a9278e4d80f01208d71aeb3 100644 --- a/gdb.spec +++ b/gdb.spec @@ -1,6 +1,6 @@ Name: gdb -Version: 12.1 -Release: 10 +Version: 14.1 +Release: 1 License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL-1.3 Source: https://ftp.gnu.org/gnu/gdb/gdb-%{version}.tar.xz @@ -12,93 +12,54 @@ Source2: gdbinit # patch from Fedora Patch1: gdb-6.3-rh-testversion-20041202.patch Patch2: gdb-6.3-gstack-20050411.patch -Patch3: gdb-6.3-test-movedir-20050125.patch -Patch4: gdb-6.3-threaded-watchpoints2-20050225.patch -Patch5: gdb-6.3-inheritancetest-20050726.patch -Patch6: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch -Patch7: gdb-6.5-sharedlibrary-path.patch -Patch8: gdb-6.5-BEA-testsuite.patch -Patch9: gdb-6.5-last-address-space-byte-test.patch -Patch10: gdb-6.5-readline-long-line-crash-test.patch -Patch11: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch -Patch12: gdb-6.5-bz109921-DW_AT_decl_file-test.patch -Patch13: gdb-6.3-bz140532-ppc-unwinding-test.patch -Patch14: gdb-6.3-bz202689-exec-from-pthread-test.patch -Patch15: gdb-6.6-bz230000-power6-disassembly-test.patch -Patch16: gdb-6.6-bz229517-gcore-without-terminal.patch -Patch17: gdb-6.6-testsuite-timeouts.patch -Patch18: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch -Patch19: gdb-6.3-attach-see-vdso-test.patch -Patch20: gdb-6.5-bz243845-stale-testing-zombie-test.patch -Patch21: gdb-6.6-buildid-locate.patch -Patch22: gdb-6.6-buildid-locate-solib-missing-ids.patch -Patch23: gdb-6.6-buildid-locate-rpm.patch -Patch24: gdb-6.7-charsign-test.patch -Patch25: gdb-6.7-ppc-clobbered-registers-O2-test.patch -Patch26: gdb-6.7-testsuite-stable-results.patch -Patch27: gdb-6.5-ia64-libunwind-leak-test.patch -Patch28: gdb-6.5-missed-trap-on-step-test.patch -Patch29: gdb-6.5-gcore-buffer-limit-test.patch -Patch30: gdb-6.3-mapping-zero-inode-test.patch -Patch31: gdb-6.3-focus-cmd-prev-test.patch -Patch32: gdb-6.8-bz442765-threaded-exec-test.patch -Patch33: gdb-6.5-section-num-fixup-test.patch -Patch34: gdb-6.8-bz466901-backtrace-full-prelinked.patch -Patch35: gdb-simultaneous-step-resume-breakpoint-test.patch -Patch36: gdb-core-open-vdso-warning.patch -Patch37: gdb-ccache-workaround.patch -Patch38: gdb-lineno-makeup-test.patch -Patch39: gdb-ppc-power7-test.patch -Patch40: gdb-archer-next-over-throw-cxx-exec.patch -Patch41: gdb-bz601887-dwarf4-rh-test.patch -Patch42: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch -Patch43: gdb-test-bt-cfi-without-die.patch -Patch44: gdb-bz634108-solib_address.patch -Patch45: gdb-test-pid0-core.patch -Patch46: gdb-test-dw2-aranges.patch -Patch47: gdb-test-expr-cumulative-archer.patch -Patch48: gdb-physname-pr11734-test.patch -Patch49: gdb-physname-pr12273-test.patch -Patch50: gdb-test-ivy-bridge.patch -Patch51: gdb-runtest-pie-override.patch -Patch52: gdb-glibc-strstr-workaround.patch -Patch53: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch -Patch54: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch55: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch -Patch56: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch -Patch57: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch -Patch58: gdb-fortran-frame-string.patch -Patch59: gdb-rhbz1156192-recursive-dlopen-test.patch -Patch60: gdb-rhbz1149205-catch-syscall-after-fork-test.patch -Patch61: gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch -Patch62: gdb-rhbz1350436-type-printers-error.patch -Patch63: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch -Patch64: gdb-fedora-libncursesw.patch -Patch65: gdb-opcodes-clflushopt-test.patch -Patch66: gdb-6.6-buildid-locate-rpm-scl.patch -Patch67: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch -Patch68: gdb-container-rh-pkg.patch -Patch69: gdb-rhbz1325795-framefilters-test.patch -Patch70: gdb-linux_perf-bundle.patch -Patch71: gdb-libexec-add-index.patch -Patch72: gdb-rhbz1398387-tab-crash-test.patch -Patch73: gdb-rhbz1553104-s390x-arch12-test.patch -Patch76: gdb-sw22395-constify-target_desc.patch +Patch3: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +Patch4: gdb-6.5-BEA-testsuite.patch +Patch5: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch +Patch6: gdb-6.6-bz229517-gcore-without-terminal.patch +Patch7: gdb-6.6-testsuite-timeouts.patch +Patch8: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +Patch9: gdb-6.3-attach-see-vdso-test.patch +Patch10: gdb-6.5-bz243845-stale-testing-zombie-test.patch +Patch11: gdb-6.6-buildid-locate.patch +Patch12: gdb-6.6-buildid-locate-solib-missing-ids.patch +Patch13: gdb-6.6-buildid-locate-rpm.patch +Patch14: gdb-6.7-ppc-clobbered-registers-O2-test.patch +Patch15: gdb-6.5-gcore-buffer-limit-test.patch +Patch16: gdb-6.3-mapping-zero-inode-test.patch +Patch17: gdb-6.5-section-num-fixup-test.patch +Patch18: gdb-6.8-bz466901-backtrace-full-prelinked.patch +Patch19: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch20: gdb-core-open-vdso-warning.patch +Patch21: gdb-archer-next-over-throw-cxx-exec.patch +Patch22: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +Patch23: gdb-test-bt-cfi-without-die.patch +Patch24: gdb-bz634108-solib_address.patch +Patch25: gdb-test-dw2-aranges.patch +Patch26: gdb-glibc-strstr-workaround.patch +Patch27: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch28: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch29: gdb-rhbz1007614-memleak-infpy_read_memory-test.patch +Patch30: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch +Patch31: gdb-rhbz1156192-recursive-dlopen-test.patch +Patch32: gdb-rhbz1149205-catch-syscall-after-fork-test.patch +Patch33: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch +Patch34: gdb-fedora-libncursesw.patch +Patch35: gdb-rhbz1261564-aarch64-hw-watchpoint-test.patch +Patch36: gdb-container-rh-pkg.patch +Patch37: gdb-linux_perf-bundle.patch +Patch38: gdb-add-index.patch +Patch39: gdb-rhbz2232086-refactor-selftest-support.patch +Patch40: gdb-rhbz-2232086-reduce-size-of-gdb-index.patch +Patch41: gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch +Patch42: gdb-rhbz-2232086-generate-gdb-index-consistently.patch +Patch43: gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch +Patch44: gdb-rhbz2250652-gdbpy_gil.patch +Patch45: gdb-rhbz2250652-avoid-PyOS_ReadlineTState.patch +Patch46: gdb-rhbz2257562-cp-namespace-null-ptr-check.patch +Patch47: gdb-ftbs-swapped-calloc-args.patch # Fedra patch end -Patch77: 0001-set-entry-point-when-text-segment-is-missing.patch -Patch78: 0002-Add-support-for-readline-8.2.patch -Patch79: gdb-initialize-the-data_head-variable-to-eliminate-c.patch -Patch80: gdb-python-remove-Python-2-support.patch -Patch81: gdb-Use-bool-for-evregpy_no_listeners_p.patch -Patch82: gdb-Make-import-gdb.events-work.patch -Patch83: gdb-Handle-Python-3.11-deprecation-of-PySys_SetPath-and-.patch -Patch84: gdb-libctf-update-regexp-to-allow-makeinfo-to-build-docu.patch -Patch85: backport-CVE-2023-39128.patch -Patch86: backport-CVE-2023-39129.patch -Patch87: backport-Fix-gdb-coffread.c-build-on-32bit-architectures.patch -Patch88: backport-Use-hex_string-in-gdb-coffread.c-instead-of-PRIxPTR.patch -Patch89: backport-CVE-2023-39130.patch +Patch9000: 0001-set-entry-point-when-text-segment-is-missing.patch %global gdb_src gdb-%{version} %global gdb_build build-%{_target_platform} @@ -140,7 +101,7 @@ BuildRequires: readline-devel >= 6.2-4 BuildRequires: gcc-c++ ncurses-devel texinfo gettext flex bison BuildRequires: expat-devel xz-devel rpm-devel zlib-devel libselinux-devel BuildRequires: python3-devel texinfo-tex -BuildRequires: perl-podlators libbabeltrace-devel guile-devel mpfr-devel +BuildRequires: perl-podlators libbabeltrace-devel guile-devel mpfr-devel gmp-devel %ifarch %{ix86} x86_64 BuildRequires: libipt-devel %endif @@ -243,7 +204,6 @@ export CXXFLAGS="$CFLAGS" %else --without-intel-pt \ %endif - --with-mpfr \ --with-auto-load-dir='$debugdir:$datadir/auto-load' \ --with-auto-load-safe-path='$debugdir:$datadir/auto-load' \ --enable-targets=aarch64-linux-gnu %{_target_platform} @@ -308,8 +268,9 @@ rm -rf $RPM_BUILD_ROOT%{_datadir}/locale/ rm -f $RPM_BUILD_ROOT%{_infodir}/bfd* rm -f $RPM_BUILD_ROOT%{_infodir}/standard* rm -f $RPM_BUILD_ROOT%{_infodir}/configure* +rm -f $RPM_BUILD_ROOT%{_infodir}/sframe-spec* rm -rf $RPM_BUILD_ROOT%{_includedir}/*.h -rm -rf $RPM_BUILD_ROOT/%{_libdir}/lib{bfd*,opcodes*,iberty*,ctf*} +rm -rf $RPM_BUILD_ROOT/%{_libdir}/lib{bfd*,opcodes*,iberty*,ctf*,sframe*} cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man1/gstack.1 ln -s gstack.1 $RPM_BUILD_ROOT%{_mandir}/man1/pstack.1 @@ -374,6 +335,35 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/gdb/python/gdb/command/backtrace.py %{_infodir}/ctf-spec.info.gz %changelog +* Wed Jan 24 2024 liuchao - 14.1-1 +- upgrade GDB version to 14.1: + - GDB no longer support AiX 4.x, 5.x and 6.x. The minimum version supported is AiX 7.1. + - GDB/MI version 1 support has been removed + - Initial built-in support for Debugger Adapter Protocol (DAP) + - GDB now recognizes the NO_COLOR environment variable + - Initial support for integer types larger than 64 bits + - Breakpoints can now be inferior-specific + - New convenience function "$_shell", to execute a shell command and return its result. + - Python support + - Support for enabling or disabling individual remote target features + - New 'no-history' stop reason + - Support for inferior-specific breakpoints + - The bkpt tuple, which appears in breakpoint-created notifications, and in the result of the -break-insert command can now include an optional 'inferior' field for both the main breakpoint, and each location, when the breakpoint is inferior-specific. + - Trying to create a thread-specific breakpoint using a non-existent thread ID now results in an error + - New "simple-values-ref-types" -list-feature value indicating how the --simple-values option in various commands take reference types into account. + - Initial support for Scalable Matrix Extension (SME) and for Scalable Matrix Extension 2 (SME2) + - The 'org.gnu.gdb.aarch64.pauth' Pointer Authentication feature is now deprecated in favor of the 'org.gnu.gdb.aarch64.pauth_v2' feature string + - Support for the Ada 2022 target name symbol ('@') + - Support for the The Ada 2022 'Enum_Rep and 'Enum_Val attributes + - The 'list' command now accepts '.' as an argument, telling GDB to print the location around the point of execution within the current frame + - New '%V' output format for printf and dprintf commands. + - The printf command now limits the size of strings fetched from the inferior to the value of the 'max-value-size' setting. + - Support for extending at configure time the default value of the 'debug-file-directory' GDB parameter via the new --additional-debug-dirs=PATHs configure option. + - New command "info main" + - New command "set tui mouse-events [on|off]" (on by default) + - New command "set always-read-ctf on|off" (off by default) + - Various new debug and maitenance commands + * Tue Nov 21 2023 Wenyu Liu - 12.1-10 - fix CVE-2023-39130