aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-06-07Fix AArch64 unintialized variable which can cause diagnostic failures.Tamar Christina2-0/+8
This patch fixes an uninitialized memory issue that can under certain circumstances turn an error into a warning because non_fatal was not initialised in all cases. Verified using valgrind. gas/config/tc-aarch64.c PR binutils/21446 * tc-aarch64.c (record_operand_error, record_operand_error_with_data): Initialize non_fatal.
2018-06-07Aarch64 SVE pseudo register supportAlan Hayward3-21/+124
Add the functionality for reading/writing pseudo registers. On SVE the V registers are pseudo registers. This is supported by adding AARCH64_SVE_V0_REGNUM. * aarch64-tdep.c (AARCH64_SVE_V0_REGNUM): Add define. (aarch64_vnv_type): Add function. (aarch64_pseudo_register_name): Add V regs for SVE. (aarch64_pseudo_register_type): Likewise. (aarch64_pseudo_register_reggroup_p): Likewise. (aarch64_pseudo_read_value_2): Use V0 offset for SVE (aarch64_pseudo_read_value): Add V regs for SVE. (aarch64_pseudo_write_2): Use V0 offset for SVE (aarch64_pseudo_write): Add V regs for SVE. * aarch64-tdep.h (struct gdbarch_tdep): Add vnv_type.
2018-06-07Automatic date update in version.inGDB Administrator1-1/+1
2018-06-07EXECUTABLE_SYMBOLS -> OTHER_SYMBOLSAlan Modra4-5/+16
EXECUTABLE_SYMBOLS is supposed to be true to its name, only defining symbols for the executable. * emulparams/elf64bmip.sh (EXECUTABLE_SYMBOLS): Don't define. (OTHER_SYMBOLS): Define this instead. * emulparams/elf32bmipn32.sh (EXECUTABLE_SYMBOLS): Don't define. (OTHER_SYMBOLS): Define similarly to elf64bmip.sh. * emulparams/elf64hppa.sh (EXECUTABLE_SYMBOLS): Don't define. (OTHER_SYMBOLS): Define instead.
2018-06-07TIC6X __c6xabi_DSBT_BASEAlan Modra4-1/+22
Adding an undefined __c6xabi_DSBT_BASE via an EXTERN in the linker script isn't ideal, as the symbol is not always needed. This patch adds the undefined symbol on encountering relocations where it is implicitly referenced. bfd/ * elf32-tic6x.c (elf32_tic6x_check_relocs): Reference __c6xabi_DSBT_BASE explicitly for R_C6000_SBR_* relocs. ld/ * emulparams/elf32_tic6x_le.sh (EXECUTABLE_SYMBOLS): Don't define.
2018-06-06Guard declarations of 'sve_{vq,vl}_from_{vl,vq}' macros on Aarch64 (and ↵Sergio Durigan Junior1-0/+4
unbreak build) Commit 122394f1476b1c925a281b15399119500c8231c1 ("Function for reading the Aarch64 SVE vector length") has added macros to manipulate SVE vector sizes based on Linux kernel sources, but did not guard them with #ifndef's, which breaks the build when the system headers already have these macros: CXX aarch64-linux-nat.o In file included from ../../gdb/aarch64-tdep.h:25, from ../../gdb/aarch64-linux-nat.c:30: ../../gdb/arch/aarch64.h:79: error: "sve_vq_from_vl" redefined [-Werror] #define sve_vq_from_vl(vl) ((vl) / 0x10) In file included from /usr/include/bits/sigcontext.h:30, from /usr/include/signal.h:291, from build-gnulib/import/signal.h:52, from ../../gdb/linux-nat.h:23, from ../../gdb/aarch64-linux-nat.c:26: /usr/include/asm/sigcontext.h:154: note: this is the location of the previous definition #define sve_vq_from_vl(vl) ((vl) / SVE_VQ_BYTES) In file included from ../../gdb/aarch64-tdep.h:25, from ../../gdb/aarch64-linux-nat.c:30: ../../gdb/arch/aarch64.h:80: error: "sve_vl_from_vq" redefined [-Werror] #define sve_vl_from_vq(vq) ((vq) * 0x10) In file included from /usr/include/bits/sigcontext.h:30, from /usr/include/signal.h:291, from build-gnulib/import/signal.h:52, from ../../gdb/linux-nat.h:23, from ../../gdb/aarch64-linux-nat.c:26: /usr/include/asm/sigcontext.h:155: note: this is the location of the previous definition #define sve_vl_from_vq(vq) ((vq) * SVE_VQ_BYTES) In order to fix this breakage, this commit guards the declaration of the macros using #ifndef's. gdb/ChangeLog: 2018-06-06 Sergio Durigan Junior <sergiodj@redhat.com> * arch/aarch64.h (sve_vg_from_vl): Guard with #ifndef. (sve_vl_from_vg): Likewise. (sve_vq_from_vl): Likewise. (sve_vl_from_vq): Likewise. (sve_vq_from_vg): Likewise. (sve_vg_from_vq): Likewise.
2018-06-06Update the AArch64 assembler to note that the Qualcomm Saphira cpu supports ↵Sameera Deshpande2-1/+6
ARMv8.4 gas * config/tc-aarch64.c (aarch64_cpus): Add support of ARMv8.4 in saphira.
2018-06-06armelf_fbsd and armelf_fuchsia dependenciesAlan Modra3-2/+12
* Makefile.am (earmelf_fbsd.c): Correct dependencies. (earmelfb_fbsd.c, earmelfb_fuchsia.c): Likewise. * Makefile.in: Regenerate.
2018-06-06Fix xtensa "clobbered by longjmp" warningsAlan Modra2-6/+12
.../opcodes/xtensa-dis.c: In function ‘print_insn_xtensa’: .../opcodes/xtensa-dis.c:257:17: error: variable ‘fmt’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered] xtensa_format fmt; ^~~ .../opcodes/xtensa-dis.c:262:26: error: variable ‘valid_insn’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered] int first, first_slot, valid_insn = 0; ^~~~~~~~~~ * xtensa-dis.c (print_insn_xtensa): Init fmt and valid_insn after setjmp. Move init for some other vars later too.
2018-06-06Automatic date update in version.inGDB Administrator1-1/+1
2018-06-05Remove some text from --version outputTom Tromey7-14/+41
I happened to notice recently that "gdb --version" says: GNU gdb (GDB) 8.0.50.20170911-git Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word". This is a bit on the wordy side, but also references interactive commands, which I think doesn't really make sense for --version. This patch removes some text from --version, while leaving it in the "show version" output. It also adds a newline between the URLs and the "For help, ..." text, because I thought that was easier to read. Finally, it indents one of the URLs, since that was simpler to read, but not the other URL, because the current format is specified by the GNU coding standards section on "--version". Now the --version output looks like: GNU gdb (GDB) 8.1.50.20180511-git Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Tested by the buildbot. gdb/ChangeLog 2018-06-05 Tom Tromey <tom@tromey.com> * cli/cli-cmds.c (show_version): Update. * top.c (print_gdb_version): Add "interactive" parameter. Update. * main.c (captured_main_1): Update. * top.h (print_gdb_version): Add "interactive" parameter and a comment. gdb/testsuite/ChangeLog 2018-06-05 Tom Tromey <tom@tromey.com> * gdb.base/default.exp: Update expected "show version" output.
2018-06-05Fix typo in common/enum-flags.h exampleDavid Malcolm2-1/+6
The DEF_ENUM_FLAGS_TYPE macro should be used with a trailing semicolon, but the example in the comment lacks one. gdb/ChangeLog: 2018-06-05 David Malcolm <dmalcolm@redhat.com> * common/enum-flags.h: Add trailing semicolon to example in comment.
2018-06-05Add "continue" response to pagerTom Tromey10-23/+89
This adds a "continue" response to the pager. If the user types "c" in response to the pager prompt, pagination will be disabled for the duration of one command -- but re-enabled afterward. This is handy if you type a command that produces a lot of output, and you don't want to baby-sit it by typing "return" each time the prompt comes up. Tested by the buildbot. gdb/ChangeLog 2018-06-05 Tom Tromey <tom@tromey.com> PR cli/12326: * NEWS: Add entry about pager. * utils.c (pagination_disabled_for_command): New global. (prompt_for_continue): Allow "c" response to prompt. (reinitialize_more_filter): Clear pagination_disabled_for_command. (fputs_maybe_filtered): Check pagination_disabled_for_command. gdb/doc/ChangeLog 2018-06-05 Tom Tromey <tom@tromey.com> PR cli/12326: * gdb.texinfo (Screen Size): Document "c" response to pagination prompt. gdb/testsuite/ChangeLog 2018-06-05 Tom Tromey <tom@tromey.com> PR cli/12326: * gdb.cp/static-print-quit.exp: Update. * lib/gdb.exp (pagination_prompt): Update. * gdb.base/page.exp: Use pagination_prompt. Add new tests. * gdb.python/python.exp: Update.
2018-06-05Tidy bfdio to consistenly use containing archiveAlan Modra6-136/+151
Archive element IO is performed on the file of the containing archive, which leads to the BFD "where" field of archives and their elements being out of sync with the real file position. (We're talking traditional archives here, not thin archives.) The old bfd_seek code recognized this by not attempting to optimize away seeks for archives. However, there was other code that could return bogus results. For example, cache.c limits the number of open files by closing a file and remembering its state once the limit is reached. If bfd_tell is called on an archive element when the containing archive is closed, it will return an invalid file pointer. It's possible to have a valid "where" field for archives by always using and updating the containing archive BFD. That's what this patch does. Note that cache.c used to find the containing archive BFD anyway for the iostream, so we're not really doing extra work, just transferring it up to the correct abstraction level. The patch also gets rid of some hacks. bfd_tell was called when bfd_seek failed, in an attempt to correct "where". That's got to be papering over another problem, so that code has been removed. bfd_read also had an "optimiziation" to return early when the number of bytes was zero, and bfd_seek optimized calls that didn't move the file pointer. This was covering for a coff_slurp_line_table bug where IO was attempted on a pe-dll BFD without an iovec. * bfd.c (struct bfd): Update comment on "where" usage. * bfdio.c (bfd_bwrite, bfd_stat): Use and update "iovec", "iostream", and "where" from containing archive file. Return error on NULL iovec. (bfd_bread): Similarly, and return error attempted out of bounds archive element access. (bfd_tell, bfd_flush): Use and update "iovec", "iostream", and "where" from containing archive file. (bfd_seek): Likewise. Return error on NULL iovec. Don't attempt to optimize away seeks. Don't paper over errors by calling bfd_tell. (bfd_get_mtime): Call bfd_stat rather than iovec->bstat. (bfd_get_size): Likewise. (bfd_mmap): Operate on and use iovec of containing archive file. Return error on NULL iovec. * cache.c (bfd_cache_lookup_worker): Abort if working on archive element bfd. (cache_bread_1): Delete bfd parameter, add FILE* parameter. Don't ignore zero byte reads. (cache_bread): Look up FILE* in cache here. Error on NULL lookup. (cache_bwrite): Rename "where" to "from". (cache_bmmap): Don't handle archive elements. * coffcode.h (coff_slurp_line_table): Exit early on zero lineno count. * bfd-in2.h: Regenerate.
2018-06-05PR23254, ld.bfd mishandles file pointers while scanning archiveAlan Modra5-16/+33
Best practice is to not mix lseek/read with fseek/fread on the same underlying file descriptor, as not all stdio implementations will cope. Since the plugin uses lseek/read while bfd uses fseek/fread this patch reopens the file for exclusive use by the plugin rather than trying to restore the file descriptor. That allows the plugin to read the file after plugin_call_claim_file too. bfd/ PR 23254 * plugin.c (bfd_plugin_open_input): Allow for possibility of nested archives. Open file again for plugin. (try_claim): Don't save and restore file position. Close file if not claimed. * sysdep.h (O_BINARY): Define. ld/ PR 23254 * plugin.c (plugin_call_claim_file): Revert 2016-07-19 patch. (plugin_object_p): Don't dup file descriptor.
2018-06-05Another s12z regenAlan Modra2-1/+5
* Makefile.in: Regenerate.
2018-06-05Add a test of the linker's "-z noexecstack" command line option.Flavio Ceolin3-0/+10
ld * testsuite/ld-elf/elf.exp Run new test. * testsuite/ld-elf/stack-noexec.rd New file: Expected readelf output.
2018-06-05Updated Malay and Esperanto translations for the gprof/ subdirectory.Nick Clifton3-184/+200
2018-06-05 Nick Clifton <nickc@redhat.com> * po/eo.po: Updated Esperanto translation. * po/ms.po: Updated Malay translation.
2018-06-05Automatic date update in version.inGDB Administrator1-1/+1
2018-06-04Remove last Ada cleanupsTom Tromey4-144/+108
This removes the last cleanups from the Ada code by changing ada_lookup_symbol_list's out parameter to be a std::vector, and then fixing up the fallout. This is a relatively shallow change. Deeper changes are possible, for example (1) changing various other functions to accept a vector rather than a pointer, or (2) changing ada_lookup_symbol_list to return the vector and omitting the length entirely. Tested by the buildbot, but I'll wait for Joel to test these as well. gdb/ChangeLog 2018-06-04 Tom Tromey <tom@tromey.com> * ada-lang.h (ada_lookup_symbol_list): Update. * ada-lang.c (resolve_subexp): Update. (symbols_are_identical_enums): Change type of syms. Remove nsyms parameter. (remove_extra_symbols, remove_irrelevant_renamings): Likewise. (ada_lookup_symbol_list_worker, ada_lookup_symbol_list): Change results parameter to std::vector. (ada_iterate_over_symbols, ada_lookup_symbol, get_var_value): Update. * ada-exp.y (block_lookup): Update. (select_possible_type_sym): Change type of syms. Remove nsyms parameter. (write_var_or_type, write_name_assoc): Update.
2018-06-04(windows) GDB/MI crash when using "-list-thread-groups --available"Joel Brobecker4-0/+64
On Windows, using the "-list-thread-groups --available" GDB/MI command before an inferior is being debugged: % gdb -q -i=mi =thread-group-added,id="i1" =cmd-param-changed,param="auto-load safe-path",value="/" (gdb) -list-thread-groups --available Segmentation fault Ooops! The SEGV happens because the -list-thread-groups --available command triggers a windows_nat_target::xfer_partial call for a TARGET_OBJECT_OSDATA object. Until a program is being debugged, the target_ops layer that gets the call is the Windows "native" layer. Except for a couple of specific objects (TARGET_OBJECT_MEMORY and TARGET_OBJECT_LIBRARIES), this layer's xfer_partial method delegates the xfer of other objects to the target beneath: default: return beneath->xfer_partial (object, annex, readbuf, writebuf, offset, len, xfered_len); Unfortunately, there is no "beneath layer" in this case, so beneath is NULL and dereferencing it leads to the SEGV. This patch fixes the issue by checking beneath before trying to delegate the request. gdb/ChangeLog: * windows-nat.c (windows_nat_target::xfer_partial): Return TARGET_XFER_E_IO if we need to delegate to the target beneath but BENEATH is NULL. gdb/testsuite/ChangeLog: * gdb.mi/list-thread-groups-no-inferior.exp: New testcase.
2018-06-04xtensa: use property tables for correct disassemblyMax Filippov6-27/+231
xtensa disassembler does not use information from the .xt.prop sections to switch between code/data disassembly in text sections. This may result in incorrect disassembly when data is interpreted as code and disassembler loses synchronization with instruction stream. Use .xt.prop section information to correctly interpret code and data and synchronize with instruction stream. 2018-06-04 Max Filippov <jcmvbkbc@gmail.com> bfd/ * elf32-xtensa.c (xtensa_read_table_entries): Make global. (compute_fill_extra_space): Drop declaration. Rename function to xtensa_compute_fill_extra_space. (compute_ebb_actions, remove_dead_literal): Update references to compute_fill_extra_space. include/ * elf/xtensa.h (xtensa_read_table_entries) (xtensa_compute_fill_extra_space): New declarations. opcodes/ * xtensa-dis.c (bfd.h, elf/xtensa.h): New includes. (dis_private): Add new fields for property section tracking. (xtensa_coalesce_insn_tables, xtensa_find_table_entry) (xtensa_instruction_fits): New functions. (fetch_data): Bump minimal fetch size to 4. (print_insn_xtensa): Make struct dis_private static. Load and prepare property table on section change. Don't disassemble literals. Don't disassemble instructions that cross property table boundaries.
2018-06-04xtensa: add separate property sections optionMax Filippov4-11/+98
It is currently not possible to correctly match .xt.prop information for sections with identical VMA. Allow creation of separate property sections in the BFD. Add assembler option --separate-prop-tables to allow creation of separate property sections. 2018-06-04 Volodymyr Arbatov <arbatov@cadence.com> bfd/ * elf32-xtensa.c (elf32xtensa_separate_props): New global variable. (xtensa_add_names): New function. (xtensa_property_section_name): Add new parameter separate_sections, use it to choose property section name. (xtensa_get_separate_property_section): New function. (xtensa_get_property_section): Invoke xtensa_get_separate_property_section to get individual property section if it exists, common property section otherwise. (xtensa_make_property_section): Pass elf32xtensa_separate_props to xtensa_property_section_name. gas/ * config/tc-xtensa.c (elf32xtensa_separate_props): New declaration. (option_separate_props, option_no_separate_props): New enumeration constants. (md_longopts): Add separate-prop-tables option. (md_parse_option): Add cases for option_separate_props and option_no_separate_props. (md_show_usage): Add help for [no-]separate-prop-tables options.
2018-06-04Use DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION to silence GCC 8.1H.J. Lu11-3/+77
GCC 8.1 warns about destination size with -Wstringop-truncation: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85643 Use DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION to silence it. bfd/ PR binutils/23146 * bfd-in.h: Include "diagnostics.h". * bfd-in2.h: Regenerated. * elf32-arm.c (elf32_arm_nabi_write_core_note): Use DIAGNOSTIC_PUSH, DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION and DIAGNOSTIC_POP to silence GCC 8.1 warnings with -Wstringop-truncation. * elf32-ppc.c (ppc_elf_write_core_note): Likewse. * elf32-s390.c (elf_s390_write_core_note): Likewse. * elf64-ppc.c (ppc64_elf_write_core_note): Likewse. * elf64-s390.c (elf_s390_write_core_note): Likewse. * elfxx-aarch64.c (_bfd_aarch64_elf_write_core_note): Likewse. include/ * diagnostics.h (DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION): Always define for GCC.
2018-06-04Use ELF_SECTION_IN_SEGMENT to map segmentsAlan Hayward2-5/+6
The macro ELF_SECTION_IN_SEGMENT should be used when calculating if a section maps to a segment. gdb/ * elfread.c (elf_symfile_segments): Use ELF_SECTION_IN_SEGMENT.
2018-06-04Add configure.nat as a dependency of config.statusSimon Marchi2-1/+6
After pulling Alan's change that added aarch64-sve-linux-ptrace.o to configure.nat, I got an undefined reference to aarch64_sve_get_vq when doing a "make clean && make". It turns out that re-running configure (./config.status --recheck) was needed to re-generate the Makefile with aarch64-sve-linux-ptrace.o included in the object list. Putting configure.nat in the dependencies of config.status would make sure that when we modify configure.nat, the configure script is re-ran. I think it also makes sense because configure.tgt and configure.host are also there. gdb/ChangeLog: * Makefile.in (config.status): Add configure.nat as a dependency.
2018-06-04Add client_state struct.Stan Cox9-374/+451
Collect per client specific global data items into struct client_state, which is similar in purpose to remote.c::remote_state. gdbserver/ChangeLog * server.h (struct client_state): New. * server.c (cont_thread, general_thread, multi_process) (report_fork_events, report_vfork_events, report_exec_events) (report_thread_events, swbreak_feature, hwbreak_feature) (vCont_supported, disable_randomization, pass_signals) (program_signals, program_signals_p, last_status, last_ptid, own_buf): Moved to client_state. * remote-utils.c (remote_debug, noack_mode) (transport_is_reliable): Moved to client_state. * tracepoint.c (current_traceframe): Moved to client_state. Update all callers. * server.c, remote-utils.c, tracepoint.c, fork-child.c, linux-low.c, remote-utils.h, target.c: Use client_state.
2018-06-04Add DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATIONH.J. Lu2-7/+35
Add DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION for GCC 8.1 to silence -Wstringop-truncation warning: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85643 * diagnostics.h (DIAGNOSTIC_STRINGIFY_1): New. (DIAGNOSTIC_STRINGIFY): Likewise. (DIAGNOSTIC_IGNORE): Replace STRINGIFY with DIAGNOSTIC_STRINGIFY. (DIAGNOSTIC_IGNORE_SELF_MOVE): Define empty if not defined. (DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER): Likewise. (DIAGNOSTIC_IGNORE_UNUSED_FUNCTION): Likewise. (DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES): Likewise. (DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION): New.
2018-06-04Change functions in cp-name-parser.y into methodsTom Tromey2-253/+284
Pedro pointed out in an earlier patch that it would be possible to make some helper functions in cp-name-parser.y into methods on cpname_state, cleaning up the code a bit. This patch implements this idea. Doing this required moving the %union earlier in the .y file, so the patch is somewhat bigger than you might expect. Tested by building with both bison and byacc, and then running the gdb.cp tests. gdb/ChangeLog 2018-06-04 Tom Tromey <tom@tromey.com> * cp-name-parser.y (cpname_state): Add method declarations. (HANDLE_QUAL): Update. (cpname_state::d_grab, cpname_state::fill_comp) (cpname_state::make_operator, cpname_state::make_dtor) (cpname_state::make_builtin_type, cpname_state::make_name) (cpname_state::d_qualify, cpname_state::d_int_type) (cpname_state::d_unary, cpname_state::d_binary): Now methods. (%union): Move earlier.
2018-06-04Add aarch64 pseudo help functionsAlan Hayward2-119/+60
Reduce code copy/paste by adding two helper functions for aarch64_pseudo_read_value and aarch64_pseudo_write Does not change any functionality. gdb/ * aarch64-tdep.c (aarch64_pseudo_read_value_1): New helper func. (aarch64_pseudo_write_1): Likewise. (aarch64_pseudo_read_value): Use helper. (aarch64_pseudo_write): Likewise.
2018-06-04Fix macOS null pointer dereferencePedro Alves2-3/+6
<https://sourceware.org/bugzilla/show_bug.cgi?id=22960#c4> reports that macOS gdb crashes with a null pointer dereference in push_target(struct target_ops *). This commit fixes that. The problem is that commit f6ac5f3d63e0 ("Convert struct target_ops to C++") left the darwin_ops global uninitialized. We don't need that global anymore, we can use the (new) get_native_target function instead for the same effect. gdb/ChangeLog: 2018-06-04 Pedro Alves <palves@redhat.com> * darwin-nat.c (darwin_ops): Delete. (darwin_attach_pid): Use get_native_target.
2018-06-04Use uint64_t for aarch64 tdep VQAlan Hayward3-3/+9
2018-06-04Enable SVE for GDBAlan Hayward4-24/+80
Enable SVE support for GDB by reading the VQ when creating a target description. Also ensurse that SVE is taken into account when creating the tdep structure, and store the current VQ value directly in tdep. gdb/ * aarch64-linux-nat.c (aarch64_linux_read_description): Support SVE. * aarch64-tdep.c (aarch64_get_tdesc_vq): New function. (aarch64_gdbarch_init): Check for SVE. * aarch64-tdep.h (gdbarch_tdep::has_sve): New function.
2018-06-04Use uint64_t for SVE VQAlan Hayward8-8/+18
Previously VQ was of type long. Using uint64_t ensures it always matches the same type as the VG register. Note that in the Linux kernel, VQ is 16bits. We cast it up to 64bits immediately after reading to ensure we always use the same type throughout the code. gdb/ * aarch64-tdep.c (aarch64_read_description): Use uint64_t for VQ. * aarch64-tdep.h (aarch64_read_description): Likewise. * arch/aarch64.c (aarch64_create_target_description): Likewise. * arch/aarch64.h (aarch64_create_target_description): Likewise. * features/aarch64-sve.c (create_feature_aarch64_sve): Likewise. * nat/aarch64-sve-linux-ptrace.c(aarch64_sve_get_vq): Likewise. * nat/aarch64-sve-linux-ptrace.h (aarch64_sve_get_vq): Likewise.
2018-06-04Automatic date update in version.inGDB Administrator1-1/+1
2018-06-03RISC-V: Handle out-of-range calls to undefined weak.Jim Wilson9-1/+120
bfd/ PR ld/23244 * elfnn-riscv.c (riscv_elf_relocate_section) <R_RISCV_CALL>: Check for and handle an undefined weak with no PLT. ld/ * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Run new weak ref tests. * testsuite/ld-riscv-elf/weakref.ld: New. * testsuite/ld-riscv-elf/weakref32.d: New. * testsuite/ld-riscv-elf/weakref32.s: New. * testsuite/ld-riscv-elf/weakref64.d: New. * testsuite/ld-riscv-elf/weakref64.s: New.
2018-06-03RISC-V: Fix symbol address problem with versioned symbols.Jim Wilson2-3/+12
bfd/ PR ld/22756 * elfnn-riscv.c (riscv_relax_delete_bytes): Add versioned_hidden check to code that ignores duplicate symbols.
2018-06-03Automatic date update in version.inGDB Administrator1-1/+1
2018-06-02Split value_fetch_lazySimon Marchi2-141/+169
While reading value_fetch_lazy, I thought it would be good to split it in small functions (especially the part that handles lval_register). gdb/ChangeLog: * value.c (value_fetch_lazy_bitfield): New. (value_fetch_lazy_memory): New. (value_fetch_lazy_register): New. (value_fetch_lazy): Factor out to smaller functions.
2018-06-02Automatic date update in version.inGDB Administrator1-1/+1
2018-06-01Make two cp-name-parser.y constants "const"Tom Tromey2-2/+6
This changes "backslashable" and "represented" in cp-name-parser.y to be const. This lets the compiler make them read-only (though in my build it seems that GCC inlines them, which seems even better). gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * cp-name-parser.y (backslashable, represented): Now const.
2018-06-01Include parser-defs.h in cp-name-parser.yTom Tromey2-5/+6
This changes cp-name-parser.y to include parser-defs.h, removing the copy-pasted declaration of parser_fprintf. This can be done now that cp-name-parser.y does not define any global variables. gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * cp-name-parser.y: Include parser-defs.h. (parser_fprintf): Remove declaration.
2018-06-01Make cp-name-parser.y a pure parserTom Tromey2-284/+324
This changes cp-name-parser.y to be a pure parser. Originally I had thought that doing this would mean that gdb would always require Bison. However, I've learned that Byacc supports some of the Bison extensions in this area. So, the new code ought to work reasonably well with both. Note that the Byacc documentations says: %pure-parser Most variables (other than yydebug and yynerrs) are allocated on the stack within yyparse, making the parser reasonably reentrant. In our case this is ok, first because gdb does not yet actualy require reentrancy, and second because gdb does not use yynerrs. gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * cp-name-parser.y: Use %pure-parser, %lex-param, and %parse-param. (lexptr, prev_lexptr, error_lexptr, global_errmsg, demangle_info) (global_result): Remove globals. (struct cpname_state): New. (yyparse): Don't declare. (yylex, yyerror): Move declarations after %union. (d_grab, fill_comp, make_operator, make_dtor, make_builtin_type) (make_name): Add state parameter. Update all callers. (d_qualify, d_int_type, d_unary, d_binary, parse_number) Add state parameter. (HANDLE_QUAL, HANDLE_SPECIAL, HANDLE_TOKEN2, HANDLE_TOKEN3): Update. (yylex): Add lvalp, state parameters. (yyerror): Add state parameter. (cp_demangled_name_to_comp): Update.
2018-06-01Use yy-remap.h in cp-name-parser.yTom Tromey2-54/+14
This changes cp-name-parser.y to use yy-remap.h, rather than its old manual approach. This required declaring parser_fprintf in cp-name-parser.y. parser-defs.h can't be included here because parser-defs.h declares a global "lexptr", which conflicts with the local one in cp-name-parser.y. This is only temporary, and will be cleaned up later in the series. gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * cp-name-parser.y (parser_fprintf): Declare. (GDB_YY_REMAP_PREFIX): Define. Include yy-remap.h. Don't redefine yy* identifiers.
2018-06-01Remove a static buffer from cp-name-parser.yTom Tromey4-16/+20
This removes a static buffer from cp-name-parser.y by replacing the fixed-sized buffer with a std::string out parameter. gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * python/py-type.c (typy_legacy_template_argument): Update. * cp-support.h (cp_demangled_name_to_comp): Update. * cp-name-parser.y (cp_demangled_name_to_comp): Change errmsg parameter to be a "std::string *". (main): Update.
2018-06-01Move gdb/common/diagnostics.h to include/diagnostics.hH.J. Lu5-9/+16
Move gdb/common/diagnostics.h to include/diagnostics.h so that it can be used in binutils. gdb/ * ada-lex.l: Include "diagnostics.h" instead of "common/diagnostics.h". * unittests/environ-selftests.c: Likewise. * common/diagnostics.h: Moved to ../include. include/ * diagnostics.h: Moved from ../gdb/common/diagnostics.h.
2018-06-01inadvertent language switch during breakpoint_re_set_oneJoel Brobecker5-0/+76
Trying to insert a breakpoint using *FUNC'address with an Ada program and then running the program until reaching that breakpoint currently yields the following behavior: (gdb) break *a'address Breakpoint 1 at 0x40240c: file a.adb, line 1. (gdb) run [1] + 27222 suspended (tty output) /[...]/gdb -q simple_main Unsuspending GDB then shows it was suspended trying to report the following error: Starting program: /home/takamaka.a/brobecke/ex/simple/a Error in re-setting breakpoint 1: Unmatched single quote. Error in re-setting breakpoint 1: Unmatched single quote. Error in re-setting breakpoint 1: Unmatched single quote. [Inferior 1 (process 32470) exited normally] The "a'address" is Ada speak for function A's address ("A" by itself means the result of calling A with no arguments). The transcript above shows that we're having problems trying to parse the breakpoint location while re-setting it. As a result, we also fail to stop at the breakpoint. Normally, breakpoint locations are evaluated with the current_language being set to the language of the breakpoint. But, unfortunately for us, what happened in this case is that parse_exp_in_context_1 calls get_selected_block which eventually leads to a call to select_frame because the current_frame hadn't been set yet. select_frame then finds that our language_mode is auto, and therefore changes the current_language to match the language of the frame we just selected. In our case, the language chosen was 'c', which of course is not able to parse an Ada expression, hence the error. This patch prevents this by forcing the language_mode to manual before we call breakpoint_re_set_one. gdb/ChangeLog: * breakpoint.c (breakpoint_re_set): Temporarily force language_mode to language_mode_manual while calling breakpoint_re_set_one. gdb/testsuite/ChangeLog: * gdb.ada/bp_fun_addr: New testcase. Tested on x86_64-linux.
2018-06-01Bump version number to 2.30.52H.J. Lu13-61/+86
Bump version number to 2.30.52 since _bfd_link_hide_symbol has been added to bfd_target. bfd/ * version.m4: Bump version to 2.30.52 * configure: Regenerated. binutils/ * configure: Regenerated. gas/ * configure: Regenerated. gprof/ * configure: Regenerated. ld/ * configure: Regenerated. opcodes/ * configure: Regenerated.
2018-06-01Remove type_name_no_tag and rename type_name_no_tag_or_errorTom Tromey17-56/+73
type_name_no_tag is just a plain wrapper for TYPE_NAME now, so this patch removes it. And, because tag names no longer exist, this renames type_name_no_tag_or_error to type_name_or_error. gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * valops.c (value_cast_structs, destructor_name_p): Update. * symtab.c (gdb_mangle_name): Update. * stabsread.c (define_symbol, read_cpp_abbrev, read_baseclasses): Update. * p-valprint.c (pascal_object_is_vtbl_ptr_type) (pascal_object_print_value_fields, pascal_object_print_value): Update. * p-typeprint.c (pascal_type_print_derivation_info): Update. * linespec.c (find_methods): Update. * gdbtypes.h (type_name_no_tag): Remove. (type_name_or_error): Rename from type_name_no_tag_or_error. * gdbtypes.c (type_name_no_tag): Remove. (type_name_or_error): Rename from type_name_no_tag_or_error. (lookup_struct_elt_type, check_typedef): Update. * expprint.c (print_subexp_standard): Update. * dwarf2read.c (dwarf2_add_field, load_partial_dies): Update. * d-namespace.c (d_lookup_nested_symbol): Update. * cp-valprint.c (cp_is_vtbl_ptr_type, cp_print_value_fields) (cp_print_class_member): Update. * cp-namespace.c (cp_lookup_nested_symbol): Update. * completer.c (add_struct_fields): Update. * c-typeprint.c (cp_type_print_derivation_info) (c_type_print_varspec_prefix, c_type_print_base_struct_union): Update. * ada-lang.c (parse_old_style_renaming, xget_renaming_scope) (ada_prefer_type, ada_is_exception_sym): Update.
2018-06-01Remove TYPE_TAG_NAMETom Tromey31-209/+221
TYPE_TAG_NAME has been an occasional source of confusion and bugs. It seems to me that it is only useful for C and C++ -- but even there, not so much, because at least with DWARF there doesn't seem to be any way to wind up with a type where the name and the tag name are both non-NULL and different. So, this patch removes TYPE_TAG_NAME entirely. This should save a little memory, but more importantly, it simplifies this part of gdb. A few minor test suite adjustments were needed. In some situations the new code does not yield identical output to the old code. gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * valops.c (enum_constant_from_type, value_namespace_elt) (value_maybe_namespace_elt): Update. * valarith.c (find_size_for_pointer_math): Update. * target-descriptions.c (make_gdb_type): Update. * symmisc.c (print_symbol): Update. * stabsread.c (define_symbol, read_type) (complain_about_struct_wipeout, add_undefined_type) (cleanup_undefined_types_1): Update. * rust-lang.c (rust_tuple_type_p, rust_slice_type_p) (rust_range_type_p, val_print_struct, rust_print_struct_def) (rust_internal_print_type, rust_composite_type) (rust_evaluate_funcall, rust_evaluate_subexp) (rust_inclusive_range_type_p): Update. * python/py-type.c (typy_get_tag): Update. * p-typeprint.c (pascal_type_print_base): Update. * mdebugread.c (parse_symbol, parse_type): Update. * m2-typeprint.c (m2_long_set, m2_record_fields, m2_enum): Update. * guile/scm-type.c (gdbscm_type_tag): Update. * go-lang.c (sixg_string_p): Update. * gnu-v3-abi.c (build_gdb_vtable_type, build_std_type_info_type): Update. * gdbtypes.h (struct main_type) <tag_name>: Remove. (TYPE_TAG_NAME): Remove. * gdbtypes.c (type_name_no_tag): Simplify. (check_typedef, check_types_equal, recursive_dump_type) (copy_type_recursive, arch_composite_type): Update. * f-typeprint.c (f_type_print_base): Update. Print "Type" prefix in summary mode when needed. * eval.c (evaluate_funcall): Update. * dwarf2read.c (fixup_go_packaging, read_structure_type) (process_structure_scope, read_enumeration_type) (read_namespace_type, read_module_type, determine_prefix): Update. * cp-support.c (inspect_type): Update. * coffread.c (process_coff_symbol, decode_base_type): Update. * c-varobj.c (c_is_path_expr_parent): Update. * c-typeprint.c (c_type_print_base_struct_union): Update. (c_type_print_base_1): Update. Print struct/class/union/enum in summary when using C language. * ax-gdb.c (gen_struct_ref, gen_namespace_elt) (gen_maybe_namespace_elt): Update. * ada-lang.c (ada_type_name): Simplify. (empty_record, ada_template_to_fixed_record_type_1) (template_to_static_fixed_type) (to_record_with_fixed_variant_part, ada_check_typedef): Update. gdb/testsuite/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * gdb.xml/tdesc-regs.exp (load_description): Update expected results. * gdb.dwarf2/method-ptr.exp: Set language to C++. * gdb.dwarf2/member-ptr-forwardref.exp: Set language to C++. * gdb.cp/typeid.exp (do_typeid_tests): Update type_re. * gdb.base/maint.exp (maint_pass_if): Update.