aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-05-12aarch64: Support for FEAT_OCCMOEzra Sitorus3-0/+30
FEAT_OCCMO - Outer Cacheable Cache Maintenance Operation - introduces system instructions that provides software with a mechanism to publish writes to the Outer cache level.
2025-05-12gdbsupport/event-loop: do not truncate poll timeouts to lower secondPatrick Monnerat1-1/+2
In update_wait_timeout function, microseconds were not taken into account in poll timeout computation, resulting in 100% cpu time consumption in the event loop while waiting for a sub-second timeout. The bug has been introduced in commit c2c6d25. This patch adds the microseconds converted to milliseconds in poll timeout computation. Conversion by excess (ceil) is performed to avoid the same problem with sub-millisecond timeouts too.
2025-05-12gdb: pass std::string from linux_find_memory_regions_fullAndrew Burgess1-6/+6
Update linux_find_memory_region_ftype to take 'const std::string &' instead of 'const char *', update the two functions which are passed as callbacks to linux_find_memory_regions_full. There should be no user visible changes after this commit. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2025-05-12gdb: remove unnecessary function declarationAndrew Burgess1-2/+0
There's no need to declare a function immediately before its definition. Lets not do that. There should be no user visible changes after this commit. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2025-05-12gdb: move extra checks into dump_note_entry_pAndrew Burgess1-6/+13
Now that dump_note_entry_p is always called (see previous commit), we can move some of the checks out of linux_make_mappings_callback into dump_note_entry_p. The checks only exist in linux_make_mappings_callback because, before the previous commit, we couldn't be sure that dump_note_entry_p would be called or not, so linux_make_mappings_callback had to run its own checks. Now that dump_note_entry_p is always called we can rely on that function to filter out which mappings should result in an NT_FILE entry, and linux_make_mappings_callback can just create an entry for everything it is passed. As a result of this change I was able to remove the inode argument from linux_make_mappings_callback and linux_find_memory_regions_thunk. The inode check has now moved to dump_note_entry_p. There should be no user visible changes after this commit. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2025-05-12gdb: always call should_dump_mapping_p during core file creationAndrew Burgess1-12/+6
This commit moves the logic for whether should_dump_mapping_p is called out of linux_find_memory_regions_full and pushes it down into the two callback functions that are used as the should_dump_mapping_p callback; `dump_mapping_p` and `dump_note_entry_p`. Older Linux kernels don't make the 'Anonymous' information available in the smaps file, and currently, GDB handles this by not calling the should_dump_mapping_p callback in linux_find_memory_regions_full, instead the answer is hard-coded to true. This is (maybe) fine for dump_mapping_p, but for dump_note_entry_p, this choice makes little sense. The dump_note_entry_p function doesn't even use the anonymous mapping information. I propose that the 'has_anonymous' check should be moved out of linux_find_memory_regions_full, and pushed into dump_mapping_p. Then in dump_note_entry_p there will be no has_anonymous check; it just isn't needed. This allows linux_find_memory_regions_full to be simplified a little, and will allow some additional clean ups in linux_make_mappings_callback, which is the partner function to dump_note_entry_p (see linux_make_mappings_corefile_notes), now that we know dump_note_entry_p is always called. This follow on clean up will be done in a later commit in this series. Looking at dump_mapping_p, I do wonder if the ::has_anonymous check could be moved later in the function. The first few checks in dump_mapping_p don't rely on the anonymous information, so running them might give better results. However, the lack of the anonymous information is only for older kernels, so testing any changes in this area would likely require spinning up an older kernel, and as the years pass, we likely care about this case less. So for now I've left the ::has_anonymous check as the first thing in dump_mapping_p as this keeps the existing behaviour. There should be no user visible changes after this commit. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2025-05-12gdb: pass struct smaps_data to linux_dump_mapping_p_ftypeAndrew Burgess1-38/+19
Simplify the argument passing in linux_find_memory_regions_full when calling the should_dump_mapping_p callback. Instead of pulling all the components from the smaps_data object and passing them separately, just pass the smaps_data object. I think this change is justified on its own; the code seems cleaner, and easier to read to my eye. But additionally, in a later commit in this series I want to pass smaps_data::has_anonymous to the should_dump_mapping_p callback, which would mean adding yet another argument, and I think the argument list is already long enough. Changing the function now to pass the smaps_data object means that I will already have the ::has_anonymous field available in the later commit. There should be no user visible changes after this commit. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2025-05-12gdb: use bool more in linux-tdep.cAndrew Burgess1-23/+23
Convert linux_dump_mapping_p_ftype to return a bool, and then update everything that is needed to handle the fallout from this change. There should be no user visible changes from this commit. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2025-05-12gdb: add '-stopped' and '-running' options to "info threads"Tankut Baris Aktemur6-14/+272
Add two options to "info threads": `-stopped` and `-running`. The purpose of these options is to filter the output of the command. The `-stopped` option means "print stopped threads only" and, similarly, `-running` means "print the running threads only". When both options are provided by the user, the indication is that the user wants the union. That is, the output contains both stopped and running threads. Suppose we have an application with 5 threads, 2 of which have hit a breakpoint. The "info threads" command in the non-stop mode gives: (gdb) info threads Id Target Id Frame * 1 Thread 0x7ffff7d99740 (running) 2 Thread 0x7ffff7d98700 something () at file.c:30 3 Thread 0x7ffff7597700 (running) 4 Thread 0x7ffff6d96700 something () at file.c:30 5 Thread 0x7ffff6595700 (running) (gdb) Using the "-stopped" flag, we get (gdb) info threads -stopped Id Target Id Frame 2 Thread 0x7ffff7d98700 something () at file.c:30 4 Thread 0x7ffff6d96700 something () at file.c:30 (gdb) Using the "-running" flag, we get (gdb) info threads -running Id Target Id Frame * 1 Thread 0x7ffff7d99740 (running) 3 Thread 0x7ffff7597700 (running) 5 Thread 0x7ffff6595700 (running) (gdb) Using both flags prints all: (gdb) info threads -stopped -running Id Target Id Frame * 1 Thread 0x7ffff7d99740 (running) 2 Thread 0x7ffff7d98700 something () at file.c:30 3 Thread 0x7ffff7597700 (running) 4 Thread 0x7ffff6d96700 something () at file.c:30 5 Thread 0x7ffff6595700 (running) (gdb) When combined with a thread ID, filtering applies to those threads that are matched by the ID. (gdb) info threads 3 Id Target Id Frame 3 Thread 0x7ffff7597700 (running) (gdb) info threads -stopped 3 No threads matched. (gdb) Regression-tested on X86_64 Linux. Reviewed-By: Eli Zaretskii <eliz@gnu.org> Reviewed-By: Guinevere Larsen <guinevere@redhat.com> Approved-by: Pedro Alves <pedro@palves.net
2025-05-12gdb: update "info threads" output when no threads match the argumentsTankut Baris Aktemur5-6/+12
If "info threads" is provided with the thread ID argument but no such threads matching the thread ID(s) are found, GDB prints No threads match '<ID...>'. Update this output to the more generalized No threads matched. The intention is that the next patch, and potentially future ones, will extend the command with more filter/match arguments. We cannot customize the output to each such argument. Hence, be more generic. Reviewed-By: Eli Zaretskii <eliz@gnu.org> Approved-by: Pedro Alves <pedro@palves.net
2025-05-12gdb: pass info_threads_opts to print_thread_info_1Tankut Baris Aktemur1-39/+41
The "info threads" command tracks its options in a struct named 'info_threads_opts', which currently has only one option. Pass the whole options object to helper functions, instead of passing the option value individually. This is a refactoring to make adding more options easier. Reviewed-By: Guinevere Larsen <guinevere@redhat.com> Approved-by: Pedro Alves <pedro@palves.net
2025-05-12Automatic date update in version.inGDB Administrator1-1/+1
2025-05-11ubsan: size_inc_line_addr integer overflowAlan Modra1-1/+1
Fix a fuzzer testcase where a large positive line_delta causes signed overflow when subtracting -5. Signed overflow is perfectly OK here.
2025-05-11msan: use of uninitialised data in get_cie_infoAlan Modra1-19/+28
This completely bogus oss-fuzz x86 testcase results in a read from an uninitialised (at the time check_eh_frame is called) part of an insn frag: .section .debug_frame orl $1,x .long x .uleb128 0,x,0 x: Fix the problem by verifying the assumption in get_cie_info that a CIE starts at the beginning of .eh_frame or .debug_frame. Or at least exclude silliness involving instructions placed there. That seems a useful sanity check. Also sanity check sizes of initial FDE fields. Yes, this doesn't completely stop the problem since you could place an insn with a relocated field later in the CIE. If fuzzers find such a testcase I'll ignore it. * ehopt.c (struct cie_info): Add "f" field. (get_cie_info): Return a bool. Verify frag at start of chain is one with the CIE size found by check_eh_frame. (check_eh_frame): Save CIE start frag. Only accept 4 or 8 byte fields in state_saw_size, state_saw_cie_offset and state_saw_pc_begin. Formatting. Localise "fix" variable.
2025-05-11Automatic date update in version.inGDB Administrator1-1/+1
2025-05-10gdb: LoongArch: Emulate floating-point branch instructionsTiezhu Yang1-1/+17
Add bceqz and bcnez cases in loongarch_insn_is_cond_branch() and loongarch_next_pc() to emulate floating-point branch instructions. Here are the references: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#_bceqz_bcnez https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#table-table-of-instruction-encoding Approved-by: Kevin Buettner <kevinb@redhat.com> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
2025-05-10Automatic date update in version.inGDB Administrator1-1/+1
2025-05-09MAINTAINERS: Update my email addressPeter Bergner1-1/+1
Update my email address and move up Surya's name as the main PPC contact. Signed-off-by: Peter Bergner <bergner@tenstorrent.com>
2025-05-09Fix two comments in cli-style.cTom Tromey1-2/+2
I noticed that a couple of new comments in cli-style.c mentioned the wrong command name. This patch fixes the comments.
2025-05-09Move "show style sources" documentationTom Tromey1-3/+3
I noticed that I had inadvertently put the "set style warning-prefix" documentation between the paragraph for "set style sources" and the paragraph for "show style sources". This patch moves the latter up a bit to clean this up.
2025-05-09aarch64: Mark predicate-as-counter pseudo instructionsAlice Carlotti3-17/+33
Using explicit pseudo aliases is clearer and more consistent with other instruction aliases. This does not change behaviour. For the non-alias instructions (everything except mov) we already picked the first matching entry for disassembly by default. For mov we picked the last matching aliased entry, which remained the original alias since do_misc_decoding doesn't recognise OP_MOV_PN_PN.
2025-05-09aarch64: Mark clearbhb as a pseudo instructionAlice Carlotti1-1/+1
This was an early name for the clrbhb hint instruction. Some software was written with the old name before it was renamed, so we support it for assembly but should never use it in disassembly. This patch has no functional change, because we already pick (by default) the last matching alias in the opcode table, and clrbhb is listed later than clearbhb.
2025-05-09aarch64: Merge dgh tests into system.dAlice Carlotti4-15/+2
2025-05-09aarch64: Fix dgh disassemblyAlice Carlotti5-7/+8
2025-05-09aarch64: Mark SME mova aliasesAlice Carlotti3-60/+100
This will only change behaviour during disassembly with -M no-aliases.
2025-05-09aarch64: Mark rev64 as a pseudo instructionAlice Carlotti3-5/+5
This is more natural than raising the priority of rev with F_P1, and is functionally equivalent.
2025-05-09aarch64: Add new test original-missing-misc.dAlice Carlotti2-0/+88
This test file includes all the remaining untested instructions that weren't part of a larger group of new or existing tests.
2025-05-09aarch64: Add new test mov-wide.dAlice Carlotti2-0/+86
Only movn was previously untested.
2025-05-09aarch64: Add new test exception-generation.dAlice Carlotti2-0/+54
svc and dcps* were already tested, but are included here as part of the same encoding group.
2025-05-09aarch64: Add new test conditional-compare.dAlice Carlotti2-0/+153
The register form of ccmp was already tested.
2025-05-09aarch64: Add new test branch-cond-pseudos.dAlice Carlotti2-0/+73
beq, bne, bcs and bcc were already tested, and bge and ble are also used in scfi tests.
2025-05-09aarch64: Add new test ldst-unpriv.dAlice Carlotti2-0/+125
All instructions were previously untested.
2025-05-09aarch64: Add new test ldst-extend-general.dAlice Carlotti2-0/+307
All instructions were previously untested.
2025-05-09aarch64: Add new test dp-general-two-source.dAlice Carlotti2-0/+178
lsl was already tested but is included here as part of the same encoding group.
2025-05-09aarch64: Add new test dp-general-one-source.dAlice Carlotti2-0/+88
rev16 and the 64-bit rev/rev64 instructions were already tested, but are included here as part of the same encoding group.
2025-05-09aarch64: Add new test addsub-carry.dAlice Carlotti2-0/+102
All instructions were previously untested.
2025-05-09aarch64: Add new test advsimd-scalar-doubling-mul.dAlice Carlotti2-0/+194
All instructions were previously untested.
2025-05-09aarch64: Add new test advsimd-scalar-two-reg-misc.dAlice Carlotti2-0/+221
sqabs, sqneg, abs and neg were already tested, but are included here as part of the same encoding group.
2025-05-09aarch64: Add new test advsimd-scalar-shift-immediate.dAlice Carlotti2-0/+356
All instructions were previously untested.
2025-05-09aarch64: Add new test advsimd-scalar-three-same.dAlice Carlotti2-0/+414
All instructions were previously untested.
2025-05-09aarch64: Add new test advsimd-copy.dAlice Carlotti2-0/+359
Only smov and the second dup variant were previously untested. However, the only test for umov was a disassembly test with -M no-aliases, and the first dup variant was only tested in assembly in diagnostic.d with the non-architectural syntax `dup v0.2d, v1.2d[0]`.
2025-05-09aarch64: Add new test advsimd-permute.dAlice Carlotti2-0/+501
All instructions were previously untested.
2025-05-09aarch64: Add new test advsimd-modified-immediate.dAlice Carlotti2-0/+201
All instructions (7 opcode table entries) were previously untested.
2025-05-09aarch64: Add new test advsimd-two-reg-misc-hilo.dAlice Carlotti4-0/+1454
All instructions were previously untested.
2025-05-09aarch64: Add new test advsimd-two-reg-misc.dAlice Carlotti2-0/+830
sqabs, abs, not, mvn, sqneg and neg were already tested, and cmeq was already assembled in an error test (sve-reg-diagnostic.d), but they are all included here as part of the same encoding group.
2025-05-09aarch64: Add new test advsimd-mul-element.dAlice Carlotti2-0/+750
All instructions were previously untested.
2025-05-09aarch64: Add new test advsimd-widening-narrowing.dAlice Carlotti2-0/+1210
All instructions were previously untested.
2025-05-09aarch64: Add new test advsimd-three-same.dAlice Carlotti2-0/+2453
All instructions except orr/mov were previously untested.
2025-05-09aarch64: Add missing widening fmops testAlice Carlotti3-10/+8
Also remove the valid instructions from the test for invalid instructions - this meant that the instruction was previously being tested for assembly but not disassembly.
2025-05-09aarch64: Add tests for fabd, urecpe and ursqrtAlice Carlotti2-2/+22
Other instructions in the encoding group are tested in advsimd-fp16.d, so add these instructions to the existing test file.