aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-03-29[gdb/testsuite] Fix missing return type in gdb.linespec/break-asm-file.cTom de Vries1-1/+1
On fedora rawhide, when running test-case gdb.linespec/break-asm-file.exp, I get: ... gdb compile failed, break-asm-file.c:21:8: error: \ return type defaults to 'int' [-Wimplicit-int] 21 | static func() | ^~~~ ... Fix this by adding the missing return type. Tested on aarch64-linux. Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-03-29Automatic date update in version.inGDB Administrator1-1/+1
2024-03-28Make pascal_language::print_type handle varstring==nullptrTom Tromey1-1/+2
PR gdb/31524 points out a crash when pascal_language::print_type is called with varstring==nullptr. This crash is a regression arising from the printf/pager rewrite -- that indirectly removed a NULL check from gdb's "puts". This patch instead fixes the problem by adding a check to print_type. Passing nullptr here seems to be expected in other places (e.g., there is a call to type_print like this in expprint.c), and other implementations of this method (or related helpers) explicitly check for NULL. I didn't write a test case for this because it seemed like overkill for a Pascal bug that only occurs with -i=mi. However, if you want one, let me know and I will do it. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31524 Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-03-28gas: gcfg: fix handling of non-local direct jmps in gcfgIndu Bhagat5-19/+104
The ginsn infrastructure in GAS includes the ability to create a GCFG (ginsn CFG). A GCFG is currently used for SCFI passes. This patch fixes the following invalid assumptions / code blocks: - The function ginsn_direct_local_jump_p () was erroneously _not_ checking whether the symbol is locally defined (i.e., within the scope of the code block for which GCFG is desired). Fix the code to do so. - Similarly, the GCFG creation code, in gcfg_build () itself had an assumption that a GINSN_TYPE_JUMP to a non-local symbol will not be seen. The latter can indeed be seen, and in fact, needs to be treated the same way as an exit from the function in terms of control-flow. gas/ * ginsn.c (ginsn_direct_local_jump_p): Check if the symbol is local to the code block or function being assembled. (add_bb_at_ginsn): Remove buggy assumption. (frch_ginsn_data_append): Direct jmps do not disqualify a stream of ginsns from GCFG creation. gas/testsuite/ * gas/scfi/x86_64/scfi-cfg-3.d: New test. * gas/scfi/x86_64/scfi-cfg-3.l: New test. * gas/scfi/x86_64/scfi-cfg-3.s: New test. * gas/scfi/x86_64/scfi-x86-64.exp: Add new test.
2024-03-28x86/SSE2AVX: move checkingJan Beulich1-11/+10
It has always been looking a little odd to me that this was done deep in cpu_flags_match(). Move it to match_template() itself - there's no need to do anything complex when encountering such a template while it cannot possibly be used.
2024-03-28x86/SSE2AVX: respect prefixesJan Beulich3-2/+21
1) Without -msse2avx we unconditionally honor REX.W. Hence we ought to also do so with -msse2avx, converting to VEX.W. 2) {rex} doesn't prevent conversion to VEX encodings. Thus {rex2} shouldn't either.
2024-03-28gas: drop integer_constant()'s maxdigJan Beulich1-8/+4
Once properly set, it's only ever holding the same value as "radix". Even if there was some plan with it, that plan hasn't made it anywhere in over 20 years.
2024-03-28gas: drop dead check for double quoteJan Beulich1-3/+0
FB and dollar label definitions can't be enclosed in double quotes. In fact at that point nul_char is the same as next_char, which we know is a digit.
2024-03-28gas: sanitize FB- and dollar-label usesJan Beulich4-20/+31
I don't view it as sensible to be more lax when it comes to references to (uses of) such labels compared to their definition: The latter has been limited to decimal numerics, while the former permitted any radix. Beyond that leading zeroes on such labels aren't helpful either. Imo labels and their use sites would better match literally, to avoid confusion. As it turns out, one z80 testcase actually had such an odd use of labels where definition and use don't match in spelling. That testcase is being adjusted accordingly. While there also adjust a comment on a local variable in integer_constant().
2024-03-28x86: templatize RAO-INT insnsJan Beulich1-8/+4
It's only four of them, but still better to reduce redundancy.
2024-03-28x86: templatize ADX insnsJan Beulich1-6/+5
It's only two of them, but still better to reduce redundancy.
2024-03-28x86: templatize shift-double insnsJan Beulich2-331/+303
With the multitude of new APX templates, it finally becomes desirable to further remove redundancy by also templatizing basic arithmetic insns. Continue with the shift-double ones. While there also drop the APX form with ShiftCount omitted. Other shift and rotate insns were deliberately left without this form as well. Note that there's also no testsuite adjustment needed for this, indicating that the form wasn't tested either.
2024-03-28x86: templatize shift/rotate insnsJan Beulich2-264/+379
With the multitude of new APX templates, it finally becomes desirable to further remove redundancy by also templatizing basic arithmetic insns. Continue with the "ordinary" shift and rotate ones. While there also drop the APX form of RCL/RCR with Imm1 omitted. Other shift insns as well as ROR/ROL were deliberately left without this form as well. Note that there's also no testsuite adjustment needed for this, indicating that the form wasn't tested either. Furthermore since RCL/RCR already had non-NDD APX forms, those end up being added for the other 6 mnemonics, too.
2024-03-28x86: templatize binary ALU insnsJan Beulich2-449/+473
With the multitude of new APX templates, it finally becomes desirable to further remove redundancy by also templatizing basic arithmetic insns. Continue with a the more complex binary (two source) cases. Note how this adds a missing CheckOperandSize to one of the APX sub forms. Furthermore since SBB already had a non-NDD APX form, one ends up being added for the other 6 mnemonics, too.
2024-03-28x86: templatize unary ALU insnsJan Beulich2-16/+22
With the multitude of new APX templates, it finally becomes desirable to further remove redundancy by also templatizing basic arithmetic insns. Continue with a few simple unary (single source) cases.
2024-03-28x86: templatize INC/DECJan Beulich3-68/+80
With the multitude of new APX templates, it finally becomes desirable to further remove redundancy by also templatizing basic arithmetic insns. Start with the simplest case, accompanied by a necessary adjustment to i386-gen (such that template uses can also be at the start of a line). While there also drop a bogus (meaningless / unreachable) "break" as well as a unused variable (which I'm surprised compilers didn't warn about).
2024-03-28[gdb/testsuite] Fix gdb.base/ending-run.exp on manjaro linuxTom de Vries1-2/+2
On aarch64-linux, using the manjaro linux distro, I run into: ... (gdb) next^M 32 }^M (gdb) next^M 0x0000fffff7d67b80 in ?? () from /usr/lib/libc.so.6^M (gdb) FAIL: gdb.base/ending-run.exp: step out of main ... What happens here is described in detail in this clause: ... -re "0x.*\\?\\? \\(\\) from /lib/powerpc.*$gdb_prompt $" { # This case occurs on Powerpc when gdb steps out of main and the # needed debug info files are not loaded on the system, preventing # GDB to determine which function it reached (__libc_start_call_main). # Ideally, the target system would have the necessary debugging # information, but in its absence, GDB's behavior is as expected. ... } ... but the clause only matches for powerpc. Fix this by: - making the regexp generic enough to also match /usr/lib/libc.so.6, and - updating the comment to not mention powerpc. Tested on aarch64-linux. PR testsuite/31450 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31450
2024-03-28[gdb/testsuite] Fix test-case gdb.threads/attach-stopped.exp on manjaro linuxTom de Vries1-2/+4
When running test-case gdb.threads/attach-stopped.exp on aarch64-linux, using the manjaro linux distro, I get: ... (gdb) thread apply all bt^M ^M Thread 2 (Thread 0xffff8d8af120 (LWP 278116) "attach-stopped"):^M #0 0x0000ffff8d964864 in clock_nanosleep () from /usr/lib/libc.so.6^M #1 0x0000ffff8d969cac in nanosleep () from /usr/lib/libc.so.6^M #2 0x0000ffff8d969b68 in sleep () from /usr/lib/libc.so.6^M #3 0x0000aaaade370828 in func (arg=0x0) at attach-stopped.c:29^M #4 0x0000ffff8d930aec in ?? () from /usr/lib/libc.so.6^M #5 0x0000ffff8d99a5dc in ?? () from /usr/lib/libc.so.6^M ^M Thread 1 (Thread 0xffff8db62020 (LWP 278111) "attach-stopped"):^M #0 0x0000ffff8d92d2d8 in ?? () from /usr/lib/libc.so.6^M #1 0x0000ffff8d9324b8 in ?? () from /usr/lib/libc.so.6^M #2 0x0000aaaade37086c in main () at attach-stopped.c:45^M (gdb) FAIL: gdb.threads/attach-stopped.exp: threaded: attach2 to stopped bt ... The problem is that the test-case expects to see start_thread: ... gdb_test "thread apply all bt" ".*sleep.*start_thread.*" \ "$threadtype: attach2 to stopped bt" ... but lack of symbols makes that impossible. Fix this by allowing " in ?? () from " as well. Tested on aarch64-linux. PR testsuite/31451 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31451
2024-03-28[gdb/testsuite] Add missing include in gdb.base/rtld-step.expTom de Vries1-1/+4
On fedora rawhide, with test-case gdb.base/rtld-step.exp I get: ... static-pie-static-libc.c: In function '_start':^M static-pie-static-libc.c:1:22: error: \ implicit declaration of function '_exit' [-Wimplicit-function-declaration]^M 1 | void _start (void) { _exit (0); }^M | ^~~~~^M compiler exited with status 1 ... UNTESTED: gdb.base/rtld-step.exp: failed to compile \ (-static-pie not supported or static libc missing) ... Fix this by adding the missing include. Tested on aarch64-linux. Approved-by: Kevin Buettner <kevinb@redhat.com>
2024-03-28RISC-V: Removed privileged spec 1.9.1 support in assembler.Nelson Chu29-3099/+218
Removed since it's may have lots of conflicts with the newer extensions, but still keep linker recognizes it in case of linking old objects. gas/ * NEWS: Updated. * config/tc-riscv.c (riscv_set_default_priv_spec): Regard 1.9.1 as an unknown version. (md_show_usage): Removed privileged spec 1.9.1 information. * testsuite/gas/riscv/attribute-05.s: Updated since privileged spec 1.9.1 is unsupported. * testsuite/gas/riscv/attribute-05.d: Likewise. * testsuite/gas/riscv/attribute-12.d: Likewise. * testsuite/gas/riscv/attribute-13.d: Likewise. * testsuite/gas/riscv/csr-dw-regnums.d: Likewise. * testsuite/gas/riscv/csr-dw-regnums.s: Likewise. * testsuite/gas/riscv/csr.s: Likewise. * testsuite/gas/riscv/csr-version-1p10.d: Likewise. * testsuite/gas/riscv/csr-version-1p10.l: Likewise. * testsuite/gas/riscv/csr-version-1p11.d: Likewise. * testsuite/gas/riscv/csr-version-1p11.l: Likewise. * testsuite/gas/riscv/csr-version-1p12.d: Likewise. * testsuite/gas/riscv/csr-version-1p12.l: Likewise. * testsuite/gas/riscv/csr-version-1p9p1.d: Removed. * testsuite/gas/riscv/csr-version-1p9p1.l: Removed. include/ * opcode/riscv-opc.h: Updated since privileged spec 1.9.1 is unsupported. ld/ * testsuite/ld-riscv-elf/attr-merge-priv-spec-01.d: Updated since privileged spec 1.9.1 is unsupported. * testsuite/ld-riscv-elf/attr-merge-priv-spec-02.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-03.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-a.s: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-b.s: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d: Likewise.
2024-03-28Automatic date update in version.inGDB Administrator1-1/+1
2024-03-27Fix clang buildTom Tromey1-1/+9
Simon pointed out that commit 818ef5f4 ("Capture warnings when writing to the index cache") broke the build with clang. This patch fixes the breakage.
2024-03-26gdb, gdbserver, gdbsupport: remove includes of early headersSimon Marchi892-902/+1
Now that defs.h, server.h and common-defs.h are included via the `-include` option, it is no longer necessary for source files to include them. Remove all the inclusions of these files I could find. Update the generation scripts where relevant. Change-Id: Ia026cff269c1b7ae7386dd3619bc9bb6a5332837 Approved-By: Pedro Alves <pedro@palves.net>
2024-03-26gdb, gdbserver, gdbsupport: include early header files with `-include`Simon Marchi4-3/+16
The motivation for this change is for analysis tools and IDEs to be better at analyzing header files on their own. There are some definitions and includes we want to occur at the very beginning of all translation units. The way we currently do that is by requiring all source files (.c and .cc files) to include one of defs.h (for gdb), server.h (for gdbserver) of common-defs.h (for gdbsupport and shared source files). These special header files define and include everything that needs to be included at the very beginning. Other header files are written in a way that assume that these special "prologue" header files have already been included. My problem with that is that my editor (clangd-based) provides a very bad experience when editing header files. Since clangd doesn't know that one of defs.h/server.h/common-defs.h was included already, a lot of things are flagged as errors. For instance, CORE_ADDR is not known. It's possible to edit the files in this state, but a lot of the power of the editor is unavailable. My proposal to help with this is to include those things we always want to be there using the compilers' `-include` option. Tom Tromey said that the current approach might exist because not all compilers used to have an option like this. But I believe that it's safe to assume they do today. With this change, clangd picks up the -include option from the compile command, and is able to analyze the header file correctly, as it sees all that stuff included or defined by that -include option. That works because when editing a header file, clangd tries to get the compilation flags from a source file that includes said header file. This change is a bit self-serving, because it addresses one of my frustrations when editing header files, but it might help others too. I'd be curious to know if others encounter the same kinds of problems when editing header files. Also, even if the change is not necessary by any means, I think the solution of using -include for stuff we always want to be there is more elegant than the current solution. Even with this -include flag, many header files currently don't include what they use, but rather depend on files included before them. This will still cause errors when editing them, but it should be easily fixable by adding the appropriate include. There's no rush to do so, as long as the code still compiles, it's just a convenience thing. The changes are: - Add the appropriate `-include` option to the various Makefiles. - There is one particularity for gdbserver's Makefile: we do not want to include server.h when building `gdbreplay.o`, as `gdbreplay.cc` doesn't include it. So we can't simply put the `-include` in `INTERNAL_CFLAGS`. Add the `-include server.h` option to the `COMPILE` and `IPAGENT_COMPILE` variables, and added a special rule to compile `gdbreplay.o` with `-include gdbsupport/common-defs.h`. - Remove the `-include` option from the `check-headers` rule in gdb/Makefile.in, since it is already included in `INTERNAL_CFLAGS`. Change-Id: If3e345d00a9fc42336322f1d8286687d22134340 Approved-By: Pedro Alves <pedro@palves.net>
2024-03-26{gdb,gdbserver}/Makefile.in: remove unnecessary intermediary variablesSimon Marchi2-13/+7
Remove `INTERNAL_CFLAGS_BASE` and `INTERNAL_WARN_CFLAGS`, inline their contents in `INTERNAL_CFLAGS`. Not functional changes expected. Change-Id: I6a09794835ca2cfd4a88a3e9f2e627c8f5bd569f Approved-By: Pedro Alves <pedro@palves.net>
2024-03-26gdb, gdbserver, gdbsupport: reformat some Makefile variables, one entry per lineSimon Marchi4-29/+90
Reformat some variables definitions. I think it makes them easier to read, and it also makes diffs clearer. Change-Id: I82f63ba0e6d0fe268eb1f1ad5ab22c3cd016ab02 Approved-By: Pedro Alves <pedro@palves.net>
2024-03-26gdb: make gdbarch_types.py non-executableSimon Marchi1-0/+0
I noticed that gdbarch_types.py is executable. It's not needed, since it's only imported from gdbarch.py. Change-Id: I481170714af66fc3fc3a48c55a7268e0789cf83e
2024-03-27Automatic date update in version.inGDB Administrator1-1/+1
2024-03-26Revert "gdbserver: convert have_ptrace_getregset to a tribool"Andrew Burgess4-10/+10
This reverts commit 5920765d7513aaae9241a1850d62d73e0477f81c.
2024-03-26Revert "gdb/x86: move reading of cs and ds state into gdb/nat directory"Andrew Burgess3-80/+37
This reverts commit 01ed1674d4435aa4e194fd9373b7705e425ef354.
2024-03-26Revert "gdbserver/x86: move no-xml code earlier in x86_linux_read_description"Andrew Burgess1-16/+11
This reverts commit 0a7bb97ad2f2fe2d18a442dad265051e34eab13e.
2024-03-26Revert "gdb/gdbserver: share I386_LINUX_XSAVE_XCR0_OFFSET definition"Andrew Burgess5-23/+41
This reverts commit 7816b81e9b36ea0f57662bfd7446b573bf0c9e54.
2024-03-26Revert "gdb/gdbserver: share some code relating to target description creation"Andrew Burgess15-267/+199
This reverts commit cd9b374ffe372dcaf7e4c15548cf53a301d8dcdd.
2024-03-26Revert "gdb/arch: assert that X86_XSTATE_MPX is not set for x32"Andrew Burgess1-6/+2
This reverts commit efba976d9713a92b4507ccfef2257e4589da2798.
2024-03-26Revert "gdbserver: update target description creation for x86/linux"Andrew Burgess5-277/+168
This reverts commit 61bb321605fc74703adc994fd7a78e9d2495ca7a.
2024-03-26Revert "gdb/gdbserver: share x86/linux tdesc caching"Andrew Burgess11-355/+393
This reverts commit 198ff6ff819c240545f9fc68b39636fd376d4ba9.
2024-03-26Revert "gdbserver/Makefile.in: add missing `-x c++`"Andrew Burgess1-1/+1
This reverts commit c7c9820071f8b81a64221f5cfafb3cbfeafe7916.
2024-03-26Revert "gdb: fix possible uninitialised variable use"Andrew Burgess1-8/+10
This reverts commit 24df37a10f8773ad5db07dc000f694d6405e3a36.
2024-03-26Revert "gdb/gdbserver: fix some defined but unused function warnings"Andrew Burgess1-12/+0
This reverts commit f4c19f89ef43dbce8065532c808e1aeb05d08994.
2024-03-26Remove redundant check from parse_number.expTom Tromey1-2/+0
A user on irc pointed out that parse_number.exp has a redundant check. This patch removes the duplicate.
2024-03-26[gdb/testsuite] Fix valgrind tests on debianTom de Vries1-1/+2
On debian 12, I run into: ... (gdb) target remote | vgdb --wait=2 --max-invoke-ms=2500 --pid=618591^M Remote debugging using | vgdb --wait=2 --max-invoke-ms=2500 --pid=618591^M relaying data between gdb and process 618591^M warning: remote target does not support file transfer, \ attempting to access files from local filesystem.^M Reading symbols from /lib/ld-linux-aarch64.so.1...^M (No debugging symbols found in /lib/ld-linux-aarch64.so.1)^M 0x000000000401a980 in ?? () from /lib/ld-linux-aarch64.so.1^M (gdb) FAIL: gdb.base/valgrind-infcall.exp: target remote for vgdb ... The problem is that we're expecting to match either of these regexps: ... set start_re1 " in \\.?_start " set start_re2 "\\.?_start \\(\\) at " ... but there are no dwarf or elf symbols present. Fix this by also allowing: ... set start_re3 "$::hex in \\?\\? \\(\\) from " ... Tested on aarch64-linux. Approved-By: Tom Tromey <tom@tromey.com>
2024-03-26Capture warnings when writing to the index cacheTom Tromey5-11/+34
PR symtab/30837 points out a race that can occur when writing to the index cache: a call to ada_encode can cause a warning, which is forbidden on a worker thread. This patch fixes the problem by arranging to capture any such warnings. This is v2 of the patch. It is rebased on top of some other changes in the same area. v1 was here: https://sourceware.org/pipermail/gdb-patches/2024-February/206595.html Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30837
2024-03-26Don't claim a fat IR object if no IR object should be claimedH.J. Lu11-37/+131
When the linker sees an input object containing nothing but IR during rescan, it should ignore it (LTO phase is over). But if the input object is a fat IR object, which has non-IR code as well, it should be used to resolve references as if it did not contain any IR at all. This patch adds lto_type to bfd and linker avoids claiming a fat IR object if no IR object should be claimed. bfd/ PR ld/23935 * archive.c (_bfd_compute_and_write_armap): Check bfd_get_lto_type instead of lto_slim_object. * elflink.c (elf_link_add_object_symbols): Likewise. * bfd.c (bfd_lto_object_type): New. (bfd): Remove lto_slim_object and add lto_type. (bfd_get_lto_type): New function. * elf.c (lto_section): Removed. (_bfd_elf_make_section_from_shdr): Don't set lto_slim_object. * format.c: (lto_section): New. (bfd_set_lto_type): New function. (bfd_check_format_matches): Call bfd_set_lto_type. * bfd-in2.h: Regenerated. binutils/ PR ld/23935 * nm.c (display_rel_file): Check bfd_get_lto_type instead of lto_slim_object. ld/ PR ld/23935 * ldmain.c (add_archive_element): Don't claim a fat IR object if no IR object should be claimed. * testsuite/ld-plugin/lto.exp (pr20103): Adjust fat IR test. Add PR ld/23935 test. * testsuite/ld-plugin/pr23935a.c: New file. * testsuite/ld-plugin/pr23935b.c: Likewise.
2024-03-26gdb/gdbserver: fix some defined but unused function warningsAndrew Burgess1-0/+12
This commit: commit 198ff6ff819c240545f9fc68b39636fd376d4ba9 Date: Tue Jan 30 15:37:23 2024 +0000 gdb/gdbserver: share x86/linux tdesc caching added some functions which are always defined, but their use is guarded within various #ifdef blocks. As a result we were seeing errors about defined, but unused, functions. I've fixed this problem in this commit by wrapping the function definitions within #ifdef blocks. I'm a little worried that there might be too many #ifdef blocks within this file, however, I'm going to commit this fix for now as this will fix the build, then I'll think about if there's a better way to split this file so we might avoid some of these #ifdef blocks.
2024-03-26gdb: fix possible uninitialised variable useAndrew Burgess1-10/+8
After this commit: commit 198ff6ff819c240545f9fc68b39636fd376d4ba9 Date: Tue Jan 30 15:37:23 2024 +0000 gdb/gdbserver: share x86/linux tdesc caching a possible use of an uninitialised variable was introduced, the 'tdesc' variable in i386_linux_core_read_description might be read without being written too if 'xcr0' was 0. This is fixed in this commit. I've updated the function to follow the same pattern as amd64_linux_core_read_description, if xcr0 is 0 then we select a default xcr0 value and use that to select a tdesc.
2024-03-25gdbserver/Makefile.in: add missing `-x c++`Simon Marchi1-1/+1
When building with Clang, I get: CXX nat/x86-linux-tdesc-ipa.o clang++: error: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Werror,-Wdeprecated] Fix that by adding the missing `-x c++` in the rule building `gdb/nat/*.c` files for the in-process agent. Change-Id: Ie53e4b9a8b57bef9669397fdfaf21617107c7180 Approved-By: Tom Tromey <tom@tromey.com>
2024-03-25gdb: mark addrmap classes `final`Simon Marchi1-3/+3
When building GDB with clang, I see: /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:95:2: error: delete called on non-final 'addrmap_mutable' that has virtual functions but non-virtual destructor [-Werror,-Wdelete-non -abstract-non-virtual-dtor] 95 | delete __ptr; | ^ /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/unique_ptr.h:396:4: note: in instantiation of member function 'std::default_delete<addrmap_mutable>::operator()' requested here 396 | get_deleter()(std::move(__ptr)); | ^ /home/smarchi/src/binutils-gdb/gdb/addrmap.c:422:14: note: in instantiation of member function 'std::unique_ptr<addrmap_mutable>::~unique_ptr' requested here 422 | auto map = std::make_unique<struct addrmap_mutable> (); | ^ Fix that by making `addrmap_mutable` final, and `addrmap_fixed` too while at it. Change-Id: I03aa0b0907c8d0e3390ddbedeb77d73b19b2b526 Approved-By: Tom Tromey <tom@tromey.com>
2024-03-26Automatic date update in version.inGDB Administrator1-1/+1
2024-03-25gprofng: fix infinite recursion on calloc with multi-threaded applicationsVladimir Mezentsev1-98/+62
libcollector uses pthread_getspecific() and pthread_setspecific() to access thread local memory. libcollector uses this memory to check that interposed functions (like malloc, calloc or free) don't have recursion. The first time we call calloc(), we call pthread_setspecific() to create a thread-specific value. On Ubuntu machine, pthread_setspecific() calls calloc(), and we cannot intercept such recursion. gcc supports thread-local storage. For example, static __thread int reentrance = 0; I rewrote code using this instead of pthread_setspecific(). gprofng/ChangeLog 2024-03-23 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/31460 * libcollector/heaptrace.c: Use the __thread variable to check for * reentry. Clean up code.
2024-03-25gdb/testsuite: Fix set_unbuffered_mode.o handling in parallel modePedro Alves1-2/+19
Cygwin/MinGW testing links in a set_unbuffered_mode.o object to all test programs. When running the testsuite in parallel mode, on Cygwin, I noticed errors like: ERROR: remote_download to host of ..../build/set_unbuffered_mode.o to ..../build/set_unbuffered_mode_saved.o: cp: cannot open '..../build/set_unbuffered_mode.o' for reading: No such file or directory ... ERROR: remote_download to host of ..../build/set_unbuffered_mode.o to ..../build/set_unbuffered_mode_saved.o: cp: cannot stat '..../build/set_unbuffered_mode.o': No such file or directory ... ERROR: remote_download to host of ..../build/set_unbuffered_mode.o to ..../build/set_unbuffered_mode_saved.o: cp: skipping file '..../build/set_unbuffered_mode.o', as it was replaced while being copied (Absolute paths elided above.) The problem is that gdb_compile's unbuffered_mode_obj cache isn't parallel safe. This is fixed in this commit. Reviewed-by: Kevin Buettner <kevinb@redhat.com> Change-Id: I67a289473c14ce0603d4b0beb755b124588f18d2