aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-10-09[PATCH, BINUTILS, AARCH64, 4/9] Add Execution and Data Restriction instructionsSudakshina Das18-1090/+1238
This patch is part of the patch series to add support for ARMv8.5-A extensions. (https://developer.arm.com/products/architecture/cpu-architecture/a-profile/docs/ddi0596/a/a64-base-instructions-alphabetic-order) This patch adds the prediction restriction instructions (that is, cfp, dvp, cpp). These instructions are retrospectively made optional for all versions of the architecture from ARMv8.0 to ARMv8.4 and is mandatory from ARMv8.5. Hence adding a new +predres which can be used by the older architectures. *** include/ChangeLog *** 2018-10-09 Sudakshina Das <sudi.das@arm.com> * opcode/aarch64.h (AARCH64_FEATURE_PREDRES): New. (AARCH64_ARCH_V8_5): Add AARCH64_FEATURE_PREDRES by default. (aarch64_opnd): Add AARCH64_OPND_SYSREG_SR. (aarch64_sys_regs_sr): Declare new table. *** opcodes/ChangeLog *** 2018-10-09 Sudakshina Das <sudi.das@arm.com> * aarch64-dis.c (aarch64_ext_sysins_op): Add case for AARCH64_OPND_SYSREG_SR. * aarch64-opc.c (aarch64_print_operand): Likewise. (aarch64_sys_regs_sr): Define table. (aarch64_sys_ins_reg_supported_p): Check for RCTX with AARCH64_FEATURE_PREDRES. * aarch64-tbl.h (aarch64_feature_predres): New. (PREDRES, PREDRES_INSN): New. (aarch64_opcode_table): Add entries for cfp, dvp and cpp. (AARCH64_OPERANDS): Add new description for SYSREG_SR. * aarch64-asm-2.c: Regenerate. * aarch64-dis-2.c: Regenerate. * aarch64-opc-2.c: Regenerate. *** gas/ChangeLog *** 2018-10-09 Sudakshina Das <sudi.das@arm.com> * config/tc-aarch64.c (aarch64_sys_regs_sr_hsh): New. (parse_operands): Add entry for AARCH64_OPND_SYSREG_SR. (md_begin): Allocate and initialize aarch64_sys_regs_sr_hsh with aarch64_sys_regs_sr. (aarch64_features): Add new "predres" option for older architectures. * doc/c-aarch64.texi: Document the same. * testsuite/gas/aarch64/sysreg-4.s: New. * testsuite/gas/aarch64/sysreg-4.d: New. * testsuite/gas/aarch64/illegal-sysreg-4.d: New. * testsuite/gas/aarch64/illegal-sysreg-4.l: New. * testsuite/gas/aarch64/predres.s: New. * testsuite/gas/aarch64/predres.d: New.
2018-10-09[PATCH, BINUTILS, AARCH64, 3/9] Add instruction SB for ARMv8.5-ASudakshina Das13-1015/+1079
This patch is part of the patch series to add support for ARMv8.5-A extensions. (https://developer.arm.com/products/architecture/cpu-architecture/a-profile/docs/ddi0596/a/a64-base-instructions-alphabetic-order) This instruction is retrospectively made optional for all versions of the architecture from ARMv8.0 to ARMv8.4 and is mandatory from ARMv8.5. Hence a new command line option of "+sb" is added for older architectures. *** include/ChangeLog *** 2018-10-09 Sudakshina Das <sudi.das@arm.com> * opcode/aarch64.h (AARCH64_FEATURE_SB): New. (AARCH64_ARCH_V8_5): Add AARCH64_FEATURE_SB by default. *** opcodes/ChangeLog *** 2018-10-09 Sudakshina Das <sudi.das@arm.com> * aarch64-tbl.h (aarch64_feature_sb): New. (SB, SB_INSN): New. (aarch64_opcode_table): Add entry for sb. * aarch64-asm-2.c: Regenerate. * aarch64-dis-2.c: Regenerate. * aarch64-opc-2.c: Regenerate. *** gas/ChangeLog *** 2018-10-09 Sudakshina Das <sudi.das@arm.com> * config/tc-aarch64.c (aarch64_features): Add new "sb" option for older architectures. * doc/c-aarch64.texi: Document the same. * testsuite/gas/aarch64/sb.s: New. * testsuite/gas/aarch64/sb.d: New.
2018-10-09[PATCH, BINUTILS, AARCH64, 2/9] Add Data procoessing instructions for ARMv8.5-ASudakshina Das10-2645/+2835
This patch is part of the patch series to add support for ARMv8.5-A extensions. (https://developer.arm.com/products/architecture/cpu-architecture/a-profile/docs/ddi0596/a/a64-base-instructions-alphabetic-order) This patch adds the data processing instructions that are new to ARMv8.5-A. 1) There are 2 instructions: xaflag, axflag, that are added to manipulate the states of the flag and are used to convert between the Arm representation and the fcmp representation. 2) The other instructions are rounding instructions which have 8 versions based on whether the floating-point number is a Single-Precision or Double-Precision number, whether the target integer is a 32-bit or 64-bit integer and whether the rounding mode is the ambient rounding mode or to zero. Each of these instruction is available in both Scalar and Vector forms. Since both 1) and 2) have separate identification mechanism and it is permissible that a ARMv8.4 compliant implementation may include any arbitrary subset of the ARMv8.5 features unless otherwise specified, new feature bits are added. *** include/ChangeLog *** 2018-10-09 Sudakshina Das <sudi.das@arm.com> * opcode/aarch64.h (AARCH64_FEATURE_FLAGMANIP): New. (AARCH64_FEATURE_FRINTTS): New. (AARCH64_ARCH_V8_5): Add both by default. *** opcodes/ChangeLog *** 2018-10-09 Sudakshina Das <sudi.das@arm.com> * aarch64-tbl.h (aarch64_feature_flagmanip): New. (aarch64_feature_frintts): New. (FLAGMANIP, FRINTTS): New. (aarch64_opcode_table): Add entries for xaflag, axflag and frint[32,64][x,z] instructions. * aarch64-asm-2.c: Regenerate. * aarch64-dis-2.c: Regenerate. * aarch64-opc-2.c: Regenerate. *** gas/ChangeLog *** 2018-10-09 Sudakshina Das <sudi.das@arm.com> * testsuite/gas/aarch64/armv8_5-a-dp.s: New. * testsuite/gas/aarch64/armv8_5-a-dp.d: New.
2018-10-09[PATCH, BINUTILS, AARCH64, 1/9] Add -march=armv8.5-a and related internal ↵Sudakshina Das7-1/+29
feature macros This patch is part of the patch series to add support for ARMv8.5-A extensions. (https://developer.arm.com/products/architecture/cpu-architecture/a-profile/exploration-tools) This is the first of the patch series and adds -march=armv8.5-a and other internal feature marcos needed for it. 2018-10-09 Sudakshina Das <sudi.das@arm.com> * config/tc-aarch64.c (aarch64_archs): New entry for armv8.5-a. * doc/c-aarch64.texi: Add documentation for the same. *** include/ChnageLog *** 2018-10-09 Sudakshina Das <sudi.das@arm.com> * opcode/aarch64.h (AARCH64_FEATURE_V8_5): New. (AARCH64_ARCH_V8_5): New. *** opcodes/ChangeLog *** 2018-10-09 Sudakshina Das <sudi.das@arm.com> * aarch64-tbl.h (aarch64_feature_set aarch64_feature_v8_5): New. (ARMV8_5, V8_5_INSN): New.
2018-10-09[gdb/testsuite] Fix target_supports_scheduler_locking racinessTom de Vries2-1/+8
When calling gdb_start_cmd, it's the caller's responsibility to wait for gdb to return to the prompt. In target_supports_scheduler_locking, that's not the case, and consequently, target_supports_scheduler_locking fails spuriously. Fix by using runto_main instead. Build and reg-tested on x86_64-linux. 2018-10-09 Tom de Vries <tdevries@suse.de> * lib/gdb.exp (target_supports_scheduler_locking): Replace gdb_start_cmd with runto_main.
2018-10-09Fix buffer overrun found by CoverityGary Benson2-2/+8
This commit fixes a buffer overrun found by Coverity, where 36 bytes are written into a 24 byte buffer. gdb/ChangeLog: * dwarf2read.c (create_dwp_hash_table): Fix buffer overrun found by Coverity.
2018-10-09Do not place symbols into a discarded .dynsymEgeyar Bagcioglu2-3/+9
Prevents getting an error about dynamic symbols in sections indexed 64K+ when .dynsym is discarded. * elflink.c (elf_link_output_extsym): Do not place symbols into a discarded .dynsym.
2018-10-09Automatic date update in version.inGDB Administrator1-1/+1
2018-10-08Remove unused variables from riscv-fbsd-tdep.cTom Tromey2-3/+6
This removes a couple of unused variables from riscv-fbsd-tdep.c. This allows a --enable-targets=all build to complete on x86-64 Fedora 28. gdb/ChangeLog 2018-10-08 Tom Tromey <tom@tromey.com> * riscv-fbsd-tdep.c (riscv_fbsd_sigframe_init): Remove unused variable. (riscv_fbsd_init_abi): Likewise.
2018-10-08Fix the [-Werror=shadow=local] warningWeimin Pan2-3/+7
Rename local variable in value_struct_elt_for_reference() to work around the shadowing a previous local warning.
2018-10-08Add native target for FreeBSD/riscv.John Baldwin8-0/+161
gdb/ChangeLog: * Makefile.in (ALLDEPFILES): Add riscv-fbsd-nat.c. * NEWS: Mention new FreeBSD/riscv native configuration. * configure.host: Add riscv*-*-freebsd*. * configure.nat: Likewise. * riscv-fbsd-nat.c: New file. gdb/doc/ChangeLog: * gdb.texinfo (Contributors): Add SRI International and University of Cambridge for FreeBSD/riscv.
2018-10-08Add FreeBSD/riscv architecture.John Baldwin6-0/+258
Support for collecting and supplying general purpose and floating point register sets is provided along with signal frame unwinding. FreeBSD only supports RV64 currently, so while some provision is made for RV32 in the general-purpose register set, the changes have only been tested on RV64. gdb/ChangeLog: * Makefile.in (ALL_TARGET_OBS): Add riscv-fbsd-tdep.o. (HFILES_NO_SRCDIR): Add riscv-fbsd-tdep.h. (ALLDEPFILES): Add riscv-fbsd-tdep.c. * NEWS: Mention new FreeBSD/riscv target. * configure.tgt: Add riscv*-*-freebsd*. * riscv-fbsd-tdep.c: New file. * riscv-fbsd-tdep.h: New file.
2018-10-08Add a helper function to trad_frame to support register cache maps.John Baldwin4-2/+87
Currently, signal frame handlers require explicitly coded calls to trad_frame_set_reg_addr() to describe the location of saved registers within a signal frame. This change permits the regcache_map_entry arrays used with regcache::supply_regset and regcache::collect_regset to be used to describe a block of saved registers given an initial address for the register block. Some systems use the same layout for registers in core dump notes, native register sets with ptrace(), and the register contexts saved in signal frames. On these systems, a single register map can now be used to describe the layout of registers in all three places. If a register map entry's size does not match the native size of a register, try to match the semantics used by regcache::transfer_regset. If a register slot is too large, assume that the register's value is stored in the first N bytes and ignore the remaning bytes. If the register slot is smaller than the register, assume the slot holds the low N bytes of the register's value. Read these low N bytes from the target and zero-extend them to generate a register value. While here, document the semantics for both regcache::transfer_regset and trad_frame with respect to register slot's whose size does not match the register's size. gdb/ChangeLog: * regcache.h (struct regcache_map_entry): Note that this type can be used with traditional frame caches. * trad-frame.c (trad_frame_set_reg_regmap): New. * trad-frame.h (trad_frame_set_reg_regmap): New.
2018-10-08Finding data member in virtual base classWeimin Pan5-1/+235
This patch fixes the original problem - printing member in a virtual base, using various expressions, do not yield the same value. Simple test case below demonstrates the problem: % cat t.cc struct base { int i; }; typedef base tbase; struct derived: virtual tbase { void func() { } }; int main() { derived().func(); } % g++ -g t.cc % gdb a.out (gdb) break derived::func (gdb) run (gdb) p i $1 = 0 (gdb) p base::i $3 = 0 (gdb) p derived::i $4 = 4196392 To fix the problem, add function get_baseclass_offset() which searches recursively for the base class along the class hierarchy. If the base is virtual, it uses "vptr" in virtual class object, which indexes to its derived class's vtable, to get and returns the baseclass offset. If the base is non-virtual, it returns the accumulated offset of its parent classes. The offset is then added to the address of the class object to access its member in value_struct_elt_for_reference().
2018-10-08AArch64: Replace C initializers with memsetTamar Christina2-1/+7
Clang doesn't accept {0} as a valid C struct initializer under their implementation of -Wmissing-field-initializers. This makes using C initializers a bit tricky. Instead I'm changing the code to use memset instead, which at least GCC inlines and generates the same code for. This also seems to be the idiom used in binutils for most targets. opcodes/ * aarch64-opc.c (verify_constraints): Use memset instead of {0}.
2018-10-08x86: Don't add GNU_PROPERTY_X86_FEATURE_2_NEEDED for -z separate-codeH.J. Lu6-51/+17
With commit 64029e93683a266c38d19789e780f3748bd6a188 Author: Alan Modra <amodra@gmail.com> Date: Fri Oct 5 11:40:54 2018 +0930 Separate header PT_LOAD for -z separate-code there is no need to add a GNU_PROPERTY_X86_ISA_1_USED note to force program header in in non-code PT_LOAD segment when -z separate-code is used. bfd/ PR ld/23428 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Don't add GNU_PROPERTY_X86_FEATURE_2_NEEDED to force program header in non-code PT_LOAD segment. ld/ PR ld/23428 * testsuite/ld-i386/property-x86-4a.d: Updated. * testsuite/ld-x86-64/property-x86-4a-x32.d: Likewise. * testsuite/ld-x86-64/property-x86-4a.d: Likewise.
2018-10-08ELF: Properly group and place orphan note sectionsH.J. Lu5-56/+140
Properly group orphan note sections. When placing orphan note section as the first note section, place it after the section before all note sections. PR ld/23658 * ldlang.c (lang_insert_orphan): Properly group and place orphan note sections. Properly handle orphan note section before all note sections. * testsuite/ld-elf/pr23658-1.d: Renamed to ... * testsuite/ld-elf/pr23658-1a.d: This. Updated. * testsuite/ld-elf/pr23658-1b.d: New test. * testsuite/ld-elf/pr23658-1c.d: Likewise.
2018-10-08Separate header PT_LOAD for -z separate-codeAlan Modra17-93/+151
This patch, along with previous patches in the series, supports putting the ELF file header and program headers in a PT_LOAD without sections. Logic governing whether headers a loaded has changed a little: The primary reason to include headers is now the presence of SIZEOF_HEADERS in a linker script. However, to support scripts that may have reserved space for headers by hand, we continue to add headers whenever the first section address is past the end of headers modulo page size. include/ * bfdlink.h (struct bfd_link_info): Add load_phdrs field. bfd/ * elf-nacl.c (nacl_modify_segment_map): Cope with header PT_LOAD lacking sections. * elf.c (_bfd_elf_map_sections_to_segments): Assume file and program headers are required when info->load_phdrs. Reorganize code handling program headers. Generate a mapping without sections just for file and program headers when -z separate-code would indicate they should be on a different page to the first section. ld/ * ldexp.c (fold_name <SIZEOF_HEADERS>): Set link_info.load_phdrs. * testsuite/ld-elf/loadaddr1.d: Pass -z noseparate-code. * testsuite/ld-elf/loadaddr2.d: Likewise. * testsuite/ld-i386/vxworks2.sd: Adjust expected output. * testsuite/ld-powerpc/vxworks2.sd: Likewise. * testsuite/ld-elf/overlay.d: Remove spu xfail. * testsuite/ld-spu/ovl.lnk: Don't use SIZEOF_HEADERS. * testsuite/ld-tic6x/dsbt-be.ld: Likewise. * testsuite/ld-tic6x/dsbt-inrange.ld: Likewise. * testsuite/ld-tic6x/dsbt-overflow.ld: Likewise. * testsuite/ld-tic6x/dsbt.ld: Likewise.
2018-10-08ld insert_os_after ignoring first assignmentAlan Modra3-5/+15
Some time ago the pr19593 test was xfailed for alpha. This turned out to be the wrong course of action since the test exposed a bug in orphan section placement. On alpha, orphan sections were being inserted before ". = SIZEOF_HEADERS" due to the test having two assignments, and on alpha, an output section statement from -Ttext-segment being passed to ld. * ldlang.c (insert_os_after): Clear ignore_first on assignment to dot, not any assignment. Clear ignore_first on output section statement contents too. * testsuite/ld-elf/pr19539.d: Remove alpha xfail.
2018-10-08Use p_vaddr_offset to set p_vaddr on segments without sectionsAlan Modra2-10/+22
p_vaddr is currently set from the first section vma if a segment has sections, and to zero if a segment has no sections. This means we lose p_vaddr when objcopy'ing executables if a segment without sections has a non-zero p_vaddr. This patch saves p_vaddr to p_vaddr_offset, and to make the use of p_vaddr_offset consistent, inverts the sign. (It's now added to section vma to get segment vaddr, and added to zero when there are no sections.) * elf.c (assign_file_positions_for_load_sections): Set p_vaddr from m->p_vaddr_offset for segments without sections. Invert sign of p_vaddr_offset. (rewrite_elf_program_header, copy_elf_program_header): Save old segment p_vaddr to p_vaddr_offset. Invert sign of p_vaddr_offset.
2018-10-08No PT_INTERP when .interp is zero sizeAlan Modra4-3/+14
Some targets don't set a default interpreter, resulting in an empty .interp section unless --dynamic-linker is passed to ld. A PT_INTERP without a path is rather useless. The testsuite change fixes a failure on microblaze-linux. bfd/ * elf.c (get_program_header_size): Don't count PT_INTERP if .interp is empty. (_bfd_elf_map_sections_to_segments): Don't create PT_INTERP if .interp is empty. ld/ * testsuite/ld-elf/pr22423.d: Pass --dynamic-linker to ld.
2018-10-08SPU overlay headersAlan Modra2-11/+32
Overlay PT_LOAD headers are moved early for reasons explained by comments in spu_elf_modify_segment_map. This patch fixes cases that shouldn't occur in sane SPU executables. * elf32-spu.c (spu_elf_modify_segment_map): Don't insert overlays before segment containing headers.
2018-10-08Tidy elf_segment_map allocationAlan Modra2-20/+27
This cleans up elf_segment_map allocation when the section array is empty. "amt += (to - from - 1) * sizeof (asection *)", when "to" and "from" are unsigned int results in an unsigned value inside the parentheses. When "to" and "from" are equal on a 64-bit host, 0xffffffff * 8 is added to "amt", not -8 as desired. The patch also renames a variable for consistency with other functions using a similar index. * elf.c (make_mapping): Cope with zero size array at end of struct elf_segment_map. (_bfd_elf_map_sections_to_segments): Likewise. (rewrite_elf_program_header, copy_elf_program_header): Likewise. (_bfd_elf_map_sections_to_segments): Rename phdr_index to hdr_index.
2018-10-08GDB: Work around buggy dwarf line information produced by Codewarrior ↵John Darrington2-1/+27
Version 5.0.40 (build 15175). gdb/ChangeLog: * dwarf2read.c (dwarf2_cu) <producer_is_codewarrior>: New field. (check_producer): Check if the producer is codewarrior. (producer_is_codewarrior): New function. (lnp_state_machine::record_line): Ignore is_stmt flag for records produced by codewarrior. (dwarf2_cu::dwarf2_cu): Initialize producer_is_codewarrior.
2018-10-08Handle R_RISCV_32_PCREL in readelfAndreas Schwab2-0/+6
* readelf.c (is_32bit_pcrel_reloc): Handle R_RISCV_32_PCREL.
2018-10-08Python doc build fixesAndreas Krebbel1-1/+2
gdb/doc/ChangeLog: 2018-10-08 Andreas Krebbel <krebbel@linux.ibm.com> * python.texi (Inferior.Architecture): Add "@end defun". Rename ref target to "Unwinding Frames in Python".
2018-10-08Automatic date update in version.inGDB Administrator1-1/+1
2018-10-06Add Inferior.architecture methodTom Tromey6-0/+47
I've written a couple of gdb unwinders in Python, and while doing so, I wanted to find the architecture of the inferior. (In an unwinder in particular, one can't use the frame's architecture, because there is no frame.) This patch adds Inferior.architecture to allow this. Normally I think I would have chosen an attribute and not a method here, but seeing that Frame.architecture is a method, I chose a method as well, for consistency. gdb/ChangeLog 2018-10-06 Tom Tromey <tom@tromey.com> PR python/19399: * python/py-inferior.c: Add "architecture" entry. (infpy_architecture): New function. gdb/doc/ChangeLog 2018-10-06 Tom Tromey <tom@tromey.com> PR python/19399: * python.texi (Inferiors In Python): Document Inferior.Architecture. gdb/testsuite/ChangeLog 2018-10-06 Tom Tromey <tom@tromey.com> PR python/19399: * gdb.python/py-inferior.exp: Add architecture test.
2018-10-06Update symbol domain and location values for PythonTom Tromey5-18/+53
In the distant past, there was no distinction between domain_enum and search_domain. At that point, there were two sets of enumerators in a single enum -- which is why these were eventually split. This confusion leaked out to the Python API as well, as noted in PR python/21765. This patch deprecates the constants that aren't useful to the Python API. They are left in place for now, but removed from the documentation. Also, their values are changed so that, if used, they might work. Finally, missing domains and location constants are added. gdb/ChangeLog 2018-10-06 Tom Tromey <tom@tromey.com> PR python/21765: * python/py-symbol.c (gdbpy_initialize_symbols): Redefine SYMBOL_VARIABLES_DOMAIN, SYMBOL_FUNCTIONS_DOMAIN, SYMBOL_TYPES_DOMAIN. Define SYMBOL_MODULE_DOMAIN, SYMBOL_COMMON_BLOCK_DOMAIN, SYMBOL_LOC_COMMON_BLOCK. gdb/doc/ChangeLog 2018-10-06 Tom Tromey <tom@tromey.com> PR python/21765: * python.texi (Symbols In Python): Document the module and common-block domains. Remove documentation for incorrect domains.
2018-10-06Use standard_output_file in a couple more placesTom Tromey3-2/+7
I noticed a few files left over in the testsuite/ directory in the build tree after running tests. Normally output files should not wind up there, but instead should end up in the test's subdirectory. This isn't always crucial, but in the past there were problems with tests clashing, preventing parallel runs, and so it is better to be clean here. This patch changes a couple of tests to use standard_output_file to fix this problem. Tested by re-running the tests in question and examining the directory. gdb/testsuite/ChangeLog 2018-10-06 Tom Tromey <tom@tromey.com> * gdb.base/gnu-ifunc.exp (build): Use standard_output_file. * gdb.trace/unavailable-dwarf-piece.exp: Use standard_output_file.
2018-10-06Do not accidentally include in-tree readline headersTom Tromey8-11/+18
PR build/17077 points out that when --with-system-readline is given, gdb will still pick up the in-tree readline headers. Normally this is not a big problem, because readline is very stable and so the ABI does not change much; but it is clearly a bug to do this, and could bite at some point. The basic problem is that OPCODES_CFLAGS uses -I$(OPCODES_SRC)/.. so that #include "opcodes/..." works. However, this also makes it so the This patch fixes the problem in a mildly hacky way: remove the offending -I option, and change gdb to use #include "../opcodes/..." instead. This continues to make it clear where the header comes from, without allowing incorrect behavior. Tested by rebuilding and then looking at the *.Po files. gdb/ChangeLog 2018-10-06 Tom Tromey <tom@tromey.com> PR build/17077: * Makefile.in (OPCODES_CFLAGS): Remove "-I$(OPCODES_SRC)/..". * arc-tdep.c, frv-tdep.c, lm32-tdep.c, mep-tdep.c, microblaze-tdep.c, or1k-tdep.h: Use ../opcodes, not opcodes, in #include.
2018-10-06Fix Python gdb.Breakpoint.location crashTom Tromey4-1/+21
I noticed today that gdb.Breakpoint.location will crash when applied to a catchpoint made with "catch throw". The bug is that "catch throw" makes a breakpoint that is of type bp_breakpoint, but which does not have a location. Regression tested on x86-64 Fedora 28. gdb/ChangeLog 2018-10-06 Tom Tromey <tom@tromey.com> * python/py-breakpoint.c (bppy_get_location): Handle a bp_breakpoint without a location. gdb/testsuite/ChangeLog 2018-10-06 Tom Tromey <tom@tromey.com> * gdb.python/py-breakpoint.exp (check_last_event): Check location of a "throw" catchpoint.
2018-10-06Update help text for commands implemented in PythonTom Tromey10-218/+198
Philippe pointed out that the "enable frame-filter" help text looked funny. While fixing this I noticed a few more problems in the help text of commands written in Python: * Trailing newlines * Wrong style for metasyntactic variables * Indentation of the text * ... and finally, I thought the function usage lines didn't need that extra newline -- someday I'd like to be able to write a "usage" command that just greps for the Usage line, so ideally it would be tighter than what was done here This patch fixes all the problems I noticed. gdb/ChangeLog 2018-10-06 Tom Tromey <tom@tromey.com> * python/lib/gdb/function/strfns.py (_MemEq, _StrLen, _StrEq) (_RegEx): Reformat help text. * python/lib/gdb/function/caller_is.py (CallerIs, CallerMatches) (AnyCallerIs, AnyCallerMatches): Reformat help text. * python/lib/gdb/function/as_string.py (_AsString): Reformat help text. * python/lib/gdb/command/xmethods.py (InfoXMethod) (EnableXMethod, DisableXMethod): Remove help indentation. Capitalize meta-syntactic variables. * python/lib/gdb/command/unwinders.py (InfoUnwinder) (EnableUnwinder, DisableUnwinder): Remove help indentation. Capitalize meta-syntactic variables. * python/lib/gdb/command/explore.py (ExploreCommand) (ExploreValueCommand, ExploreTypeCommand): Reformat help text. * python/lib/gdb/command/type_printers.py (InfoTypePrinter) (EnableTypePrinter, DisableTypePrinter): Remove help indentation. * python/lib/gdb/command/pretty_printers.py (InfoPrettyPrinter): Remove help indentation. (EnablePrettyPrinter, DisablePrettyPrinter): Likewise. * python/lib/gdb/command/frame_filters.py (EnableFrameFilter) (DisableFrameFilter, SetFrameFilterPriority) (ShowFrameFilterPriority, InfoFrameFilter): Reword help text.
2018-10-07Automatic date update in version.inGDB Administrator1-1/+1
2018-10-06Call nonl before wgetch in TUITom Tromey2-3/+24
PR tui/28819 points out that, in the TUI, the C-j and C-m keys cannot be bound differently in one's ~/.inputrc. However, this works in other readline applications. The bug is that the TUI uses curses' "nl" mode, which causes wgetch to return the same value for both keys. There is a "nonl" mode, but it also affects output. This patch fixes the bug by arranging to call nonl before reading a key and then nl afterward. This avoids any potential problem with changing the output if gdb was to use nonl globally. gdb/ChangeLog 2018-10-06 Tom Tromey <tom@tromey.com> PR tui/28819: * tui/tui-io.c (gdb_wgetch): New function. (tui_mld_getc, tui_getc): Use it.
2018-10-06Update string expected from "help info proc" on gdb.base/info-proc.expSergio Durigan Junior2-1/+6
Commit 73f1bd769a5 ("Make the "info proc" documentation more consistent.") updated the output from "help info proc", but forgot to update the test on gdb.base/info-proc.exp. This obvious patch does that. Checked-in as obvious. gdb/testsuite/ChangeLog: 2018-10-06 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.base/info-proc.exp: Update string expected from "help info proc".
2018-10-06Automatic date update in version.inGDB Administrator1-1/+1
2018-10-05x86: Add Intel ENCLV to assembler and disassemblerH.J. Lu9-1/+33
gas/ * testsuite/gas/i386/se1.s: Add enclv. * testsuite/gas/i386/x86-64-se1.s: Likewise. * testsuite/gas/i386/se1.d: Updated. * testsuite/gas/i386/x86-64-se1.d: Likewise. opcodes/ * i386-dis.c (rm_table): Add enclv. * i386-opc.tbl: Add enclv. * i386-tbl.h: Regenerated.
2018-10-05Fix -Wshadow=local warning in sol_thread_target::waitTom Tromey2-2/+7
Rainer pointed out that -Wshadow=local broke the Solaris build. This fixes it. gdb/ChangeLog 2018-10-05 Tom Tromey <tom@tromey.com> * sol-thread.c (sol_thread_target::wait): Rename inner "save_ptid".
2018-10-05Set correct SHT_NOTE type for .note.spu_nameAlan Modra2-0/+10
* elf32-spu.c (spu_elf_create_sections): Make .note.spu_name SHT_NOTE.
2018-10-05[Arm, 3/3] Add Execution and Data Prediction instructions for AArch32Sudakshina Das10-1/+71
This patch is part of the patch series to add support for ARMv8.5-A extensions. (https://developer.arm.com/products/architecture/cpu-architecture/a-profile/exploration-tools) This patch adds the Execution and Data Prediction Restriction instructions (that is, cfprctx, dvprxtc, cpprctx). These are all aliases to MCR and are disassembled as such. This instruction is retrospectively made optional for all versions of the architecture from ARMv8.0 to ARMv8.4 and is mandatory from ARMv8.5. Hence adding a new +predres for older versions of the architecture. *** include/ChangeLog *** 2018-10-05 Sudakshina Das <sudi.das@arm.com> * opcode/arm.h (ARM_EXT2_PREDRES): New. (ARM_ARCH_V8_5A): Add ARM_EXT2_PREDRES by default. *** gas/ChangeLog *** 2018-10-05 Sudakshina Das <sudi.das@arm.com> * config/tc-arm.c (arm_ext_predres): New. (insns): Add new cfprctx, dvprctx and cpprctx instructions. (arm_extensions): Add "predres". * doc/c-arm.texi: Document the above. * testsuite/gas/arm/predres-bad.d: New test. * testsuite/gas/arm/predres-bad.l: New test. * testsuite/gas/arm/predres.s: New test. * testsuite/gas/arm/predres1.d: New test. * testsuite/gas/arm/predres2.d: New test.
2018-10-05[Arm, 2/3] Add instruction SB for AArch32Sudakshina Das14-1/+102
This patch is part of the patch series to add support for ARMv8.5-A extensions. (https://developer.arm.com/products/architecture/cpu-architecture/a-profile/exploration-tools) This patch adds the instruction SB. This instruction is retrospectively made optional for all versions of the architecture from ARMv8.0 to ARMv8.4 and is mandatory from ARMv8.5. Hence adding a new "+sb" for older archtectures. *** include/ChangeLog *** 2018-10-05 Sudakshina Das <sudi.das@arm.com> * opcode/arm.h (ARM_EXT2_SB): New. (ARM_ARCH_V8_5A): Add ARM_EXT2_SB by default. *** opcodes/ChangeLog *** 2018-10-05 Sudakshina Das <sudi.das@arm.com> * arm-dis.c (arm_opcodes): Add sb. (thumb32_opcodes): Likewise. *** gas/ChangeLog *** 2018-10-05 Sudakshina Das <sudi.das@arm.com> * config/tc-arm.c (arm_ext_sb): New. (insns): Add new sb instruction. (arm_extensions): Add "sb". * doc/c-arm.texi: Document the above. * testsuite/gas/arm/sb-bad.d: New test. * testsuite/gas/arm/sb-bad.l: New test. * testsuite/gas/arm/sb-thumb1.d: New test. * testsuite/gas/arm/sb-thumb2.d: New test. * testsuite/gas/arm/sb.s: New test. * testsuite/gas/arm/sb1.d: New test. * testsuite/gas/arm/sb2.d: New test.
2018-10-05[Arm, 1/3] Add -march=armv8.5-a and related internal feature macros to AArch32Sudakshina Das6-0/+37
This patch is part of the patch series to add support for ARMv8.5-A extensions. (https://developer.arm.com/products/architecture/cpu-architecture/a-profile/exploration-tools) This is the first of the patch series and adds -march=armv8.5-a and other internal feature marcos needed for it. *** gas/ChangeLog *** 2018-10-05 Sudakshina Das <sudi.das@arm.com> * config/tc-arm.c (arm_archs): New entry for armv8.5-a. (cpu_arch_ver): Likewise. * doc/c-arm.texi: Add documentation for the same. * testsuite/gas/arm/attr-march-armv8_5-a.d: New. *** include/ChnageLog *** 2018-10-05 Sudakshina Das <sudi.das@arm.com> * opcode/arm.h (ARM_EXT2_V8_5A): New. (ARM_AEXT2_V8_5A, ARM_ARCH_V8_5A): New.
2018-10-04Add -Wshadow=localTom Tromey5-3/+15
This adds -Wshadow=local to configure. gdb/ChangeLog 2018-10-04 Tom Tromey <tom@tromey.com> * configure: Rebuild. * warning.m4 (AM_GDB_WARNINGS): Add -Wshadow=local. gdb/gdbserver/ChangeLog 2018-10-04 Tom Tromey <tom@tromey.com> * configure: Rebuild.
2018-10-04Shadowing fix in gdbscm_frame_read_varTom Tromey2-1/+5
-Wshadow=local pointed out that the shadowing in gdbscm_frame_read_var means that the ultimate call to read_var_value will always be passed block==NULL. The fix is to remove the inner declaration. gdb/ChangeLog 2018-10-04 Tom Tromey <tom@tromey.com> * guile/scm-frame.c (gdbscm_frame_read_var): Remove inner declaration of "block".
2018-10-04Avoid shadowing in fdwalkTom Tromey2-1/+5
-Wshadow=local caught this buglet. fdwalk redeclares "result" in the inner scope, meaning that this function will always return 0, even on error. gdb/ChangeLog 2018-10-04 Tom Tromey <tom@tromey.com> * common/filestuff.c (fdwalk): Remove inner declaration of "result".
2018-10-04Fix latent bug in msp430-tdep.cTom Tromey2-4/+8
-Wshadow=local found this latent bug. msp430-tdep.c does: const gdb_byte *arg_bits; { /* Aggregates of any size are passed by reference. */ gdb_byte struct_addr[4]; [... arg_bits = struct_addr; } ... use arg_bits Here, arg_bits can point to an object that's gone out of scope. The fix is to hoist the inner "struct_addr" buffer to an outer scope, and rename it to avoid shadowing. gdb/ChangeLog 2018-10-04 Tom Tromey <tom@tromey.com> * msp430-tdep.c (msp430_push_dummy_call): Rename inner "structs_addr" and hoist declaration.
2018-10-04Avoid shadowing in linux-tdep.cTom Tromey2-1/+7
This is one of the uglier changes to avoid local shadowing. Because obstack.h uses statement expressions, in some cases a nested obstack call will result in shadowing. Rather than try to fix obstack.h, this patch simply works around the one instance of this problem. gdb/ChangeLog 2018-10-04 Tom Tromey <tom@tromey.com> * linux-tdep.c (linux_make_mappings_corefile_notes): Introduce new variable "size".
2018-10-04Use std::string in mdebugread.cTom Tromey2-14/+10
This changes a couple of spots in mdebugread to use std::string rather than manual management. This is simpler, and also avoids shadowing by renaming the variable in question. gdb/ChangeLog 2018-10-04 Tom Tromey <tom@tromey.com> * mdebugread.c (parse_partial_symbols): Use std::string.
2018-10-04Avoid shadowing in gdbserverTom Tromey4-21/+31
This fixes a few instances of shadowing in gdbserver. These are all simple fixes. gdb/gdbserver/ChangeLog 2018-10-04 Tom Tromey <tom@tromey.com> * server.c (handle_status): Rename inner "thread". (process_serial_event): Declare "res" in 'm' case. * linux-low.c (last_thread_of_process_p, find_lwp_pid) (iterate_over_lwps): Rename inner "thread". (linux_qxfer_libraries_svr4): Rename inner "len". * gdbthread.h (find_thread_in_random): Rename inner "thread".