aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-11-15Import the time_r gnulib moduleChristian Biesinger14-6/+277
This allows GDB to use localtime_r unconditionally. See https://lists.gnu.org/archive/html/bug-gnulib/2019-11/msg00022.html for details on the compile error mentioned below. gdb/ChangeLog: 2019-11-15 Christian Biesinger <cbiesinger@google.com> * gdbsupport/common-defs.h: Include time.h before pathmax.h to avoid compile errors. gnulib/ChangeLog: 2019-11-15 Christian Biesinger <cbiesinger@google.com> * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate. * import/Makefile.am: Update. * import/Makefile.in: Regenerate. * import/m4/gnulib-cache.m4: Update. * import/m4/gnulib-comp.m4: Update. * import/m4/time_r.m4: New file. * import/time_r.c: New file. * update-gnulib.sh: Import time_r. Change-Id: I53fc861b192940d613ca97f2910b4533c730f667
2019-11-15Import the strerror_r-posix module and use it in GDB.Christian Biesinger29-163/+6663
Makes sure to assign the return value of strerror_r to an int, so that we get a compile error if we accidentally get the wrong version. gdb/ChangeLog: 2019-11-15 Christian Biesinger <cbiesinger@google.com> * config.in: Regenerate. * configure: Regenerate. * gdbsupport/common.m4: No longer check for strerror_r. * gdbsupport/posix-strerror.c (safe_strerror): Always call the POSIX version of strerror_r, now that gnulib provides it if necessary. gdb/gdbserver/ChangeLog: 2019-11-15 Christian Biesinger <cbiesinger@google.com> * config.in: Regenerate. * configure: Regenerate. gnulib/ChangeLog: 2019-11-15 Christian Biesinger <cbiesinger@google.com> * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate. * import/Makefile.am: Update. * import/Makefile.in: Regenerate. * import/extra/config.rpath: New file. * import/glthread/lock.c: New file. * import/glthread/lock.h: New file. * import/glthread/threadlib.c: New file. * import/m4/gnulib-cache.m4: Update. * import/m4/gnulib-comp.m4: Update. * import/m4/lib-ld.m4: New file. * import/m4/lib-link.m4: New file. * import/m4/lib-prefix.m4: New file. * import/m4/lock.m4: New file. * import/m4/strerror_r.m4: New file. * import/m4/threadlib.m4: New file. * import/strerror_r.c: New file. * update-gnulib.sh: Import strerror_r-posix. Change-Id: I5cfeb12a5203a4cd94a78581541e6085a68685c3
2019-11-15Generate gnulib's toplevel Makefile.in using automakeChristian Biesinger6-356/+1952
This is a lot simpler and as a side-effect this will correctly regenerate import/Makefile and config.h during rebuilds if necessary. gnulib/ChangeLog: 2019-11-15 Christian Biesinger <cbiesinger@google.com> * Makefile.am: New file. * Makefile.in: Replace with generated file. * aclocal-m4-deps.mk: Remove. * configure.ac: Use the foreign option for automake and specify the aclocal search path here. * update-gnulib.sh: Don't generate aclocal-m4-deps.mk anymore. Also don't specify the aclocal include path here, now that it is in configure.ac. Change-Id: I6a2c4d41cf4f0e21d5c813197bad63ed5c08e408
2019-11-15Revert previous delta.Nick Clifton3-2/+8
PR 2587 * Makefile.am: Revert change from 2019-11-13. * Makefile.in: Regenerate.
2019-11-14Update READMEChristian Biesinger2-1/+24
Adds descriptions for some recent-ish configure options to README. Also updates the minimum Python version per commit 6c28e44a359e9f6cf455ddff0009ca99406f7224. 2019-11-14 Christian Biesinger <cbiesinger@google.com> * README (`configure' options): Update. Change-Id: I8ce8ca6935afbd130295e143802c585cf1e735f9
2019-11-15Automatic date update in version.inGDB Administrator1-1/+1
2019-11-14Allow re-assigning to convenience variablesTom Tromey4-1/+33
A customer reported somewhat odd gdb behavior, where re-assigning an array or string to a convenience variable would yield "Too many array elements". A test case is: (gdb) p $x = "x" (gdb) p $x = "xyz" This patch fixes the problem by making a special case in the evaluator for assignment to convenience variables, which seems like the correct behavior. Note that a previous patch implemented this for Ada, see commit f411722cb ("Allow re-assigning to convenience variables"). gdb/ChangeLog 2019-11-14 Tom Tromey <tromey@adacore.com> * eval.c (evaluate_subexp_standard) <BINOP_ASSIGN>: Do not pass an expected type for the RHS if the LHS is a convenience variable. gdb/testsuite/ChangeLog 2019-11-14 Tom Tromey <tromey@adacore.com> * gdb.base/gdbvars.exp (test_convenience_variables): Add regression tests. Change-Id: I5e66a2d243931a5c43c7af4bc9f6717464c2477e
2019-11-14[gdb/doc] Fix typosTom de Vries4-31/+37
Fix typos in gdb docs. gdb/doc/ChangeLog: 2019-11-14 Tom de Vries <tdevries@suse.de> * gdb.texinfo: Fix typos. * python.texi: Same. * stabs.texinfo: Same. Change-Id: I044d6788eeea48e4a9b73ee752e5aaf333e56a46
2019-11-14Another attempt at fixing building gprof with gmake.Nick Clifton3-4/+10
PR 2587 * Makefile.am (SUFFIXES): Add .c. * Makefile.in: Regenerate.
2019-11-14gdb: fix build error in unittests/vec-utils-selftests.cSimon Marchi2-0/+14
When building with gcc 9.2.0, I get the following build error: In file included from /home/simark/src/binutils-gdb/gdb/unittests/vec-utils-selftests.c:23: /home/simark/src/binutils-gdb/gdb/gdbsupport/gdb_vecs.h: In instantiation of ‘T unordered_remove(std::__debug::vector<T>&, typename std::__debug::vector<T>::iterator) [with T = selftests::vector_utils_tests::unordered_remove_tests()::obj; typename std::__debug::vector<T>::iterator = __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<selftests::vector_utils_tests::unordered_remove_tests()::obj*, std::__cxx1998::vector<selftests::vector_utils_tests::unordered_remove_tests()::obj, std::allocator<selftests::vector_utils_tests::unordered_remove_tests()::obj> > >, std::__debug::vector<selftests::vector_utils_tests::unordered_remove_tests()::obj>, std::random_access_iterator_tag>]’: /home/simark/src/binutils-gdb/gdb/unittests/vec-utils-selftests.c:53:26: required from here /home/simark/src/binutils-gdb/gdb/gdbsupport/gdb_vecs.h:53:5: error: implicitly-declared ‘selftests::vector_utils_tests::unordered_remove_tests()::obj::obj(const selftests::vector_utils_tests::unordered_remove_tests()::obj&)’ is deprecated [-Werror=deprecated-copy] 53 | T removed = std::move (*it); | ^~~~~~~ /home/simark/src/binutils-gdb/gdb/unittests/vec-utils-selftests.c:41:10: note: because ‘selftests::vector_utils_tests::unordered_remove_tests()::obj’ has user-provided ‘selftests::vector_utils_tests::unordered_remove_tests()::obj& selftests::vector_utils_tests::unordered_remove_tests()::obj::operator=(const selftests::vector_utils_tests::unordered_remove_tests()::obj&)’ 41 | obj &operator= (const obj &other) | ^~~~~~~~ In file included from /home/simark/src/binutils-gdb/gdb/unittests/vec-utils-selftests.c:23: /home/simark/src/binutils-gdb/gdb/gdbsupport/gdb_vecs.h:58:10: error: implicitly-declared ‘selftests::vector_utils_tests::unordered_remove_tests()::obj::obj(const selftests::vector_utils_tests::unordered_remove_tests()::obj&)’ is deprecated [-Werror=deprecated-copy] 58 | return removed; | ^~~~~~~ /home/simark/src/binutils-gdb/gdb/unittests/vec-utils-selftests.c:41:10: note: because ‘selftests::vector_utils_tests::unordered_remove_tests()::obj’ has user-provided ‘selftests::vector_utils_tests::unordered_remove_tests()::obj& selftests::vector_utils_tests::unordered_remove_tests()::obj::operator=(const selftests::vector_utils_tests::unordered_remove_tests()::obj&)’ 41 | obj &operator= (const obj &other) | ^~~~~~~~ I think gcc is just trying to be nice and recommends the good practice of providing a copy constructor if an assignment operator is provided. Silence the warning by providing that copy constructor. gdb/ChangeLog: * unittests/vec-utils-selftests.c (unordered_remove_tests::obj): Provide explicit default and copy constructor. Change-Id: I323361b1c120bf8525613b74e7e5983910e002df
2019-11-14x86: drop redundant SYSCALL/SYSRET templatesJan Beulich3-26/+5
The Cpu64 forms are no different in their attributes except for the CPU flags; there's no need to key these off of anything other than CpuSYSCALL even for the 64-bit forms. Dropping these improves the diagnostic on SYSRETQ used in 32-bit code from "unsupported instruction `sysret'" to "invalid instruction suffix for `sysret'".
2019-11-14x86: fold individual Jump* attributes into a single Jump oneJan Beulich8-14892/+10989
..., taking just 3 bits instead of 5. No two of them are used together.
2019-11-14x86: make JumpAbsolute an insn attributeJan Beulich9-26501/+26531
... instead of an operand one: There's only ever one operand here anyway.
2019-11-14x86: make AnySize an insn attributeJan Beulich7-14487/+14504
... instead of an operand one. Which operand it applies to can be determined from other operand properties, but as it turns out the only place it is actually used at doesn't even need further qualification.
2019-11-14x86/Intel: correct CMPSD test cases' regexp closing paren placementJan Beulich3-39/+45
The CMPS test case derivation from their MOVS counterparts I did in d241b91073 ("x86/Intel: correct MOVSD and CMPSD handling") ended up with misplaced closing parentheses in som regexps. Correct this.
2019-11-14x86/Intel: extend MOVSD/CMPSD testsuite coverageJan Beulich10-0/+386
This is still in the context of PR/gas 25167.
2019-11-14Fix python gdbpy_breakpoint_object leak.Philippe Waroquiers2-1/+6
valgrind reports a leak when a breakpoint is created then deleted: ==1313== 40 bytes in 1 blocks are definitely lost in loss record 1,115 of 8,596 ==1313== at 0x4835753: malloc (vg_replace_malloc.c:307) ==1313== by 0x6E05BC: _PyObject_New (object.c:255) ==1313== by 0x470E4B: gdbpy_breakpoint_created(breakpoint*) (py-breakpoint.c:1023) ==1313== by 0x2946D9: operator() (std_function.h:687) ==1313== by 0x2946D9: notify (observable.h:106) ==1313== by 0x2946D9: install_breakpoint(int, std::unique_ptr<breakpoint, std::default_delete<breakpoint> >&&, int) (breakpoint.c:8136) ==1313== by 0x295BCA: create_breakpoint_sal (breakpoint.c:8878) ==1313== by 0x295BCA: create_breakpoints_sal (breakpoint.c:8919) ==1313== by 0x295BCA: create_breakpoints_sal_default (breakpoint.c:13671) ... The leak is due to a superfluous Py_INCREF when the python object is allocated inside gdbpy_breakpoint_created, when the python object is allocated locally: this object has already a refcount of 1, and the only reference is the reference from the C breakpoint object. The Py_INCREF is however needed when the python object was created from python: the python object was stored in bppy_pending_object, and gdbpy_breakpoint_created creates a new reference to this object. Solve the leak by calling 'Py_INCREF (newbp);' only in the bppy_pending_object case. Regression tested on debian/amd64 natively and under valgrind on centos/amd64. Before the patch, 795 tests have a definite leak. After the patch, 197 have a definite leak. Thanks to Tom, that helped on irc with the python refcount logic. gdb/ChangeLog 2019-11-14 Philippe Waroquiers <philippe.waroquiers@skynet.be> * python/py-finishbreakpoint.c (gdbpy_breakpoint_created): only call Py_INCREF (newbp) in the bppy_pending_object case.
2019-11-14Automatic date update in version.inGDB Administrator1-1/+1
2019-11-13Remove symbol-related static assertsTom Tromey3-19/+6
commit 3573abe1d added static asserts to ensure that symbol sizes don't vary. However, this failed to build on Windows, on at least one ARM platform (see PR build/25182) and internally at AdaCore for PPC. So, I think it is probably best to just remove these assertions, effectively reverting 3573abe1d. gdb/ChangeLog 2019-11-13 Tom Tromey <tromey@adacore.com> PR build/25182: * psympriv.h (partial_symbol): Remove static assert. * symtab.h (general_symbol_info, symbol): Remove static assert. Change-Id: I51940fb2240c474838b48494b5072081701789bb
2019-11-13Fix the rule for building C files in the gprof makefile.Nick Clifton2-1/+6
PR 2587 * Makefile.am: Fix rule to build .c files from .m files.
2019-11-12gnulib: Fix path to import/Makefile{,.in}Christian Biesinger2-2/+6
I don't know why this path is what it is but it is clearly wrong. gnulib/ChangeLog: 2019-11-12 Christian Biesinger <cbiesinger@google.com> * Makefile.in: Fix path to say import/ instead of gnulib/. Change-Id: Ib7f6a319ee764d20072e38911766ca7032d6ca8e
2019-11-12RISC-V: Support the INSN_CLASS.*F.* classes for .insn directive.Jim Wilson4-61/+71
We have to enable the f extension through -march or ELF attribute if we use the FPR in .insn directive. The behavior is same as the riscv_opcodes. 2019-11-12 Nelson Chu <nelson.chu@sifive.com> opcodes/ * riscv-opc.c (riscv_insn_types): Replace the INSN_CLASS_I with INSN_CLASS_F and the INSN_CLASS_C with INSN_CLASS_F_AND_C if we use the floating point register (FPR). gas/ * testsuite/gas/riscv/insn.d: Add the f extension to -march option. Change-Id: I4f59d04c82673ef84c56ecd2659ad8ce164dd626
2019-11-13Automatic date update in version.inGDB Administrator1-1/+1
2019-11-12RISC-V: Fix ld relax failure with calls and align directives.Jim Wilson9-3/+68
Make _bfd_riscv_relax_call handle section alignment padding same as the _bfd_riscv_relax_lui and _bfd_riscv_relax_pc functions already do. Use the max section alignment if section boundaries are crossed, otherwise the alignment of the containing section. bfd/ PR 25181 * elfnn-riscv.c (_bfd_riscv_relax_call): Always add max_alignment to foff. If sym_sec->output_section and sec->output_section are the same and not *ABS* then set max_alignment to that section's alignment. ld/ PR 25181 * testsuite/ld-riscv-elf/call-relax-0.s: New file. * testsuite/ld-riscv-elf/call-relax-1.s: New file. * testsuite/ld-riscv-elf/call-relax-2.s: New file. * testsuite/ld-riscv-elf/call-relax-3.s: New file. * testsuite/ld-riscv-elf/call-relax.d: New test. * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Run call-relax test. Change-Id: Iaf65cee52345abf1955f36e8e72c4f6cc0db8d9a
2019-11-12gdb: Support printf 'z' size modifierAndrew Burgess8-2/+106
The gdb format mechanism doesn't currently support the 'z' size modifier, there are a few places in GDB where this is used. Instead of removing these uses lets just add support to GDB for using 'z'. I found this issue when trying to use some of the debug output. Before this commit: (gdb) set debug dwarf-line 9 (gdb) file test Reading symbols from test... Unrecognized format specifier 'z' in printf (No debugging symbols found in test) (gdb) After this commit: (gdb) set debug dwarf-line 9 (gdb) file test Reading symbols from test... Adding dir 1: /usr/include Adding file 1: test.c Adding file 2: stdc-predef.h Processing actual line 3: file 1, address 0x4004a0, is_stmt 1, discrim 0 Processing actual line 4: file 1, address 0x4004a0, is_stmt 1, discrim 0 .... lots of debug output ... Processing actual line 10: file 1, address 0x4003b7, is_stmt 0, discrim 0 (gdb) I've added a self test to cover the integer format size modifiers, including the 'z' modifier. gdb/ChangeLog: * gdbsupport/format.c (format_pieces::format_pieces): Support printf 'z' size modifier. * gdbsupport/format.h (enum argclass): Add size_t_arg. * printcmd.c (ui_printf): Handle size_t_arg. * ui-out.c (ui_out::vmessage): Likewise. * unittests/format_pieces-selftests.c (test_format_int_sizes): New function. (run_tests): Call test_format_int_sizes. gdb/gdbserver/ChangeLog: * ax.c (ax_printf): Handle size_t_arg. Change-Id: Ib6c44d88aa5bce265d757e4c0698881803dd186f
2019-11-12Make struct symbol inherit from general_symbol_infoChristian Biesinger9-73/+109
Since this is now no longer a POD, also give it a constructor that initializes all fields. (I have considered overloading operator new to zero-initialize the memory instead; let me know if you prefer that) gdb/ChangeLog: 2019-11-12 Christian Biesinger <cbiesinger@google.com> * ada-exp.y (write_ambiguous_var): Update. * buildsym.c (add_symbol_to_list): Update. * dwarf2read.c (read_variable): Update. (new_symbol): Update. * jit.c (finalize_symtab): Update. * language.c (language_alloc_type_symbol): Update. * symtab.c (fixup_symbol_section): Update. (initialize_objfile_symbol_1): Move code to... (initialize_objfile_symbol): ...here. Remove now-unnecessary memset. (allocate_symbol): Update. (allocate_template_symbol): Update. (get_symbol_address): Update. * symtab.h (struct symbol): Inherit from general_symbol_info instead of having as a field, and add a constructor. (SYMBOL_VALUE): Update. (SYMBOL_VALUE_ADDRESS): Update. (SET_SYMBOL_VALUE_ADDRESS): Update. (SYMBOL_VALUE_BYTES): Update. (SYMBOL_VALUE_COMMON_BLOCK): Update. (SYMBOL_BLOCK_VALUE): Update. (SYMBOL_VALUE_CHAIN): Update. (SYMBOL_LANGUAGE): Update. (SYMBOL_SECTION): Update. (SYMBOL_OBJ_SECTION): Update. (SYMBOL_SET_LANGUAGE): Update. (SYMBOL_SET_LINKAGE_NAME): Update. (SYMBOL_SET_NAMES): Update. (SYMBOL_NATURAL_NAME): Update. (SYMBOL_LINKAGE_NAME): Update. (SYMBOL_DEMANGLED_NAME): Update. (SYMBOL_SEARCH_NAME): Update. (SYMBOL_MATCHES_SEARCH_NAME): Update. (struct symbol): Update. (struct template_symbol): Update. (struct rust_vtable_symbol): Update. * xcoffread.c (SYMBOL_DUP): Update. Change-Id: I05b1628455bcce3efaa101e65ef051708d17eb07
2019-11-12Consolidate setting of current_layoutTom Tromey2-4/+7
Currently several functions in tui-layout.c set current_layout after their work is done. This moves this assignment to show_layout, instead. gdb/ChangeLog 2019-11-12 Tom Tromey <tom@tromey.com> * tui/tui-layout.c (show_layout): Set current_layout. (show_source_disasm_command, show_data) (show_source_or_disasm_and_command): Don't set current_layout. Change-Id: Id8b23797d68e607f0fcd6d29b8801869d40d1869
2019-11-12Move _initialize_tui_layout to end of fileTom Tromey2-25/+30
This moves _initialize_tui_layout to the end of the file, conforming to the typical gdb style. gdb/ChangeLog 2019-11-12 Tom Tromey <tom@tromey.com> * tui/tui-layout.c (_initialize_tui_layout): Move to end. Change-Id: I667f741b44b2bc470878a36f093a96d89fa31893
2019-11-12Make TUI resizing tests more robustTom Tromey8-46/+174
As Sergio pointed out, the TUI resizing tests are flaky. Debugging this showed three main problems. 1. expect's "stty" command processes its arguments one-by-one. So, rather than requesting a single resize, it sends two separate resize requests (one for rows and one for columns). This means gdb sees two SIGWINCH signals and resizes the terminal twice. I consider this a bug in expect, but I couldn't readily see how to report a bug; and anyway the fix wouldn't propagate very quickly. This patch works around this problem by explicitly doing two separate resizes (so it will be robust if expect ever does change); and then by waiting for each resize to complete before continuing. 2. gdb uses curses to drive the console rendering. Currently the test suite looks for terminal text insertion sequences to decide when a command has completed. However, it turns out that, sometimes, curses can output things in non-obvious ways. I didn't debug into curses but I guess this can happen due to output optimizations. No matter the reason, sometimes the current approach of only tracking text insertions is not enough to detect that gdb has finished rendering. This patch fixes this problem by arranging to detect the termination output after any curses command, not just insertion. 3. Detecting when a resize has completed is tricky. In fact, I could not find a way to reliably do this. This patch fixes this problem by adding a special maint "tui-resize-message" setting to gdb. When this is enabled, gdb will print a message after each SIGWINCH has been fully processed. The test suite enables this mode and then waits for the message in order to know when control can be returned to the calling test. This patch also adds a timeout, to avoid the situation where the terminal code fails to notice a change for some reason. This lets the test at least try to continue. gdb/ChangeLog 2019-11-12 Tom Tromey <tom@tromey.com> * tui/tui-win.c (resize_message): New global. (show_tui_resize_message): New function. (tui_async_resize_screen): Print message if requested. (_initialize_tui_win): Add tui-resize-message setting. * NEWS: Add entry for new commands. gdb/doc/ChangeLog 2019-11-12 Tom Tromey <tom@tromey.com> * gdb.texinfo (Maintenance Commands): Document new command. gdb/testsuite/ChangeLog 2019-11-12 Tom Tromey <tom@tromey.com> * lib/tuiterm.exp (_accept): Add wait_for parameter. Check output after any command. Expect prompt after WAIT_FOR is seen. (enter_tui): Enable resize messages. (command): Expect command in output. (get_line): Avoid error when cursor appears to be off-screen. (dump_screen): Include screen size in title. (_do_resize): New proc, from "resize". (resize): Rewrite. Do resize in two steps. * gdb.tui/empty.exp (layouts): Fix entries. (check_boxes): Remove xfail. (check_text): Dump screen on failure. Change-Id: I420e0259cb99b21adcd28f671b99161eefa7a51d
2019-11-12[gas][arm] Enable VLDM, VSTM, VPUSH, VPOP for MVEMihail Ionescu4-44/+131
This patch enables a few instructions for Armv8.1-M MVE. Currently VLDM, VSTM, VSTR, VLDR, VPUSH and VPOP are enabled only when the Armv8-M Floating-point Extension is enabled. According to the ARMv8.1-M ARM, section A.1.4.2[1], they can be enabled by having "Armv8-M Floating-point Extension and/or Armv8.1-M MVE". [1]https://developer.arm.com/docs/ddi0553/bh/armv81-m-architecture-reference-manual 2019-11-12 Mihail Ionescu <mihail.ionescu@arm.com> * config/tc-arm.c (do_vfp_nsyn_push): Move in order to enable it for both fpu_vfp_ext_v1xd and mve_ext and add call to the aliased vstm instruction for mve_ext. (do_vfp_nsyn_pop): Move in order to enable it for both fpu_vfp_ext_v1xd and mve_ext and add call to the aliased vldm instruction for mve_ext. (do_neon_ldm_stm): Add fpu_vfp_ext_v1 and mve_ext checks. (insns): Enable vldm, vldmia, vldmdb, vstm, vstmia, vstmdb, vpop, vpush, and fldd, fstd, flds, fsts for arm_ext_v6t2 instead of fpu_vfp_ext_v1xd. * testsuite/gas/arm/v8_1m-mve.s: New. * testsuite/gas/arm/v8_1m-mve.d: New.
2019-11-12[binutils][arm] Update the decoding of MVE VMOV, VMVNMihail Ionescu6-8/+112
This patch updates the decoding of the VMOV and VMVN instructions which depend on cmode. Previously VMOV and VMVN with cmode 1101 were not allowed. The cmode changes also required updating of the MVE conflict checking. Now instructions with opcodes 0xef800d50 and 0xef800e70 correctly get decoded as VMOV and VMVN, respectively. 2019-11-12 Mihail Ionescu <mihail.ionescu@arm.com> * opcodes/arm-dis.c (mve_opcodes): Enable VMOV imm to vec with cmode 1101. (is_mve_encoding_conflict): Update cmode conflict checks for MVE_VMVN_IMM. 2019-11-12 Mihail Ionescu <mihail.ionescu@arm.com> * gas/config/tc-arm.c (do_neon_mvn): Allow mve_ext cmode=0xd. * testsuite/gas/arm/mve-vmov-vmvn-vorr-vbic.s: New test. * testsuite/gas/arm/mve-vmov-vmvn-vorr-vbic.d: Likewise.
2019-11-12[gas][arm] Make .fpu reset the FPU/Coprocessor feature bitsMihail Ionescu5-2/+32
This patch is fixes the '.fpu' behaviour. Currently, using '.fpu' resets the previously selected '.fpu' options (by overwriting them), but does not reset previous FPU options selected by other means (ie. when using '.arch_extension fp' in conjunction with '.fpu <x>', the FPU is not reset). Example: .arch armv8-a @ SET BASE .arch_extension fp @ ADD FP-ARMV8 .fpu vfpv2 @ ADD (already existing bits, does not reset) vfms.f32 s0, s1, s2 @ OK .arch armv8-a @ RESET .fpu fp-armv8 @ ADD FP-ARMV8 vfms.f32 s0, s1, s2 @ OK .fpu vfpv2 @ RESET to VFPV2 vfms.f32 s0, s1, s2 @ ERROR After the patch this becomes: .arch armv8-a @ SET BASE .arch_extension fp @ ADD FP-ARMV8 .fpu vfpv2 @ RESET TO VFPV2 vfms.f32 s0, s1, s2 @ ERROR .arch armv8-a @ RESET .fpu fp-armv8 @ ADD FP-ARMV8 vfms.f32 s0, s1, s2 @ OK .fpu vfpv2 @ RESET to VFPV2 vfms.f32 s0, s1, s2 @ ERROR gas/ChangeLog: 2019-11-11 Mihail Ionescu <mihail.ionescu@arm.com> * config/tc-arm.c (s_arm_fpu): Clear selected_cpu fpu bits. (fpu_any): Remove OBJ_ELF guards. * gas/testsuite/gas/arm/fpu-rst.s: New. * gas/testsuite/gas/arm/fpu-rst.d: New. * gas/testsuite/gas/arm/fpu-rst.l: New.
2019-11-12x86: fold EsSeg into IsStringJan Beulich8-11306/+11318
EsSeg (a per-operand bit) is used with IsString (a per-insn attribute) only. Extend the attribute to 2 bits, thus allowing to encode - not a string insn, - string insn with neither operand requiring use of %es:, - string insn with 1st operand requiring use of %es:, - string insn with 2nd operand requiring use of %es:, which covers all possible cases, allowing to drop EsSeg. The (transient) need to comment out the OTUnused #define did uncover an oversight in the earlier OTMax -> OTNum conversion, which is being taken care of here.
2019-11-12x86: eliminate ImmExt abuseJan Beulich18-445/+540
Drop the remaining instances left in place by commit c3949f432f ("x86: limit ImmExt abuse), now that we have a way to specify specific GPRs. Take the opportunity and also introduce proper 16-bit forms of applicable SVME insns as well as 1-operand forms of CLZERO.
2019-11-12x86: introduce operand type "instance"Jan Beulich9-14228/+14307
Special register "class" instances can't be combined with one another (neither in templates nor in register entries), and hence it is not a good use of resources (memory as well as execution time) to represent them as individual bits of a bit field. Furthermore the generalization becoming possible will allow improvements to the handling of insns accepting only individual registers as their operands.
2019-11-12Automatic date update in version.inGDB Administrator1-1/+1
2019-11-11Document and extend readline-bindable functionsTom Tromey4-1/+27
This adds readline-bindable function names to a few gdb functions that already had key bindings. This lets users change the bindings. This also removes the gdb-command function. Due to how this function is implemented, it doesn't make sense to allow binding it. Finally, this updates the documentation to reflect these changes. gdb/ChangeLog 2019-11-11 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_initialize_readline): Add new bindable readline functions. gdb/doc/ChangeLog 2019-11-11 Tom Tromey <tom@tromey.com> * gdb.texinfo (TUI Keys): Document readline function names. Change-Id: I2233779b7aefe372f19bd03c8f325733c3385e72
2019-11-11Document operate-and-get-nextTom Tromey2-0/+11
This adds some documentation for the operate-and-get-next readline function that gdb supplies. The text is largely taken from the Bash manual. gdb/doc/ChangeLog 2019-11-11 Tom Tromey <tom@tromey.com> * gdb.texinfo (Editing): Document operate-and-get-next. Change-Id: I9adb16d9ce84bfbda5fe8a2828f668ea878c080c
2019-11-11Use getpwuid_r instead of getpwuidChristian Biesinger2-1/+8
gdb/ChangeLog: 2019-11-11 Christian Biesinger <cbiesinger@google.com> * nat/linux-osdata.c (user_from_uid): Use getpwuid_r. Change-Id: I587359267f8963ef1da6ba0223a1525807a721de
2019-11-11Fix typo in vFile:pwrite documentationTom Tromey2-1/+5
A user on irc noticed that the remote protocol documentation mentioned "vFile:write" -- but this is a typo, there is only "vFile:pwrite". This patch fixes the bug. Tested by rebuilding, committing as obvious. gdb/doc/ChangeLog 2019-11-11 Tom Tromey <tromey@adacore.com> * gdb.texinfo (Host I/O Packets): Fix typo in "vFile:pwrite". Change-Id: I2f668a691eed7883ba6bc092471739f44c82301b
2019-11-11Arm64: SVE2's smaxp/sminp require operands 1 and 3 to be the same registerJan Beulich5-2/+17
This is just like for their umaxp/uminp and fmaxp/fminp counterparts.
2019-11-11Arm64: fix build with old glibcJan Beulich2-10/+12
Some old glibc versions have string.h surface "index", which some compilers then warn about if shadowed by a local variable. Re-use an existing variable instead.
2019-11-11PR24996, Gold fix for ternary operator within linker scriptsMiguel Saldivar2-2/+9
PR 24996 * expression.cc (Trinary_expression::arg2_value): Use correct integer expression when calling "eval_maybe_dot" method. (Trinary_expression::arg3_value): Likewise.
2019-11-11Automatic date update in version.inGDB Administrator1-1/+1
2019-11-10gdb/python: Introduce gdb.lookup_static_symbolsAndrew Burgess9-0/+142
If gdb.lookup_static_symbol is going to return a single symbol then it makes sense (I think) for it to return a context sensitive choice of symbol, that is the global static symbol that would be visible to the program at that point. However, if the user of the python API wants to instead get a consistent set of global static symbols, no matter where they stop, then they have to instead consider all global static symbols with a given name - there could be many. That is what this new API function offers, it returns a list (possibly empty) of all global static symbols matching a given name (and optionally a given symbol domain). gdb/ChangeLog: * python/py-symbol.c (gdbpy_lookup_static_symbols): New function. * python/python-internal.h (gdbpy_lookup_static_symbols): Declare new function. * python/python.c (python_GdbMethods): Add gdb.lookup_static_symbols method. * NEWS: Mention gdb.lookup_static_symbols. gdb/testsuite/ChangeLog: * gdb.python/py-symbol.exp: Add test for gdb.lookup_static_symbols. gdb/doc/ChangeLog: * python.texi (Symbols In Python): Add documentation for gdb.lookup_static_symbols. Change-Id: I1153b0ae5bcbc43b3dcf139043c7a48bf791e1a3
2019-11-10gdb/python: smarter symbol lookup for gdb.lookup_static_symbolAndrew Burgess8-14/+109
When using gdb.lookup_static_symbol I think that GDB should find static symbols (global symbol with static linkage) from the current object file ahead of static symbols from other object files. This means that if we have two source files f1.c and f2.c, and both files contains 'static int foo;', then when we are stopped in f1.c a call to 'gdb.lookup_static_symbol ("foo")' will find f1.c::foo, and if we are stopped in f2.c we would find 'f2.c::foo'. Given that gdb.lookup_static_symbol always returns a single symbol, but there can be multiple static symbols with the same name GDB is always making a choice about which symbols to return. I think that it makes sense for the choice GDB makes in this case to match what a user would get on the command line if they asked to 'print foo'. gdb/testsuite/ChangeLog: * gdb.python/py-symbol.c: Declare and call function from new py-symbol-2.c file. * gdb.python/py-symbol.exp: Compile both source files, and add new tests for gdb.lookup_static_symbol. * gdb.python/py-symbol-2.c: New file. gdb/doc/ChangeLog: * python.texi (Symbols In Python): Extend documentation for gdb.lookup_static_symbol. gdb/ChangeLog: * python/py-symbol.c (gdbpy_lookup_static_symbol): Lookup in static block of current object file first. Also fix typo in header comment. Change-Id: Ie55dbeb8806f35577b46015deecde27a0ca2ab64
2019-11-10gdb: Add a class to track last display symtab and line informationAndrew Burgess3-73/+148
In stack.c we currently have a set of static global variables to track the last displayed symtab and line. This commit moves all of these into a class and adds an instance of the class to track the same information. The API into stack.c is unchanged after this cleanup. There should be no user visible changes after this commit. gdb/ChangeLog: * stack.c (set_last_displayed_sal): Delete. (last_displayed_sal_valid): Delete. (last_displayed_pspace): Delete. (last_displayed_addr): Delete. (last_displayed_symtab): Delete. (last_displayed_line): Delete. (class last_displayed_symtab_info_type): New. (last_displayed_symtab_info): New static global variable. (print_frame_info): Call methods on last_displayed_symtab_info. (clear_last_displayed_sal): Update header comment, and make use of last_displayed_symtab_info. (last_displayed_sal_is_valid): Likewise. (get_last_displayed_pspace): Likewise. (get_last_displayed_addr): Likewise. (get_last_displayed_symtab): Likewise. (get_last_displayed_line): Likewise. (get_last_displayed_sal): Likewise. * stack.h (clear_last_displayed_sal): Update header comment. (last_displayed_sal_is_valid): Likewise. (get_last_displayed_pspace): Likewise. (get_last_displayed_addr): Likewise. (get_last_displayed_symtab): Likewise. (get_last_displayed_line): Likewise. (get_last_displayed_sal): Likewise. Change-Id: Ia3dbfe267feec03108c5c8ed8bd94fc0a030c3ed
2019-11-10gdb: Convert frame_show_address to return a boolAndrew Burgess3-4/+10
Just a clean up, should be no user visible changes after this commit. gdb/ChangeLog: * stack.c (frame_show_address): Convert return type to bool. * stack.h (frame_show_address): Likewise, and update header comment. Change-Id: Iaaa9ebd4ff6534db19c5329f1c604932c747bd7f
2019-11-10gdb_vecs.h: Avoid self move assignAndrew Burgess4-1/+75
While working on another patch I ran into an issue with unordered_remove (in gdb_vecs.h), where removing the last item of the vector can cause a self move assign. When compiling the C++ standard library in debug mode (with -D_GLIBCXX_DEBUG=1) this causes an error to trigger. I've fixed the issue in this patch and provided a unit test. The provided unit test includes an assignment operator which checks for self move assign, this removes the need to compile with -D_GLIBCXX_DEBUG=1 in order to spot the bug. If you're keen to see the error reported from the C++ standard library then remove operator= from the unit test and recompile GDB with -D_GLIBCXX_DEBUG=1. gdb/ChangeLog: * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add new file to the list. * unittests/vec-utils-selftests.c: New file. * gdbsupport/gdb_vecs.h (unordered_remove): Avoid self move assign. Change-Id: I80247b20cd5212038117db7412865f5e6a9257cd
2019-11-10Remove can_highlight from TUI windowsTom Tromey4-7/+12
Each TUI window has a "can_highlight" member. However, this has the same meaning as "can_box" -- a window can be highlighted if and only if it can be boxed. So, this patch removes can_highlight in favor of simply using can_box. gdb/ChangeLog 2019-11-10 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c (tui_unhighlight_win): Use can_box. (tui_highlight_win): Likewise. (tui_win_info::check_and_display_highlight_if_needed): Likewise. * tui/tui-data.h (struct tui_win_info) <can_highlight>: Remove. * tui/tui-command.h (struct tui_cmd_window) <tui_cmd_window>: Don't set can_highlight. Change-Id: I35916859070efcdfcc6e692c71cc6070956dcfce