aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-06-15Add MIPS Allegrex CPU as a MIPS2-based CPUDavid Guillen Fandos22-44/+685
The Allegrex CPU was created by Sony Interactive Entertainment to power their portable console, the PlayStation Portable. The pspdev organization maintains all sorts of tools to create software for said device including documentation. Signed-off-by: David Guillen Fandos <david@davidgf.net>
2023-06-15GAS/doc: Correct Tag_GNU_MIPS_ABI_MSA attribute descriptionMaciej W. Rozycki1-3/+4
Rewrite the paragraph to match the style of Tag_GNU_MIPS_ABI_FP text immediately above, correcting grammar and formatting at the same time. gas/ * doc/as.texi (MIPS Attributes): Correct Tag_GNU_MIPS_ABI_MSA attribute description.
2023-06-15Revert "MIPS: gas: alter 64 or 32 for mipsisa triples if march is implicit"Maciej W. Rozycki2-162/+122
This reverts commit 094025a30bb2da19df3990e0c0ff8167af823aa1. It was applied unapproved.
2023-06-15Revert "MIPS: default r6 if vendor is img"Maciej W. Rozycki3-15/+3
This reverts commit be0d391f22fe6009c3be907753975a984cbbcc23. It was applied unapproved.
2023-06-15Revert "MIPS: fix r6 testsuites"Maciej W. Rozycki182-621/+349
This reverts commit ffc528aed56b9e2c171137da28690a9bb6861b0b. It was applied unapproved.
2023-06-15Revert "MIPS: fix -gnuabi64 testsuite"Maciej W. Rozycki58-797/+524
This reverts commit cb81e84c72933a7fad10b75b7e270d92d8d65251. It was applied unapproved.
2023-06-15Revert "MIPS: fix some ld testcases with compiler"Maciej W. Rozycki11-77/+16
This reverts commit a0631c1501c113c04891c9a24a9ff5276257f28d. It was applied unapproved.
2023-06-15Revert "MIPS: add MT ASE support for micromips32"Maciej W. Rozycki8-730/+18
This reverts commit acce83dacff0ce43677410c67aaae32817afe991. It was applied unapproved.
2023-06-15Revert "MIPS: sync oprand char usage between mips and micromips"Maciej W. Rozycki2-30/+12
This reverts commit 5b207b919483f67311a73dfc1de8897ecfd8e776. It was applied unapproved.
2023-06-15Re: Add some expected failures for bfin linker testsAlan Modra16-17/+19
After commit 7ade0f1582c4 I was seeing bfin-elf +XPASS: weak symbols, and on looking into the bfin targets a little, discovered we have two bfin-linux targets. One, bfin-uclinux, is like bfin-elf in that ld -m elf32bfin is the default, and the other, bfin-linux-uclibc where ld -m elf32bfinfd is the default. So putting bfin-*-*linux* in test xfails or elsewhere is wrong. We want bfin-*-linux* instead to just select the fdpic bfin target. This patch corrects wrong bfin target triples in the ld testsuite, not just the recent change but others I'd added to xfails too. It also fixes the bfin-linux-uclibc ld-elf/64ksec fail
2023-06-15vms write_archive memory leaksAlan Modra1-0/+2
This fixes two memory leaks in the vms archive handling. * vms-lib.c (_bfd_vms_lib_build_map): Free input symbols. (_bfd_vms_lib_write_archive_contents): Free archive map symbols.
2023-06-15Automatic date update in version.inGDB Administrator1-1/+1
2023-06-14[gdb/testsuite] Fix gdb.base/step-over-exit.exp with glibc debuginfoTom de Vries1-1/+1
In test-case gdb.base/step-over-exit.exp, we set a breakpoint on _exit and continue, expecting to hit the breakpoint. Without glibc debug info installed, we have with target board unix/-m64: ... Thread 2.1 "step-over-exit" hit Breakpoint 2.2, 0x00007ffff7d46aee in \ _exit () from /lib64/libc.so.6^M (gdb) PASS: gdb.base/step-over-exit.exp: continue to exit ... and with target board unix/-m32: ... Thread 2.1 "step-over-exit" hit Breakpoint 2.2, 0xf7d84c25 in _exit () from \ /lib/libc.so.6^M (gdb) PASS: gdb.base/step-over-exit.exp: continue to exit ... However after installing debug info (packages glibc-debuginfo and glibc-32bit-debuginfo), we have for -m64 (note: __GI__exit instead of _exit): ... Thread 2.1 "step-over-exit" hit Breakpoint 2.2, \ __GI__exit (status=<optimized out>) at \ ../sysdeps/unix/sysv/linux/_exit.c:27^M 27 {^M (gdb) PASS: gdb.base/step-over-exit.exp: continue to exit ... and -m32 (note: _Exit instead of _exit): ... Thread 2.1 "step-over-exit" hit Breakpoint 2.2, _Exit () at \ ../sysdeps/unix/sysv/linux/i386/_exit.S:24^M 24 ../sysdeps/unix/sysv/linux/i386/_exit.S: No such file or directory.^M (gdb) FAIL: gdb.base/step-over-exit.exp: continue to exit ... The gdb_test allows for both _exit and __GI__exit, but not _Exit: ... gdb_test "continue" \ "Continuing\\..*Breakpoint $decimal.*_exit \\(.*\\).*" \ "continue to exit" ... Fix this by allowing _Exit as well. Tested on x86_64-linux.
2023-06-14Add some expected failures for bfin linker testsNick Clifton17-15/+22
2023-06-14Add --remap-inputs option to the BFD linker.Nick Clifton11-0/+429
PR 30374 * ldfile.c (struct input_remap): New structure. (ldfile_add_remap): New function. (ldfile_remap_input_free): New function. (ldfile_add_remap_file): New function. (ldfile_possibly_remap_input): New function. (ldfile_print_input_remaps): New function. * ldfile.h: Add prototypes for new functions. * ldlang.c (new_afile): Call ldfile_possibly_remap_input. (lang_finish): Call ldfile_remap_input_free. (lang_map): Call ldfile_print_input_remaps. * ldlex.h (OPTION_REMAP_INPUTS, OPTION_REMAP_INPUTS_FILE): Define. * lexsup.c (ld_options): Add --remap-inputs-file and --remap-inputs. (parse_args): Handle new options. * NEWS: Mention the new feature. * ld.texi: Document the new options. * testsuite/ld-misc/input-remap.exp: New test driver. * testsuite/ld-misc/remaps.r: New file: Expected linker output. * testsuite/ld-misc/remaps.txt: New file. Input remaps file.
2023-06-14asprintf memory leaksAlan Modra10-76/+108
A number of backends want to return bfd_reloc_dangerous messaqes from relocation special_function, and construct the message using asprintf. Such messages are not freed anywhere, leading to small memory leaks inside libbfd. To limit the leaks, I'd implemented a static buffer in the ppc backends that was freed before use in asprintf output. This patch extends that scheme to other backends using a shared static buffer and goes further in freeing the buffer on any bfd_close. The patch also fixes a few other cases where asprintf output was not freed after use. bfd/ * bfd.c (_input_error_msg): Make global and rename to.. (_bfd_error_buf): ..this. (bfd_asprintf): New function. (bfd_errmsg): Use bfd_asprintf. * opncls.c (bfd_close_all_done): Free _buf_error_buf. * elf32-arm.c (find_thumb_glue, find_arm_glue): Use bfd_asprintf. * elf32-nios2.c (nios2_elf32_relocate_section): Likewise. * elf32-ppc.c (ppc_elf_unhandled_reloc): Likewise. * elf64-ppc.c (ppc64_elf_unhandled_reloc): Likewise. * elfnn-riscv.c (riscv_resolve_pcrel_lo_relocs): Likewise. (riscv_elf_relocate_section): Likewise. * libbfd.h: Regenerate. gas/ * read.c (read_end): Free current_name and current_label. (do_s_func): Likewise on error path. strdup label. ld/ * pe-dll.c (make_head, make_tail, make_one), (make_singleton_name_thunk, make_import_fixup_entry), (make_runtime_pseudo_reloc), (pe_create_runtime_relocator_reference: Free oname after use.
2023-06-14Re: bfd/elf.c strtab memory leakAlan Modra1-9/+9
There are other places that leak the strtab. * elf.c (_bfd_elf_compute_section_file_positions): Free strtab on error paths.
2023-06-14Automatic date update in version.inGDB Administrator1-1/+1
2023-06-13[gdb/testsuite] Fix gdb.tui/long-prompt.exp with read1Tom de Vries1-4/+1
When running test-case gdb.tui/long-prompt.exp with check-read1, we get: ... (gdb) FAIL: gdb.tui/long-prompt.exp: prompt size == width + 1: \ end of screen: at last line ... The problem is in these commands: ... Term::command "echo \\n" Term::command "echo \\n" Term::command "echo \\n" Term::command "echo \\n" ... The last one makes the terminal scroll, and the scrolling makes the expected output match on a different line. Fix this by replacing the sequence with a single command: ... Term::command "echo \\n\\n\\n\\n\\n\\n" ... which avoids scrolling. Tested on x86_64-linux.
2023-06-13[gdb/testsuite] Fix and add prompt anchoring in tuitermTom de Vries2-2/+100
There is a test-case that contains a unit test for tuiterm: gdb.tui/tuiterm.exp. However, this only excercises the tuiterm itself, and not the functions that interact with it, like Term::command. Add a new test-case gdb.tui/tuiterm-2.exp that: - overrides proc accept_gdb_output (to be able simulate incorrect responses while avoiding the timeout), - overrides proc send_gdb (to be able to call Term::command without a gdb instance, such that all tuiterm input is generated by the test-case). - issues Term::command calls, and - checks whether they behave correctly. This exposes a problem in Term::command. The "prompt before command" regexp starts with a bit that is supposed to anchor the prompt to the border: ... set str "(^|\|)$gdb_prompt $str" ... but that doesn't work due to insufficient escaping. Fix this by adding the missing escape: ... set str "(^|\\|)$gdb_prompt $str" ... Futhermore, the "prompt after command" regexp in Term::wait_for has no anchoring at all: ... set prompt_wait_for "$gdb_prompt \$" ... so add that as well. Tested on x86_64-linux.
2023-06-13[gdb/testsuite] Allow procs with default value args in with_overrideTom de Vries2-2/+99
Currently proc with_override does not work with procs with default value args. Fix this, and add a test-case excercising this scenario. Tested on x86_64-linux.
2023-06-13[gdb/testsuite] Fix gdb.dap/type_check.exp with older pythonTom de Vries2-1/+10
On openSUSE Leap 15.4 with system python 3.6, I run into: ... (gdb) python check_everything()^M (gdb) FAIL: gdb.dap/type_check.exp: type checker ... In check_everything, the hasattr test fails silently: ... def check_everything(): # Older versions of Python can't really implement this. if hasattr(typing, "get_origin"): ... and that makes the gdb_test in the test-case fail. Fix this by emitting UNSUPPORTED instead in check_everything, and detecting this in the test-case. Tested on x86_64-linux.
2023-06-13gdb/testsuite: use proper int size for gdb.dwarf2/symbol_needs_eval*.expLancelot SIX2-6/+18
We recently realized that symbol_needs_eval_fail.exp and symbol_needs_eval_timeout.exp invalidly dereference an int (4 bytes on x86_64) by reading 8 bytes (the size of a pointer). Here how it goes: In gdb/testsuite/gdb.dwarf2/symbol_needs_eval.c a global variable is defined: int exec_mask = 1; and later both tests build some DWARF using the assembler doing: set exec_mask_var [gdb_target_symbol exec_mask] ... DW_TAG_variable { {DW_AT_name a} {DW_AT_type :$int_type_label} {DW_AT_location { DW_OP_addr $exec_mask_var DW_OP_deref ... } } The definition of the DW_OP_deref (from Dwarf5 2.5.1.3 Stack Operations) says that "The size of the data retrieved from the dereferenced address is the size of an address on the target machine." On x86_64, the size of an int is 4 while the size of an address is 8. The result is that when evaluating this expression, the debugger reads outside of the `a` variable. Fix this by using `DW_OP_deref_size $int_size` instead. To achieve this, this patch adds the necessary steps so we can figure out what `sizeof(int)` evaluates to for the current target. While at it, also change the definition of the int type in the assembled DWARF information so we use the actual target's size for an int instead of the literal 4. Tested on x86_64 Linux. Approved-By: Tom Tromey <tom@tromey.com>
2023-06-13Automatic date update in version.inGDB Administrator1-1/+1
2023-06-12Simplify case DW_OP_GNU_uninit in dwarf_expr_context::execute_stack_opKevin Buettner1-6/+1
Tom Tromey pointed out that the test and call to error() for the DW_OP_GNU_uninit case in dwarf_expr_context::execute_stack_op (in gdb/dwarf2/expr.c)... if (op_ptr != op_end && *op_ptr != DW_OP_piece && *op_ptr != DW_OP_bit_piece) error (_("DWARF-2 expression error: DW_OP_GNU_uninit must always " "be the very last op in a DWARF expression or " "DW_OP_piece/DW_OP_bit_piece piece.")); ...could be replaced by a call to dwarf_expr_require_composition which performs a similar check and outputs a suitable error message.
2023-06-12Added self to W.A.A. maintainersSimon Farre1-0/+1
2023-06-12gdb/testsuite: Testing with the armflang compilerRichard Bunt1-1/+4
Currently the Fortran test suite does not run with armflang because the compiler detection fails. This in turn means fortran_runto_main does not know which main method to use to start a test case. Fortran compiler detection was added in 44d469c5f85; however, the commit message notes that it was not tested with armflang. This commit tests and fixes up a minor issue to get the detection working. The goal here is to get the tests running and preventing further regressions during future work. This change does not do anything to fix existing failures. >From what I can understand, the auto detection leverages the preprocessor to extract the Fortran compiler identity from the defines. This preprocessor output is then evaluated by the test suite to import these defines. In the case of armflang, this evaluation step is disrupted by the presence of the following warning: $ armflang -E -fdiagnostics-color=never testsuite/lib/compiler.F90 -o compiler.exp $ clang-13: warning: argument unused during compilation: '-fdiagnostics-color=never' [-Wunused-command-line-argument] The evaluation logic is already set up to filter this warning, but the prefix differs. This commit fixes the issue by updating the filter to exclude the armflang flavour of warning. gdb.fortran regression tests run with GNU, Intel and Intel LLVM. No regressions detected. The gdb.fortran test results with ACfL 23.04.1 are as follows. Before: # of expected passes 560 # of unexpected failures 113 # of unresolved testcases 2 # of untested testcases 5 # of duplicate test names 2 After: # of expected passes 5388 # of unexpected failures 628 # of known failures 10 # of untested testcases 8 # of unsupported tests 5 # of duplicate test names 5 As can be seen from the above, there are now considerably more passing assertions. Reviewed-By: Luis Machado <luis.machado@arm.com> Approved-By: Tom Tromey <tom@tromey.com>
2023-06-12Remove f-strings from DAPTom Tromey4-4/+4
Kévin pointed out that gdb claims a minimum Python version of 3.2, but the DAP code uses f-strings, which were added in 3.6. This patch removes the uses of f-strings from the DAP code. I can't test an older version of Python, but I did confirm that this still works with the version I have.
2023-06-12Implement DAP conditional breakpointsTom Tromey3-16/+144
I realized that I had only implemented DAP breakpoint conditions for exception breakpoints, and not other kinds of breakpoints. This patch corrects the oversight.
2023-06-12Do not report totalFrames from DAP stackTrace requestTom Tromey1-7/+5
Currently, gdb will unwind the entire stack in response to the stackTrace request. I had erroneously thought that the totalFrames attribute was required in the response. However, the spec says: If omitted or if `totalFrames` is larger than the available frames, a client is expected to request frames until a request returns less frames than requested (which indicates the end of the stack). This patch removes this from the response in order to improve performance when the stack trace is very long.
2023-06-12Implement DAP breakpointLocations requestTom Tromey5-1/+63
This implements the DAP breakpointLocations request.
2023-06-12Add "stop at main" extension to DAP launch requestTom Tromey4-3/+61
Co-workers who work on a program that uses DAP asked for the ability to have gdb stop at the main subprogram when launching. This patch implements this extension. Reviewed-By: Eli Zaretskii <eliz@gnu.org>
2023-06-12Add "target" parameter to DAP attach requestTom Tromey4-4/+74
This adds a new "target" to the DAP attach request. This is passed to "target remote". I thought "attach" made the most sense for this, because in some sense gdb is attaching to a running process. It's worth noting that all DAP "attach" parameters are defined by the implementation. Reviewed-By: Eli Zaretskii <eliz@gnu.org>
2023-06-12Handle DAP supportsVariableType capabilityTom Tromey5-3/+19
A DAP client can report the supportsVariableType capability in the initialize request. In this case, gdb can include the type of a variable or expression in various results.
2023-06-12Implement DAP setExpression requestTom Tromey2-1/+28
This implements the DAP setExpression request.
2023-06-12Add gdb.Value.assign methodTom Tromey4-0/+52
This adds an 'assign' method to gdb.Value. This allows for assignment without requiring the use of parse_and_eval. Reviewed-By: Eli Zaretskii <eliz@gnu.org>
2023-06-12Add type-checking to DAP requestsTom Tromey13-28/+287
It occurred to me recently that gdb's DAP implementation should probably check the types of objects coming from the client. This patch implements this idea by reusing Python's existing type annotations, and supplying a decorator that verifies these at runtime. Python doesn't make it very easy to do runtime type-checking, so the core of the checker is written by hand. I haven't tried to make a fully generic runtime type checker. Instead, this only checks the subset that is needed by DAP. For example, only keyword-only functions are handled. Furthermore, in a few spots, it wasn't convenient to spell out the type that is accepted. I've added a couple of comments to this effect in breakpoint.py. I've tried to make this code compatible with older versions of Python, but I've only been able to try it with 3.9 and 3.10.
2023-06-12Use tuples for default arguments in DAPTom Tromey2-3/+3
My co-worker Kévin taught me that using a mutable object as a default argument in Python is somewhat dangerous, because the object is created a single time (when the function is defined), and so if it is mutated in the body of the function, the changes will stick around. This patch changes the cases like this in DAP to use () rather than [] as the default. This patch is merely preventative, as no bugs like this are in the code.
2023-06-12Fix a latent bug in DAP request decoratorTom Tromey1-2/+3
The 'request' decorator is intended to also ensure that the request function runs in the DAP thread. However, the unwrapped function is installed in the global request map, so the wrapped version is never called. This patch fixes the bug.
2023-06-12Add test for DAP pause requestTom Tromey1-0/+41
I neglected to write a test for the DAP "pause" request. This patch adds one.
2023-06-12Rename one DAP functionTom Tromey1-1/+1
When I first started implementing DAP, I had some vague plan of having the implementation functions use the same name as the request. I abandoned this idea, but one vestige remained. This patch renames the one remaining function to be gdb-ish.
2023-06-12Add singleThread support to some DAP requestsTom Tromey3-16/+41
A few DAP requests support a "singleThread" parameter, which is somewhat similar to scheduler-locking. This patch implements support for this.
2023-06-12Implement DAP stepOut requestTom Tromey3-1/+20
This implements the DAP "stepOut" request.
2023-06-12Implement DAP attach requestTom Tromey5-4/+97
This implements the DAP "attach" request. Note that the copyright dates on the new test source file are not incorrect -- this was copied verbatim from another directory. Reviewed-By: Eli Zaretskii <eliz@gnu.org>
2023-06-12Implement DAP setExceptionBreakpoints requestTom Tromey5-7/+189
This implements the DAP setExceptionBreakpoints request for Ada. This is a somewhat minimal implementation, in that "exceptionOptions" are not implemented (or advertised) -- I wasn't completely sure how this feature is supposed to work. I haven't added C++ exception handling here, but it's easy to do if needed. This patch relies on the new MI command execution support to do its work.
2023-06-12Don't require inferior execution for Ada catchpointsTom Tromey1-86/+29
Currently, Ada catchpoints require that the inferior be running. However, there's no deep reason for this -- for example, C++ exception catchpoints do not have this requirement. Instead, those work like ordinary breakpoints: they are pending until the needed runtime locations are seen. This patch changes Ada catchpoints to work the same way.
2023-06-12Mark members of ada_catchpoint "private"Tom Tromey1-15/+17
This changes the members of ada_catchpoint to be private.
2023-06-12Turn should_stop_exception into a method of ada_catchpointTom Tromey1-5/+9
This turns the should_stop_exception function in ada-lang.c into a method of ada_catchpoint.
2023-06-12Combine create_excep_cond_exprs and ada_catchpoint::re_setTom Tromey1-26/+18
This patch merges create_excep_cond_exprs into ada_catchpoint::re_set. This is less verbose and is also a step toward making ada_catchpoint work more like the other code_breakpoint-based exception catchpoints.
2023-06-12Transfer ownership of exception string to ada_catchpointTom Tromey3-10/+12
This changes the ada_catchpoint to require an rvalue ref, so that ownership of the exception string can be transferred to the catchpoint object.