aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-08-30Revert "Gold/MIPS: Drop mips*le/mips*el* triple pattern"Maciej W. Rozycki1-1/+1
This reverts commit adb3ae2eba78b4b84d7b94342f6774b250190a98. It was applied unapproved.
2023-08-30Revert "Gold/MIPS: Add targ_extra_size=64 for mips32 triples"Maciej W. Rozycki1-2/+0
This reverts commit d6cdc0af2b880bb48dd16055f4cb3509c7a2da70. It was applied unapproved.
2023-08-30Revert "Gold/MIPS: Add mips64*/mips64*el triple support"Maciej W. Rozycki1-16/+0
This reverts commit 5c4cdba100b66e2924a25dad9b12d8e5b84d527f. It was applied unapproved.
2023-08-30Revert "MIPS: Use 64-bit a ABI by default for `mipsisa64*-*-linux*' targets"Maciej W. Rozycki5-18/+16
This reverts commit 025e84f93566c8ced594ef48ddee1dec7e5b4cdd. It was applied unapproved.
2023-08-30gdbserver, linux-low: add a couple of nullptr assertions.Willgerodt, Felix1-0/+4
This safeguards a couple of places that may theoretically return NULL but must not in this specific context. These were found by a static analysis tool. Approved-By: Tom Tromey <tom@tromey.com>
2023-08-30RISC-V: Make XVentanaCondOps RV64 onlyTsukasa OI3-2/+8
Although XVentanaCondOps instructions are XLEN-agonistic, Ventana's manual only defines them only for RV64 (because all Ventana's processors implement RV64). This commit limits XVentanaCondOps instructions RV64-only to match the behavior of the manual and LLVM. Note that this commit alone will not make XVentanaCondOps extension with RV32 invalid (it just makes XVentanaCondOps on RV32 empty). opcodes/ChangeLog: * riscv-opc.c (riscv_opcodes): Restrict "vt.maskc" and "vt.maskcn" to XLEN=64. gas/ChangeLog: * testsuite/gas/riscv/x-ventana-condops-32.d: New failure test. * testsuite/gas/riscv/x-ventana-condops-32.l: Likewise.
2023-08-30objdump: Free sorted_syms on error pathAlan Modra1-0/+1
* objdump.c (disassemble_data): Free sorted_syms before returning.
2023-08-30binutils/dwarf.c abbrev list leakAlan Modra1-1/+7
* dwarf.c (process_debug_info): Call free_abrev_list on return paths.
2023-08-30Re: readelf/objdump: Handle DWARF info with mixed types of range sectionAlan Modra1-1/+4
PR 30791 * dwarf.c (free_debug_information): Free range_versions.
2023-08-30Automatic date update in version.inGDB Administrator1-1/+1
2023-08-29[gdb/build] Fix C inclusion of nat/x86-cpuid.hTom de Vries1-0/+12
When running test-case gdb.arch/i386-avx512.exp, I run into: ... gdb compile failed, In file included from gdb.arch/i386-avx512.c:20:0: src/gdb/nat/x86-cpuid.h: In function 'x86_cpuid_count': src/gdb/nat/x86-cpuid.h:63:16: error: \ 'nullptr' undeclared (first use in this function) if (__eax == nullptr) ^~~~~~~ src/gdb/nat/x86-cpuid.h:63:16: note: each \ undeclared identifier is reported only once for each function it appears in === gdb Summary === # of untested testcases 1 ... This is due to commit e85aad4ae76 ("nat/x86-cpuid.h: Add x86_cpuid_count wrapper around __get_cpuid_count"), which introduced the nullptr check. The header file gdb/nat/x86-cpuid.h is a file that is included in the build and compiled as a C++ file, but also in the testsuite and compiled as a C file. Fix this by replacing nullptr with (void *)0. Tested on x86_64-linux. Co-Authored-By: Kevin Buettner <kevinb@redhat.com> Approved-by: Kevin Buettner <kevinb@redhat.com>
2023-08-29More renames in array_operation::evaluateTom Tromey1-4/+3
array_operation::evaluate has variables named "tem2" and "tem3". This patch replaces one with a better name, and entirely removes the other. Reviewed-by: John Baldwin <jhb@FreeBSD.org> Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-29Remove "highbound" parameter from value_arrayTom Tromey4-19/+12
value_array requires the passed-in bounds to match the length of the array_view it is given. This patch removes the redundant "highbound" parameter. Reviewed-by: John Baldwin <jhb@FreeBSD.org> Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-29Remove another redundant variable from array_operation::evaluateTom Tromey1-8/+4
This removes yet another redundant variable from array_operation::evaluate -- only one index is needed. Reviewed-by: John Baldwin <jhb@FreeBSD.org> Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-29Remove redundant variable from array_operation::evaluateTom Tromey1-3/+2
In array_operation::evaluate, 'idx' and 'tem' are redundant in one branch. This patch merges them, using the clearer name. Reviewed-by: John Baldwin <jhb@FreeBSD.org> Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-29Hoist array bounds check in array_operation::evaluateTom Tromey1-3/+2
This hoists the array bounds check in array_operation::evaluate to before the loop. Reviewed-by: John Baldwin <jhb@FreeBSD.org> Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-29Declare 'tem' in loop header in array_operation::evaluateTom Tromey1-5/+4
This changes array_operation::evaluate to declare the 'tem' variable in the loop header, rather than at the top of the function. This is cleaner and easier to reason about. I also changed 'nargs' to be 'const'. Reviewed-by: John Baldwin <jhb@FreeBSD.org> Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-29Use gdb::array_view for value_arrayTom Tromey4-4/+5
This changes value_array to accept an array view. I also replaced an alloca with a std::vector in array_operation::evaluate. This function can work on any size of array, so it seems bad to use alloca. Reviewed-by: John Baldwin <jhb@FreeBSD.org> Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-29gdb/testsuite: recognize one more unsupported instruction in ↵Simon Marchi1-0/+3
gdb.reverse/step-precsave.exp When running this test on a processor that supports AVX512 (AMD EPYC 9634) on Debian 12 bookwork (system compiler is gcc 12.2.0), I see: continue^M Continuing.^M Process record does not support instruction bound.^M Process record does not support instruction 0x62 at address 0x7ffff7f49b40.^M Process record: failed to record execution log.^M ^M Program stopped.^M 0x00007ffff7f49b40 in ?? () from /lib/x86_64-linux-gnu/libc.so.6^M (gdb) FAIL: gdb.reverse/step-precsave.exp: run to end of main The instruction at this address is: 0x00007ffff7f49b40: 62 e2 7d 48 7a c6 vpbroadcastb %esi,%zmm16 This seems like an AVX512 instruction (given the use of zmm16). Match this byte value in order to produce a KFAIL. Change-Id: I1d20357fa538ba60b9c537160acf511a37d751ee Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30807 Approved-By: Tom Tromey <tom@tromey.com>
2023-08-29[gdb/testsuite] Require have_compile_flag -mavx512f in gdb.arch/i386-avx512.expTom de Vries1-0/+1
When running test-case gdb.arch/i386-avx512.exp with gcc 4.8.4, I run into: ... Running gdb.arch/i386-avx512.exp ... gdb compile failed, gcc: error: unrecognized command line option '-mavx512f' ... Fix this by requiring have_compile_flag -mavx512f. Tested on x86_64-linux.
2023-08-29[gdb/testsuite] Require gcc >= 5 in gdb.linespec/cpls-abi-tag.expTom de Vries1-0/+8
When running test-case gdb.linespec/cpls-abi-tag.exp with gcc 4.8.4, we run into: ... cpls-abi-tag.cc:71:26: error: ‘abi_tag’ attribute applied to non-function ‘s’ ABI3 test_abi_tag_struct s; ^ ... The test-case is supported starting gcc 5. Fix this by requiring gcc >= 5, if a gcc compiler is used. Tested on x86_64-linux.
2023-08-29[gdb/testsuite] Handle some test-cases with older compilerTom de Vries5-5/+23
When running test-case gdb.mi/print-simple-values.exp with gcc 4.8.4, I run into a compilation failure due to the test-case requiring c++11 and the compiler defaulting to less than that. Fix this by compiling with -std=c++11. Likewise in a few other test-cases. Tested on x86_64-linux.
2023-08-29[gdb/testsuite] Fix false negative in have_host_localeTom de Vries1-0/+2
In test-case gdb.tui/pr30056.exp we check for: ... require {have_host_locale C.UTF-8} ... The "C.UTF-8" is normalized by have_host_locale to "c.utf8", before trying to find it in the list returned by host_locales. On my development platform, "locale -a" lists C.utf8, which is normalized to "c.utf8" by host_locales, so there's a match and have_host_locale returns true. On another platform however, "locale -a" lists C.UTF-8, which is normalized to "c.utf-8" by host_locales, so there's no match and have_host_locale returns false. Fix this by also dropping the dash in host_locales. Tested on x86_64-linux.
2023-08-29readelf: typos in user messagesNicolas Boulenguez1-2/+2
2023-08-29Default getpkt 'forever' parameter to 'false'Tom Tromey1-80/+81
This patch changes remote.c so that the getpkt 'forever' parameter now defaults to 'false' and fixes up all the callers. Reviewed-by: John Baldwin <jhb@FreeBSD.org>
2023-08-29Unify getpkt and getpkt_or_notif_saneTom Tromey1-30/+5
getpkt and getpkt_or_notif_sane are just wrappers for getpkt_or_notif_sane_1. This patch adds the is_notif parameter to getpkt, with a suitable default, and removes the wrappers. Reviewed-by: John Baldwin <jhb@FreeBSD.org>
2023-08-29Use bool in getpktTom Tromey1-102/+102
This changes getpkt and related functions to use bool rather than int. Reviewed-by: John Baldwin <jhb@FreeBSD.org>
2023-08-29Remove expecting_notif parameter from getpkt_or_notif_sane_1Tom Tromey1-11/+12
For getpkt_or_notif_sane_1, expecting_notif is redundant, because it always reflects whether the is_notif parameter is non-NULL. This patch removes the redundant parameter. Reviewed-by: John Baldwin <jhb@FreeBSD.org>
2023-08-29Remove getpkt_saneTom Tromey1-26/+14
I noticed that getpkt is just a wrapper around getpk_sane, so this patch unifies the two of them. Reviewed-by: John Baldwin <jhb@FreeBSD.org>
2023-08-29[gdb/testsuite] Check for sys/random.h in gdb.reverse/getrandom.expTom de Vries2-0/+9
When running test-case gdb.reverse/getrandom.exp on a system with eglibc 2.19, we run into: ... gdb compile failed, gdb.reverse/getrandom.c:18:24: fatal error: \ sys/random.h: No such file or directory #include <sys/random.h> ^ compilation terminated. === gdb Summary === # of untested testcases 1 ... and: ... UNTESTED: gdb.reverse/getrandom.exp: failed to prepare ... Fix this by testing for the presence of the header, such that we have instead: ... UNSUPPORTED: gdb.reverse/getrandom.exp: require failed: \ have_system_header sys/random.h ... Tested on x86_64-linux and i686-linux.
2023-08-29Automatic date update in version.inGDB Administrator1-1/+1
2023-08-28[gdb/testsuite] Improve xfail in gdb.cp/nsusing.expTom de Vries1-4/+16
In test-case gdb.cp/nsusing.exp I came across these xfails without PRMS mentioned: ... XFAIL: gdb.cp/nsusing.exp: print x, before using statement XFAIL: gdb.cp/nsusing.exp: print x, only using M ... Add the missing PRMS, such that we have: ... XFAIL: gdb.cp/nsusing.exp: print x, before using statement (PRMS gcc/108716) XFAIL: gdb.cp/nsusing.exp: print x, only using M (PRMS gcc/108716) ... and limit the xfail to unfixed versions. The PR is fixed starting gcc 13, but it has been backported to release branches stretching back to gcc 10. For simplicity we just stick to testing for the major version and ignore the backported fixes. Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com>
2023-08-28gdbserver: Fix style of struct declarations in i387-fp.ccJohn Baldwin1-3/+6
2023-08-28gdbserver: Simplify handling of ZMM registers.John Baldwin1-81/+41
- Reuse num_xmm_registers directly for the count of ZMM0-15 registers as is already done for the YMM registers for AVX rather than using a new variable that is always the same. - Replace 3 identical variables for the count of upper ZMM16-31 registers with a single variable. Make use of this to merge various loops working on the ZMM XSAVE region so that all of the handling for the various sub-registers in this region are always handled in a single loop. - While here, fix some bugs in i387_cache_to_xsave where if X86_XSTATE_ZMM was set on i386 (e.g. a 32-bit process on a 64-bit kernel), the -1 register nums would wrap around and store the value of GPRs in the XSAVE area. This should be harmless, but is definitely odd. Instead, check num_zmm_high_registers directly when checking X86_XSTATE_ZMM and skip the ZMM region handling entirely if the register count is 0. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-28x86: Remove X86_XSTATE_SIZE and related constants.John Baldwin1-12/+0
Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-28gdbserver: Use x86_xstate_layout to parse the XSAVE extended state area.Aleksandar Paunovic1-51/+74
Replace the extended state area fields of i387_xsave with methods which return an offset into the XSAVE buffer. The two changed functions are called within all tests which runs gdbserver. Signed-off-by: Aleksandar Paunovic <aleksandar.paunovic@intel.com> Co-authored-by: John Baldwin <jhb@FreeBSD.org> Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-28gdbserver: Refactor the legacy region within the xsave structAleksandar Paunovic1-25/+2
Legacy fields of the XSAVE area are already defined within fx_save struct. Use class inheritance to remove code duplication. The two changed functions are called within all tests which run gdbserver. Signed-off-by: Aleksandar Paunovic <aleksandar.paunovic@intel.com> Co-authored-by: John Baldwin <jhb@FreeBSD.org> Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-28gdbserver: Add a function to set the XSAVE mask and size.John Baldwin4-11/+31
Make x86_xcr0 private to i387-fp.cc and use i387_set_xsave_mask to set the value instead. Add a static global instance of x86_xsave_layout and initialize it in the new function as well to be used in a future commit to parse XSAVE extended state regions. Update the Linux port to use this function rather than setting x86_xcr0 directly. In the case that XML is not supported, don't bother setting x86_xcr0 to the default value but just omit the call to i387_set_xsave_mask as i387-fp.cc defaults to the SSE case used for non-XML. In addition, use x86_xsave_length to determine the size of the XSAVE register set via CPUID. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-28gdb: Use x86_xstate_layout to parse the XSAVE extended state area.John Baldwin2-190/+278
All of the tables describing the offsets of individual registers for XSAVE state components now hold relative offsets rather than absolute offsets. Some tables (those for MPX registers and ZMMH registers) had to be split into separate tables as they held entries that spanned multiple state components. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-28gdb: Support XSAVE layouts for the current host in the Linux x86 targets.John Baldwin5-5/+22
Note that this uses the CPUID instruction to determine the total size of the XSAVE register set. If there is a way to fetch the register set size using ptrace that would probably be better. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-28gdb: Update x86 Linux architectures to support XSAVE layouts.John Baldwin3-43/+61
Refactor i386_linux_core_read_xcr0 to fetch and return a corresponding x86_xsave_layout as well as xcr0 using the size of an existing NT_X86_XSTATE core dump to determine the offsets via i387_guess_xsave_layout. Use this to add an implementation of gdbarch_core_xfer_x86_xsave_layout. Use tdep->xsave_layout.sizeof_xsave as the size of the XSTATE register set. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-28gdb: Support XSAVE layouts for the current host in the FreeBSD x86 targets.John Baldwin5-62/+62
Use the CPUID instruction to fetch the offsets of supported state components. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-28gdb: Update x86 FreeBSD architectures to support XSAVE layouts.John Baldwin3-36/+64
Refactor i386fbsd_core_read_xcr0 to fetch and return a corresponding x86_xsave_layout as well as xcr0 using the size of an existing NT_X86_XSTATE core dump to determine the offsets via i387_guess_xsave_layout. Use this to add an implementation of gdbarch_core_xfer_x86_xsave_layout. Use tdep->xsave_layout.sizeof_xsave as the size of the XSTATE register set and only fetch/store the register set if this size is non-zero. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-28x86 nat: Add helper functions to save the XSAVE layout for the host.John Baldwin2-0/+102
x86_xsave_length returns the total length of the XSAVE state area standard format as queried from CPUID. x86_fetch_xsave_layout uses CPUID to query the offsets of XSAVE extended regions from the running host. The total length of the XSAVE state area can either be supplied by the caller if known (e.g. from FreeBSD's PT_GETXSTATEINFO) or it can be queried from the running host using x86_xsave_length. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-28nat/x86-cpuid.h: Add x86_cpuid_count wrapper around __get_cpuid_count.John Baldwin1-0/+32
Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-28core: Support fetching x86 XSAVE layout from architectures.John Baldwin7-0/+137
Add gdbarch_core_read_x86_xsave_layout to fetch the x86 XSAVE layout structure from a core file. Current OS's do not export the offsets of XSAVE state components in core dumps, so provide an i387_guess_xsave_layout helper function to set offsets based on known combinations of XCR0 masks and total state sizes. Eventually when core dumps do contain this information this function should only be used as a fall back for older core dumps. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-28gdb: Store an x86_xsave_layout in i386_gdbarch_tdep.John Baldwin6-3/+79
This structure is fetched from the current target in i386_gdbarch_init via a new "fetch_x86_xsave_layout" target method. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-28x86: Add an x86_xsave_layout structure to handle variable XSAVE layouts.John Baldwin1-9/+56
The standard layout of the XSAVE extended state area consists of three regions. The first 512 bytes (legacy region) match the layout of the FXSAVE instruction including floating point registers, MMX registers, and SSE registers. The next 64 bytes (XSAVE header) contains a header with a fixed layout. The final region (extended region) contains zero or more optional state components. Examples of these include the upper 128 bits of YMM registers for AVX. These optional state components generally have an architecturally-fixed size, but they are not assigned architectural offsets in the extended region. Instead, processors provide additional CPUID leafs describing the size and offset of each component in the "standard" layout for a given CPU. (There is also a "compact" format which uses an alternate layout, but existing OS's currently export the "standard" layout when exporting XSAVE data via ptrace() and core dumps.) To date, GDB has assumed the layout used on current Intel processors for state components in the extended region and hardcoded those offsets in the tables in i387-tdep.c and i387-fp.cc. However, this fails on recent AMD processors which use a different layout. Specifically, AMD Zen3 and later processors do not leave space for the MPX register set in between the AVX and AVX512 register sets. To rectify this, add an x86_xsave_layout structure which contains the total size of the XSAVE extended state area as well as the offset of each known optional state component. Subsequent commits will modify XSAVE parsing in both gdb and gdbserver to use x86_xsave_layout. Co-authored-by: Aleksandar Paunovic <aleksandar.paunovic@intel.com> Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-08-28Use sect_offset_str in cooked_index::dumpTom Tromey1-2/+1
Mark Wielaard pointed out that cooked_index::dump uses PRIx64, and Andreas Schwab pointed out that gdb already has sect_offset_str. This patch applies both these observations.
2023-08-28Use hex_string in gdb/coffread.c instead of PRIxPTRMark Wielaard1-2/+2
The getsymname function uses PRIxPTR to print and uintptr_t value in an error message. Use hex_string instead. Approved-By: Tom Tromey <tom@tromey.com>