aboutsummaryrefslogtreecommitdiff
path: root/gdb
AgeCommit message (Collapse)AuthorFilesLines
25 hoursgdb/configure.ac: remove elf_hp.h checkHEADmasterSimon Marchi3-7/+0
The comment says this is for HP/UX, which is no longer supported. There should be no functional changes with this, since nothing checks HAVE_ELF_HP_H. Change-Id: Ie897fc64638c9fea28463e1bf69e450c3673fd84
25 hoursgdb, gdbserver, gdbsupport: flatten and sort some list in configure filesSimon Marchi2-32/+138
This makes the lists easier sort read and modify. There are no changes in the generated config.h files, so I'm confident this brings no functional changes. Change-Id: Ib6b7fc532bcd662af7dbb230070fb1f4fc75f86b
31 hoursgdb: handle DW_AT_entry_pc pointing at an empty sub-rangeAndrew Burgess4-1/+356
The test gdb.cp/step-and-next-inline.exp creates a test binary called step-and-next-inline-no-header. This test includes a function `tree_check` which is inlined 3 times. When testing with some older versions of gcc (I've tried 8.4.0, 9.3.1) we see the following DWARF representing one of the inline instances of tree_check: <2><8d9>: Abbrev Number: 38 (DW_TAG_inlined_subroutine) <8da> DW_AT_abstract_origin: <0x9ee> <8de> DW_AT_entry_pc : 0x401165 <8e6> DW_AT_GNU_entry_view: 0 <8e7> DW_AT_ranges : 0x30 <8eb> DW_AT_call_file : 1 <8ec> DW_AT_call_line : 52 <8ed> DW_AT_call_column : 10 <8ee> DW_AT_sibling : <0x92d> ... <1><9ee>: Abbrev Number: 46 (DW_TAG_subprogram) <9ef> DW_AT_external : 1 <9ef> DW_AT_name : (indirect string, offset: 0xe8): tree_check <9f3> DW_AT_decl_file : 1 <9f4> DW_AT_decl_line : 38 <9f5> DW_AT_decl_column : 1 <9f6> DW_AT_linkage_name: (indirect string, offset: 0x2f2): _Z10tree_checkP4treei <9fa> DW_AT_type : <0x9e8> <9fe> DW_AT_inline : 3 (declared as inline and inlined) <9ff> DW_AT_sibling : <0xa22> ... Contents of the .debug_ranges section: Offset Begin End ... 00000030 0000000000401165 0000000000401165 (start == end) 00000030 0000000000401169 0000000000401173 00000030 0000000000401040 0000000000401045 00000030 <End of list> ... Notice that one of the sub-ranges of tree-check is empty, this is the line marked 'start == end'. As the end address is the first address after the range, this range cover absolutely no code. But notice too that the DW_AT_entry_pc for the inline instance points at this empty range. Further, notice that despite the ordering of the sub-ranges, the empty range is actually in the middle of the region defined by the lowest address to the highest address. The ordering is not a problem, the DWARF spec doesn't require that ranges be in any particular order. However, this empty range is causing issues with GDB newly acquire DW_AT_entry_pc support. GDB already rejects, and has done for a long time, empty sub-ranges, after all, the DWARF spec is clear that such a range covers no code. The recent DW_AT_entry_pc patch also had GDB reject an entry-pc which was outside of the low/high bounds of a block. But in this case, the entry-pc value is within the bounds of a block, it's just not within any useful sub-range. As a consequence, GDB is storing the entry-pc value, and making use of it, but when GDB stops, and tries to work out which block the inferior is in, it fails to spot that the inferior is within tree_check, and instead reports the function into which tree_check was inlined. I've tested with newer versions of gcc (12.2.0 and 14.2.0) and with these versions gcc is still generating the empty sub-range, but now this empty sub-range is no longer the entry point. Here's the corresponding ranges table from gcc 14.2.0: Contents of the .debug_rnglists section: Table at Offset: 0: Length: 0x56 DWARF version: 5 Address size: 8 Segment size: 0 Offset entries: 0 Offset Begin End ... 00000021 0000000000401165 000000000040116f 0000002b 0000000000401040 (base address) 00000034 0000000000401040 0000000000401040 (start == end) 00000037 0000000000401041 0000000000401046 0000003a <End of list> ... The DW_AT_entry_pc is 0x401165, but this is not the empty sub-range, as a result, when GDB stops at the entry-pc, GDB will correctly spot that the inferior is in the tree_check function. The fix I propose here is, instead of rejecting entry-pc values that are outside the block's low/high range, instead reject entry-pc values that are not inside any of the block's sub-ranges. Now, GDB will ignore the prescribed entry-pc, and will instead select a suitable default entry-pc based on either the block's low-pc value, or the first address of the first range. I have extended the gdb.cp/step-and-next-inline.exp test to check this case, but this does depend on the compiler version being used (newer compilers will always pass, even without the fix). So I have also added a DWARF assembler test to cover this case. Reviewed-By: Kevin Buettner <kevinb@redhat.com>
34 hourstestsuite, threads: add missing return statementsRohr, Stephan2-0/+5
Add missing return statements in * gdb.threads/process-exit-status-is-leader-exit-status.c * gdb.threads/next-fork-exec-other-thread.c to fix 'no return statement' compiler warnings, e.g.: process-exit-status-is-leader-exit-status.c: In function ‘start’: process-exit-status-is-leader-exit-status.c:46:1: warning: no return statement in function returning non-void [-Wreturn-type] 46 | } | ^ Approved-By: Simon Marchi <simon.marchi@efficios.com>
5 days[gdb/syscalls] Add syscalls {set,get,list,remove}xattratTom de Vries24-0/+96
In commit 58776901074 ("[gdb/syscalls] Update to linux v6.11") I updated to linux v6.11, but a recent submission for loongarch [1] used a current trunk version, so it makes sense to do this as well elsewhere. Using linux current trunk with update-linux-from-src.sh gets us 4 more syscalls: - setxattrat - getxattrat - listxattrat - removexattrat Tested on x86_64-linux. [1] https://sourceware.org/pipermail/gdb-patches/2024-November/213613.html
6 daysgdb/testsuite: skip gdb.threads/omp-par-scope.exp with clangGuinevere Larsen1-0/+8
Since 2020 it has been reported to clang[1] that the debug information around OpenMP is insufficient. The OpenMP section is not declared within the correct scope, and instead clang marks as if the section was a function in the global scope. This causes several failures in the test gdb.threads/omp-par-scope.exp when using clang to test GDB. Since this isn't a true failure of GDB, and there is little expectation that clang will be able to fix this soon, this commit disables the aforementioned test when clang is being used. [1] https://github.com/llvm/llvm-project/issues/44236 Approved-by: Kevin Buettner <kevinb@redhat.com>
6 days[gdb/symtab] Fix parent map dumpTom de Vries4-12/+36
Before the fix for PR symtab/32225, the parent map dump showed a mapping from section offsets to cooked index entries: ... 0x0000000000000035 0x3ba9560 (0x34: sp1::A) ... but now that's no longer the case: ... 0x00000000406f5405 0x410a04d0 (0x34: sp1::A) ... Fix this by extending the annotation somewhat, such that we get: ... map start: 0x0000000012c52405 0x135fd550 (section: .debug_info, offset: 0x35) -> (0x34: sp1::A) ... Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32225
6 days[gdb/testsuite] Add gdb.dwarf2/dw2-tu-dwarf-4-5.expTom de Vries3-0/+173
Add a regression test for PR symtab/32225. Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32225
6 days[gdb/symtab] Fix parent map when handling .debug_info and .debug_typesAuthor: Tom Tromey2-14/+9
Consider test-case: ... $ cat test.c namespace sp1 { class A { int i; const int f1 = 1; ... const int f29 = 1; }; } sp1::A a; void _start (void) {} $ cat test2.c namespace sp2 { class B { float f; const float f1 = 1; ... const float f29 = 1; }; } sp2::B b; ... compiled like this: ... $ g++ test.c -gdwarf-4 -c -g -fdebug-types-section $ g++ test2.c -gdwarf-5 -c -g -fdebug-types-section $ g++ -g test.o test2.o -nostdlib ... Using: ... $ gdb -q -batch -iex "maint set worker-threads 0" a.out -ex "maint print objfiles" ... we get a cooked index entry with incorrect parent: ... [29] ((cooked_index_entry *) 0x3c57d1a0) name: B canonical: B qualified: sp1::A::B DWARF tag: DW_TAG_class_type flags: 0x0 [] DIE offset: 0x154 parent: ((cooked_index_entry *) 0x3c57d110) [A] ... The problem is that the parent map assumes that all offsets are in the same section. Fix this by using dwarf2_section_info::buffer-relative addresses instead, which get us instead: ... [29] ((cooked_index_entry *) 0x3f0962b0) name: B canonical: B qualified: sp2::B DWARF tag: DW_TAG_class_type flags: 0x0 [] DIE offset: 0x154 parent: ((cooked_index_entry *) 0x3f096280) [sp2] ... Tested on x86_64-linux. PR symtab/32225 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32225
6 days[gdb/tdep] s390: Add arch15 record/replay supportAndreas Arnez1-3/+75
Enable recording of the new "arch15" instructions on z/Architecture targets.
7 daysnios2: Remove all GDB support for Nios II targets.Sandra Loosemore21-3028/+6
Intel has EOL'ed the Nios II architecture, and it's time to remove support from all toolchain components before it gets any more bit-rotten from lack of maintenance or regular testing.
7 days[gdb/syscalls] Update aarch64-linux.xml to linux v6.11Tom de Vries3-9/+144
Use gdb/syscalls/update-linux.sh to update aarch64-linux.xml.in to linux v6.11, and update aarch64-linux.xml by running make. Noteworthy changes are removal of entries: - arch_specific_syscall - syscalls which look like they were added accidentally. I modified update-linux.sh to keep the copyright start date. Verified with shellcheck. Tested-By: Luis Machado <luis.machado@arm.com> Approved-By: Luis Machado <luis.machado@arm.com>
7 days[gdb/syscalls] Sync with strace v6.12Tom de Vries13-12/+13
I ran gdb/syscalls/update-linux-defaults.sh with strace sources v6.12, and got one difference in gdb/syscalls/linux-defaults.xml.in: ... + <syscall name="mseal" groups="memory"/> ... Rerun make to propagate this change to the xml files.
7 days[gdb/syscalls] Use update-linux-from-src.sh for arm-linuxTom de Vries4-85/+235
I tried to use arm-linux.py to regenerate arm-linux.xml.in, but it didn't work. Fix this by: - adding handling of arm-linux.xml.in in update-linux-from-src.sh, - regenerating arm-linux.xml.in using update-linux-from-src.sh and linux 6.11 sources, - regenerating arm-linux.xml using make, and - removing arm-linux.py. This changes the name "oldolduname" into "olduname". Tested on arm-linux. Verified with shellcheck.
7 days[gdb/syscalls] Restructure update-linux-from-src.shTom de Vries1-13/+72
Restructure update-linux-from-src.sh to do the generation of each line in the script it self rather than in awk. Tested on aarch64-linux. Verified with shellcheck.
7 days[gdb/syscalls] Improve update-linux-from-src.shTom de Vries1-21/+52
Some improvements in gdb/syscalls/update-linux-from-src.sh: - use bash instead of sh - use local to distinguish between local and global vars (which brings to light that pre uses the global rather than the local start_date) - factor out main and parse_args - factor out regen - iterate over *.xml.in instead of *.in Tested on aarch64-linux. Verified with shellcheck.
7 days[gdb/syscalls] Update to linux v6.11Tom de Vries22-0/+24
Regenerate some gdb/syscalls/*.xml.in files using gdb/syscalls/update-linux-from-src.sh and linux v6.11 sources. Regenerate the corresponding gdb/syscalls/*.xml using make. Tested on aarch64-linux.
8 daysConvert dwarf2_per_objfile::die_type_hash to new hash tableSimon Marchi2-80/+43
Convert dwarf2_per_objfile::die_type_hash, which maps debug info offsets to `type *`, to gdb::unordered_map. Change-Id: I5c174af64ee46d38a465008090e812acf03704ec Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert dwarf2_cu::call_site_htab to new hash tableSimon Marchi5-63/+65
Convert one use of htab_t, mapping (unrelocated) pc to call_site objects, to `gdb::unordered_map<unrelocated_addr, call_site *>`. Change-Id: I40a0903253a8589dbdcb75d52ad4d233931f6641 Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert dwarf_cu::die_hash to new hash tableSimon Marchi4-58/+44
Convert one use of htab_t, mapping offsets to die_info object, to `gdb::unordered_set`. Change-Id: Ic80df22bda551e2d4c2511d167e057f4d6cd2b3e Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert gdb_bfd.c to new hash tableSimon Marchi1-65/+47
This converts the BFD cache in gdb_bfd.c to use the new hash table. Change-Id: Ib6257fe9d4f7f8ef793a2c82d53935a8d2c245a3 Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert more DWARF code to new hash tableSimon Marchi3-74/+43
This converts more code in the DWARF reader to use the new hash table. Change-Id: I86f8c0072f0a09642de3d6f033fefd0c8acbc4a3 Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert all_bfds to new hash tableSimon Marchi2-31/+19
This converts gdb_bfd.c to use the new hash table for all_bfds. This patch slightly changes the htab_t pretty-printer test, which was relying on all_bfds. Note that with the new hash table, gdb-specific printers aren't needed; the libstdc++ printers suffice -- in fact, they are better, because the true types of the contents are available. Change-Id: I48b7bd142085287b34bdef8b6db5587581f94280 Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert typedef hash to new hash tableSimon Marchi3-110/+71
This converts the typedef hash to use the new hash table. This patch found a latent bug in the typedef code. Previously, the hash function looked at the type name, but the hash equality function used types_equal -- but that strips typedefs, meaning that equality of types did not imply equality of hashes. This patch fixes the problem and updates the relevant test. Change-Id: I0d10236b01e74bac79621244a1c0c56f90d65594 Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert abbrevs to new hash tableSimon Marchi2-59/+48
This converts the DWARF abbrevs themselves to use the new hash table. Change-Id: I0320a733ecefe2cffeb25c068f17322dd3ab23e2 Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert abbrev cache to new hash tableSimon Marchi2-43/+42
This converts the DWARF abbrev cache to use the new hash table. Change-Id: I5e88cd4030715954db2c43f873b77b6b8e73f5aa Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert gnu-v3-abi.c to new hash tableSimon Marchi1-66/+32
This converts gnu-v3-abi.c to use the new hash table. This change shows how a std::vector can easily be made directly from the hash table, simplifying the earlier approach of constructing a vector and a hash table at the same time. Change-Id: Ia0c387a035a52300db6b6f5a3a2e5c69efa01155 Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert static links to new hash tableSimon Marchi3-67/+13
This converts the objfile static link table to the new hash map. Change-Id: If978e895679899ca2af4ef01c12842b4184d88e6 Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert type copying to new hash tableSimon Marchi14-87/+41
This converts the type copying code to use the new hash map. Change-Id: I35f0a4946dcc5c5eb84820126cf716b600f3302f Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert compile/compile.c to new hash tableSimon Marchi2-146/+19
This converts compile/compile.c to use the new hash table. Change-Id: I7df3b8d791ece731ae0d1d64cdc91a2e372f5d4f Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert disasm.c to new hash tableSimon Marchi1-67/+18
This converts disasm.c to use the new hash table. Change-Id: I2efbe7ecc2964ec49e0b726ad4674e8eafc929f7 Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert py-framefilter.c to new hash tableSimon Marchi1-30/+32
This converts py-framefilter.c to use the new hash table. Change-Id: I38f4eaa8ebbcd4fd6e5e8ddc462502a92bf62f5e Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert breakpoint.c to new hash tableSimon Marchi1-10/+3
This converts breakpoint.c to use the new hash table. Change-Id: I6d997a6242969586a7f8f9eb22cc8dd8d3ac97ff Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert dwarf2/macro.c to new hash tableSimon Marchi1-14/+8
This converts dwarf2/macro.c to use the new hash table. Change-Id: I6af0d1178e2db330fe3a89d57763974145ed17c4 Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert target-descriptions.c to new hash tableSimon Marchi1-11/+9
This converts target-descriptions.c to use the new hash table. Change-Id: I03dfc6053c9856c5578548afcfdf58abf8b7ec2c Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert linespec.c to new hash tableSimon Marchi1-36/+18
This converts linespec.c to use the new hash table. Note that more simplification could perhaps be done. Currently, the collectors in this code insert an element into a set and then, if the element has not been seen before, append it to a vector. If we know the order does not matter, or if the results can be sorted later, we could dispense with the vector. This would simplify the code some more. (This technique is used in the vtable patch, later in this series.) Change-Id: Ie6828b1520d918d189ab5140dc8094a609152cf2 Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert filename-seen-cache.h to new hash tableSimon Marchi3-80/+20
This converts filename-seen-cache.h to use the new hash table. filename-seen-cache.c is removed. Change-Id: Iffac1d5e49d1610049b7deeef6e98d49e644366a Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysConvert compile-c-symbols.c to new hash tableSimon Marchi1-48/+5
This converts compile-c-symbols.c to use the new hash table. I made it use a set of string_view instead of a set of `symbol *`, to avoid calling `symbol::natural_name` over and over. This appears safe to do, since I don't expect the storage behing the natural names to change during the lifetime of the map. Change-Id: Ie9f9334d4f03b9a8ae6886287f82cd435eee217c Co-Authored-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
8 daysgdb: make `cooked_index_storage::get_abbrev_table_cache` return a referenceSimon Marchi2-4/+4
It can never return nullptr, return a reference instead of a pointer. Change-Id: Ibc6f16eb74dc16059152982600ca9f426d7f80a4 Approved-By: Tom Tromey <tom@tromey.com>
8 daysgdb: constification around abbrev_table_cache and abbrev_tableSimon Marchi3-8/+9
Make `abbrev_table_cache::find` const, make it return a pointer to `const abbrev_table`, adjust the fallouts. Make `cooked_index_storage::get_abbrev_table_cache` const, make itreturn a pointer to const `abbrev_table_cache`. Change-Id: If63b4b3a4c253f3bd640b13bce4a854eb2d75ece Approved-By: Tom Tromey <tom@tromey.com>
8 daysgdb: rename abbrev_cache to abbrev_table_cacheSimon Marchi5-27/+26
This cache holds `abbrev_table` objects, so I think it's clearer and more consistent to name it `abbrev_table_cache`. Rename it and everything that goes along with it. Change-Id: I43448c0aa538dd2c3ae5efd2f7b3e7b827409d8c Approved-By: Tom Tromey <tom@tromey.com>
8 daysgdb: do better in breakpoint_free_objfileAndrew Burgess1-2/+24
The breakpoint_free_objfile function is called from the objfile destructor, and has the job of removing references to the soon to be deleted objfile from all breakpoint locations. The current implementation of breakpoint_free_objfile seems to miss lots of possible objfile references within bp_location. Currently we only check if bp_location::symtab is associated with the objfile in question, but there's bp_location::section and bp_location::probe, both of which might reference the soon to be deleted objfile. Additionally bp_location::symbol and bp_location::msymbol if set will surely be related to the objfile and should also be cleaned up. I'm not aware that this causes any problems, but it doesn't seem like a good idea to retain pointers to deleted state, so I propose that we improve breakpoint_free_objfile to set these pointers back to nullptr. In the future I plan to investigate the possibility of merging the functionality of breakpoint_free_objfile into disable_breakpoints_in_freed_objfile which is called via the gdb::observers::free_objfile event. However, I already have a patch series in progress which touches this area of GDB, and I'd like to avoid conflicting with that earlier series: https://inbox.sourceware.org/gdb-patches/cover.1724948606.git.aburgess@redhat.com Once this patch, and that earlier series have landed then I'll see if I can merge breakpoint_free_objfile, but I don't think that this needs to block this patch. There should be no user visible changes after this commit.
8 daysgdb: remove an unnecessary scope block in update_breakpoint_locationsAndrew Burgess1-45/+45
In update_breakpoint_locations there's a scope block which I don't think adds any value. There is one local defined within the scope, the local is currently an 'int' but should be a 'bool', either way there's no destructor being triggered when we exit the scope. This commit changes the local to a 'bool', removes the unnecessary scope, and re-indents the code. Within the (now removed) scope was a `for' loop. Inside the loop I have converted this: for (....) { if (CONDITION) { /* Body */ } } to this: for (....) { if (!CONDITION) continue; /* Body */ } which means that the body doesn't need to be indented as much, making things easier to read. There should be no functional change after this commit. Reviewed-By: Klaus Gerlicher <klaus.gerlicher@intel.com>
8 daysgdb: remove bp_location::objfileAndrew Burgess2-4/+0
The bp_location::objfile member variable is never used, so lets delete it. There should be no user visible changes after this commit.
8 daysgdb/testsuite: force TERM setting for some filename completion testsAndrew Burgess1-62/+47
Some of the filename completion tests perform mid-line completion. That is we enter a partial line, then move the cursor back to the middle of the line and perform completion. The problem is that, emitting characters into the middle of a terminal line relies on first emitting some control characters. And which control characters are emitted will depend on the current TERM setting. When I initially added the mid-line completion tests I setup two regexp that covered two different terminal types, but PR gdb/32338 identifies additional terminal types that emit different sequences of control characters. Rather than trying to handle all possible terminal types, lets just force the TERM variable to something simple (i.e. "dumb") and then just support that one case. The thing being tested for here was that GDB would complete a filename in the middle of a line, the specific terminal type was not really important. I've simplified the regexp used to match the completion in two places, and I now force TERM to be "dumb" for the mid-line completion tests. I've tested this by setting my global environment TERM to 'ansi', 'xterm', 'xterm-mono', and 'dumb', and I see no failures in any mode now. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32338 Tested-By: Tom de Vries <tdevries@suse.de>
8 daysgdb: Add LoongArch process record/replay support in NEWS and docHui Li2-1/+4
At present, process record/replay and reverse debugging has been implemented on LoongArch. Update the NEWS and doc to record this new change. Signed-off-by: Hui Li <lihui@loongson.cn> Reviewed-By: Eli Zaretskii <eliz@gnu.org> Approved-By: Tom Tromey <tom@tromey.com> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
8 daysgdb: LoongArch: Add system call support for process record/replayHui Li4-0/+937
The process record and replay function also need record Linux system call instruction. This patch adds LoongArch system call number definitions in gdb/arch/loongarch-syscall.h, and adds loongarch_linux_syscall_record() in gdb/loongarch-linux-tdep.c to record system call execute log. With this patch, the main functions of process record/replay and reverse debugging are implemented. The LoongArch system call numbers definitions are obtained from Linux kernel. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/unistd.h https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/loongarch/include/asm/unistd.h Signed-off-by: Hui Li <lihui@loongson.cn> Approved-By: Guinevere Larsen <guinevere@redhat.com> (record-full) Approved-By: Tom Tromey <tom@tromey.com> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
8 daysgdb: LoongArch: Add basic process record/replay supportHui Li5-1/+504
GDB provides a special process record and replay target that can record a log of the process execution, and replay it later with both forward and reverse execution commands. This patch adds the basic support of process record and replay on LoongArch, it allows users to debug basic LoongArch instructions and provides reverse debugging support. Here is a simple example on LoongArch: $ cat test.c int a = 0; int main() { a = 1; a = 2; return 0; } $ gdb test ... (gdb) start ... Temporary breakpoint 1, main () at test.c:4 4 a = 1; (gdb) record (gdb) p a $1 = 0 (gdb) n 5 a = 2; (gdb) n 6 return 0; (gdb) p a $2 = 2 (gdb) rn 5 a = 2; (gdb) rn Reached end of recorded history; stopping. Backward execution from here not possible. main () at test.c:4 4 a = 1; (gdb) p a $3 = 0 (gdb) record stop Process record is stopped and all execution logs are deleted. (gdb) c Continuing. [Inferior 1 (process 129178) exited normally] Signed-off-by: Hui Li <lihui@loongson.cn> Approved-By: Guinevere Larsen <guinevere@redhat.com> (record-full) Approved-By: Tom Tromey <tom@tromey.com> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
8 daysgdb: LoongArch: Add instruction definition for process recordHui Li1-0/+2096
GDB provides a special process record function that can record a log of the process execution. The core of this feature is need to record the execution of all instructions. This patch adds opcode definitions and judgments in gdb/arch/loongarch-insn.h. This is preparation for later patch on LoongArch, there is no effect for the other archs with this patch. The LoongArch opcode and mask definitions are obtained from https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=opcodes/loongarch-opc.c LoongArch instruction description refer to the LoongArch Reference Manual: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html Signed-off-by: Hui Li <lihui@loongson.cn> Reviewed-By: Guinevere Larsen <guinevere@redhat.com> Approved-By: Tom Tromey <tom@tromey.com> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
10 days[gdb/contrib] Add two words to common-misspellings.txtTom de Vries1-0/+2
While reviewing changes generated by spellcheck.sh for directory sim, I noticed two more misspellings: ... arrithemetic->arithmetic electricaly->electrically ... Add them to common-misspellings.txt, and fix them in directory sim. Tested by rebuilding on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com>