aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-06-27Add note about adding ChangeLog.git to src-release.shNick Clifton1-0/+8
2023-06-27gprofng: Update intel urlCui, Lili1-1/+1
Since the old software.intel.com has been removed, update a new one. gprofng/ChangeLog 2023-06-27 Lili Cui <lili.cui@intel.com> * gp-display-html/gp-display-html.in: Update intel url.
2023-06-27Automatic date update in version.inGDB Administrator1-1/+1
2023-06-26Fix gas tests for aarch64-peNick Clifton120-9/+363
2023-06-26Synchromize libiberty sources with master version in gcc repositoryNick Clifton11-122/+363
2023-06-26Sync config.guess and config.sub with upstream master versions.Nick Clifton3-36/+131
2023-06-26Updated French translation for the gprof sub-directoryNick Clifton2-47/+52
2023-06-26Automatic date update in version.inGDB Administrator1-1/+1
2023-06-25LoongArch: Support referring to FCSRs as $fcsrXFeiyang Chen6-8/+56
Previously, FCSRs were referred to as $rX, which seemed strange. We refer to FCSRs as $fcsrX, which ensures compatibility with LLVM IAS as well. gas/ChangeLog: * config/tc-loongarch.c: (loongarch_fc_normal_name): New definition. (loongarch_fc_numeric_name): New definition. (loongarch_single_float_opcodes): Modify `movgr2fcsr` and `movfcsr2gr`. testsuite/gas/loongarch/float_op.d: Likewise. testsuite/gas/loongarch/float_op.s: Likewise. include/ChangeLog: * opcode/loongarch.h: (loongarch_fc_normal_name): New extern. (loongarch_fc_numeric_name): New extern. opcodes/ChangeLog: * opcodes/loongarch-dis.c (loongarch_after_parse_args): Support referring to FCSRs as $fcsrX. * opcodes/loongarch-opc.c (loongarch_args_parser_can_match_arg_helper): Likewise. Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
2023-06-25Automatic date update in version.inGDB Administrator1-1/+1
2023-06-24Automatic date update in version.inGDB Administrator1-1/+1
2023-06-23gdb/testsuite: Avoid infinite loop in gdb.reverse/step-reverse.expThiago Jung Bauermann1-3/+25
This testcase sometimes gets stuck in a loop for hours when running in our CI. The problem is that due to an issue unrelated to reverse debugging the inferior exits early, and because of the overly generic ".*" pattern the testcase keeps sending the "next" command without noticing that the inferior is gone. gdb_test_multiple has a pattern to detect that "The program is not being run.", but since it is placed after the patterns from the caller it won't be triggered. It also has a timeout pattern but because it is triggered between successful matches, each time the test matches the '-re -wrap ".*"' this counts as a successful match and the timeout is reset. Since the test binary is compiled with debug information, fix by changing one of the generic patterns to match entering the main function and the other one to match the source code line number that is shown by GDB right after the "step" command. Also, as a precaution add a maximum number of times the "next" command will be sent. Co-Authored-By: Tom de Vries <tdevries@suse.de> Reviewed-By: Bruno Larsen <blarsen@redhat.com> Approved-By: Tom de Vries <tdevries@suse.de>
2023-06-23[GOLD] PowerPC64 huge branch dynamic relocsAlan Modra1-61/+38
PowerPC64 gold and ld.bfd implement an indirect branch trampoline, used when the destination of a branch exceeds a bounce through another "b" instruction. When generating PIEs or shared libraries, the addresses need dynamic relocations. This was implemented in gold using a dedicated relocation section, but this means the relative relocations for these addresses are not sorted properly with other dynamic relative relocations: gold doesn't support merging relocation sections, then sorting. Instead we need to use a single .rela.dyn section. This is done by increasing the size of rela_dyn_ during do_relax to account for needed dynamic relocations, delaying adding the actual relocations until the end of relaxation once the layout has stabilised. * powerpc.cc (Target_powerpc): Add rela_dyn_size_; (update_current_size): New function. (Target_powerpc::do_relax): Capture the size of rela_dyn_ at the start of relaxation. Artifically increase its size during relaxation to account for needed indirect branches, and add those relocations at the end. (Output_data_brlt_powerpc::rel_, reset_brlt_sizes), (finalize_brlt_sizes, add_reloc, set_current_size): Delete. (Target_powerpc::make_brlt_section): Don't make reloc section.
2023-06-23[GOLD] Support setting DT_RELACOUNT lateAlan Modra11-16/+38
PowerPC gold adds relative dynamic relocs in do_relax. These aren't accounted for in the value set in add_target_dynamic_tags, which is called before do_relax. Provide a way of setting DT_RELCOUNT and DT_RELACOUNT at the point where .dynamic is written. * layout.cc (Layout::add_target_dynamic_tags): Add custom_relcount parameter. Emit DT_RELCOUNT/RELACOUNT as a custom target handled dynamic tag if set. * layout.h(Layout::add_target_dynamic_tags): Update prototype. * aarch64.cc (Target_aarch64::do_finalize_sections): Adjust add_target_dynamic_tags call. * arm.cc (Target_arm::do_finalize_sections): Likewise. * i386.cc (Target_i386::do_finalize_sections): Likewise. * mips.cc (Target_mips::do_finalize_sections): Likewise. * s390.cc (Target_s390::do_finalize_sections): Likewise. * sparc.cc (Target_sparc::do_finalize_sections): Likewise. * tilegx.cc (Target_tilegx::do_finalize_sections): Likewise. * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise. * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise. (Target_powerpc::do_dynamic_tag_custom_value): New function.
2023-06-23[GOLD] powerpc DT_RELACOUNTAlan Modra1-2/+7
DT_RELACOUNT was calculated incorrectly, and relative relocs not sorted as they should be to the start of .rela.dyn, due to adding one particular class of dynamic reloc using the wrong "add" method. * powerpc.cc (Target_powerpc::Scan::global): Add relative dyn relocs for ADDR64 and similar using add_global_relative.
2023-06-23lto test fails with -fno-inline in CFLAGSAlan Modra1-5/+5
Putting -fno-inline in CFLAGS results in these failures. FAIL: Build liblto-17b.so 1 FAIL: PR ld/12365 FAIL: PR ld/13183 * ld-plugin/lto.exp: Add -finline to compiler flags in some tests.
2023-06-22Fix off-by-one errorTom Tromey1-1/+1
Simon pointed out that commit a2bbca9fa5e ("Use std::vector<bool> for agent_expr::reg_mask") caused a regression in libstdc++ debug mode. This was due to an off-by-one error in a vector resize. This patch fixes the problem.
2023-06-23Automatic date update in version.inGDB Administrator1-1/+1
2023-06-22gdb/testsuite: fix gdb.python/py-unwind.exp with python >= 3.11Ilya Leoshkevich1-1/+3
Python 3.11 changed the AttributeError message - see commit 0cb765b2cec9 ("bpo-46730: Add more info to @property AttributeError messages (GH-31311)"). Add the new message to the expectations. Approved-By: Tom Tromey <tom@tromey.com> Link: https://sourceware.org/pipermail/gdb-patches/2023-June/200433.html
2023-06-22Revert "x86: Don't check if AVX512 template requires AVX512VL"H.J. Lu1-2/+3
This reverts commit c7face14225296a2f5d3ebeb8ace88c166d80c3e.
2023-06-22[gdb/testsuite] Clean or check standard_output_file dir in gdb_initTom de Vries2-5/+41
In commit e2adba909e7 ("[gdb/testsuite] Clean up before compilation in gdb.ada/call-no-debug.exp") I added some code in the test-case to remove some files at the start of the test-case: ... remote_file host delete [standard_output_file prog.o] remote_file host delete [standard_output_file prog.ali] ... Then in commit b7b77500dc5 ("[gdb/testsuite] Clean standard_output_file dir in gdb_init") I tried to do this more structurally, by cleaning up the entire standard_output_file directory, for all test-cases. This caused a regression when using "make check -j 2", due to the cleanup removing the active gdb.log, so I reverted the commit. Try again, this time handling the two cases separately. If the standard_output_file directory contains an active gdb.log, check that the directory contains no files other than gdb.log and gdb.sum. This puts the reponsibility for the cleanup at the callers in gdb/testsuite/Makefile.in which use --outdir. If the standard_output_file directory doesn't contain an active gdb.log, clean it by removing the entire directory. An exception is made for performance tests, where cleaning up the standard_output_file dir is the wrong thing to do, because an invocation with GDB_PERFTEST_MODE == run is intended to reuse binaries left there by an earlier invocation with GDB_PERFTEST_MODE == compile. Tested on x86_64-linux. Suggested-By: Tom Tromey <tom@tromey.com> Reviewed-By: Tom Tromey <tom@tromey.com> Tested-By: Luis Machado <luis.machado@arm.com>
2023-06-22Implement DAP "hover" contextTom Tromey4-6/+119
A DAP client can request that an expression be evaluated in "hover" context, meaning that it should not cause side effects. In gdb, this can be implemented by temporarily setting a few "may-" parameters to "off". In order to make this work, I had to also change "may-write-registers" so that it can be changed while the program is running. I don't think there was any reason for this prohibition in the first place. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30476
2023-06-22Implement DAP logging breakpointsTom Tromey3-3/+132
DAP allows a source breakpoint to specify a log message. When this is done, the breakpoint acts more like gdb's dprintf: it logs a message but does not cause a stop. I looked into implement this using dprintf with the new %V printf format. However, my initial attempt at this did not work, because when the inferior is continued, the dprintf output is captured by the gdb.execute call. Maybe this could be fixed by having all inferior-continuation commands use the "&" form; the main benefit of this would be that expressions are only parsed a single time.
2023-06-22Handle supportsVariablePaging in DAPTom Tromey3-9/+25
A bug report about the supportsVariablePaging capability in DAP resulted in a clarification: when this capability is not present, DAP implementations should ignore the paging parameters to the "variables" request. This patch implements this clarification.
2023-06-22Implement type checking for DAP breakpoint requestsTom Tromey1-46/+82
I realized that with a small refactoring, it is possible to type-check the parameters to the various DAP breakpoint requests. This would have caught the earlier bug involving hitCondition.
2023-06-22Handle exceptions when creating DAP breakpointsTom Tromey3-40/+92
When creating a DAP breakpoint, a failure should be returned by setting "verified" to False. gdb didn't properly implement this, and there was a FIXME comment to this effect. This patch fixes the problem.
2023-06-22Reuse breakpoints more frequently in DAPTom Tromey1-2/+4
The DAP breakpoint code tries to reuse a breakpoint when possible. Currently it uses the condition and the hit condition (aka ignore count) when making this determination. However, these attributes are just going to be reset anyway, so this patch changes the code to exclude these from the reuse decision.
2023-06-22Fix type of DAP hitConditionTom Tromey2-5/+8
DAP specifies a breakpoint's hitCondition as a string, meaning it is an expression to be evaluated. However, gdb implemented this as if it were an integer instead. This patch fixes this oversight.
2023-06-22gdb/DAP Few bug fixes & Evaluate Array Watch varsSimon Farre2-2/+2
v2. EvaluateResult does not need a name, just as what Tom pointed out in previous review. It's only the *children* that need to be made sure that their names are valid. An identifier for a variable, can't ever have an integer as a name, anyhow (not as far as I am aware, no programming languages allow for that). Removed the f-strings and use str() instead as pointed out that f-strings might not be supported fully. v1. This patch fixes a few bugs. First of all, name of VariableReferences must always be of string type. This patch makes sure that this is the case by formatting the name. If (when) the name is an integer, this will cause clients to fail or throw errors. Fixes a bug in NoOpArrayPrinter that calculated children to be N, but only ever retrieves N-1 children, which makes Python at some time later (during fetch_children -> fetch_one_child(N) ) raise an exception (out of list index) which makes the entire request go bad. The result[self.result_name] also f-strings the printer.to_string() value, because this can potentially be a LazyString (which is a Python object, not a string) and is not serializable by json.dumps. Approved-By: Tom Tromey <tom@tromey.com>
2023-06-22Automatic date update in version.inGDB Administrator1-1/+1
2023-06-21x86: Free the symbol buffer and the relocation buffer after useH.J. Lu1-14/+28
When --no-keep-memory is used, the symbol buffer and the relocation buffer aren't cached. When packing relative relocations, we may allocate a new symbol buffer and a new relocation buffer for each eligible section in an object file. If there are many sections, memory may be exhausted. In this case, we should free the symbol buffer and the relocation buffer after use. If symbol buffer entries are used to track relative relocations against local symbols for later use, the symbol buffer should be cached. PR ld/30566 * elfxx-x86.c (elf_x86_relative_reloc_record_add): Add an argument to inform caller if the symbol buffer should be kept. (_bfd_x86_elf_link_relax_section): Call _bfd_elf_link_info_read_relocs instead of _bfd_elf_link_read_relocs. Free the symbol buffer and the relocation buffer after use. Cache the symbol buffer if it is used.
2023-06-21Add missing backslash to update-gnulib.shTom Tromey5-4/+6
A user on irc noticed a missing backslash on one line in update-gnulib.sh. This patch adds it. Re-running update-gnulib.sh causes a few copyright notices to change. Presumably these are from upstream gnulib and shouldn't be touched by our yearly update. I've updated the script to account for this, but I did not want to try testing it...
2023-06-21[gdb/testsuite] Add have_host_localeTom de Vries7-0/+42
With test-case gdb.tui/pr30056.exp, I run into: ... sh: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)^M ... and then subsequently into: ... WARNING: timeout in accept_gdb_output FAIL: gdb.tui/pr30056.exp: Control-C ... This is on a CentOS 7 distro for powerpc64le. Either it has no C.UTF-8 support, or it's not installed: ... $ locale -a | grep ^C C $ ... Fix this by: - adding a new proc have_host_locale, and - using it in all test-cases using setenv LC_ALL. Tested on powerpc64le-linux and x86_64-linux.
2023-06-21[gdb/testsuite] Fix gdb.tui/wrap-line.expTom de Vries1-2/+8
PR testsuite/30458 reports the following FAIL: ... PASS: gdb.tui/wrap-line.exp: width-auto-detected: cli: wrap ^CQuit (gdb) WARNING: timeout in accept_gdb_output Screen Dump (size 50 columns x 24 rows, cursor at column 6, row 3): 0 Quit 1 (gdb) 7890123456789012345678901234567890123456789 2 W^CQuit 3 (gdb) ... FAIL: gdb.tui/wrap-line.exp: width-auto-detected: cli: prompt after wrap ... The problem is that the regexp doesn't account for the ^C: ... gdb_assert { [Term::wait_for "^WQuit"] } "prompt after wrap" ... The ^C occurs occasionally. This is something we'd like to fix. It's reported as a readline problem here ( https://lists.gnu.org/archive/html/bug-readline/2023-06/msg00000.html ). For now, fix this by updating the regexp, and likewise in another place in the test-case where we use ^C. Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30458
2023-06-21PR30536, ppc64el gold linker produces unusable clang-16 binaryAlan Modra1-1/+9
In commit 0961e631575b, the fix for PR30217, make_lplt_section and make_brlt_section were changed to use rela_dyn_ rather than their own separate dynamic reloc sections. This fails miserably whenever brlt_ is needed for long branches, due to needing to iterate sizing and thus reset brlt_ sizes. PR 30536 PR 30217 * powerpc.cc (Target_powerpc::make_brlt_section): Don't use rela_dyn_.
2023-06-21[gdb/testsuite] Reimplement Term::command_no_prompt_prefixTom de Vries1-3/+17
Say we run test-case gdb.tui/basic.exp. It calls Term::enter_tui, which does: ... command_no_prompt_prefix "tui enable" ... The proc command_no_prompt_prefix is documented as: ... # As proc command, but don't wait for an initial prompt. This is used for # initial terminal commands, where there's no prompt yet. ... Indeed, before the "tui enable" command, the tuiterm is empty, so there is no prompt and just before switching to TUI we have in the tuiterm: ... tui enable ... The reason that there is no prompt, is that: - in order for tuiterm to show something, its input processing procs need to be called, and - the initial gdb prompt, and subsequent prompts generated by gdb_test-style procs, are all consumed by those procs instead. This is in principle not a problem, but the absence of a prompt makes a tuiterm session look less like a session on an actual xterm. Add a new proc gen_prompt, that: - generates a prompt using echo - consumes the response before the prompt using gdb_expect - consumes the prompt using Term::wait_for "". This allows us to reimplement Term::command_no_prompt_prefix using Term::command, and just before switching to TUI we have in the tuiterm: ... (gdb) tui enable ... Tested on x86_64-linux.
2023-06-21[gdb/testsuite] Make Term::wait_for "" match only a promptTom de Vries2-0/+17
The semantics of Term::wait_for is: ... # Accept some output from gdb and update the screen. WAIT_FOR is # a regexp matching the line to wait for. Return 0 on timeout, 1 # on success. proc wait_for {wait_for} { ... Note that besides the regexp, also a subsequent gdb prompt is matched. I recently used wait_for "" in a few test-cases, thinking that this would match just a prompt, but in fact that's not the case. Fix this in wait_for, and add a corresponding test in gdb.tui/tuiterm-2.exp. Tested on x86_64-linux.
2023-06-21Prune linker warnings about an executable stack being created with the -z ↵Nick Clifton2-2/+19
execstack option. * testsuite/lib/binutils-common.exp (prune_warnings_extra): Prune warnings about -z execstack creating an executable stack.
2023-06-21For test for PR 29072 when the linker is configured with ↵Nick Clifton2-0/+22
--enable-default-execstack=no. PR 29072 * testsuite/ld-elf/elf.exp (target_defaults_to_execstack): Always return false for linkers configured with the --enable-default-execstack=no option.
2023-06-21gdbserver: use target_waitstatus::to_string in 'prepare_resume_reply'Tankut Baris Aktemur1-2/+3
Use the to_string method of target_waitstatus in 'prepare_resume_reply' for a more readable log message. Approved-By: Tom Tromey <tom@tromey.com>
2023-06-21x86: fix expansion of %XVJan Beulich1-7/+8
Only %LV should continue on to S handling; avoid emitting a stray 'l' (typically) in suffix-always mode.
2023-06-21elf32_arm_get_synthetic_symtab memory leakAlan Modra1-15/+10
ARM get_synthetic_symtab reads .plt and caches that data. Caching the data doesn't make a lot of sense since get_synthetic_symtab is only called once per bfd, and the memory might be put to better use. It also leaks on closing the bfd. * elf32-arm.c (elf32_arm_get_synthetic_symtab): Don't cache plt contents. Free plt data before returning.
2023-06-21macho-o.c don't leak strtabAlan Modra1-0/+2
* mach-o.c (bfd_mach_o_write_symtab_content): Free strtab on success path.
2023-06-21Automatic date update in version.inGDB Administrator1-1/+1
2023-06-20Use ARRAY_SIZE in ax-general.cTom Tromey1-3/+2
This changes a couple of spots in ax-general.c to use ARRAY_SIZE. While making this change, I noticed that one of the bounds checks was incorrect. Reviewed-by: John Baldwin <jhb@FreeBSD.org>
2023-06-20Remove aop_lastTom Tromey2-7/+0
aop_last is only used for an assertion. However, due to the '.def' construct in the sources, this assert could never plausibly trigger (the assert predates the use of a .def file here). This patch removes the constant and the assert. Reviewed-by: John Baldwin <jhb@FreeBSD.org>
2023-06-20Make aop_map 'static'Tom Tromey2-31/+30
This changes aop_map to be 'static'. Reviewed-by: John Baldwin <jhb@FreeBSD.org>
2023-06-20Use bool for agent_expr::tracingTom Tromey2-9/+8
This changese agent_expr::tracing to have type bool, allowing inline initialization and cleaning up the code a little. Reviewed-by: John Baldwin <jhb@FreeBSD.org>
2023-06-20Simplify agent_expr constructorTom Tromey2-17/+6
This simplifies the agent_expr constructor a bit, and removes the destructor entirely. Reviewed-by: John Baldwin <jhb@FreeBSD.org>
2023-06-20Use std::vector<bool> for agent_expr::reg_maskTom Tromey3-45/+19
agent_expr::reg_mask implements its own packed boolean vector. This patch replaces it with a std::vector<bool>, simplifying the code. Reviewed-by: John Baldwin <jhb@FreeBSD.org>