aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-10-21[gdb/contrib] Add spellcheck.sh --checkTom de Vries1-1/+18
Add a new option --check to gdb/contrib/spellcheck.sh, to do the spell check and bail out ASAP with an exit code of 1 if misspelled words were found, or 0 otherwise. Verified with shellcheck.
2024-10-21gdb/guile: add get-basic-typeAndrew Burgess4-1/+29
A question was asked on stackoverflow.com about the guile function get-basic-type[1] which is mentioned in the docs along with an example of its use. The problem is, the function was apparently never actually added to GDB. But it turns out that it's pretty easy to implement, so lets add it now. Better late than never. The implementation mirrors the Python get_basic_type function. I've added a test which is a copy of the documentation example. One issue is that the docs suggest that the type will be returned as just "int", however, I'm not sure what this actually means. It makes more sense that the function return a gdb:type object which would be represented as "#<gdb:type int>", so I've updated the docs to show this output. [1] https://stackoverflow.com/questions/79058691/unbound-variable-get-basic-type-in-gdb-guile-session Reviewed-By: Kevin Buettner <kevinb@redhat.com>
2024-10-21[gdb/build, c++20] Fix more deprecated implicit capture of thisTom de Vries2-3/+3
When building gdb with -std=c++20 I run into: ... gdb/dwarf2/cooked-index.c: In lambda function: gdb/dwarf2/cooked-index.c:471:47: error: implicit capture of ‘this’ via \ ‘[=]’ is deprecated in C++20 [-Werror=deprecated] 471 | gdb::thread_pool::g_thread_pool->post_task ([=] () | ^ gdb/dwarf2/cooked-index.c:471:47: note: add explicit ‘this’ or ‘*this’ capture ... Fix this and two more spots by removing the capture default, and explicitly listing all captures. Tested on x86_64-linux.
2024-10-21Automatic date update in version.inGDB Administrator1-1/+1
2024-10-20gdb: fix 'maint info inline-frames' after 'stepi'Andrew Burgess2-7/+44
There is an invalid assumption within 'maint info inline-frames' which triggers an assert: (gdb) stepi 0x000000000040119d 18 printf ("Hello World\n"); (gdb) maintenance info inline-frames ../../src/gdb/inline-frame.c:554: internal-error: maintenance_info_inline_frames: Assertion `it != inline_states.end ()' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. ----- Backtrace ----- ... etc ... The problem is this assert: /* Stopped threads always have cached inline_state information. */ gdb_assert (it != inline_states.end ()); If you check out infrun.c and look in handle_signal_stop for the call to skip_inline_frames then you'll find a rather large comment that explains that we don't always compute the inline state information for performance reasons. So the assertion is not valid. I've updated the code so that if there is cached information we use that, but if there is not then we just create our own information for the current $pc of the current thread. This means that, if there is cached information, GDB still correctly shows which frame the inferior is in (it might not be in the inner most frame). If there is no cached information we will always display the inferior as being in the inner most frame, but that's OK, because if skip_inline_frames has not been called then GDB will have told the user they are in the inner most frame, so everything lines up. I've extended the test to check 'maint info inline-frames' after a stepi which would previously have triggered the assertion.
2024-10-20Use std::make_unique in more placesTom Tromey11-31/+35
I searched for spots using ".reset (new ...)" and replaced most of these with std::make_unique. I think this is a bit cleaner and more idiomatic. Regression tested on x86-64 Fedora 40. Reviewed-By: Klaus Gerlicher<klaus.gerlicher@intel.com>
2024-10-20Report bfd_merge_sections errorAlan Modra3-10/+12
PR 32260 bfd/ * elfxx-target.h (bfd_elfNN_bfd_merge_sections): Default to bfd_generic_merge_sections when using the generic linker. * elflink.c (_bfd_elf_merge_sections): Return error from _bfd_merge_sections. Abort on wrong hash table. ld/ * ldlang.c (lang_process): Report bfd_merge_sections error.
2024-10-20Automatic date update in version.inGDB Administrator1-1/+1
2024-10-19Capture the current directory and debug directory in DWARF readerTom Tromey2-7/+18
This changes the DWARF reader to capture the current working directory and the current debug directory. This avoids races when the DWARF reader is working in the background. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31716
2024-10-19Add cwd paramter to openpTom Tromey2-5/+8
This patch adds a cwd paramter to openp, so that the current directory can be passed in by the caller. This is useful when background threads call this function -- they can then avoid using the global and thus avoid races with the user using "cd". Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31716
2024-10-19Pass current directory to gdb_abspathTom Tromey2-12/+12
Currently, gdb_abspath uses the current_directory global. However, background threads need to capture this global to avoid races with the user using "cd". This patch changes this function to accept a cwd parameter, in prepration for this. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31716
2024-10-19[gdbsupport] Add gdb::array_view::{iterator,const_iterator}Tom de Vries2-4/+42
While trying to substitute some std::vector type A in the code with a gdb::array_view: ... - using A = std::vector<T> + using A = gdb::array_view<T> .... I ran into the problem that the code was using A::iterator while gdb::array_view doesn't define such a type. Fix this by: - adding types gdb::array_view::iterator and gdb::array_view::const_iterator, - using them in gdb::array_view::(c)begin and gdb::array_view::(c)end, as is usual, and - using them explicitly in a unit test. Tested on aarch64-linux. Approved-By: Tom Tromey <tom@tromey.com>
2024-10-19[gdbsupport] Use std::span-style iterators for gdb::array_viewTom de Vries1-4/+4
There's a plan to replace gdb::array_view with std::span (PR31422), and making gdb::array_view more like std::span helps with that. One difference is that std::span has: ... constexpr iterator begin() const noexcept; constexpr const_iterator cbegin() const noexcept; ... while gdb::array_view has: ... constexpr T *begin () noexcept; constexpr const T *begin () const noexcept; ... Fix this by renaming the second variant to cbegin, and making the first variant const. Likewise for gdb::array_view::end. Tested on aarch64-linux. Approved-By: Tom Tromey <tom@tromey.com>
2024-10-19[gdb/guile, c++20] Work around Werror=volatile in libguile.hTom de Vries1-1/+8
When building gdb with -std=c++20, I run into: ... In file included from /usr/include/guile/2.0/libguile/__scm.h:479, from /usr/include/guile/2.0/libguile.h:31, from /data/vries/gdb/src/gdb/guile/guile-internal.h:30, from /data/vries/gdb/src/gdb/guile/guile.c:37: /usr/include/guile/2.0/libguile/gc.h: In function ‘scm_unused_struct* \ scm_cell(scm_t_bits, scm_t_bits)’: /usr/include/guile/2.0/libguile/tags.h:98:63: error: using value of \ assignment with ‘volatile’-qualified left operand is deprecated \ [-Werror=volatile] 98 | # define SCM_UNPACK(x) ((scm_t_bits) (0? (*(volatile SCM *)0=(x)): x)) | ~~~~~~~~~~~~~~~~~~~^~~~~ ... This was reported upstream [1]. Work around this by using SCM_DEBUG_TYPING_STRICTNESS == 0 instead of the default SCM_DEBUG_TYPING_STRICTNESS == 1. Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com> PR guile/30767 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30767 [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65333
2024-10-19[gdb/symtab] Skip local variables in cooked indexTom de Vries3-7/+66
Consider test-case gdb.dwarf2/local-var.exp. The corresponding source contains a function with a local variable: ... program test logical :: local_var local_var = .TRUE. end ... Currently, the local variable shows up in the cooked index: ... [2] ((cooked_index_entry *) 0xfffec40063b0) name: local_var canonical: local_var qualified: local_var DWARF tag: DW_TAG_variable flags: 0x2 [IS_STATIC] DIE offset: 0xa3 parent: ((cooked_index_entry *) 0xfffec4006380) [test] ... making the cooked index larger than necessary. Fix this by skipping it in cooked_indexer::index_dies. Tested on aarch64-linux. PR symtab/32276 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32276
2024-10-19Automatic date update in version.inGDB Administrator1-1/+1
2024-10-18Require a command argument in gdb.execute_miTom Tromey2-0/+11
Hannes pointed out that gdb.execute_mi() will crash. This patch fixes the bug. Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
2024-10-18x86: Regenerate missing table filesMayShao-oc3-4388/+4428
As soon as I committed Zhaoxin's patch, I realized that I did not include the regen file. Regenerate them and commit as obvious. opcodes/ChangeLog: * i386-tbl.h: Regenerated. * i386-mnem.h: Ditto. * i386-init.h: Ditto.
2024-10-18x86: Support x86 ZHAOXIN GMI instructionsMayShao-oc10-3/+84
gas/ChangeLog: * NEWS: Support ZHAOXIN GMI instructions. * config/tc-i386.c: Add gmi. * doc/c-i386.texi: Document gmi. * testsuite/gas/i386/i386.exp: Add gmi test. * testsuite/gas/i386/gmi.d: Ditto. * testsuite/gas/i386/gmi.s: Ditto. opcodes/ChangeLog: * i386-dis.c: New comment. * i386-gen.c: Add gmi. * i386-opc.h (CpuGMI): New. * i386-opc.tbl: Add Zhaoxin GMI instructions. * i386-tbl.h: Regenerated. * i386-mnem.h: Ditto. * i386-init.h: Ditto.
2024-10-17gprofng: fix a memory leak in the mxv-pthreads exampleRuud van der Pas3-11/+18
Fix a bug where the main program does not free the rows of the matrix. The memory for thread_data_arguments is also not released. In function check_results, the memory for the marker vector is not released. The usage of the verbose veriable has been extended to print more messages. gprofng/ChangeLog 2024-10-16 Ruud van der Pas <ruud.vanderpas@oracle.com> PR 32273 PR 32274 * mxv-pthreads/src/main.c: add calls to free() to release the memory allocated for array A and vector marker. Improve the usage of the verbose variable. * mxv-pthreads/src/manage_data.c: add a diagnostic printf statement. * mxv-pthreads/src/mydefs.h: adapt prototype to match the changes in main.c.
2024-10-18Automatic date update in version.inGDB Administrator1-1/+1
2024-10-18[gdb] Handle bad alloc handling in gdb_bfd_openTom de Vries1-7/+8
Say we simulate a bad alloc in gdb_bfd_init_data: ... + { + static bool throw_bad_alloc = true; + if (throw_bad_alloc) + { + throw_bad_alloc = false; + + va_list dummy; + throw gdb_quit_bad_alloc (gdb_exception_quit ("bad alloc", dummy)); + } + } gdata = new gdb_bfd_data (abfd, st); ... That works out fine for doing "file a.out" once: ... $ gdb -q -batch -ex "file a.out" bad alloc $ ... but doing so twice get us: ... $ gdb -q -batch -ex "file a.out" -ex "file a.out" bad alloc Fatal signal: Segmentation fault ----- Backtrace ----- 0x5183f7 gdb_internal_backtrace_1 /home/vries/gdb/src/gdb/bt-utils.c:121 0x5183f7 _Z22gdb_internal_backtracev /home/vries/gdb/src/gdb/bt-utils.c:167 0x62329b handle_fatal_signal /home/vries/gdb/src/gdb/event-top.c:917 0x6233ef handle_sigsegv /home/vries/gdb/src/gdb/event-top.c:990 0xfffeffba483f ??? 0x65554c eq_bfd /home/vries/gdb/src/gdb/gdb_bfd.c:231 0xeaca77 htab_find_with_hash /home/vries/gdb/src/libiberty/hashtab.c:597 0x657487 _Z12gdb_bfd_openPKcS0_ib /home/vries/gdb/src/gdb/gdb_bfd.c:580 0x6272d7 _Z16exec_file_attachPKci /home/vries/gdb/src/gdb/exec.c:451 0x627e67 exec_file_command /home/vries/gdb/src/gdb/exec.c:550 0x627f23 file_command /home/vries/gdb/src/gdb/exec.c:565 Segmentation fault (core dumped) $ ... The problem is in gdb_bfd_open, where we insert abfd into gdb_bfd_cache: ... if (bfd_sharing) { slot = htab_find_slot_with_hash (gdb_bfd_cache, &search, hash, INSERT); gdb_assert (!*slot); *slot = abfd; } gdb_bfd_init_data (abfd, &st); ... while the bad alloc means that gdb_bfd_init_data is interrupted and abfd is not properly initialized. Fix this by reversing the order, inserting abfd into gdb_bfd_cache only after a successful call to gdb_bfd_init_data, such that we get: ... $ gdb -q -batch -ex "file a.out" -ex "file a.out" bad alloc $ ... Tested on aarch64-linux. Approved-By: Tom Tromey <tom@tromey.com>
2024-10-18[gdb/build] Use -fno-hoist-adjacent-loads for gcc <= 13Tom de Vries1-0/+7
When building gdb with gcc 12 and -fsanitize=threads while renabling background dwarf reading by setting dwarf_synchronous to false, I run into: ... (gdb) file amd64-watchpoint-downgrade Reading symbols from amd64-watchpoint-downgrade... (gdb) watch global_var ================== WARNING: ThreadSanitizer: data race (pid=20124) Read of size 8 at 0x7b80000500d8 by main thread: #0 cooked_index_entry::full_name(obstack*, bool) const cooked-index.c:220 #1 cooked_index::get_main_name(obstack*, language*) const cooked-index.c:735 #2 cooked_index_worker::wait(cooked_state, bool) cooked-index.c:559 #3 cooked_index::wait(cooked_state, bool) cooked-index.c:631 #4 cooked_index_functions::wait(objfile*, bool) cooked-index.h:729 #5 cooked_index_functions::compute_main_name(objfile*) cooked-index.h:806 #6 objfile::compute_main_name() symfile-debug.c:461 #7 find_main_name symtab.c:6503 #8 main_language() symtab.c:6608 #9 set_initial_language_callback symfile.c:1634 #10 get_current_language() language.c:96 ... Previous write of size 8 at 0x7b80000500d8 by thread T1: #0 cooked_index_shard::finalize(parent_map_map const*) \ dwarf2/cooked-index.c:409 #1 operator() cooked-index.c:663 ... ... SUMMARY: ThreadSanitizer: data race cooked-index.c:220 in \ cooked_index_entry::full_name(obstack*, bool) const ================== Hardware watchpoint 1: global_var (gdb) PASS: gdb.arch/amd64-watchpoint-downgrade.exp: watch global_var ... This was also reported in PR31715. This is due do gcc PR110799 [1], generating wrong code with -fhoist-adjacent-loads, and causing a false positive for -fsanitize=threads. Work around the gcc PR by forcing -fno-hoist-adjacent-loads for gcc <= 13 and -fsanitize=threads. Tested in that same configuration on x86_64-linux. Remaining ThreadSanitizer problems are the ones reported in PR31626 (gdb.rust/dwindex.exp) and PR32247 (gdb.trace/basic-libipa.exp). PR gdb/31715 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31715 Tested-By: Bernd Edlinger <bernd.edlinger@hotmail.de> Approved-By: Tom Tromey <tom@tromey.com> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110799
2024-10-18[gdb/symtab] Fix qualified name for cooked index dumpTom de Vries2-6/+13
While looking at the cooked index entry for local variable l4 of function test in test-case gdb.fortran/logical.exp: ... $ gdb -q -batch outputs/gdb.fortran/logical/logical \ -ex "maint print objfiles" ... [9] ((cooked_index_entry *) 0x7fc6e0003010) name: l4 canonical: l4 qualified: l4 DWARF tag: DW_TAG_variable flags: 0x2 [IS_STATIC] DIE offset: 0x17c parent: ((cooked_index_entry *) 0x7fc6e0002f20) [test] ... I noticed that while the entry does have a parent, that's not reflected in the qualified name. This makes it harder to write test-cases that check the parent of a cooked index entry. This is due to the implementation of full_name, which skips printing parents if the language does not specify an appropriate separator. Fix this by using "::" as default separator, getting us instead: ... [9] ((cooked_index_entry *) 0x7f94ec0040c0) name: l4 canonical: l4 qualified: test::l4 DWARF tag: DW_TAG_variable flags: 0x2 [IS_STATIC] DIE offset: 0x17c parent: ((cooked_index_entry *) 0x7f94ec003fd0) [test] ... Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com>
2024-10-17gprofng: fix regression in man page installationVladimir Mezentsev2-17/+22
gprofng/ChangeLog 2024-10-14 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> * doc/Makefile.am: Use install-data-local to install gprofng examples. * doc/Makefile.in: Rebuild.
2024-10-17Fix for -Wstringop-overflow false positiveMichael Matz1-2/+2
the way the overflow check was written wasn't understood by some GCC versions and produced false positives for the memset call being called potentially with object sizes that are larger than half address-space.
2024-10-17PR32260: Improve error handling on string mergingMichael Matz1-13/+25
if the input sections are near the max supported size (4G) we might fail to enlarge the hash table. The error handling for this case didn't quite work. When this happens we can gracefully fall back to just not deduplicate this section (and continue with further mergable sections). We were mixing that with the case of not being able to even allocate a small structure (in which case we can as well error out completely), this disentables both cases. bfd/ PR ld/32260 * merge.c (sec_merge_maybe_resize): Check overflow in ultimate target type. (record_section): Return three-state, use new state when unable to enlarge hash table. (_bfd_merge_sections): Remove current section from merging consideration when hashtable can't be enlarged.
2024-10-17[gdb/testsuite] Fix gdb.ada/fixed_points.exp for gcc < 10Tom de Vries1-1/+1
When running test-case gdb.ada/fixed_points.exp with system gcc 7, I run into: ... (gdb) PASS: gdb.ada/fixed_points.exp: scenario=all: print fp4_var / 1 get_compiler_info: gcc-7-5-0 p Float(Another_Fixed) = Float(Another_Delta * 5)^M No definition of "another_delta" in current context.^M (gdb) FAIL: gdb.ada/fixed_points.exp: scenario=all: value of another_fixed ... This is a regression since commit 1411185a57e ("Introduce and use gnat_version_compare"), which did: ... # This failed before GCC 10. - if {$scenario == "all" && [test_compiler_info {gcc-10-*}]} { + if {$scenario == "all" && [gnat_version_compare < 10]} { gdb_test "p Float(Another_Fixed) = Float(Another_Delta * 5)" "true" \ "value of another_fixed" } ... Fix this by using gnat_version_compare >= 10 instead. Tested on x86_64-linux, with gcc 7 - 13.
2024-10-17LoongArch: Check PC-relative relocations for shared librariesLulu Cai11-0/+80
Building shared libraries should not be allowed for PC-relative relocations against external symbols. Currently LoongArch has no corresponding checks and silently generates wrong shared libraries. However, In the first version of the medium cmodel, pcalau12i+jirl was used for function calls, in which case PC-relative relocations were allowed.
2024-10-17Add myself to gdb/MAINTAINERSkamathforaix1-0/+1
2024-10-17Automatic date update in version.inGDB Administrator1-1/+1
2024-10-16gprofng: use xmalloc/xrealloc/xcalloc/xstrdup/xstrndup from libibertyAndreas Schwab43-497/+356
PR gprofng/32241 * src/Makefile.am (CSOURCES): Remove dbe_memmgr.c * src/Makefile.in: Regenerate. * src/dbe_memmgr.c: Remove. * src/gprofng.cc (main): Call xmalloc_set_program_name. * src/gp-archive.cc (main): Likewise. * src/gp-collect-app.cc (main): Likewise. * src/gp-display-src.cc (main): Likewise. * src/gp-display-text.cc (main): Likewise. * src/Application.cc: Use xmalloc, xrealloc, xcalloc, xstrdup, xstrndup instead of malloc, realloc, calloc, strdup, strndup. * src/BaseMetric.cc: Likewise. * src/CallStack.cc: Likewise. * src/ClassFile.cc: Likewise. * src/Data_window.cc: Likewise. * src/Dbe.cc: Likewise. * src/DbeJarFile.cc: Likewise. * src/DbeSession.cc: Likewise. * src/DbeView.cc: Likewise. * src/DerivedMetrics.cc: Likewise. * src/DwarfLib.cc: Likewise. * src/Elf.cc: Likewise. * src/Emsg.cc: Likewise. * src/Experiment.cc: Likewise. * src/Function.cc: Likewise. * src/Module.cc: Likewise. * src/Print.cc: Likewise. * src/QLParser.yy: Likewise. * src/SAXParserFactory.cc: Likewise. * src/Settings.cc: Likewise. * src/SourceFile.cc: Likewise. * src/StringBuilder.cc: Likewise. * src/StringMap.h: Likewise. * src/Table.cc: Likewise. * src/checks.cc: Likewise. * src/collctrl.cc: Likewise. * src/comp_com.c: Likewise. * src/count.cc: Likewise. * src/envsets.cc: Likewise. * src/gp-archive.cc: Likewise. * src/gp-display-src.cc: Likewise. * src/gp-display-text.cc: Likewise. * src/gprofng.cc: Likewise. * src/ipc.cc: Likewise. * src/ipcio.cc: Likewise. * src/vec.h: Likewise. * src/util.cc: Likewise. (get_prog_name): Remove. * src/util.h: Likewise. * src/dbe_hwc.h (malloc, realloc, calloc, strdup): Define.
2024-10-16Assertion fail at peicode.h:607Alan Modra1-2/+2
This is the assertion that vars->string_ptr < vars->end_string_ptr, ie. when it fails we've overflowed the string buffer area. Caused by allocating space for import_name but writing symbol_name, and they can be different. * peicode.h (SIZEOF_ILF_STRINGS): Revert 042f14505e change.
2024-10-16Add noxfail option to run_dump_testAlan Modra3-3/+14
The noxfail option is useful in situations like pr23658-1e which fails on all microblaze ELF targets except microblaze-linux. This was possible to handle by writing a small proc and use that as an xfail predicate, or painstakingly listing all microblaze ELF targets, but this is simpler. The patch also fixes some other FAILs and XPASSes of the pr23658 tests. binutils/ * testsuite/lib/binutils-common.exp (run_dump_test): Support noxfail. ld/ * testsuite/ld-elf/pr23658-1a.d: Don't xfail m68hc12. * testsuite/ld-elf/pr23658-1e.d: Likewise. xfail xstormy16 and correct microblaze xfails.
2024-10-16PR32266, segv when linking libclang_rt.asan-powerpc64.soAlan Modra5-96/+90
Change the mmap support added with commit 9ba56acee518 to always mmap memory with PROT_READ | PROT_WRITE. Prior to that commit most file contents were read into a buffer allocated with bfd_alloc or bfd_malloc and thus the memory was read/write. Even after that commit any section contents with relocations must be read/write to apply the relocs. Making them all read/write is not a major change, and it should not introduce any measurable linker slowdown for contents that are not modified. More importantly, it removes a BFD behaviour difference that only triggers when large files are involved. PR 32266 PR 32109 * libbfd.c (bfd_mmap_local): Remove prot param. Always mmap with PROT_READ | PROT_WRITE. Adjust all calls. (_bfd_mmap_temporary): Rename from _bfd_mmap_readonly_temporary. (_bfd_munmap_temporary): Rename from _bfd_munmap_readonly_temporary. _bfd_mmap_persistent): Rename from _bfd_mmap_readonly_persistent. (_bfd_generic_get_section_contents): Use PROT_READ | PROT_WRITE regardless of relocs. * libbfd-in.h: Update decls to suit. Make non-USE_MMAP variants static inline functions. * elflink.c: Update all uses of _bfd_mmap functions. * elf.c: Likewise. (bfd_elf_get_str_section): Revert commit 656f8fbaae. * libbfd.h: Regenerate.
2024-10-16Support Intel AVX10.2 convert instructionsLiwei Xu20-1996/+3780
In this patch, we will support AVX10.2 convert instructions. All of them are new instruction forms. Among all the instructions, vcvtbiasph2[b,h]f8[,s] needs extra care. Since Operand 2 could indicate memory size, we do not need suffix under ATTmode. However, we could not fold all three templates but only XMM/YMM since the dst operand size are the same for them. Also, a new iterator <cvt8> is added to reduce redundancy. gas/ * testsuite/gas/i386/i386.exp: Add AVX10.2 tests. * testsuite/gas/i386/x86-64.exp: Ditto. * testsuite/gas/i386/avx10_2-256-cvt-intel.d: New. * testsuite/gas/i386/avx10_2-256-cvt.d: Ditto. * testsuite/gas/i386/avx10_2-256-cvt.s: Ditto. * testsuite/gas/i386/avx10_2-512-cvt-intel.d: Ditto. * testsuite/gas/i386/avx10_2-512-cvt.d: Ditto. * testsuite/gas/i386/avx10_2-512-cvt.s: Ditto. * testsuite/gas/i386/x86-64-avx10_2-256-cvt-intel.d: Ditto. * testsuite/gas/i386/x86-64-avx10_2-256-cvt.d: Ditto. * testsuite/gas/i386/x86-64-avx10_2-256-cvt.s: Ditto. * testsuite/gas/i386/x86-64-avx10_2-512-cvt-intel.d: Ditto. * testsuite/gas/i386/x86-64-avx10_2-512-cvt.d: Ditto. * testsuite/gas/i386/x86-64-avx10_2-512-cvt.s: Ditto. opcodes/ * i386-dis-evex-prefix.h: Add PREFIX_EVEX_0F3874, PREFIX_EVEX_MAP5_18, PREFIX_EVEX_MAP5_1B, PREFIX_EVEX_MAP5_1E and PREFIX_EVEX_MAP5_74. * i386-dis-evex.h: Add table pass for AVX10.2 instructions. * i386-dis.c (MOD_EVEX_0F38B1): New. (PREFIX_EVEX_0F3874): Ditto. (PREFIX_EVEX_MAP5_18): Ditto. (PREFIX_EVEX_MAP5_1B): Ditto. (PREFIX_EVEX_MAP5_1E): Ditto. (PREFIX_EVEX_MAP5_74): Ditto. * i386-opc.tbl: Add AVX10.2 instructions. * i386-mnem.h: Regenerated. * i386-tbl.h: Ditto. Co-authored-by: Kong Lingling <lingling.kong@intel.com> Co-authored-by: Haochen Jiang <haochen.jiang@intel.com>
2024-10-16Automatic date update in version.inGDB Administrator1-1/+1
2024-10-15Introduce and use gnat_version_compareTom Tromey15-25/+55
While testing a modified GNAT, I found that this test in fun_renaming.exp was returning 0 for GCC 13: if {[test_compiler_info {gcc-6*}]} This patch introduces a new, more robust way to check the GNAT compiler version, and changes the gda.ada tests to use it. A small update to version_compare was also needed. Note that, in its current form, this new code won't really interact well with non-GCC compilers (specifically gnat-llvm). This doesn't seem like a major issue at this point, though, because gnat-llvm doesn't properly emit debuginfo yet, and when it does, more changes will be needed in these tests anyway. Reviewed-by: Keith Seitz <keiths@redhat.com>
2024-10-15LoongArch: Add more relaxation support for call36mengqinggang4-3/+190
Add relaxation support for call36 that jump to PLT entry. Add relaxation support for call36 with IFUNC symbol. Add relaxation support for call36 that jump to undefweak symbol. For undefweak symbol, it can always be relaxed if it have no PLT entry. Because we set the address of undefweak symbol without PLT entry to PC like relocate_section.
2024-10-15LoongArch: Optimize the relaxation processmengqinggang1-142/+139
The symbol value is only calculated when the relocation can be relaxed.
2024-10-15x86: Refine instruction check in x86_check_tls_relocationCui, Lili1-10/+11
gas/ChangeLog: * config/tc-i386.c (x86_check_tls_relocation): Refine instruction check.
2024-10-15x86/testsuite: Rename AVX10.2 media testcasesHaochen Jiang14-12/+12
Change these testcase name to make them clearer. gas/ChangeLog: * testsuite/gas/i386/avx10_2-256-1-intel.d: Renamed to... * testsuite/gas/i386/avx10_2-256-media-intel.d: ...this. * testsuite/gas/i386/avx10_2-256-1.d: Renamed to... * testsuite/gas/i386/avx10_2-256-media.d: ...this. * testsuite/gas/i386/avx10_2-256-1.s: Renamed to... * testsuite/gas/i386/avx10_2-256-media.s: ...this. * testsuite/gas/i386/avx10_2-512-1-intel.d: Renamed to... * testsuite/gas/i386/avx10_2-512-media-intel.d: ...this. * testsuite/gas/i386/avx10_2-512-1.d: Renamed to... * testsuite/gas/i386/avx10_2-512-media.d: ...this. * testsuite/gas/i386/avx10_2-512-1.s: Renamed to... * testsuite/gas/i386/avx10_2-512-media.s: ...this. * testsuite/gas/i386/x86-64-avx10_2-256-1-intel.d: Renamed to... * testsuite/gas/i386/x86-64-avx10_2-256-media-intel.d: ...this. * testsuite/gas/i386/x86-64-avx10_2-256-1.d: Renamed to... * testsuite/gas/i386/x86-64-avx10_2-256-media.d: ...this. * testsuite/gas/i386/x86-64-avx10_2-256-1.s: Renamed to... * testsuite/gas/i386/x86-64-avx10_2-256-media.s: ...this. * testsuite/gas/i386/x86-64-avx10_2-512-1-intel.d: Renamed to... * testsuite/gas/i386/x86-64-avx10_2-512-media-intel.d: ...this. * testsuite/gas/i386/x86-64-avx10_2-512-1.d: Renamed to... * testsuite/gas/i386/x86-64-avx10_2-512-media.d: ...this. * testsuite/gas/i386/x86-64-avx10_2-512-1.s: Renamed to... * testsuite/gas/i386/x86-64-avx10_2-512-media.s: ...this. * testsuite/gas/i386/i386.exp: Change testcase name. * testsuite/gas/i386/x86-64.exp: Ditto.
2024-10-15Automatic date update in version.inGDB Administrator1-1/+1
2024-10-14gdb/testsuite: fix gdb.multi/inferior-specific-bp.expGuinevere Larsen1-1/+2
A recent commit, "16a6f7d2ee3 gdb: avoid breakpoint::clear_locations calls in update_breakpoint_locations", started checking if GDB correctly relocates a breakpoint from inferior 1's declaration of the function "bar" to inferior 2's declaration. Unfortunately, inferior 2 never calls bar in its regular execution, and because of that, clang would optimize that whole function away, making it so there is no location for the breakpoint to be relocated to. This commit changes the .c file so that the function is not optimized away and the test fully passes with clang. It is important to actually call bar instead of using __attribute__((used)) because the latter causes the breakpoint locations to be inverted, 3.1 belongs to inferior 2 and 3.2 belongs to inferior 1, which will cause an unrelated failure. Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-10-14ia64/ELF: fix HPUX testsuite falloutJan Beulich3-13/+13
... from 1f1b5e506bf0 ("bfd/ELF: restrict file alignment for object files"), as noticed / reported by Alan.
2024-10-14x86: also template-expand trailing mnemonic partJan Beulich1-60/+72
So far template expansion was limited to fields other than the insn mnemonic. In order to be able to use <fop> also for AVX10.2 we want the trailing mnemonic part to also be expanded. Split out the respective piece of code into a helper function, which is then invoked twice.
2024-10-14gas: drop SKIP_WHITESPACE_AFTER_NAME()Jan Beulich21-98/+85
Exclusively all users should use restore_line_pointer() instead, at which point SKIP_WHITESPACE() suffices as a check afterwards.
2024-10-14gdb: make frame_unwind_try_unwinder return boolGuinevere Larsen1-6/+6
Before this commit, the function frame_unwind_try_unwinder would return an int, where 1 meant the unwinder works, and 0 it doesn't. This is just a boolean with extra steps, so this commit updates the function to return bool instead.
2024-10-14LoongArch: Fixed R_LARCH_[32/64]_PCREL generation bugLulu Cai4-2/+22
The enum BFD_RELOC_[32/64] was mistakenly used in the macro instead of the relocation in fixp. This can cause the second relocation of a pair to be deleted when -mthin-add-sub is enabled. Apply the correct macro to fix this. Also sets the initial value of -mthin-add-sub.
2024-10-14Automatic date update in version.inGDB Administrator1-1/+1