aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-06-11Automatic date update in version.inGDB Administrator1-1/+1
2024-06-10IBM zSystems: Rewrite l(g)rl @GOTENT to larl for --no-pieIlya Leoshkevich5-12/+41
Regtested on s390x-redhat-linux. Rewriting l(g)rl @GOTENT to larl is unnecessarily guarded by bfd_link_pic(). There were no use cases for this in the past, but since recently the Linux Kernel on s390x is compiled with -fPIE and linked with --no-pie. Remove the unnecessary bfd_link_pic() check. bfd/ChangeLog: * elf32-s390.c (elf_s390_relocate_section): Don't check for bfd_link_pic() when rewriting lrl@GOTENT to larl. (elf_s390_finish_dynamic_symbol): Emit a relative reloc for the above case. * elf64-s390.c (elf_s390_relocate_section): Don't check for bfd_link_pic() when rewriting lgrl@GOTENT to larl. (elf_s390_finish_dynamic_symbol): Emit a relative reloc for the above case. ld/ChangeLog: * testsuite/ld-s390/s390.exp: Hook up the new tests. * testsuite/ld-s390/gotreloc_31-no-pie-1.dd: New test. * testsuite/ld-s390/gotreloc_64-no-pie-1.dd: New test.
2024-06-10Make global_symbol_searcher::filenames privateTom Tromey3-35/+26
This patch renames global_symbol_searcher::filenames and makes it private, adding a new method to append a filename to the vector. This also cleans up memory management here, removing an alloca from rbreak, and removing a somewhat ugly SCOPE_EXIT from the Python code, in favor of having global_symbol_searcher manage the memory itself. Regression tested on x86-64 Fedora 38.
2024-06-10[gdb/python] Fix GDB_PY_{LL,LLU}_ARG on platform without long longTom de Vries1-2/+2
If in gdb/python/python-internal.h, we pretend to have a platform that doesn't support long long: ... -#ifdef HAVE_LONG_LONG +#if 0 ... I get on arm-linux: ... (gdb) placement_candidate() disassemble test^M Dump of assembler code for function test:^M 0x004004d8 <+0>: push {r11} @ (str r11, [sp, #-4]!)^M 0x004004dc <+4>: Python Exception <class 'ValueError'>: \ Buffer returned from read_memory is sized 0 instead of the expected 4^M ^M unknown disassembler error (error = -1)^M (gdb) FAIL: $exp: memory source api: second disassembler pass ... The problem is that gdb_py_longest is typedef-ed to long, but the corresponding format character GDB_PY_LL_ARG is defined to "L", meaning "long long" [1]. Fix this by using "l", meaning long instead. Likewise for GDB_PY_LLU_ARG. Tested on arm-linux. Approved-By: Tom Tromey <tom@tromey.com> PR python/31845 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31845 [1] https://docs.python.org/3/c-api/arg.html
2024-06-10[gdb/python] Fix gdb.python/py-disasm.exp on arm-linuxTom de Vries3-7/+9
After fixing test-case gdb.python/py-disasm.exp to recognize the arm nop: ... nop {0} ... we run into: ... disassemble test^M Dump of assembler code for function test:^M 0x004004d8 <+0>: push {r11} @ (str r11, [sp, #-4]!)^M 0x004004dc <+4>: add r11, sp, #0^M 0x004004e0 <+8>: nop {0}^M => 0x004004e4 <+12>: Python Exception <class 'ValueError'>: Buffer \ returned from read_memory is sized 0 instead of the expected 4^M ^M unknown disassembler error (error = -1)^M (gdb) FAIL: $exp: global_disassembler=ShowInfoRepr: disassemble test ... This is caused by this code in gdbpy_disassembler::read_memory_func: ... gdbpy_ref<> result_obj (PyObject_CallMethod ((PyObject *) obj, "read_memory", "KL", len, offset)); ... where len has type "unsigned int", while "K" means "unsigned long long" [1]. Fix this by using "I" instead, meaning "unsigned int". Also, offset has type LONGEST, which is typedef'ed to int64_t, while "L" means "long long". Fix this by using type gdb_py_longest for offset, in combination with format character "GDB_PY_LL_ARG". Likewise in disasmpy_info_read_memory. Tested on arm-linux. Reviewed-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com> Approved-By: Tom Tromey <tom@tromey.com> PR python/31845 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31845 [1] https://docs.python.org/3/c-api/arg.html
2024-06-10aarch64: warn on unpredictable results for new rcpc3 instructionsMatthieu Longo6-26/+306
The previous patch for the feature rcpc3 introduced 4 new operations (ldiapp, stilp, ldapr, stlr). The specification mentions some cases of inputs causing unpredictable results. gas currently fails to diagnose them, and does not emit warnings. Even if the instruction encoding is valid, the developer probably wants to know for those cases that the instruction won't have the expected effect. - ldiapp & stilp: * unpredictable load pair transfer with register overlap * unpredictable transfer with writeback - ldapr & stlr: * unpredictable transfer with writeback This patch also completes the existing relevant tests.
2024-06-10Revert "MIPS/Allegrex: Exclude trap instructions"Maciej W. Rozycki4-57/+30
This reverts commit a2e71b281a9365872451a157767e03a2e89ddaad.
2024-06-10Revert "MIPS/Allegrex: Enable dbreak instruction"Maciej W. Rozycki3-4/+2
This reverts commit c41020942b94ea7c5a58de4fed644826e8f0b509.
2024-06-10[gdb/python] Note that python 3.6 assumes long long supportTom de Vries1-2/+13
Starting with python 3.6, support for platforms without long long support has been removed [1]. HAVE_LONG_LONG and PY_LONG_LONG are still defined, but only for compatibility, so stop relying on them. Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com> [1] https://github.com/python/cpython/issues/72148
2024-06-10PR31873, buffer overflow in evax_bfd_print_dstAlan Modra1-0/+2
PR 31873 * vms-alpha.c (evax_bfd_print_dst): Sanity check len against dst_size.
2024-06-10src-release.sh: don't take untracked files into account in the uncommitted ↵Rostislav Krasny1-2/+2
changes check
2024-06-10MIPS/Allegrex: Enable dbreak instructionDavid Guillen Fandos3-2/+4
2024-06-10MIPS/Allegrex: Exclude trap instructionsDavid Guillen Fandos4-30/+57
These instructions are not supported by the target even though they are part of the MIPS II specification.
2024-06-10x86/APX: convert ZU to operand constraintJan Beulich5-4224/+4228
Extremely rarely used attributes are inefficient when represented by a separate attribute. Convert it to an operand constraint, as already suggested during review. The collision with RegKludge is pretty simple to resolve.
2024-06-10x86: disassembler macro for condition codeJan Beulich9-557/+347
Both CMPccXADD and APX'es {,CF}CMOVcc have almost identical entries replicated 16 times each. Fold those to just one each by introducing a %CC macro. (Note that the recording of ->condition_code in print_insn() is merely for completeness for now; it's not used as long as only VEX/EVEX encodings would consume it.) This then also renders condition codes printed consistent across all respective insns; CMPxxXADD had a number of outliers so far.
2024-06-10x86/APX: support extended SETcc formJan Beulich5-312/+564
As indicated during review, spelling/readability-wise setz %eax is easier than setzuz %al _and_ properly specifies the full register that's being modified. Permit that form to be used, even if the spec writers are unwilling to formally mention it. While there also correct the non-ZU EVEX form: That ought to also permit memory operands.
2024-06-10gdb: re-add necessary includes in tui/tui-win.cSimon Marchi1-0/+2
Commit 9102a6c15c75 ("gdb/tui: cleanup includes") broke gdb.python/tui-window.exp on Linux: Running /data/vries/gdb/src/gdb/testsuite/gdb.python/tui-window.exp ... WARNING: timeout in accept_gdb_output WARNING: timeout in accept_gdb_output FAIL: gdb.python/tui-window.exp: Window was updated and caused a build failure on AIX: CXX tui/tui-win.o tui/tui-win.c: In function 'void tui_sigwinch_handler(int)': tui/tui-win.c:532:3: error: 'mark_async_signal_handler' was not declared in this scope; did you mean 'async_signal_handler'? 532 | mark_async_signal_handler (tui_sigwinch_token); | ^~~~~~~~~~~~~~~~~~~~~~~~~ | async_signal_handler tui/tui-win.c: At global scope: tui/tui-win.c:538:1: error: variable or field 'tui_async_resize_screen' declared void 538 | tui_async_resize_screen (gdb_client_data arg) | ^~~~~~~~~~~~~~~~~~~~~~~ tui/tui-win.c:538:26: error: 'gdb_client_data' was not declared in this scope 538 | tui_async_resize_screen (gdb_client_data arg) | ^~~~~~~~~~~~~~~ tui/tui-win.c: In function 'void tui_initialize_win()': tui/tui-win.c:579:36: error: 'tui_async_resize_screen' was not declared in this scope 579 | = create_async_signal_handler (tui_async_resize_screen, NULL, | ^~~~~~~~~~~~~~~~~~~~~~~ tui/tui-win.c:579:7: error: 'create_async_signal_handler' was not declared in this scope; did you mean 'async_signal_handler'? 579 | = create_async_signal_handler (tui_async_resize_screen, NULL, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ | async_signal_handler gmake: *** [Makefile:1947: tui/tui-win.o] Error 1 On Linux, the removal of the signal.h include causes the `#ifdef SIGWINCH` sections to become inactive. The code builds, but then the TUI fails to react to terminal size changes. When we add back the inclusion of signal.h, then we see the same build error as on AIX. On AIX, I suppose that the SIGWINCH define is still seen by some other transitive include. When I go back to before 9102a6c15c75, I don't see async-event.h and signal.h being marked as unneeded by clangd, so I'm not sure why I removed them in the first place... I'll be more careful in the future (files with #ifdef/#ifndef can be tricky w.r.t. determining necessary includes). So, re-add the inclusion of signal.h and async-event.h Change-Id: I3ed385c2dc1726ade2118a5186ea7cccffd12635 Reported-By: Aditya Kamath1 <Aditya.Kamath1@ibm.com> Reported-By: Tom de Vries <tdevries@suse.de> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31865
2024-06-10[gdb/testsuite] Don't use set auto-solib-add offTom de Vries14-38/+9
In test-case gdb.mi/mi-var-child-f.exp, we have: ... mi_gdb_test "-gdb-set auto-solib-add off" "\\^done" mi_runto prog_array mi_gdb_test "nosharedlibrary" ".*\\^done" ... This was added to avoid a name clash between the array variable as defined in gdb.mi/array.f90 and debug info in shared libraries, and used in other places in the testsuite. The same workaround is also used to ignore symbols from shared libraries when excercising for instance a command that prints all symbols. However, this approach can cause problems for targets like arm that require symbol info for some libraries like ld.so and libc to fully function. While absense of debug info for shared libraries should be handled gracefully (which does need fixing, see PR31817), failure to do so should not result in failures in unrelated test-cases. Fix this by removing "set auto-solib-add off". This ensures that we don't run into PR31817, while the presence of nosharedlibrary still ensures that in the rest of the test-case we're not bothered by shared library symbols. Likewise in other test-cases. Approved-by: Kevin Buettner <kevinb@redhat.com> Tested on arm-linux.
2024-06-10gas: extend \+ support to .reptJan Beulich6-7/+93
PR gas/31752 While not quite as macro-like as .irp / .irpc, this perhaps benefits from supporting \+ even more than those: It allows, where desired, to get away without maintaining an explicit count variable in source code. Keep .rep (and custom per-arch uses of s_rept() / do_repeat()) behavior unaltered.
2024-06-10x86/APX: add missing CPU requirement to imm+rm forms of <alu2> insnsJan Beulich2-15/+15
This was overlooked when the form was added by dd74a603376e ("Support APX NF").
2024-06-10ld-aarch64: check support before launching dt_relr testsClément Chigot2-10/+13
Not all aarch64 targets supports dt_relr as this requires some mechanisms on the OS side. Adjust support_dt_relr helper and use it in aarch64-elf.exp.
2024-06-10Automatic date update in version.inGDB Administrator1-1/+1
2024-06-10regen sim/frv files for copyright updateAlan Modra4-4/+4
2024-06-10autoupdate: regen after replacing obsolete macrosMatthieu Longo11-34/+17
2024-06-10autoconf: delete obsolete unused m4 fileMatthieu Longo1-32/+0
config/uintmax_t.m4 contains only one function: jm_AC_TYPE_UINTMAX_T. After a grep, I could not find any usage of it. jm_AC_TYPE_UINTMAX_T seems to be an old implementation of the officially suppported AC_TYPE_UINTMAX_T. Doc: https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/ autoconf-2.72/autoconf.html#index-AC_005fTYPE_005fUINTMAX_005fT-1 config/stdint.m4 seems to have taken over. The usage of AC_REQUIRE([AC_TYPE_UINTMAX_T]) is not garded or inside a function, so it will also automatically be run for the configure.ac files using AC_CONFIG_MACRO_DIRS([../config]) instead of m4_include([../config/stdint.m4]). It seems that people replaced jm_AC_TYPE_UINTMAX_T occurences by AC_TYPE_UINTMAX_T, and forgot to delete uintmax_t.m4. Deleting the file and regenerating the build scripts results in no diff, so it looks safe to delete it from the repository.
2024-06-10autoupdate: add square brackets around arguments of AC_INITMatthieu Longo14-14/+14
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fINIT-2
2024-06-10autoupdate: add square brackets around argument of AC_PREREQMatthieu Longo2-2/+2
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fPREREQ-1
2024-06-10autoupdate: replace old version of AC_INIT by the new oneMatthieu Longo1-1/+2
- old AC_INIT by AC_INIT + AC_CONFIG_SRC_DIR https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fINIT-3
2024-06-10autoupdate: replace obsolete macros AC_CONFIG_HEADERMatthieu Longo4-4/+4
- AC_CONFIG_HEADER by AC_CONFIG_HEADERS https://www.gnu.org/software/automake/manual/1.12.2/html_node/Obsolete-Macros.html#index-AM_005fCONFIG_005fHEADER
2024-06-10autoupdate: replace obsolete macros AC_CANONICAL_SYSTEMMatthieu Longo6-8/+9
- AC_CANONICAL_SYSTEM by: * AC_CANONICAL_HOST where host, and host_alias are needed * AC_CANONICAL_TARGET where target_alias is needed https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fCANONICAL_005fTARGET-1
2024-06-10autoupdate: replace obsolete macros AC_PROG_LIBTOOLMatthieu Longo1-1/+1
- AC_PROG_LIBTOOL by LT_INIT https://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html#index-LT_005fINIT
2024-06-10autoupdate: replace obsolete macros AC_AIX, AC_MINIX, and AC_GNU_SOURCEMatthieu Longo9-11/+2
- AC_AIX, AC_MINIX, and AC_GNU_SOURCE by AC_USE_SYSTEM_EXTENSIONS https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fAIX https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fMINIX-1 https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fGNU_005fSOURCE-1
2024-06-10autoupdate: replace obsolete macros AC_HELP_STRINGMatthieu Longo7-16/+13
- AC_HELP_STRING by AS_HELP_STRING https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fHELP_005fSTRING-1 Except for the ifdef in lib-prefix.m4, make the defun of AC_LIB_ARG_WITH unconditional.
2024-06-08gold: Properly remove the versioned symbolH.J. Lu10-25/+261
When the versioned symbol foo is removed from the shared library, the ".symver foo,foo@VER" directive provides binary compatibility for foo@VER. In this case, the unversioned symbol foo should be hidden and shouldn't generate a multiple definition error. PR gold/31830 * resolve.cc (Symbol_table::resolve): Move symbol version handling to ... * symtab.cc (Symbol_table::add_from_object): Here. If the hidden version from .symver is the same as the default version from the unversioned symbol, don't make the unversioned symbol the default versioned symbol. * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_pr31830.sh. (check_DATA): ver_test_pr31830_a.syms and ver_test_pr31830_b.syms. (ver_test_pr31830_a.syms): New. (ver_test_pr31830_b.syms): Likewise. (ver_test_pr31830_a.so): Likewise. (ver_test_pr31830_b.so): Likewise. * testsuite/Makefile.in: Regenerated. * testsuite/ver_test_pr31830.script: New file. * testsuite/ver_test_pr31830.sh: Likewise. * testsuite/ver_test_pr31830_a.c: Likewise. * testsuite/ver_test_pr31830_b.c: Likewise. * testsuite/ver_test_pr31830_lto.c: Likewise. * testsuite/ver_test_pr31830_lto.sh: Likewise. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-06-09Automatic date update in version.inGDB Administrator1-1/+1
2024-06-08Fix typo in warning in gdb/configureTom Tromey2-3/+3
Eli pointed out that "babeltrace" is misspelled in a warning in gdb/configure. This patch fixes the typo.
2024-06-08gdb: Avoid compilation warning in gcore.c.Eli Zaretskii1-1/+1
See https://sourceware.org/pipermail/gdb-patches/2024-June/209726.html for the details. Approved-By: Tom Tromey <tom@tromey.com>
2024-06-07gdb: remove get_exec_fileSimon Marchi13-47/+41
I believe that the get_exec_file function is unnecessary, and the code can be simplified if we remove it. Consider for instance when you "run" a program on Linux with native debugging. 1. run_command_1 obtains the executable file from `current_program_space->exec_filename ()` 2. it passes it to `run_target->create_inferior()`, which is `inf_ptrace_target::create_inferior()` in this case, which then passes it to `fork_inferior()` 3. `fork_inferior()` then has a fallback, where if the passed exec file is nullptr, it gets its from `get_exec_file()`. 4. `get_exec_file()` returns `current_program_space->exec_filename ()` - just like the things we started with - or errors out if the current program space doesn't have a specified executable. If there's no exec filename passed in step 1, there's not going to be any in step 4, so it seems pointless to call `get_exec_file()`, we could just error out when `exec_file` is nullptr. But we can't error out directly in `fork_inferior()`, since the error is GDB-specific, and that function is shared with GDBserver. Speaking of GDBserver, all code paths that lead to `fork_inferior()` provide a non-nullptr exec file. Therefore, to simplify things: - Make `fork_inferior()` assume that the passed exec file is not nullptr, don't call `get_exec_file()` - Change some targets (darwin-nat, go32-nat, gnu-nat, inf-ptrace, nto-procfs, procfs) to error out when the exec file passed to their create_inferior method is nullptr. Some targets are fine with a nullptr exec file, so we can't check that in `run_command_1()`. - Add the `no_executable_specified_error()` function, which re-uses the error message that `get_exec_file()` had. - Change some targets (go32-nat, nto-procfs) to not call `get_exec_file()`, since it's pointless for the same reason as in the example above, if it returns, it's going the be the same value as the `exec_file` parameter. Just rely on `exec_file`. - Remove the final use of `get_exec_file()`, in `load_command()`. - Remove the `get_exec_file()` implementations in GDB and GDBserver and remove the shared declaration. Change-Id: I601c16498e455f7baa1f111a179da2f6c913baa3 Approved-By: Tom Tromey <tom@tromey.com>
2024-06-07gdb: remove dead code in nto-procfs.cSimon Marchi1-8/+0
`get_exec_file()` never returns nullptr, so remove some dead code that check for a nullptr return. Change-Id: I9eff2a013d602588aaf4477a22cf45f2bc417c6a Approved-By: Tom Tromey <tom@tromey.com>
2024-06-07gdb: replace `get_exec_file (0)` calls with ↵Simon Marchi15-31/+27
`current_program_space->exec_filename ()` Calls of `get_exec_file (0)` are equivalent to just getting the exec filename from the current program space. I'm looking to remove `get_exec_file`, so replace these uses with `current_program_space->exec_filename ()`. Remove the `err` parameter of `get_exec_wrapper` since all the calls that remain pass 1, meaning to error out if no executable is specified. Change-Id: I7729ea4c7f03dbb046211cc5aa3858ab3a551965 Approved-By: Tom Tromey <tom@tromey.com>
2024-06-07gdb: make progspace::exec_filename private, add getter / setterSimon Marchi7-29/+35
Just like the title says... I think this makes things a bit clearer, for instance where the exec filename is set. It also makes the read call sites a bit nicer, avoiding the `.get ()`. Change-Id: If8b58ae8f6270c8a34b868f6ca06128c6671ea3c Approved-By: Tom Tromey <tom@tromey.com>
2024-06-07gdb/tui: cleanup includesSimon Marchi22-81/+5
Remove includes reported as unused by clangd. Then, add any includes necessary to get rid of errors (includes possibly relying on previous includes).. I didn't remove the includes of gdb-safe-ctypes.h, because it appears to do some some preprocessor magic, redefining standard macros. I'm afraid that removing these includes could change the behavior unintentionally. Change-Id: I4c5b652355c3bbce022fe0d447a72dc4e1d17d34 Approved-By: Tom Tromey <tom@tromey.com>
2024-06-07gdb: add IWYU export pragams to gdb_curses.hSimon Marchi1-7/+7
It seems like gdb_curses.h is included whenever we want to access ncurses functionality, instead of including directly ncurses.h. As a result, clangd often erroneously shows that gdb_curses.h inclusions are unused. By adding those pragmas, clangd (and the include-what-you-use tool) understands that gdb_curses.h is a valid provider for whatever these ncurses.h files provide. Change-Id: Ia8acd761dae1577f7151d5fb558f35514b4e4ea2 Approved-By: Tom Tromey <tom@tromey.com>
2024-06-07gdb/tui: change some macros to functionsSimon Marchi17-72/+102
Change the `TUI_*` macros to access known windows to functions. Define them in their respective files, because trying to define them in tui-data.h would end up causing include cycles. This makes static analysis (detection of unused include files in this case) more accurate, and I think in general we should avoid hiding code behind macros if not necessary. Change-Id: I1e38cee843984c48ab34030b19dac0d726f851af Approved-By: Tom Tromey <tom@tromey.com>
2024-06-08Automatic date update in version.inGDB Administrator1-1/+1
2024-06-07gdb/testsuite: Add gdb.arch/aarch64-mops-watchpoint.expThiago Jung Bauermann2-0/+145
Test behaviour of watchpoints triggered by MOPS instructions. This test is similar to gdb.base/memops-watchpoint.exp, but specifically for MOPS instructions rather than whatever instructions are used in the libc's implementation of memset/memcpy/memmove. There's a separate watched variable for each set of instructions so that the testcase can test whether GDB correctly identified the watchpoint that triggered in each case. Approved-By: Luis Machado <luis.machado@arm.com> Tested-By: Luis Machado <luis.machado@arm.com>
2024-06-07gdb/aarch64: Add record support for MOPS instructions.Thiago Jung Bauermann3-0/+333
There are two kinds of MOPS instructions: set instructions and copy instructions. Within each group there are variants with minor differences in how they read or write to memory — e.g., non-temporal read and/or write, unprivileged read and/or write and permutations of those — but they work in the same way in terms of the registers and regions of memory that they modify. The new gdb.reverse/aarch64-mops.exp testcase verifies that MOPS instructions are recorded and correctly reversed. Not all variants of the copy and set instructions are tested, since there are many and the record and replay target processes them in the same way. PR tdep/31666 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31666 Approved-By: Luis Machado <luis.machado@arm.com> Tested-By: Luis Machado <luis.machado@arm.com>
2024-06-07gdb/aarch64: Disable displaced single-step for MOPS instructionsThiago Jung Bauermann4-3/+275
The AArch64 MOPS (Memory Operation) instructions provide a standardised instruction sequence to perform a memset, memcpy or memmove. A sequence is always composed of three instructions: a prologue instruction, a main instruction and an epilogue instruction. As an illustration, here are the implementations of these memory operations in glibc 2.39: (gdb) disassemble/r Dump of assembler code for function __memset_mops: => 0x0000fffff7e8d780 <+0>: d503201f nop 0x0000fffff7e8d784 <+4>: aa0003e3 mov x3, x0 0x0000fffff7e8d788 <+8>: 19c10443 setp [x3]!, x2!, x1 0x0000fffff7e8d78c <+12>: 19c14443 setm [x3]!, x2!, x1 0x0000fffff7e8d790 <+16>: 19c18443 sete [x3]!, x2!, x1 0x0000fffff7e8d794 <+20>: d65f03c0 ret End of assembler dump. (gdb) disassemble/r Dump of assembler code for function __memcpy_mops: => 0x0000fffff7e8c580 <+0>: d503201f nop 0x0000fffff7e8c584 <+4>: aa0003e3 mov x3, x0 0x0000fffff7e8c588 <+8>: 19010443 cpyfp [x3]!, [x1]!, x2! 0x0000fffff7e8c58c <+12>: 19410443 cpyfm [x3]!, [x1]!, x2! 0x0000fffff7e8c590 <+16>: 19810443 cpyfe [x3]!, [x1]!, x2! 0x0000fffff7e8c594 <+20>: d65f03c0 ret End of assembler dump. (gdb) disassemble/r Dump of assembler code for function __memmove_mops: => 0x0000fffff7e8d180 <+0>: d503201f nop 0x0000fffff7e8d184 <+4>: aa0003e3 mov x3, x0 0x0000fffff7e8d188 <+8>: 1d010443 cpyp [x3]!, [x1]!, x2! 0x0000fffff7e8d18c <+12>: 1d410443 cpym [x3]!, [x1]!, x2! 0x0000fffff7e8d190 <+16>: 1d810443 cpye [x3]!, [x1]!, x2! 0x0000fffff7e8d194 <+20>: d65f03c0 ret End of assembler dump. The Arm Architecture Reference Manual says that "the prologue, main, and epilogue instructions are expected to be run in succession and to appear consecutively in memory". Therefore this patch disables displaced stepping on them. The testcase verifies that MOPS sequences are correctly single-stepped. PR tdep/31666 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31666 Approved-By: Luis Machado <luis.machado@arm.com> Tested-By: Luis Machado <luis.machado@arm.com>
2024-06-07[gdb/tdep] Fix ARM_LINUX_JB_PC_EABITom de Vries1-2/+16
In arm-linux-tdep.c, ARM_LINUX_JB_PC_EABI is defined as 9, but it's been 1 since glibc 2.20. See glibc commit 80a56cc3ee ("ARM: Add SystemTap probes to longjmp and setjmp."). Update it, allowing us to run into the gdb/26967 kfail. Tested on arm-linux. Approved-By: Luis Machado <luis.machado@arm.com> PR arm/tdep Bug: https://www.sourceware.org/bugzilla/show_bug.cgi?id=31089
2024-06-07Re: Yet another ecoff fuzzed object fixAlan Modra1-0/+1
In commit 6fc018e9e593 I replaced the fdr_ptr csym check against the header isymMax count with a check against bfd symcount. In fact, both checks are needed. The isymMax check sanity checks accesses against the external sym array, the symcount one against the internal array. * ecoff.c (_bfd_ecoff_slurp_symbol_table): Reinstate fdr_ptr csym check against isymMax.