aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-02-06[gdb/build] Fix unused var in linux-fork.cTom de Vries1-2/+2
On x86_64-linux, with gcc 7.5.0 I ran into a build breaker: ... linux-fork.c: In function ‘void detach_checkpoint_command(const char*, int)’: linux-fork.c:744:16: error: unused variable ‘inf’ [-Werror=unused-variable] auto [fi, inf] = parse_checkpoint_id (args); ^ linux-fork.c: In function ‘void linux_fork_context(fork_info*, int, inferior*)’: linux-fork.c:1020:22: error: unused variable ‘oldinf’ [-Werror=unused-variable] auto [oldfp, oldinf] = find_fork_ptid (inferior_ptid); ^ ... Fix this by dropping the unused variables, similar how that was done in commit bc13da1980c ("[gdb/build] Fix unused var in corelow.c"). Tested on x86_64-linux, by completing a build.
2025-02-05Return bool from dwarf2_read_gdb_indexTom Tromey2-10/+11
This changes dwarf2_read_gdb_index to return bool rather than int.
2025-02-06x86: Use hehdr_start for __ehdr_startH.J. Lu1-5/+10
Use hehdr_start for __ehdr_start instead of elf_link_hash_lookup. * elfxx-x86.c (elf_x86_linker_defined): Use hehdr_start if name is NULL. (_bfd_x86_elf_link_check_relocs): Pass NULL as __ehdr_start to elf_x86_linker_defined. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-02-06Automatic date update in version.inGDB Administrator1-1/+1
2025-02-05Linux checkpoints: Update NEWS and gdb.texinfo regarding multiple inferiorsKevin Buettner2-1/+21
Reviewed-By: Eli Zaretskii <eliz@gnu.org> Reviewed-By: Tom Tromey <tom@tromey.com> Approved-By: Andrew Burgess <aburgess@redhat.com>
2025-02-05Print only process ptids from linux-fork.cKevin Buettner2-13/+28
This commit causes a "process ptid" to be passed to all calls of target_pid_to_str in linux-fork.c. A "process ptid" is one in which only the pid component is set to a non-zero value; both the lwp and tid components are zero. The reason for doing this is that pids associated with checkpoints can never be a thread due to the fact that checkpoints (which are implemented by forking a process) can only (reasonably) work with single-threaded processes. Without this commit, many of the "info checkpoints" commands in gdb.multi/checkpoint-multi.exp will incorrectly show some of the checkpoints as threads. E.g... Id Active Target Id Frame * 1.0 y Thread 0x7ffff7cb5740 (LWP 581704) at 0x401199, file hello.c, line 51 1.2 n process 581716 at 0x401199, file hello.c, line 51 1.3 n process 581717 at 0x401199, file hello.c, line 51 2.1 n process 581708 at 0x401258, file goodbye.c, line 62 2.2 y Thread 0x7ffff7cb5740 (LWP 581712) at 0x401258, file goodbye.c, line 62 3.0 y Thread 0x7ffff7cb5740 (LWP 581713) at 0x40115c, file hangout.c, line 31 3.2 n process 581715 at 0x40115c, file hangout.c, line 31 (gdb With this commit in place, the output looks like this instead: Id Active Target Id Frame * 1.0 y process 535276 at 0x401199, file hello.c, line 51 1.2 n process 535288 at 0x401199, file hello.c, line 51 1.3 n process 535289 at 0x401199, file hello.c, line 51 2.1 n process 535280 at 0x401258, file goodbye.c, line 62 2.2 y process 535284 at 0x401258, file goodbye.c, line 62 3.0 y process 535285 at 0x40115c, file hangout.c, line 31 3.2 n process 535287 at 0x40115c, file hangout.c, line 31 (For brevity, I've removed the directory elements in each of the paths above.) The testcase, gdb.multi/checkpoint-multi.exp, has been updated to reflect the fact that only "process" should now appear in output from "info checkpoints". Reviewed-By: Tom Tromey <tom@tromey.com> Approved-By: Andrew Burgess <aburgess@redhat.com>
2025-02-05Capitalize output of successful checkpoint commandKevin Buettner4-4/+4
This commit causes the output of a "checkpoint" command to be changed from: checkpoint N: fork returned pid DDDD to: Checkpoint N: fork returned pid DDDD This change was made to bring the output of the "checkpoint" command in line with that of other commands, e.g.: (gdb) break main Breakpoint 1 at ... (gdb) catch exec Catchpoint 2 (exec) (gdb) add-inferior [New inferior 2] Added inferior 2 The tests gdb.base/checkpoint.exp, gdb.base/kill-during-detach.exp, and gdb.multi/checkpoint-multi.exp have been updated to accept the new (capitalized) output from the "checkpoint" command. Reviewed-By: Tom Tromey <tom@tromey.com> Approved-By: Andrew Burgess <aburgess@redhat.com>
2025-02-05Make linux checkpoints work with multiple inferiorsKevin Buettner5-184/+1230
The current linux checkpoint code, most of which may be found in linux-fork.c, is quite broken when attempting to use more than one inferior. Running GDB will show internal errors when starting two inferiors, placing a checkpoint in one, then switching to the other and doing one of the following commands, "restart", "detach", "kill", or continue (to program exit). Test cases for two of those scenarios may be found in this bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31065 I've tested for each of the scenarios and many more in the new test case, gdb.multi/checkpoint-multi.exp. I started off with the goal of fixing just those problems, and was mostly successful with a much smaller patch, but doing "info checkpoints" with more than one inferior didn't work correctly due to some of the inferiors being in the wrong program space. That led me to making the linux-fork code fully inferior-aware. Prior to this commit, the list of forks was being maintained in a global named named 'fork_list'. I turned this into a per-inferior data structure. There was also global named 'highest_fork_num' which is also now part of the per-inferior struct. A registry key named 'checkpoint_inferior_data_key' along with function 'get_checkpoint_inferior_data' is used to access the per-inferior data. This new function, get_checkpoint_inferior_data, is only called by the new functions 'fork_list', 'reset_highest_fork_num', and increment_highest_fork_num, each of which is passed a pointer to the inferior. Most occurrences referring to the (previously) global 'fork_list' have been replaced by 'fork_list (inf)'. In some functions, where the 'fork_list' is referenced multiple times, a local named 'fork_list' is declared and initialized instead, like this: auto &fork_list = ::fork_list (inf); The constructor for 'struct fork_info' has gained an additional parameter. In addition to passing the pid of the new fork, we now also pass the fork identifier, fork_num, to the constructor. This integer is shown to the user in the "info checkpoints" command and is provided by the user, perhaps in conjunction with the inferior number, in commands which manipulate checkpoints, e.g. 'restart' and 'delete checkpoint'. When checkpoints are used in only one inferior, this commit will present information to the user and will accept checkpoint identifiers to commands in much the same way as the code did before this commit. Per Pedro Alves's recommendations, the "info checkpoints" command has been changed somewhat. "info checkpoints" used to display "(main process)" for the first process in the checkpoint list. This is no longer done because it does not provide useful information. It also used to display "<running>", when the process is running and no useful frame information may be displayed. This has been changed to "(running)" in order to be more consistent with the output of the "info threads" command. A new column has been added to the output for showing the active process in the output from "info checkpoints". This column will display 'y' for the active process and 'n' for the others. For the active inferior a '*' is also printed preceding the checkpoint identifier. Here's what things look(ed) like before and after for just one inferior: Before: (gdb) info checkpoints * 0 Thread 0x7ffff7cd3740 (LWP 84201) (main process) at 0x40114a, file hello.c, line 28 1 process 84205 at 0x401199, file hello.c, line 51 2 process 84206 at 0x4011a3, file hello.c, line 53 After: (gdb) info checkpoints Id Active Target Id Frame * 0 y process 551311 at 0x40114a, file hello.c, line 28 1 n process 551314 at 0x401199, file hello.c, line 51 2 n process 551315 at 0x4011a3, file hello.c, line 53 (The Thread versus process distinction is handled by another patch - the "After" example assumes that patch is applied too.) When there are multiple inferiors, the "info checkpoints" output looks like this: (gdb) info checkpoints Id Active Target Id Frame 1.0 y process 535276 at 0x401199, file hello.c, line 51 1.1 n process 535283 at 0x401199, file hello.c, line 51 1.2 n process 535288 at 0x401199, file hello.c, line 51 2.1 n process 535280 at 0x401258, file goodbye.c, line 62 2.2 y process 535284 at 0x401258, file goodbye.c, line 62 * 3.0 y process 535285 at 0x40115c, file hangout.c, line 31 3.2 n process 535287 at 0x40115c, file hangout.c, line 31 A new function named 'parse_checkpoint_id' has been added. As its name suggests, it's responsible for parsing a string representing a checkpoint identifier. These identifiers may be either a decimal number representing the checkpoint number in the current inferior or two decimal numbers separated by '.', in which case the first is the inferior number and the second is the checkpoint number in that inferior. It is called by delete_checkpoint_command, detach_checkpoint_command, info_checkpoints_command, and restart_command. Calls to 'parse_checkpoint_id' replace calls to 'parse_and_eval_long', plus error checking and error reporting code near the calls to 'parse_and_eval_long'. As such, error checking and reporting has been consolidated into a single function and the messages output are more uniform, though this has necessitated changes to the existing test case gdb.base/checkpoint.exp. The functions 'find_fork_ptid' and 'find_fork_pid' used to return a pointer to a fork_info struct. They now return a pair consisting of the pointer to a fork_info struct in addition to a pointer to the inferior containing that checkpoint. 'find_fork_id' returns a pointer to a fork_info struct just as it did before, but it's now gained a new parameter, 'inf', which is the inferior in which to look. info_checkpoints_command used to simply iterate over the list of forks (checkpoints), printing each one out. It now needs to iterate over all inferiors and, for those which have checkpoints, it needs to iterate over the list of checkpoints in that inferior. As noted earlier, the format of the output has been changed so that checkpoint identifiers incorporating an inferior number may be printed. linux_fork_context, called by restart_command, now contains code to switch inferiors when the fork being restarted is in an inferior which is different from the current one. The scoped_switch_fork_info class now also contains code for switching inferiors in both the constructor and destructor. gdb/linux-nat.c has a few changes. All but one of them are related to passing the inferior to one of the linux-fork functions. But one of the tests in linux_nat_target::detach has also changed in a non-obvious way. In attempting to determine whether to call linux_fork_detach(), that code used to do: if (pid == inferior_ptid.pid () && forks_exist_p ()) It's been simplified to: if (forks_exist_p (inf)) I had added the 'pid == inferior_ptid.pid ()' condition in late 2023 while working on a detach bug. It was kind of a hack to prevent calling linux_fork_detach() when in a different inferior. That's no longer needed since the call to forks_exist_p does this directly - i.e. it is now inferior-aware. Finally, the header file 'linux-fork.h' has been updated to reflect the fact that add_fork, linux_fork_killall, linux_fork_detach, and forks_exist_p all now require that a pointer to an inferior be passed to these functions. Additionally (as mentioned earlier), find_fork_pid now returns std::pair<fork_info *, inferior *> instead 'of fork_info *'. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31065 Reviewed-By: Tom Tromey <tom@tromey.com> Approved-By: Andrew Burgess <aburgess@redhat.com>
2025-02-05Fix another illegal memory access triggered by corrupt ELF input files.Nick Clifton1-0/+4
PR 32644
2025-02-05Add even more checks for corrupt input when processing relocations for ELF ↵Nick Clifton1-100/+106
files. PR 32643
2025-02-05Prevent illegal memory access when checking relocs in a corrupt ELF binary.Nick Clifton4-18/+39
PR 32641
2025-02-05aarch64: Add leading zeros to opcodes in aarch64-tbl.hYury Khrustalev1-143/+143
Opcodes and bitmasks are 32-bit numbers and omitting leading zeros might be interpreted as if they are 28-bit.
2025-02-05aarch64: Clean up whitespace in aarch64-tbl.hYury Khrustalev1-280/+280
Clean up whitespace for conforming to GNU coding standards
2025-02-05Prevent an abort in the bfd linker when attempting to generate dynamic ↵Nick Clifton1-0/+9
relocs for a corrupt input file. PR 32638
2025-02-05gdb: restrict configure error with all targets and 64 bit bfd to mipsGuinevere Larsen2-6/+20
The recent commit b601c58034ed755fb765fc13782b6876bffd25d4 causes the gdb configure to fail if --enable-targets=all was requested, but 64 bit bfd was not enabled. This was due to a build failure first reported against mips, and that I also encountered building on a 32 bit mips system, but that looked like a general failure. Further examination showed that this is, in fact, mips-specific (or at least, not completely generic) as other targets like debian-i386 and 32-bit arm could build all targets just fine. This commit restricts the new error to only trigger in mips hosts. Approved-By: Andrew Burgess <aburgess@redhat.com>
2025-02-05Prevent illegal memory access when indexing into the sym_hashes array of the ↵Nick Clifton1-45/+45
elf bfd cookie structure. PR 32636
2025-02-05gas MMIX: Use more of is_... framework like is_whitespace and is_end_of_stmtJan Beulich1-40/+30
Convert uses of ISSPACE() and testing for specific characters into calls to is_whitespace and is_end_of_stmt. While doing that, also remove some redundant tests, like ';' together with is_end_of_line[] and is_whitespace and !is_end_of_line. Note the invalid casts being fixed as part of moving to is_... macros; there were (unsigned int) where there should have been (unsigned char) applied on char as index to is_end_of_line[]. Beware that the input language changes slightly: some constructs with whitespace characters other than space and TAB are now invalid.
2025-02-05Automatic date update in version.inGDB Administrator1-1/+1
2025-02-04[gdb/tui] Clean up asserts in tui_source_window_base::refresh_windowTom de Vries1-2/+3
Commit 1c525b0e037 ("[gdb/tui] Fix assert in tui_source_window_base::refresh_window") added an early return in tui_source_window_base::refresh_window. Assert after the early return that "m_pad != nullptr", and clean up the following asserts that allow for m_pad == nullptr. Tested on x86_64-linux. Reported-By: Andrew Burgess <aburgess@redhat.com> Co-Authored-By: Andrew Burgess <aburgess@redhat.com> Approved-By: Andrew Burgess <aburgess@redhat.com>
2025-02-04[pre-commit] Require pre-commit version 3.2.0Tom de Vries1-0/+1
Recent commit 0bd340d6704 ("pre-commit autoupdate") bumped the isort version to 6.0.0. Subsequently, I started running into: ... $ SKIP=flake8,isort pre-commit run An error has occurred: InvalidManifestError: ==> File /home/vries/.cache/pre-commit/repommstqefj/.pre-commit-hooks.yaml ==> At Hook(id='isort') ==> At key: stages ==> At index 0 =====> Expected one of commit, commit-msg, manual, merge-commit, \ post-checkout, post-commit, post-merge, post-rewrite, prepare-commit-msg, \ push but got: 'pre-commit' Check the log at /home/vries/.cache/pre-commit/pre-commit.log ... I found a similar PR [1], that explains that using pre-commit as a stage (as isort 6.0.0 does) is supported starting pre-commit 3.2.0. Add minimum_pre_commit_version 3.2.0 in .pre-commit-config.yaml, as suggested in the PR. After adding this, I get a more helpful message: ... $ SKIP=flake8,isort pre-commit run An error has occurred: InvalidConfigError: ==> File .pre-commit-config.yaml ==> At Config() ==> At key: minimum_pre_commit_version =====> pre-commit version 3.2.0 is required but version 2.17.0 is installed. \ Perhaps run `pip install --upgrade pre-commit`. Check the log at /home/vries/.cache/pre-commit/pre-commit.log ... and after doing so which upgrades pre-commit to version 4.1.0, as well as re-installing pre-commit using: ... $ pre-commit uninstall $ pre-commit install ... I have a functional setup again. Interestingly, since pre-commit 4.1.0 runs in a python 3.11 environment, I no longer need to skip flake8 and isort, as I needed to previously when the system python 3.6 was used. Approved-By: Simon Marchi <simon.marchi@efficios.com> [1] https://github.com/psf/black/issues/4065
2025-02-04pre-commit: run flake8 on more Python filesSimon Marchi3-17/+21
pre-commit currently runs flake8 only on `gdb/python/**/*.py`. There are more files we can run it on, without running it on all the testsuite files. Add: - gdb/gdb-gdb.py.in - gdb/*.py - gdb/testsuite/*.py Fix the new errors that popped up: gdb/copyright.py:29:21: W605 invalid escape sequence '\*' gdb/copyright.py:29:29: W605 invalid escape sequence '\*' gdb/copyright.py:29:38: W605 invalid escape sequence '\*' gdb/copyright.py:29:46: W605 invalid escape sequence '\*' gdb/copyright.py:34:1: F401 'datetime' imported but unused gdb/testsuite/analyze-racy-logs.py:150:9: E722 do not use bare 'except' Change-Id: Ia864c22d4f170d4e18ce3beb06a86c49966654b2 Approved-By: Tom Tromey <tom@tromey.com>
2025-02-04Reorder gnatmake arguments in inline-section-gc.expTom Tromey1-2/+2
inline-section-gc.exp ends up passing "-lm" to gnatmake as an "marg" -- meaning gnatmake should process it itself. However, the gnat-llvm gnatmake does not know what to do with this, so the test fails. This patch rearranges the arguments so that the (implicit) trailing -lm ends up being passed through to the linker.
2025-02-04doc: sframe: Clarify FDE/FRE function/range start address fieldsJens Remus1-4/+6
The function start address in a SFrame FDE (sfde_func_start_address) is encoded as a signed offset to the function start address from the SFrame section. The PC range start address in a SFrame FRE (sfre_start_address) is encoded as an unsigned offset to the range from the function start address. Signed-off-by: Jens Remus <jremus@linux.ibm.com>
2025-02-04gas: Skip SFrame FDE if .cfi_val_offset specifies non-default offsetJens Remus1-5/+5
Unwinding of the stack pointer (SP) is performed using the assumed default rule ".cfi_val_offset <SP-reg>, 0", so that SP unwinds as: SP = CFA Warn if the CFI directive .cfi_val_offset is encountered for the SP register with a different offset. gas/ * gen-sframe.c (sframe_xlate_do_val_offset): Skip SFrame FDE if non-default SP value offset. Signed-off-by: Jens Remus <jremus@linux.ibm.com>
2025-02-04gas: sframe: Use appropriate struct cfi_insn_data union membersJens Remus1-9/+9
Use the appropriate struct cfi_insn_data union members to access fields when generating SFrame information from CFI directives. gas/ * gen-sframe.c (sframe_xlate_do_def_cfa, sframe_xlate_do_offset, sframe_xlate_do_val_offset): Access ri fields, as .cfi_def_cfa, .cfi_offset, and .cfi_val_offset define a register and offset value. * (sframe_xlate_do_def_cfa_register): Access r field, as .cfi_def_cfa_register defines a register. Signed-off-by: Jens Remus <jremus@linux.ibm.com>
2025-02-04gdb/python: add void_type () method to gdb.Architecture objectJan Vrany4-1/+26
This commit adds a new method to Python architecture objects that returns a void type for that architecture. This will be useful later to create types for function symbols created using Python extension code. Reviewed-By: Eli Zaretskii <eliz@gnu.org> Approved-By: Andrew Burgess <aburgess@redhat.com>
2025-02-04gdb/python: add domain property to gdb.SymbolJan Vrany4-2/+24
Reviewed-By: Eli Zaretskii <eliz@gnu.org> Approved-By: Andrew Burgess <aburgess@redhat.com>
2025-02-04gdb/python: add subblocks property to gdb.BlockJan Vrany4-3/+48
This commit adds new propery "subblocks" to gdb.Block objects. This allows Python to traverse block tree starting with global block. Reviewed-By: Eli Zaretskii <eliz@gnu.org> Approved-By: Andrew Burgess <aburgess@redhat.com>
2025-02-04[gdb/testsuite] Fix gdb.ada/big_packed_array.exp on s390x-linuxTom de Vries1-1/+8
When running test-case gdb.ada/big_packed_array.exp on s390x-linux, I run into: ... (gdb) print bad^M $2 = (0 => 0 <repeats 24 times>, 1)^M (gdb) FAIL: gdb.ada/big_packed_array.exp: scenario=minimal: print bad ... This is with gcc 7.5.0, and this xfail should trigger: ... if { $have_xfail && [string is integer $last] \ && [expr ($last & 0xf) == 0] } { # gcc/101643 setup_xfail *-*-* } ... but it doesn't because $last is '1'. Fix this by using 0xf0 as mask for big endian. Tested on s390x-linux.
2025-02-04[gdb/testsuite] Fix gdb.ada/convvar_comp.exp on s390x-linuxTom de Vries2-2/+4
When running test-case gdb.ada/convvar_comp.exp on s390x-linux, I get: ... (gdb) run ^M Starting program: pb16_063 ^M ^M Breakpoint 1, pck.break_me (item=...) at pck.adb:17^M 17 function Break_Me (Item : T) return Boolean is^M (gdb) print item.started^M Cannot access memory at address 0x0^M (gdb) FAIL: gdb.ada/convvar_comp.exp: print item.started ... This happens as follows. The parameter item is available in (DW_OP_fbreg: -168): ... <2><912>: Abbrev Number: 18 (DW_TAG_formal_parameter) <913> DW_AT_name : (indirect string, offset: 0x14ca): item <919> DW_AT_type : <0x929> <91d> DW_AT_location : 3 byte block: 91 d8 7e (DW_OP_fbreg: -168) ... and according to the rules of -O0, it's considered to be available after the prologue, which looks like this: ... 0000000001002998 <pck__break_me>: 1002998: b3 c1 00 2b ldgr %f2,%r11 100299c: b3 c1 00 0f ldgr %f0,%r15 10029a0: e3 f0 ff 58 ff 71 lay %r15,-168(%r15) 10029a6: b9 04 00 bf lgr %r11,%r15 10029aa: e3 20 b0 a0 00 24 stg %r2,160(%r11) ... To detect the prologue, gdb checks the line info, which looks like this: ... pck.adb: File name Line number Starting address View Stmt pck.adb 17 0x1002998 x pck.adb 17 0x1002998 1 x pck.adb 19 0x10029b0 x pck.adb 20 0x10029b8 x pck.adb - 0x10029c6 ... and gdb concludes that it's an empty prologue, so we stop at 0x1002998 and try to print parameter item, which is not available yet. For more details, see this comment in skip_prologue_using_sal: ... /* For languages other than assembly, treat two consecutive line entries at the same address as a zero-instruction prologue. ... The same thing happens on x86_64-linux, but it causes no problem there, because amd64_skip_prologue decides not to trust the result: ... struct compunit_symtab *cust = find_pc_compunit_symtab (func_addr); /* LLVM backend (Clang/Flang) always emits a line note before the prologue and another one after. We trust clang and newer Intel compilers to emit usable line notes. */ if (post_prologue_pc && (cust != NULL && cust->producer () != nullptr && (producer_is_llvm (cust->producer ()) || producer_is_icc_ge_19 (cust->producer ())))) return std::max (start_pc, post_prologue_pc); ... because the producer is GCC. Work around this by setting a breakpoint on the first statement of pck.break_me instead. Tested on s390x-linux.
2025-02-04[gdb/testsuite] Use c++ flag in c++ test-casesTom de Vries21-25/+108
In some cases, test-cases use c++, but don't add "c++" to the compilation flags. This can cause problems with some compilers. Fix this in some test-cases. Approved-By: Tom Tromey <tom@tromey.com> PR testsuite/30380 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30380
2025-02-04Update with latest changes to src-release.shNick Clifton1-32/+42
2025-02-04Rename 'binutils' to 'binutils_with_gold'. Rename 'bin_no_gold' to ↵Nick Clifton1-12/+26
'binutils'. Add 'gold'
2025-02-04[gdb/testsuite] Fix gdb.base/list-dot-nodebug.exp on openSUSETom de Vries1-1/+1
On openSUSE Leap 15.6 with test-case gdb.base/list-dot-nodebug.exp I run into: ... (gdb) list .^M warning: 1 ../sysdeps/x86_64/crtn.S: No such file or directory^M (gdb) FAIL: $exp: debug=none: print before start ... The intent of the debug=none case is to generate an executable with no debug info. However, we have quite a few CUs with debug info: ... $ readelf -wi outputs/gdb.base/list-dot-nodebug/list-dot-nodebug-none \ | egrep -c " @ " 431 ... This is because this code: ... gdb_gnu_strip_debug $executable no-debuglink ... uses $executable, and the variable is set here: ... set executable ${testfile}-none ... which sets it to "list-dot-nodebug-none" and consequently gdb_gnu_strip_debug cannot find it. Fix this by using "[standard_output_file $executable]" instead. Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com> PR testsuite/31721 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31721
2025-02-04[gdb/tui] Remove stale title when showing "No Source Available"Tom de Vries2-0/+7
When running test-case gdb.tui/main.exp, the last command discards the executable file and symbol table: ... (gdb) file No executable file now. Discard symbol table from `main'? (y or n) [answered Y; input not from terminal] No symbol file now. (gdb) ... and we end up with this source window: ... +-tui-layout.c----------------------------------------------------------------+ | | | | | | | | | | | | | [ No Source Available ] | | | | | | | | | | | | | +-----------------------------------------------------------------------------+ ... The source window title shouldn't be showing tui-layout.c. It's the source file containing function main for the executable that was just discarded. Fix this by clearing the title in tui_source_window::erase_source_content. Tested on x86_64-linux. Approved-By: Tom Tromey <tom@tromey.com>
2025-02-04elf: Store __ehdr_start hash in elf_link_hash_tableH.J. Lu4-5/+8
Since commit 97da0e2677c4a38df2406576428ec27d1da26e7c Author: Alan Modra <amodra@gmail.com> Date: Wed Jan 12 23:42:23 2022 +1030 tweak __ehdr_start visibility and flags for check_relocs creates __ehdr_start hash in lang_symbol_tweaks, store __ehdr_start hash in elf_link_hash_table so that we just need to lookup it up only once. bfd/ * elf-bfd.h (elf_link_hash_table): Add hehdr_start. * elf.c (assign_file_positions_for_load_sections): Use hehdr_start. ld/ * ldelf.c (ldelf_before_allocation): Use hehdr_start for __ehdr_start hash. * ldlang.c (lang_symbol_tweaks): Store hehdr_start hash in hehdr_start. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-02-04elflink.c: Replace bed->dynamic_sec_flags with flagsH.J. Lu1-4/+2
Since at the function entry, there is flags = bed->dynamic_sec_flags; we can replace bed->dynamic_sec_flags with flags. * elflink.c (_bfd_elf_create_got_section): Replace bed->dynamic_sec_flags with flags. (_bfd_elf_link_create_dynamic_sections): Likewise. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-02-03pre-commit autoupdateSimon Marchi2-3/+3
Run `pre-commit autoupdate`. This picks up a fresh Black version from 2025, and with it comes a small but welcome formatting change. There is a new version of isort as well, but no formatting change there. Change-Id: Ie654a9c14c3a4096893011082668efb57c166fa4
2025-02-04Automatic date update in version.inGDB Administrator1-1/+1
2025-02-03[gdb/syscalls] Sync with strace v6.13Tom de Vries31-87/+91
After syncing with strace v6.13 using: ... $ update-linux-defaults.sh ~/upstream/strace.git ... we have a few new entries in linux-defaults.xml.in: ... <syscall name="getxattrat" groups="descriptor,file"/> <syscall name="listxattrat" groups="descriptor,file"/> <syscall name="removexattrat" groups="descriptor,file"/> <syscall name="setxattrat" groups="descriptor,file"/> ... Regenerate most *-linux.xml.in files using: ... $ ./update-linux-from-src.sh ~/upstream/linux-stable.git ... updating the copyright years, and do so manually for the remaining two. Then regenerate *-linux.xml using make, propagating the groups changes and copyright years. Tested on x86_64-linux. Approved-By: Andrew Burgess <aburgess@redhat.com>
2025-02-03Z8k: use is_whitespace()Jan Beulich1-12/+12
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). At the same time use is_end_of_stmt() instead of an open-coded check in adjacent code.
2025-02-03Z80: use is_whitespace()Jan Beulich1-4/+4
Replace an open-coded check and convert ISSPACE() uses.
2025-02-03Xtensa: use is_whitespace()Jan Beulich1-4/+5
Convert an open-coded check.
2025-02-03xgate: use is_whitespace()Jan Beulich1-1/+1
Convert an open-coded check.
2025-02-03x86: use is_whitespace()Jan Beulich2-49/+48
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input).
2025-02-03wasm32: use is_whitespace()Jan Beulich1-1/+1
Convert an open-coded check.
2025-02-03Visium: use is_whitespace()Jan Beulich1-2/+2
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert an open-coded check.
2025-02-03VAX: use is_whitespace()Jan Beulich1-9/+9
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input).
2025-02-03v850: use is_whitespace()Jan Beulich1-9/+8
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert open-coded checks as well as ISSPACE() uses. At the same time use is_end_of_stmt() instead of a kind-of-open- coded check in adjacent code.
2025-02-03C6x: use is_whitespace()Jan Beulich1-6/+7
Wherever blanks are permissible in input, tabs ought to be permissible, too. This is particularly relevant when -f is passed to gas (alongside appropriate input). Also convert an ISSPACE() use. At the same time use is_end_of_stmt() instead of open-coded checks in adjacent code.