aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-10-29Change program_space_empty_p to method on program_spaceTom Tromey4-10/+16
This changes program_space_empty_p to be a method on program_space. It also changes it to return bool. I removed the "_p" suffix because "empty" is a "well-known" C++ method name. gdb/ChangeLog 2020-10-29 Tom Tromey <tom@tromey.com> * inferior.c (delete_inferior): Update. * progspace.c (program_space::empty): Rename from program_space_empty_p. Return bool. * progspace.h (struct program_space) <empty>: New method. (program_space_empty_p): Don't declare.
2020-10-29Change clear_program_space_solib_cache to method on program_spaceTom Tromey4-10/+20
This changes clear_program_space_solib_cache to be a method on program_space. Also, it removes a call to this function from the program_space destructor, as that is not necessary. gdb/ChangeLog 2020-10-29 Tom Tromey <tom@tromey.com> * progspace.c (program_space::~program_space): Don't call clear_program_space_solib_cache. (program_space::clear_solib_cache): Rename from clear_solib_cache. * solib.c (handle_solib_event): Update. * progspace.h (struct program_space) <clear_solib_cache>: New method. (clear_program_space_solib_cache): Don't declare.
2020-10-29Remove symfile_objfile macroTom Tromey18-79/+124
This removes the symfile_objfile macro, in favor of just spelling out the member access. gdb/ChangeLog 2020-10-29 Tom Tromey <tom@tromey.com> * windows-tdep.c (windows_solib_create_inferior_hook): Update. * target.c (info_target_command): Update. * symfile.c (syms_from_objfile_1, finish_new_objfile) (symbol_file_clear, reread_symbols): Update. * symfile-mem.c (add_symbol_file_from_memory_command): Update. * stabsread.c (scan_file_globals): Update. * solib.c (update_solib_list): Update. * solib-svr4.c (elf_locate_base, open_symbol_file_object) (svr4_fetch_objfile_link_map, enable_break) (svr4_relocate_main_executable) (svr4_iterate_over_objfiles_in_search_order): Update. * solib-frv.c (lm_base, enable_break) (frv_relocate_main_executable): Update. (main_got, frv_fdpic_find_canonical_descriptor): Update. (frv_fetch_objfile_link_map): Update. * solib-dsbt.c (lm_base, dsbt_relocate_main_executable): Update. * solib-darwin.c (darwin_solib_create_inferior_hook): Update. * solib-aix.c (solib_aix_solib_create_inferior_hook): Update. * remote.c (remote_target::get_offsets): Update. (remote_target::start_remote) (extended_remote_target::post_attach): Update. * objfiles.c (entry_point_address_query): Update. * nto-procfs.c (nto_procfs_target::create_inferior): Update. * minsyms.c (get_symbol_leading_char): Update. * frame.c (inside_main_func): Update. * progspace.h (symfile_objfile): Remove macro.
2020-10-29Change program_space::ebfd to a gdb_bfd_ref_ptrTom Tromey4-9/+16
This changes program_space::ebfd to a gdb_bfd_ref_ptr, removing some manual management. gdb/ChangeLog 2020-10-29 Tom Tromey <tom@tromey.com> * exec.c (exec_file_attach): Update. * progspace.c (program_space::exec_close): Update. * progspace.h (struct program_space) <ebfd>: Now a gdb_bfd_ref_ptr. <set_exec_bfd>: Change argument type. <exec_bfd>: Update.
2020-10-29Remove the exec_bfd macroTom Tromey28-120/+218
This removes the exec_bfd macro, in favor of new accessors on program_space. In one spot the accessor can't be used; but this is still a big improvement over the macro, IMO. gdb/ChangeLog 2020-10-29 Tom Tromey <tom@tromey.com> * windows-tdep.c (windows_solib_create_inferior_hook): Update. * symfile.c (reread_symbols): Update. * symfile-mem.c (add_symbol_file_from_memory_command) (add_vsyscall_page): Update. * source-cache.c (source_cache::get_plain_source_lines): Update. * solib-svr4.c (find_program_interpreter, elf_locate_base) (svr4_current_sos_direct, svr4_exec_displacement) (svr4_relocate_main_executable): Update. (svr4_iterate_over_objfiles_in_search_order): Update. * solib-frv.c (enable_break2, enable_break): Update. * solib-dsbt.c (lm_base, enable_break): Update. * solib-darwin.c (find_program_interpreter) (darwin_solib_create_inferior_hook): Update. * sol-thread.c (rw_common, ps_pdmodel): Update. * rs6000-nat.c (rs6000_nat_target::create_inferior): Update. * remote.c (compare_sections_command) (remote_target::trace_set_readonly_regions): Update. * remote-sim.c (get_sim_inferior_data) (gdbsim_target::create_inferior, gdbsim_target::create_inferior): Update. (gdbsim_target_open, gdbsim_target::files_info): Update. * exec.h (exec_bfd): Remove macro. * progspace.c (initialize_progspace): Update. * proc-service.c (ps_addr_to_core_addr, core_addr_to_ps_addr): Update. * nto-procfs.c (nto_procfs_target::post_attach) (nto_procfs_target::create_inferior): Update. * maint.c (maintenance_info_sections): Update. * linux-thread-db.c (thread_db_target::get_thread_local_address): Update. * infcmd.c (post_create_inferior): Update. * gcore.c (default_gcore_arch, default_gcore_target): Update. (objfile_find_memory_regions): Update. * exec.c (validate_exec_file, exec_file_attach) (exec_read_partial_read_only, print_section_info): Update. * corelow.c (core_target_open): Update. * corefile.c (reopen_exec_file, validate_files): Update. * arm-tdep.c (gdb_print_insn_arm): Update. * arch-utils.c (gdbarch_update_p, default_print_insn): Update. * progspace.h (struct program_space) <exec_bfd, set_exec_bfd>: New methods.
2020-10-29Remove current_target_sections macroTom Tromey5-15/+23
This removes the current_target_sections macro, replacing it with uses of the appropriate member from current_program_space. gdb/ChangeLog 2020-10-29 Tom Tromey <tom@tromey.com> * progspace.h (current_target_sections): Remove macro. * solib-svr4.c (scan_dyntag): Update. * solib-dsbt.c (scan_dyntag): Update. * exec.c (exec_target::close): Update. (add_target_sections, add_target_sections_of_objfile) (remove_target_sections, exec_target::get_section_table) (exec_target::files_info, set_section_command) (exec_set_section_address, exec_target::has_memory) (exec_target::has_memory): Update.
2020-10-29Remove exec_bfd_mtime defineTom Tromey5-4/+13
This removes the exec_bfd_mtime define, in favor of directly using the appropriate member of the current program space. gdb/ChangeLog 2020-10-29 Tom Tromey <tom@tromey.com> * source-cache.c (source_cache::get_plain_source_lines): Use current_program_space. * corefile.c (reopen_exec_file): Use current_program_space. * exec.c (exec_file_attach): Use current_program_space. * exec.h (exec_bfd_mtime): Remove.
2020-10-29Remove commented-out code from gcore.cTom Tromey2-20/+6
I found some code in gcore.c that has been commented out since d3420b2fce5e (Mark Kettenis 2003-09-04 166) #if 1 /* See if this even matters... */ This patch deletes this entire function, because the body was reduced to just "return 0". gdb/ChangeLog 2020-10-29 Tom Tromey <tom@tromey.com> * gcore.c (default_gcore_mach): Remove. (create_gcore_bfd): Update.
2020-10-29Change exec_close to be a method on program_spaceTom Tromey5-28/+35
exec_close uses the current program space, so it seemed cleaner to change it to be a method on program_space. This patch makes this change. gdb/ChangeLog 2020-10-29 Tom Tromey <tom@tromey.com> * progspace.c (program_space::exec_close): New method, from exec_close in exec.c. * exec.c (exec_close): Move to progspace.c. (exec_target::close, exec_file_attach): Update. * progspace.h (struct program_space) <exec_close>: Declare method.
2020-10-29Remove exec_filename macroTom Tromey8-20/+34
This removes the exec_filename macro, replacing it with uses of the member of current_program_space. This also renames that member, and changes it to be a unique pointer. gdb/ChangeLog 2020-10-29 Tom Tromey <tom@tromey.com> * progspace.h (struct program_space) <exec_filename>: Rename from pspace_exec_filename. Now a unique_xmalloc_ptr. * inferior.c (print_selected_inferior): Update. (print_inferior): Update. * mi/mi-main.c (print_one_inferior): Update. * exec.h (exec_filename): Remove macro. * corefile.c (get_exec_file): Update. * exec.c (exec_close): Update. (exec_file_attach): Update. * progspace.c (clone_program_space): Update. (print_program_space): Update.
2020-10-29Add target_section constructorTom Tromey4-18/+23
This adds a constructor to target_section, simplifying the code that creates instances of this. gdb/ChangeLog 2020-10-29 Tom Tromey <tom@tromey.com> * target-section.h (struct target_section): Add constructor. * exec.c (build_section_table, add_target_sections_of_objfile): Update. * corelow.c (core_target::build_file_mappings): Update.
2020-10-29Fix an illegal memory access problem when processing secondary relocs for ↵Nick Clifton2-5/+33
architectures which support both REL and RELA relocs. PR 26809 * elf.c (_bfd_elf_slurp_secondary_reloc_section): Use the correct sized reloc reading function. (_bfd_elf_write_secondary_reloc_section): Use the correct sized reloc writing function.
2020-10-29aarch64: Fix DSB instruction 'missing immediate expression' errorsPrzemyslaw Wirkus3-1/+34
This patch fixes errors with DSB instruction after introduction of DSB nXS variant. That change would cause GAS to reject valid DSB immediate string operands. gas/ChangeLog: 2020-10-28 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com> * config/tc-aarch64.c (parse_operands): Check for C0-C15 value of DSB immediate string operand. * testsuite/gas/aarch64/system-4.d: Update test. * testsuite/gas/aarch64/system-4.s: Update test.
2020-10-29dwarf: Also match abbrev base when searching abbrev listH.J. Lu5-22/+1517
A .debug_abbrev section can have multiple CUs. When caching abbrev list, we need to check abbrev base to support multiple CUs. PR binutils/26808 * dwarf.c (abbrev_list): Add abbrev_base. (new_abbrev_list): Add an abbrev_base argument and record it. (find_abbrev_list_by_abbrev_offset): Add an abbrev_base argument and match it. (process_debug_info): Pass abbrev_base to new_abbrev_list and find_abbrev_list_by_abbrev_offset. (display_debug_abbrev): Pass 0 abbrev_base to new_abbrev_list and find_abbrev_list_by_abbrev_offset. * testsuite/binutils-all/x86-64/pr26808.dump: New file. * testsuite/binutils-all/x86-64/pr26808.dwp.bz2: Likewise. * testsuite/binutils-all/x86-64/x86-64.exp: Run PR binutils/26808 test.
2020-10-29gdb: restore thread after detaching or killing an inferiorTankut Baris Aktemur4-0/+18
The "detach inferiors N" command causes the current inferior to switch. E.g.: $ gdb a.out Reading symbols from a.out... (gdb) start ... (gdb) add-inferior [New inferior 2] Added inferior 2 on connection 1 (native) (gdb) inferior 2 [Switching to inferior 2 [<null>] (<noexec>)] (gdb) info inferiors Num Description Connection Executable 1 process 18242 1 (native) /path/to/a.out * 2 <null> 1 (native) (gdb) detach inferiors 1 Detaching from program: /path/to/a.out, process 18242 [Inferior 1 (process 18242) detached] (gdb) info inferiors Num Description Connection Executable * 1 <null> /path/to/a.out 2 <null> 1 (native) (gdb) The same switch happens with the "kill inferiors N" command. Prevent it by restoring the current thread. gdb/ChangeLog: 2020-10-29 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> PR gdb/19318 * inferior.c (detach_inferior_command): Restore the current thread. (kill_inferior_command): Ditto. gdb/testsuite/ChangeLog: 2020-10-29 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * gdb.base/kill-detach-inferiors-cmd.exp: Check that 'kill inferiors' and 'detach inferiors' do not change the current inferior.
2020-10-29Fix a potential illegal memory access by objcopy when extracting dwo sections.Nick Clifton2-2/+15
PR 26805 * objcopy.c (is_dwo_section): Check for missing or short section names.
2020-10-29[gdb/testsuite] Fix DUPLICATEs in gdb.threads/tls.expTom de Vries2-2/+11
With test-case gdb.threads/tls.exp, we get these: ... DUPLICATE: gdb.threads/tls.exp: selected thread: 4 DUPLICATE: gdb.threads/tls.exp: selected thread: 2 DUPLICATE: gdb.threads/tls.exp: selected thread: 3 ... Fix these using with_test_prefix. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-10-29 Tom de Vries <tdevries@suse.de> * gdb.threads/tls.exp: Fix DUPLICATEs.
2020-10-29Automatic date update in version.inGDB Administrator1-1/+1
2020-10-28[gdb/testsuite] Fix gdb.python/py-symbol.exp with -readnowTom de Vries2-4/+32
When running test-case gdb.python/py-symbol.exp with target board readnow, we get: ... FAIL: gdb.python/py-symbol.exp: print line number of rr FAIL: gdb.python/py-symbol.exp: print value of rr ... These are FAILs due to PR25857. Mark these FAILs as KFAILs. gdb/testsuite/ChangeLog: 2020-10-28 Tom de Vries <tdevries@suse.de> * gdb.python/py-symbol.exp: Add KFAILs for -readnow.
2020-10-28[gdb/testsuite] Fix re-read FAILs with -readnowTom de Vries3-0/+21
When running the testsuite with target board readnow, we run into: ... FAIL: gdb.ada/exec_changed.exp: start second FAIL: gdb.ada/exec_changed.exp: start just first FAIL: gdb.base/reread.exp: opts= "" "" : run to foo() second time FAIL: gdb.base/reread.exp: opts= "" "" : second pass: run to foo() second time FAIL: gdb.base/reread.exp: opts= "-fPIE" "ldflags=-pie" : \ run to foo() second time FAIL: gdb.base/reread.exp: opts= "-fPIE" "ldflags=-pie" : second pass: \ run to foo() second time ... These are FAILs due to PR26800. Mark these as KFAILs. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-10-28 Tom de Vries <tdevries@suse.de> * gdb.ada/exec_changed.exp: Add KFAILs for -readnow. * gdb.base/reread.exp: Same.
2020-10-28[gdb/testsuite] Fix gdb.rust/traits.exp with -readnowTom de Vries3-2/+20
With test-case gdb.rust/traits.exp and target board readnow we get: ... FAIL: gdb.rust/traits.exp: print *td FAIL: gdb.rust/traits.exp: print *tu ... Mark these FAILs as KFAILs. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-10-28 Tom de Vries <tdevries@suse.de> * lib/gdb.exp (readnow): Handle arg. * gdb.rust/traits.exp: Add KFAILs for -readnow.
2020-10-28[gdb/testsuite] Fix gdb.base/relocate.exp with -readnowTom de Vries2-4/+9
With test-case gdb.base/relocate.exp and target board readnow, we get: ... FAIL: gdb.base/relocate.exp: symbol-file with offset FAIL: gdb.base/relocate.exp: add-symbol-file with offset FAIL: gdb.base/relocate.exp: add-symbol-file with offset, text address given FAIL: gdb.base/relocate.exp: add-symbol-file with offset, data address given ... Fix these FAILs by updating the regexps for -readnow. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-10-28 Tom de Vries <tdevries@suse.de> * gdb.base/relocate.exp: Update regexp for -readnow.
2020-10-28[gdb/testsuite] Fix gdb.dwarf2/dw2-error.exp with -readnowTom de Vries2-0/+14
With test-case gdb.dwarf2/dw2-error.exp and target board readnow, we get: ... FAIL: gdb.dwarf2/dw2-error.exp: break -q main ... In the normal case, after running into the dwarf error, the minimal symbols are still available, but with -readnow this is not the case. Mark the FAIL as KFAIL. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-10-28 Tom de Vries <tdevries@suse.de> * gdb.dwarf2/dw2-error.exp: Mark failure break in main as known with -readnow.
2020-10-28[gdb/symtab] Fix language of frame without debug infoTom de Vries5-0/+143
On openSUSE Leap 15.2, I run into this FAIL with target board readnow and test-case gdb.dwarf2/dw2-align.exp: ... (gdb) set lang c++^M Warning: the current language does not match this frame.^M (gdb) FAIL: gdb.dwarf2/dw2-align.exp: set lang c++ ... Adding some extra debugging shows that the current language differs without and with readnow: ... Breakpoint 1, 0x00000000004004ab in main ()^M (gdb) show lang^M -The current source language is "auto; currently c".^M +The current source language is "auto; currently asm".^M ... This is explained by find_pc_compunit_symtab (0x4004ab) called from select_frame, which: - without readnow: returns NULL, and - with readnow: returns the symtab for the CU crtn.S, wich has language "MIPS assembler". In the former case, the symtab for crtn.S is not expanded, and find_pc_compunit_symtab hits the default NULL return. In the latter case, the symtab for crtn.S is expanded, and the "best match" loop in find_pc_compunit_symtab returns that symtab as its best match. The GLOBAL_BLOCK for crtn.S has these outer limits of the address range: ... (gdb) p /x b.startaddr $6 = 0x4003c2 (gdb) p /x b.endaddr $7 = 0x40053d ... and 0x4004ab indeed fits in that range, which explains why the CU is considered a match. However, the actual address ranges for the CU are: ... 00000040 ffffffffffffffff 0000000000000000 (base address) 00000040 00000000004003c2 00000000004003c7 00000040 0000000000400538 000000000040053d 00000040 <End of list> ... which confirms that the CU should not be considered a match. The problem is that the "best match" loop is based on the assumption that a symtab with a better match will be found, but in this case we don't find a better match because there's no debug info describing main. Fix this by preferring to use the addres map in the "best match" loop, which will accurately tell us that addrmap_find (bv.map, 0x4004ab) == NULL. Tested on x86_64-linux (that is, openSUSE Leap 15.2), with and without readnow. In the case of a readnow run, brings down the number of unexpected failures from 66 to 38. The FAIL does not reproduce on f.i. Ubuntu 18.04.5, because there the exec does not contain debug info for crtn.S. The dwarf assembly test-case mimics the scenario described above, and reproduces the FAIL with and without -readnow, for both mentioned OS configurations. Also fixes PR25980 - "Overlapping Dwarf Compile Units with non-overlapping subranges gives incorrect line information". gdb/ChangeLog: 2020-10-28 Tom de Vries <tdevries@suse.de> PR symtab/26772 * symtab.c (find_pc_sect_compunit_symtab): In case there's an address map, check it in the "best match" loop. gdb/testsuite/ChangeLog: 2020-10-28 Tom de Vries <tdevries@suse.de> PR symtab/26772 * gdb.dwarf2/dw2-ranges-overlap.c: New test. * gdb.dwarf2/dw2-ranges-overlap.exp: New file.
2020-10-28Use sha256 for hashes in the release processAndreas Rammhold4-11/+19
I just came across the GDB 10.1 release notes and saw that md5 is still being used in those. I thought it would be a good idea to instead have a more modern, secure and wildly available hash function such as SHA256 as part of the release process. The changes have been done rather mechnically via sed but executing the `src-release.sh -b gdb` did work so I am confident about the result. While this does not directly address the release mails, I was wasn't able to find the template/script used for those, this is probably still an improvement. ChangeLog: * src-release.sh: Use sha256sum instead of md5sum. binutils/ChangeLog: * README-how-to-make-a-release: Use sha256sum instead of md5sum. Change-Id: I9cf19ea40699137c45463b8514f6e29271af2347
2020-10-28aarch64: Add CSR PDEC instructionPrzemyslaw Wirkus13-1417/+1489
This patch adds: + New feature +csre to -march command line. + New instruction CSR PDEC associated with CSRE feature. Please note that CSRE system registers were already upstreamed. This patch should finalize CSRE feature implementation. CSRE feature adds CSR PDEC (Decrements Call stack pointer by the size of a Call stack record) instruction. Although this instruction has operand (PDEC) it's instruction's only operand. PDEC forces instruction field Rt to be set to 0b1111. This results in fixed opcode of the instruction. gas/ChangeLog: 2020-10-27 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com> * NEWS: Update docs. * config/tc-aarch64.c (parse_csr_operand): New operand parser. (parse_operands): Call to CSR operand parser. * testsuite/gas/aarch64/csre_csr-invalid.d: New test. * testsuite/gas/aarch64/csre_csr-invalid.l: New test. * testsuite/gas/aarch64/csre_csr-invalid.s: New test. * testsuite/gas/aarch64/csre_csr.d: New test. * testsuite/gas/aarch64/csre_csr.s: New test. include/ChangeLog: 2020-10-27 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com> * opcode/aarch64.h (AARCH64_FEATURE_CSRE): New -march feature. (enum aarch64_opnd): New CSR instruction field AARCH64_OPND_CSRE_CSR. opcodes/ChangeLog: 2020-10-27 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com> * aarch64-opc.c (aarch64_print_operand): CSR PDEC operand print-out. * aarch64-tbl.h (CSRE): New CSRE feature handler. (_CSRE_INSN): New CSRE instruction type. (struct aarch64_opcode): New 'csre' entry for a CSRE CLI feature. * aarch64-asm-2.c: Regenerated. * aarch64-dis-2.c: Regenerated. * aarch64-opc-2.c: Regenerated.
2020-10-28aarch64: Add WFET instruction for Armv8.7-aPrzemyslaw Wirkus7-1348/+1428
This patch adds new to Armv8.7 WFET instruction which take one operand: WFET <Xt> Where: <Xt> is 64-bit name of the general-purpose source register, encoded in the "Rd" field. For more details regarding WFET (Wait For Event with Timeout) instruction for Armv8.7-a please refer to Arm A64 Instruction set documentation for Armv8-A architecture profile, see document pages 565 of [0]. [0]: https://developer.arm.com/docs/ddi0596/i gas/ChangeLog: 2020-10-27 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com> * NEWS: Update docs. * testsuite/gas/aarch64/system-5.d: New test. * testsuite/gas/aarch64/system-5.s: New test. opcodes/ChangeLog: 2020-10-27 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com> * aarch64-tbl.h (struct aarch64_opcode): Add new WFET instruction encoding and operand description. * aarch64-asm-2.c: Regenerated. * aarch64-dis-2.c: Regenerated. * aarch64-opc-2.c: Regenerated.
2020-10-28aarch64: Add DSB instruction Armv8.7-a variantPrzemyslaw Wirkus18-1455/+1622
This patch adds new variant (nXS) of DSB memory barrier instruction available in Armv8.7-a. New nXS variant has different encoding in comparison with pre Armv8.7-a DSB memory barrier variant thus new instruction and new operand was added. DSB memory nXS barrier variant specifies the limitation on the barrier operation. Allowed values are: DSB SYnXS|#28 DSB ISHnXS|#24 DSB NSHnXS|#20 DSB OSHnXS|#16 Please note that till now, for barriers, barrier operation was encoded in 4-bit unsigned immediate CRm field (in the range 0 to 15). For DSB memory nXS barrier variant, barrier operation is a 5-bit unsigned assembly instruction immediate, encoded in instruction in two bits CRm<3:2>: CRm<3:2> #imm 00 16 01 20 10 24 11 28 This patch extends current AArch64 barrier instructions with above mapping. Notable patch changes include: + New DSB memory barrier variant encoding for Armv8.7-a. + New operand BARRIER_DSB_NXS for above instruction in order to distinguish between existing and new DSB instruction flavour. + New set of DSB nXS barrier options. + New instruction inserter and extractor map between instruction immediate 5-bit value and 2-bit CRm field of the instruction itself (see FLD_CRm_dsb_nxs). + Regeneration of aarch64-[asm|dis|opc]-2.c files. + Test cases to cover new instruction assembling and disassembling. For more details regarding DSB memory barrier instruction and its Armv8.7-a flavour please refer to Arm A64 Instruction set documentation for Armv8-A architecture profile, see document pages 132-133 of [0]. [0]: https://developer.arm.com/docs/ddi0596/i gas/ChangeLog: 2020-10-23 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com> * NEWS: Docs update. * config/tc-aarch64.c (parse_operands): Add AARCH64_OPND_BARRIER_DSB_NXS handler. (md_begin): Add content of aarch64_barrier_dsb_nxs_options to aarch64_barrier_opt_hsh hash. * testsuite/gas/aarch64/system-4-invalid.d: New test. * testsuite/gas/aarch64/system-4-invalid.l: New test. * testsuite/gas/aarch64/system-4-invalid.s: New test. * testsuite/gas/aarch64/system-4.d: New test. * testsuite/gas/aarch64/system-4.s: New test. include/ChangeLog: 2020-10-23 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com> * opcode/aarch64.h (enum aarch64_opnd): New operand AARCH64_OPND_BARRIER_DSB_NXS. (aarch64_barrier_dsb_nxs_options): Declare DSB nXS options. opcodes/ChangeLog: 2020-10-23 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com> * aarch64-asm.c (aarch64_ins_barrier_dsb_nxs): New inserter. * aarch64-asm.h (AARCH64_DECL_OPD_INSERTER): New inserter ins_barrier_dsb_nx. * aarch64-dis.c (aarch64_ext_barrier_dsb_nxs): New extractor. * aarch64-dis.h (AARCH64_DECL_OPD_EXTRACTOR): New extractor ext_barrier_dsb_nx. * aarch64-opc.c (aarch64_print_operand): New options table aarch64_barrier_dsb_nxs_options. * aarch64-opc.h (enum aarch64_field_kind): New field name FLD_CRm_dsb_nxs. * aarch64-tbl.h (struct aarch64_opcode): Define DSB nXS barrier Armv8.7-a instruction. * aarch64-asm-2.c: Regenerated. * aarch64-dis-2.c: Regenerated. * aarch64-opc-2.c: Regenerated.
2020-10-28aarch64: Add basic support for armv8.7-a architecturePrzemyslaw Wirkus5-2/+9
This patch adds support for AArch64 -march=armv8.7-a command line option in GAS. Please note that this change ONLY extends -march= command line interface with a new "armv8.7-a" option. Architectural changes like new instructions will be added in following patches. gas/ChangeLog: 2020-10-16 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com> * NEWS: Docs update. * config/tc-aarch64.c (armv8.7-a): New arch. * doc/c-aarch64.texi (-march=armv8.7-a): Update docs. include/ChangeLog: 2020-10-16 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com> * opcode/aarch64.h (AARCH64_FEATURE_V8_7): New feature bitmask. (AARCH64_ARCH_V8_7): New arch feature set. opcodes/ChangeLog: 2020-10-16 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com> * aarch64-tbl.h (ARMV8_7): New macro.
2020-10-28Fix a potential illegal memory access when creating an srec format file.Nick Clifton2-1/+10
PR 26774 * srec.c (srec_write_symbols): Do not emit symbols in sections that have been removed from the output.
2020-10-28Fix compile time warning building with gcc 11.Nick Clifton2-1/+5
PR 26795 * elfedit.c (process_archive): Remove spurious call to free().
2020-10-28[gdb/testsuite] Fix gdb.cp/nsalias.exp with -readnowTom de Vries3-8/+32
When running test-case gdb.cp/nsalias.exp with target board readnow, we get: ... FAIL: gdb.cp/nsalias.exp: complaint for too many recursively imported \ declarations ... The complaint is not detected, because: - the complaint is triggered during the file command instead of during "print N100::x" - the "set complaints 1" is not effective because it's issued after the file command Fix the FAIL by setting the complaints limit earlier, and detecting the complaint also during the file command. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-10-28 Tom de Vries <tdevries@suse.de> * lib/gdb.exp (gdb_file_cmd): Set gdb_file_cmd_msg. * gdb.cp/nsalias.exp: Set complaints limit before file cmd. Expect complaint during file command for -readnow.
2020-10-28[gdb/testsuite] Fix typo in gdb.cp/nsalias.expTom de Vries2-1/+5
Fix typo "compaint" -> "complaint". gdb/testsuite/ChangeLog: 2020-10-28 Tom de Vries <tdevries@suse.de> * gdb.cp/nsalias.exp: Fix typo in test name.
2020-10-28[gdb/testsuite] Fix gdb.dwarf2/dw2-filename.exp with -readnowTom de Vries2-1/+5
When running test-case gdb.dwarf2/dw2-filename.exp with target board -readnow, we run into: ... FAIL: gdb.dwarf2/dw2-filename.exp: info sources ... The normal output is: ... (gdb) info sources^M Source files for which symbols have been read in:^M ^M Source files for which symbols will be read in on demand:^M ^M src/gdb/testsuite/gdb.dwarf2/file1.txt^M (gdb) ... but with -readnow file1.txt appears in the "Source files for which symbols have been read in" catagory instead, as expected. Fix the FAIL by making the regexp match the -readnow output. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-10-28 Tom de Vries <tdevries@suse.de> * gdb.dwarf2/dw2-filename.exp: Update regexp for -readnow.
2020-10-28[gdb/testsuite] Fix gdb.dwarf2/dw2-stack-boundary.exp with -readnowTom de Vries2-1/+30
When running test-case gdb.dwarf2/dw2-stack-boundary.exp with target board readnow, we run into: ... FAIL: gdb.dwarf2/dw2-stack-boundary.exp: check partial symtab errors ... The cause for the FAIL is that these complaints are not there: ... During symbol reading: location description stack underflow^M During symbol reading: location description stack overflow^M ... Fix this by KFAILing the complaints for -readnow. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-10-28 Tom de Vries <tdevries@suse.de> * gdb.dwarf2/dw2-stack-boundary.exp: KFAILing the complaints for -readnow.
2020-10-28Automatic date update in version.inGDB Administrator1-1/+1
2020-10-27[gdb/testsuite] Fix gdb.base/multi-forks.exp timeout with -readnowTom de Vries2-1/+15
When running test-case gdb.base/multi-forks.exp with target board readnow, we run into: ... FAIL: gdb.base/multi-forks.exp: run to exit 1 (timeout) ... Fix this by using exp_continue. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-10-27 Tom de Vries <tdevries@suse.de> * gdb.base/multi-forks.exp: Use exp_continue to fix timeout.
2020-10-27[gdb/testsuite] Fix DUPLICATEs in gdb.base/multi-forks.expTom de Vries1-20/+26
When running test-case gdb.base/multi-forks.exp I get: ... DUPLICATE: gdb.base/multi-forks.exp: run to exit 2 DUPLICATE: gdb.base/multi-forks.exp: run to exit 2 ... Fix these by using test_with_prefix. Tested on x86_64-linux.
2020-10-27[gdb/testsuite] Fix gdb.base/maint.exp FAILs with -readnowTom de Vries2-5/+24
When running test-case gdb.base/maint.exp with target board readnow, we run into: ... FAIL: gdb.base/maint.exp: mt expand-symtabs FAIL: gdb.base/maint.exp: maint print objfiles: psymtabs FAIL: gdb.base/maint.exp: maint print psymbols -source FAIL: gdb.base/maint.exp: maint print psymbols -pc FAIL: gdb.base/maint.exp: maint info line-table with filename of symtab that \ is not currently expanded ... When using -readnow: - there are no partial symtabs - all symtabs are expanded at symbol load time and these differences from normal behaviour cause the FAILs. Update the tests for -readnow. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-10-27 Tom de Vries <tdevries@suse.de> * gdb.base/maint.exp: Update for -readnow.
2020-10-27[gdb/testsuite] Fix gdb.cp/psymtab-parameter.exp with -readnowTom de Vries2-3/+9
When running test-case gdb.cp/psymtab-parameter.exp with target board readnow, we run into: ... FAIL: gdb.cp/psymtab-parameter.exp: maintenance info symtabs ... The FAIL is expected, as mentioned in the comment: ... # The goal is to keep the CU (Compilation Unit) unexpanded. It would be # rather XFAIL than FAIL here. For example -readnow breaks it. gdb_test_no_output "maintenance info symtabs" ... Fix the FAIL by skipping the command for -readnow. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-10-27 Tom de Vries <tdevries@suse.de> * gdb.cp/psymtab-parameter.exp: Don't expect unexpanded CU for -readnow.
2020-10-27Fix gdb.python/py-format-string.exp with ClangGary Benson2-2/+8
GDB includes the virtual table pointer when formatting polymorphic C++ objects for printing, but GCC and Clang name these differently: GCC emits a DW_AT_name of "_vptr.Base" when describing the virtual table pointer of a type derived from type "Base", whereas Clang will emit "_vptr$Base" in this situation. This commit fixes a testcase which failed because of this. gdb/testsuite/ChangeLog: * gdb.python/py-format-string.exp (test_deref_refs): Treat "_vptr$Base" as correct, in addition to "_vptr.Base". (test_mixed): Likewise.
2020-10-27Add skip_fortran_tests to two Fortran testcasesGary Benson3-2/+11
This commit adds missing skip_fortran_tests checks to two Fortran testcases that did not have it. It also fixes a copy-paste error in a comment. gdb/testsuite/ChangeLog: * gdb.mi/mi-fortran-modules.exp: Check skip_fortran_tests. * gdb.mi/mi-vla-fortran.exp: Likewise. Also fix a comment.
2020-10-27Fix seg-fault when running the ld testsuite for the hppa64-linux target.Nick Clifton2-1/+7
* elf64-hppa.c (elf_hppa_final_link_relocate): Check that the symbol's section is being output before adding its offset to the addend when processing R_PARISC_SECREL32.
2020-10-27Fix the decoding of DW_FORM_ref_addr DWARF attribute.Nick Clifton2-138/+474
* dwarf.c (struct abbrev_list): New structure. Used to collect lists of abbreviation sets. (struct abbrev_map): New structure. Used to map CU offsets to abbreviation offsets. (record_abbrev_list): New function. A new entry to an abbreviation list. (free_all_abbrevs): Update to free abbreviation lists. (new_abbrev_list): New function. Start a new abbreviation list. (find_abbrev_list_by_abbrev_offset): New function. (find_abbrev_map_by_offset): New function. (add_abbrev): Add abbrev_list parameter. (add_abbrev_attr): Likewise. (process_abbrev_section): Rename to process_abbrev_set and add list parameter. (get_type_abbrev_from_form): New function. Attempts to decode the forms used by DW_AT_type attributes. (get_type_signedness): Display type names if operating in wide mode. Use get_type_abbrev_from_form. (read_and_display_attr_value): Use get_type_abbrev_from_form. (process_debug_info): Pre-parse the CU headers to collate all the abbrevs before starting the main scan. (process_debug_abbrev): Do not free any loaded abbrevs. (free_debug_memory): Free the abbrev maps.
2020-10-27gdb: remove unused includes in m32c-tdep.cSimon Marchi2-8/+4
include-what-you-use says: ../../../src/binutils-gdb/gdb/m32c-tdep.c should remove these lines: - #include "dis-asm.h" // lines 24-24 - #include "dwarf2/expr.h" // lines 31-31 - #include "dwarf2/frame.h" // lines 30-30 - #include "elf-bfd.h" // lines 21-21 - #include "elf/m32c.h" // lines 22-22 - #include "target.h" // lines 37-37 - struct m32c_reg; // lines 45-45 That looks right, remove them. Tested by rebuilding. gdb/ChangeLog: * m32c-tdep.c: Remove unused includes. Change-Id: I28b41795f3bcc5406488dbf272c9e86fd5781b6b
2020-10-27gdb: remove unused includes in xtensa-tdep.cSimon Marchi2-9/+4
include-what-you-use says that these includes are not necessary in xtensa-tdep.c: ../../../src/binutils-gdb/gdb/xtensa-tdep.c should remove these lines: - #include "dis-asm.h" // lines 29-29 - #include "dummy-frame.h" // lines 36-36 - #include "dwarf2.h" // lines 37-37 - #include "dwarf2/loc.h" // lines 39-39 - #include "inferior.h" // lines 30-30 - #include "objfiles.h" // lines 25-25 - #include "remote.h" // lines 45-45 - #include "serial.h" // lines 46-46 - #include "symfile.h" // lines 24-24 That looks about right, so remove them. Tested by re-building. gdb/ChangeLog: * xtensa-tdep.c: Remove includes. Change-Id: I9774ec59a68dd94e06967713d2f271b1760f6e6a
2020-10-27gdb/breakpoint: use gdb::option for the '-force' flagTankut Baris Aktemur4-20/+85
Use the gdb::option framework for the '-force' flag of the 'condition' command. This gives tab-completion ability for the flag. gdb/ChangeLog: 2020-10-27 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * breakpoint.c (struct condition_command_opts): New struct. (condition_command_option_defs): New static global. (make_condition_command_options_def_group): New function. (condition_completer): Update to consider the '-force' flag. (condition_command): Use gdb::option for the '-force' flag. gdb/testsuite/ChangeLog: 2020-10-27 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * gdb.base/condbreak.exp: Update the completion tests to consider the '-force' flag.
2020-10-27[gdb/testsuite] Fix section matching in find_pc_sect_compunit_symtabTom de Vries4-6/+43
When running test-case gdb.base/list-ambiguous.exp with target board readnow, we run into: ... FAIL: gdb.base/list-ambiguous.exp: list ambiguous_fun ... The test-case contains two static functions ambiguous_fun, one in list-ambiguous0.c and one in list-ambiguous1.c. The list command is supposed to show both, but only the one from list-ambiguous0.c is shown. This is due to the section check in find_pc_sect_compunit_symtab. It checks whether the candidate compunit_symtab contains a symbol that has the required section. This check is only done for GLOBAL_BLOCK symbols. The check succeeds for the compunit_symtab for list-ambiguous0.c, because it contains main, but it fails for list-ambiguous0.c because it has no global symbols. Fix this by extending the section check to STATIC_BLOCK symbols. Tested on x86_64-linux. gdb/ChangeLog: 2020-10-27 Tom de Vries <tdevries@suse.de> * symtab.c (find_pc_sect_compunit_symtab): Include STATIC_BLOCK symbols in section check. gdb/testsuite/ChangeLog: 2020-10-27 Tom de Vries <tdevries@suse.de> * gdb.base/list-ambiguous-readnow.exp: New file.
2020-10-27[gdb/symtab] Use early continue in find_pc_sect_compunit_symtabTom de Vries2-44/+54
Function find_pc_sect_compunit_symtab contains a loop: ... for (compunit_symtab *cust : obj_file->compunits ()) { ... if (...) { /* Lots of code. */ } } ... Reduce indentation level and improve readability by using early continue. Tested on x86_64-linux. gdb/ChangeLog: 2020-10-27 Tom de Vries <tdevries@suse.de> * symtab.c (find_pc_sect_compunit_symtab): Use early continue.
2020-10-27gdb/breakpoint: add flags to 'condition' and 'break' commands to force conditionTankut Baris Aktemur15-21/+189
The previous patch made it possible to define a condition if it's valid at some locations. If the condition is invalid at all of the locations, it's rejected. However, there may be cases where the user knows the condition *will* be valid at a location in the future, e.g. due to a shared library load. To make it possible that such condition can be defined, this patch adds an optional '-force' flag to the 'condition' command, and, respectively, a '-force-condition' flag to the 'break'command. When the force flag is passed, the condition is not rejected even when it is invalid for all the current locations (note that all the locations would be internally disabled in this case). For instance: (gdb) break test.c:5 Breakpoint 1 at 0x1155: file test.c, line 5. (gdb) cond 1 foo == 42 No symbol "foo" in current context. Defining the condition was not possible because 'foo' is not available. The user can override this behavior with the '-force' flag: (gdb) cond -force 1 foo == 42 warning: failed to validate condition at location 1.1, disabling: No symbol "foo" in current context. (gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep y <MULTIPLE> stop only if foo == 42 1.1 N 0x0000000000001155 in main at test.c:5 Now the condition is accepted, but the location is automatically disabled. If a future location has a context in which 'foo' is available, that location would be enabled. For the 'break' command, -force-condition has the same result: (gdb) break test.c:5 -force-condition if foo == 42 warning: failed to validate condition at location 0x1169, disabling: No symbol "foo" in current context. Breakpoint 1 at 0x1169: file test.c, line 5. gdb/ChangeLog: 2020-10-27 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * breakpoint.h (set_breakpoint_condition): Add a new bool parameter. * breakpoint.c: Update the help text of the 'condition' and 'break' commands. (set_breakpoint_condition): Take a new bool parameter to control whether condition definition should be forced even when the condition expression is invalid in all of the current locations. (condition_command): Update the call to 'set_breakpoint_condition'. (find_condition_and_thread): Take the "-force-condition" flag into account. * linespec.c (linespec_keywords): Add "-force-condition" as an element. (FORCE_KEYWORD_INDEX): New #define. (linespec_lexer_lex_keyword): Update to consider "-force-condition" as a keyword. * ada-lang.c (create_ada_exception_catchpoint): Ditto. * guile/scm-breakpoint.c (gdbscm_set_breakpoint_condition_x): Ditto. * python/py-breakpoint.c (bppy_set_condition): Ditto. * NEWS: Mention the changes to the 'break' and 'condition' commands. gdb/testsuite/ChangeLog: 2020-10-27 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * gdb.base/condbreak-multi-context.exp: Expand to test forcing the condition. * gdb.linespec/cpcompletion.exp: Update to consider the '-force-condition' keyword. * gdb.linespec/explicit.exp: Ditto. * lib/completion-support.exp: Ditto. gdb/doc/ChangeLog: 2020-10-27 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * gdb.texinfo (Set Breaks): Document the '-force-condition' flag of the 'break'command. * gdb.texinfo (Conditions): Document the '-force' flag of the 'condition' command.