aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-07-30RISC-V: Set insn info fields correctly when disassembling.Jim Wilson5-178/+242
include/ * opcode/riscv.h (INSN_TYPE, INSN_BRANCH, INSN_CONDBRANCH, INSN_JSR) (INSN_DREF, INSN_DATA_SIZE, INSN_DATA_SIZE_SHIFT, INSN_1_BYTE) (INSN_2_BYTE, INSN_4_BYTE, INSN_8_BYTE, INSN_16_BYTE): New. opcodes/ * riscv-dis.c (riscv_disassemble_insn): Set insn_type and data_size fields. * riscv-opc.c (riscv_opcodes): Use new INSN_* flags to annotate insns.
2018-07-30gdb: Fix sizeof for dynamic types other than arraysAndrew Burgess2-1/+8
In commit: commit 37cc0caeca4c9a8552370040f4cfeaeceaa03369 Date: Wed Jul 18 13:38:35 2018 +0200 [gdb/exp] Interpret size of vla with unknown size as <optimized out> All dynamic types are treated as arrays in the 'sizeof' code path, which means that structures can incorrectly be treated as arrays. This can cause a failure in the gdb.base/vla-datatypes.exp test script. This commit adds a check that we do have an array before checking the array bounds, and I also check that the array index type is dynamic too. This second check probably isn't strictly necessary, but shouldn't hurt, a non-dynamic index type shouldn't have undefined high bound. gdb/ChangeLog: * eval.c (evaluate_subexp_for_sizeof): Check for array type before checking array bounds are defined.
2018-07-30x86: don't mistakenly scale non-8-bit displacementsJan Beulich6-1/+60
In commit b5014f7af2 I've removed (instead of replaced) a conditional, resulting in addressing forms not allowing 8-bit displacements to now get their displacements scaled under certain circumstances. Re-add the missing conditional.
2018-07-30 * MAINTAINERS (C-SKY): Add Yunhai Shang as co-maintainer.Andrew Jenner2-0/+5
2018-07-30 * MAINTAINERS (C-SKY): Add Lifang Xia as maintainer.Andrew Jenner2-0/+5
2018-07-30Fix crash with -D_GLIBCXX_DEBUGTom Tromey2-3/+10
I noticed a buildbot failure where gdb crashed in info-os.exp, when compiled with -D_GLIBCXX_DEBUG: (gdb) info os procgroups /usr/include/c++/7/bits/stl_algo.h:4834: Error: comparison doesn't meet irreflexive requirements, assert(!(a < a)). Objects involved in the operation: iterator::value_type "< operator type" { type = pid_pgid_entry; } The bug here is that pid_pgid_entry::operator< violates the C++ irreflexivity rule; that is, that an object cannot be less than itself. Tested locally by re-running info-os.exp. gdb/ChangeLog 2018-07-30 Tom Tromey <tom@tromey.com> * nat/linux-osdata.c (pid_pgid_entry::operator<): Fix irreflexivity violation.
2018-07-30Remove old lint codeTom Tromey5-20/+11
This removes dead code that, according to the comments, existed to placate lint. I don't think this has been relevant in a long time, and certainly not since gdb switched to C++. Tested by rebuilding. ChangeLog 2018-07-30 Tom Tromey <tom@tromey.com> * cli/cli-decode.c (lookup_cmd): Remove lint code. * value.c (unpack_long): Remove lint code. * valops.c (value_ind): Remove lint code. * valarith.c (value_x_binop, value_x_unop, value_equal) (value_pos): Remove lint code.
2018-07-30Prevent a seg-fault in the linker when trying to process SH object files ↵Nick Clifton2-17/+112
with bogus relocs. PR 22706 * elf32-sh.c (sh_elf_relocate_section): When processing translation relocs, fail if the relocation offset is too small. Replace BFD_ASSERTs with more helpful error messages.
2018-07-30Fix thinko in the placement of the .gnu.build.attributes section.Nick Clifton2-1/+7
* scripttempl/elf.sc: Move the .gnu.build.attributes section to after the .comment section.
2018-07-30Add support for the C_SKY series of processors.Andrew Jenner162-5/+27187
This patch series is a new binutils port for C-SKY processors, including support for both the V1 and V2 processor variants. V1 is derived from the MCore architecture while V2 is substantially different, with mixed 16- and 32-bit instructions, a larger register set, a different (but overlapping) ABI, etc. There is support for bare-metal ELF targets and Linux with both glibc and uClibc. This code is being contributed jointly by C-SKY Microsystems and Mentor Graphics. C-SKY is responsible for the technical content and has proposed Lifang Xia and Yunhai Shang as port maintainers. (Note that C-SKY does have a corporate copyright assignment on file with the FSF.) Mentor Graphics' role has been cleaning up the code, adding documentation and additional test cases, etc, to address issues we anticipated reviewers would complain about. bfd * Makefile.am (ALL_MACHINES, ALL_MACHINES_CFILES): Add C-SKY. (BFD32_BACKENDS, BFD_BACKENDS_CFILES): Likewise. * Makefile.in: Regenerated. * archures.c (enum bfd_architecture): Add bfd_arch_csky and related bfd_mach defines. (bfd_csky_arch): Declare. (bfd_archures_list): Add C-SKY. * bfd-in.h (elf32_csky_build_stubs): Declare. (elf32_csky_size_stubs): Declare. (elf32_csky_next_input_section: Declare. (elf32_csky_setup_section_lists): Declare. * bfd-in2.h: Regenerated. * config.bfd: Add C-SKY. * configure.ac: Likewise. * configure: Regenerated. * cpu-csky.c: New file. * elf-bfd.h (enum elf_target_id): Add C-SKY. * elf32-csky.c: New file. * libbfd.h: Regenerated. * reloc.c: Add C-SKY relocations. * targets.c (csky_elf32_be_vec, csky_elf32_le_vec): Declare. (_bfd_target_vector): Add C-SKY target vector entries. binutils* readelf.c: Include elf/csky.h. (guess_is_rela): Handle EM_CSKY. (dump_relocations): Likewise. (get_machine_name): Likewise. (is_32bit_abs_reloc): Likewise. include * dis-asm.h (csky_symbol_is_valid): Declare. * opcode/csky.h: New file. opcodes * Makefile.am (TARGET_LIBOPCODES_CFILES): Add csky-dis.c. * Makefile.in: Regenerated. * configure.ac: Add C-SKY. * configure: Regenerated. * csky-dis.c: New file. * csky-opc.h: New file. * disassemble.c (ARCH_csky): Define. (disassembler, disassemble_init_for_target): Add case for ARCH_csky. * disassemble.h (print_insn_csky, csky_get_disassembler): Declare. gas * Makefile.am (TARGET_CPU_CFILES): Add entry for C-SKY. (TARGET_CPU_HFILES, TARGET_ENV_HFILES): Likewise. * Makefile.in: Regenerated. * config/tc-csky.c: New file. * config/tc-csky.h: New file. * config/te-csky_abiv1.h: New file. * config/te-csky_abiv1_linux.h: New file. * config/te-csky_abiv2.h: New file. * config/te-csky_abiv2_linux.h: New file. * configure.tgt: Add C-SKY. * doc/Makefile.am (CPU_DOCS): Add entry for C-SKY. * doc/Makefile.in: Regenerated. * doc/all.texi: Set CSKY feature. * doc/as.texi (Overview): Add C-SKY options. (Machine Dependencies): Likewise. * doc/c-csky.texi: New file. * testsuite/gas/csky/*: New test cases. ld * Makefile.am (ALL_EMULATION_SOURCES): Add C-SKY emulations. (ecskyelf.c, ecskyelf_linux.c): New rules. * Makefile.in: Regenerated. * configure.tgt: Add C-SKY. * emulparams/cskyelf.sh: New file. * emulparams/cskyelf_linux.sh: New file. * emultempl/cskyelf.em: New file. * gen-doc.texi: Add C-SKY. * ld.texi: Likewise. (Options specific to C-SKY targets): New section. * testsuite/ld-csky/*: New tests.
2018-07-30Combine ,gnu.build.attributes.* sections into one .gnu.build.attributes ↵Nick Clifton4-0/+12
section during linking. gold * layout.cc (section_name_mapping): Add an entry for .gnu.build.attributes. ld * scripttempl/elf.sc: Place .gnu.build.attributes sections with other read-only sections.
2018-07-30Automatic date update in version.inGDB Administrator1-1/+1
2018-07-29Fix unwind offset for start_symbol.John David Anglin2-1/+9
* config/tc-hppa.c: Include "struc-symbol.h". (pa_build_unwind_subspace): Use call_info->start_symbol->sy_frag instead of frag_now for local symbol replacement.
2018-07-29Automatic date update in version.inGDB Administrator1-1/+1
2018-07-28gdb: Don't call gdb_load_shlib unless GDB is runningAndrew Burgess3-1/+15
The gdb_load_shlib function will, on remote targets, try to run some GDB commands. This obviously isn't going to work unless GDB is running. The gdb.trace/tspeed.exp test calls gdb_load_shlib before starting GDB. Don't do that. The failure that's triggered is actually DeJaGNU complaining that the variable $use_gdb_stub doesn't exist, this is only created when GDB is started. Something like this should trigger a failure: make check-gdb \ RUNTESTFLAGS="--target_board=remote-gdbserver-on-localhost \ gdb.trace/tspeed.exp" This commit also adds a check to gdb_load_shlib that GDB is running. The check is always performed, so this should catch cases where a GDB developer adds a use of gdb_load_shlib but doesn't test their code with a remote target. gdb/testsuite/ChangeLog: * gdb.trace/tspeed.exp: Only call gdb_load_shlib after gdb has started. * lib/gdb.exp (gdb_load_shlib): Call perror if GDB is not running.
2018-07-28[gdb/exp] Interpret size of vla with unknown size as <optimized out>Tom de Vries4-0/+51
At -O3 -g -gstrict-dwarf, gcc generates for an optimized out vla 'a' a DW_TAG_variable with type DW_TAG_array_type containing one DW_TAG_subrange_type, but without DW_AT_upper_bound or DW_AT_count, which makes the upper bound value 'unknown': ... .uleb128 0x15 # (DIE (0x161) DW_TAG_variable) .long 0xec # DW_AT_abstract_origin .long 0x170 # DW_AT_type ... .uleb128 0xa # (DIE (0x170) DW_TAG_array_type) .long 0x110 # DW_AT_type .long 0x17f # DW_AT_sibling .uleb128 0x17 # (DIE (0x179) DW_TAG_subrange_type) .long 0xc6 # DW_AT_type .byte 0 # end of children of DIE 0x170 ... But gdb prints '0' for the size of 'a': ... /gdb ./vla-1.exe -batch -ex "b f1" -ex "run" -ex "p sizeof(a)" Breakpoint 1 at 0x4004c0: f1. (2 locations) Breakpoint 1, f1 (i=<optimized out>) at vla-1.c:18 18 } $1 = 0 ... while <optimized out> would be more appropriate. This patch fixes that in evaluate_subexp_for_sizeof. Build and reg-tested on x86_64-linux. 2018-07-28 Tom de Vries <tdevries@suse.de> * eval.c (evaluate_subexp_for_sizeof): Interpret size of dynamic type with undefined upper bound as <optimized out>. * gdb.base/vla-optimized-out-o3-strict.exp: New file.
2018-07-28Automatic date update in version.inGDB Administrator1-1/+1
2018-07-27RISC-V: Fix gas configure support for riscv*-*-*.Jim Wilson2-1/+5
gas/ * configure.tgt (riscv*): Accept as alias for riscv32*.
2018-07-27Improve gcore manpage and clarify "-o" optionSergio Durigan Junior4-18/+32
Ref.: https://bugs.debian.org/904628 It has been reported that gcore's manpage is a bit imprecise when it comes to two things: - It doesn't explicity say that the command accepts more than one PID on its CLI. - It fails to mention that the argument passed through the "-o" option is actually a prefix that will be used to compose the corefile's filename, and not the actual filename. I decided to give it a try and rewrite parts of the text to further clarify these two points. I ended up rewording the "Description" section because, IMHO, it was a bit confuse to understand. To make things consistent, I've also renamed the "$name" variable in the gcore.in script, and expanded the usage text. gdb/doc/ChangeLog: 2018-07-27 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.texinfo (gcore man): Rewrite "Description" and "-o" option sections to further clarify that gcore can take more than one PID, and that "-o" is used to specify a prefix, not a filename. gdb/ChangeLog: 2018-07-27 Sergio Durigan Junior <sergiodj@redhat.com> * gcore.in: Rename variable "name" to "prefix". Expand "usage" text.
2018-07-27x86: Check for more than 2 memory referencesH.J. Lu6-0/+32
For movsd (%esi), %ss:(%edi), %ss:(%eax) we got [hjl@gnu-tools-1 tmp]$ as -o x.o x.s x.s: Assembler messages: x.s:1: Error: too many memory references for `movsd' munmap_chunk(): invalid pointer x.s:1: Internal error (Aborted). Please report this bug. [hjl@gnu-tools-1 tmp]$ struct _i386_insn has const seg_entry *seg[2]; 3 memory references will overflow the seg array. We should issue an error if there are more than 2 memory references. PR gas/23453 * config/tc-i386.c (parse_operands): Check for more than 2 memory references. * testsuite/gas/i386/inval.s: Add a movsd test with 3 memory references. * testsuite/gas/i386/x86-64-inval.s: Likewise. * testsuite/gas/i386/inval.l: Updated. * testsuite/gas/i386/x86-64-inval.l: Likewise.
2018-07-27S12Z: Remove ELF_TARGET_ID macroJohn Darrington2-1/+4
* elf32-s12z.c (ELF_TARGET_ID): Don't define.
2018-07-27Add functions and macros to read and write 24 bit values.John Darrington3-2/+57
* libbfd.c (bfd_getb24, bfd_getl24): New functions. (bfd_get_24, bfd_put_24): New macros. * bfd-in2.h: Regenerate.
2018-07-27S12Z: Remove inappropriate comment.John Darrington2-1/+5
* elf32-s12z.c (s12z_elf_set_mach_from_flags): Remove comment.
2018-07-27S12Z: Emit uninitialized data in the .bss segmentJohn Darrington2-0/+6
* scripttempl/elfm9s12z.sc: Put input sections called .common into the .bss segment.
2018-07-27S12Z: Emit initialized data segment image.John Darrington2-3/+7
* scripttempl/elfm9s12z.sc: Emit the data_section at the end of text.
2018-07-27MIPS/GAS: Correct the AFL_ASE_MASK macroChenghua Xu2-1/+6
Fix an issue with commit 8095d2f70e1a ("MIPS/GAS: Split Loongson MMI Instructions from loongson2f/3a"), AFL_ASE_MASK should be 0x0006ffff instead of 0x0004ffff. 2018-07-27 Chenghua Xu <paul.hua.gm@gmail.com> Maciej W. Rozycki <macro@linux-mips.org> include/ * elf/mips.h (AFL_ASE_MASK): Correct typo.
2018-07-27Re: PowerPC Improve support for Gekko & BroadwayAlan Modra2-6/+12
PowerPC has replaced use of "long" for insns with "int64_t", in preparation for 64-bit power10 insns. * ppc-opc.c (insert_sprbat): Correct function parameter and return type. (extract_sprbat): Likewise, variable too.
2018-07-27Automatic date update in version.inGDB Administrator1-1/+1
2018-07-26Fix Cygwin compilation after target_ops C++ conversion.Jon Turney2-4/+9
After f6ac5f3d "Convert struct target_ops to C++", we need to explicitly use the global namespace when calling ::close() from windows_nat_target methods, as that object has a close() method. gdb/ChangeLog: 2018-07-14 Jon Turney <jon.turney@dronecode.org.uk> * windows-nat.c (windows_nat_target::create_inferior): Update to call close() in global namespace.
2018-07-26x86: Initialize broadcast_op.bytes to 0H.J. Lu2-0/+6
* config/tc-i386.c (check_VecOperations): Initialize broadcast_op.bytes to 0.
2018-07-26Make psymbols and psymtabs independent of the program spaceTom Tromey11-356/+280
This patch finally makes partial symbols and partial symtabs independent of the program space. Specifically: It changes add_psymbol_to_list to accept a section index, and changes the psymbol readers to pass this. At the same time it removes the code to add the objfile's section offset to the psymbol. It adds an objfile argument to the psymtab textlow and texthigh accessors and changes some code to use the raw variants instead. It removes the "relocate" method from struct quick_symbol_functions, as it is no longer needed any more. It changes partial_symbol::address so that the relevant offset is now applied at the point of use. gdb/ChangeLog 2018-07-26 Tom Tromey <tom@tromey.com> * dwarf-index-write.c (add_address_entry): Don't add objfile offsets. * dbxread.c (find_stab_function): Rename from find_stab_function_addr. Return a bound_minimal_symbol. (read_dbx_symtab): Use raw_text_low, raw_text_high. Don't add objfile offsets. (end_psymtab): Use raw_text_low, raw_text_high, MSYMBOL_VALUE_RAW_ADDRESS. (read_ofile_symtab): Update. (process_one_symbol): Update. * dwarf2read.c (create_addrmap_from_index): Don't add objfile offsets. (dw2_relocate): Remove. (dw2_find_pc_sect_symtab): Bias PC by the text offset before searching addrmap. (dwarf2_gdb_index_functions, dwarf2_debug_names_functions): Update. (process_psymtab_comp_unit_reader, add_partial_symbol) (add_partial_subprogram, dwarf2_ranges_read): Update. (load_partial_dies): Update. (add_address_entry): Don't add objfile offsets. (dwarf2_build_include_psymtabs): Update. (create_addrmap_from_aranges): Don't add objfile offsets. (dw2_find_pc_sect_compunit_symtab): Update. * mdebugread.c (parse_symbol): Don't add objfile offsets. (parse_lines): Remove 'pst' parameter, replace with 'textlow'. Update. (parse_partial_symbols): Don't add objfile offsets. Use raw_text_low, raw_text_high. Update. (handle_psymbol_enumerators, psymtab_to_symtab_1): Update. * objfiles.c (objfile_relocate1): Don't relocate psymtabs_addrmap or call 'relocate' quick function. Clear psymbol_map. * psympriv.h (struct partial_symbol) <address>: Add section offset. <set_unrelocated_address>: Rename from set_address. <raw_text_low, raw_text_high>: New methods. <text_low, text_high>: Add objfile parameter. (add_psymbol_to_bcache): Add 'section' parameter. Call set_unrelocated_address. * psymtab.c (find_pc_sect_psymtab_closer, find_pc_sect_psymtab) (find_pc_psymbol): Update. (fixup_psymbol_section, relocate_psymtabs): Remove. (dump_psymtab, psym_functions): Update. (add_psymbol_to_bcache, add_psymbol_to_list): Add 'section' parameter. (maintenance_info_psymtabs, maintenance_check_psymtabs): Update. (start_psymtab_common): Update. * symfile-debug.c (debug_qf_relocate): Remove. (debug_sym_quick_functions): Update. * symfile.h (struct quick_symbol_functions) <relocate>: Remove. * xcoffread.c (scan_xcoff_symtab): Don't add objfile offsets. Update.
2018-07-26Add validity bits for psymtab high and low fieldsTom Tromey5-11/+30
Right now some psymtab code checks whether a psymtab's textlow or texthigh fields are valid by comparing against 0. I imagine this is mildly wrong in the current environment, but once psymtabs are relocated dynamically, it will no longer be correct, because it will be much more normal to see a psymtab with a textlow of zero -- this will just mean it appears at the start of the text section. This patch introduces validity bits to handle this situation more nicely, and changes users of the code to follow. gdb/ChangeLog 2018-07-26 Tom Tromey <tromey@redhat.com> * dbxread.c (end_psymtab): Use text_high_valid and text_low_valid. * mdebugread.c (parse_partial_symbols): Use text_low_valid. (psymtab_to_symtab_1): Use text_high_valid and text_low_valid. * psympriv.h (struct partial_symtab) <m_text_low, m_text_high>: Update comment. <text_low_valid, text_high_valid>: New fields. <set_text_low, set_text_high>: Update. * xcoffread.c (scan_xcoff_symtab): Use text_low_valid.
2018-07-26Introduce accessors for psymtab high and low fieldsTom Tromey7-97/+150
This introduces accessors for the partial symbol table textlow and texthigh fields. This lets us later arrange to relocate these values at their point of use. I did this conversion by renaming the fields. I didn't rename the fields back afterward, thinking that on the off chance that someone has a patch touching this area, then a merge would helpfully break their compile. I looked at making the fields private, but this interferes with the memset in allocate_psymtab, and I didn't want to chase this down. This conversion can be done later if need be. gdb/ChangeLog 2018-07-26 Tom Tromey <tom@tromey.com> * dbxread.c (read_dbx_symtab, end_psymtab, read_ofile_symtab): Update. * dwarf2read.c (dwarf2_create_include_psymtab): Don't initialize textlow and texthigh fields. (process_psymtab_comp_unit_reader, dwarf2_build_include_psymtabs): Update. * mdebugread.c (parse_lines, parse_partial_symbols) (psymtab_to_symtab_1): Update. * psympriv.h (struct partial_symtab) <m_text_low, m_text_high>: Rename fields. Update comment. Now private. <text_low, text_high, set_text_low, set_text_high>: New methods. * psymtab.c (find_pc_sect_psymtab_closer, find_pc_sect_psymtab) (find_pc_sect_psymbol, relocate_psymtabs, dump_psymtab) (start_psymtab_common, maintenance_info_psymtabs) (maintenance_check_psymtabs): Update. * xcoffread.c (xcoff_end_psymtab): Don't initialize textlow and texthigh fields. (scan_xcoff_symtab): Update.
2018-07-26Introduce partial_symbol::addressTom Tromey3-20/+53
This introduces a partial_symbol::address method. This method takes an objfile argument. This is necessary so that we can later relocate a partial symbol at its point of use. It also adds an accessor to compute the unrelocated value; and a method to be used for setting the field. Note that the new method doesn't actually perform any relocation yet. That will come in a subsequent patch. However, the comments are written to reflect the intended, rather than the temporary, semantics. gdb/ChangeLog 2018-07-26 Tom Tromey <tromey@redhat.com> * psympriv.h (struct partial_symbol) <unrelocated_address, address, set_address>: New methods. * psymtab.c (find_pc_sect_psymtab_closer, find_pc_sect_psymbol) (fixup_psymbol_section, relocate_psymtabs): Update. (print_partial_symbols): Add 'objfile' parameter. Update. (dump_psymtab, add_psymbol_to_bcache, psym_fill_psymbol_map): Update.
2018-07-26Change representation of psymbol to flush out accessorsTom Tromey4-101/+115
This is the psymbol analog to the patch to change the representation of minimal symbols: https://sourceware.org/ml/gdb-patches/2013-10/msg00524.html It has the same rationale: namely, that we're going to change the code to apply psymbol offsets at runtime. This will be done by adding an argument to the SYMBOL_VALUE_ADDRESS macro -- but since we can't convert all the symbol types at once, we need a new approach. Because gdb now is in C++, this patch changes partial_symbol to inherit from general_symbol_info, rather than renaming the field. This simplifies code in some places. Also, as noted before, these macros implement a kind of "phony polymorphism" that is not actually useful in practice; so this patch removes the macros in favor of simply referring directly to members. In a few cases -- obj_section in this patch and the symbol address in the future -- methods will be used instead. Note that this removes the blanket memset from add_psymbol_to_bcache. This hasn't really been needed since bcache was modified to allow holes in objects and since psymtab took advantage of that. This deletion was required due to changing partial_symbol to derive from general_symbol_info. gdb/ChangeLog 2018-07-26 Tom Tromey <tom@tromey.com> * dwarf-index-write.c (write_psymbols, debug_names::insert) (debug_names::write_psymbols): Update. * psympriv.h (struct partial_symbol): Derive from general_symbol_info. <obj_section>: New method. (PSYMBOL_DOMAIN, PSYMBOL_CLASS): Remove.n * psymtab.c (find_pc_sect_psymtab_closer, find_pc_sect_psymtab) (find_pc_sect_psymbol, fixup_psymbol_section) (match_partial_symbol, lookup_partial_symbol, relocate_psymtabs) (print_partial_symbols, recursively_search_psymtabs) (compare_psymbols, psymbol_hash, psymbol_compare) (add_psymbol_to_bcache, maintenance_check_psymtabs) (psymbol_name_matches, psym_fill_psymbol_map): Update.
2018-07-26Remove dead code in end_psymtabTom Tromey2-7/+5
I noticed that there is a bit of dead code in end_psymtab. This deletes it. Normally I would investigate a fix for the code. However, considering that the code has been this way a long time (since the first import to sourceware) and considering that dbxread.c is not as important any more, I think it's safe to just consider that there's no bug. gdb/ChangeLog 2018-07-26 Tom Tromey <tromey@redhat.com> * dbxread.c (end_psymtab): Remove dead code.
2018-07-26[gdb/testsuite] Add comment in gdb.base/vla-optimized-out.cTom de Vries2-0/+7
2018-07-26 Tom de Vries <tdevries@suse.de> * gdb.base/vla-optimized-out.c: Add comment about origin of test-case.
2018-07-26PowerPC Improve support for Gekko & BroadwayAlex Chadwick12-13/+323
This is a relatively straightforward patch to improve support for the IBM Gekko and IBM Broadway processors. Broadway is functionally equivalent to the IBM 750CL, while Gekko's functionality is a subset of theirs. The patch simplifies this reality and adds -mgekko and -mbroadway as aliases for -m750cl. I didn't feel it was worth wasting a PPC_OPCODE_* bit to differentiate Gekko. The patch adds a number of simplified mnemonics for special purpose register access. Notably, Broadway adds 4 additional IBAT and DBAT registers but these are not assigned sequential SPR numbers. gas/ * config/tc-ppc.c (md_show_usage): Add -mgekko and -mbroadway. * doc/as.texi (Target PowerPC options): Add -mgekko and -mbroadway. * doc/c-ppc.texi (PowerPC-Opts): Likewise. * testsuite/gas/ppc/broadway.d, * testsuite/gas/ppc/broadway.s: New test for broadway. * testsuite/gas/ppc/ppc.exp: Run new test. include/ * opcode/ppc.h (PPC_OPCODE_750): Adjust comment. opcodes/ * ppc-dis.c (ppc_opts): Add -mgekko and -mbroadway. (powerpc_init_dialect): Handle bfd_mach_ppc_750. * ppc-opc.c (insert_sprbat, extract_sprbat): New functions to support disjointed BAT. (powerpc_operands): Allow extra bit in SPRBAT_MASK. Add SPRGQR. (XSPRGQR_MASK, GEKKO, BROADWAY): Define. (powerpc_opcodes): Add 750cl extended mnemonics for spr access.
2018-07-26Re: Enhance powerpc ld -r --relaxAlan Modra2-3/+7
git commit 491993044ba6 broke the powerpc vxworks testsuite. * testsuite/ld-powerpc/vxworks-relax-2.rd: Update for 2018-07-25 ppc_elf_relax_section changes.
2018-07-26gdb: Add switch to disable DWARF stack unwindersAndrew Burgess11-2/+106
Add a maintenance command to disable the DWARF stack unwinders. Normal users would not need this feature, but it is useful to allow extended testing of fallback stack unwinding strategies, for example, prologue scanners. This is a partial implementation of the idea discussed in pr gdb/8434, which talks about a generic ability to disable any frame unwinder. Being able to arbitrarily disable any frame unwinder would be a more complex patch, and I was unsure how useful such a feature would really be, however, I can see (and have) a real need to disable DWARF unwinders. That's why this patch only targets that specific set of unwinders. If in the future we find ourselves adding more switches to disable different unwinders, then we should probably move to a more generic solution, and remove this patch. gdb/ChangeLog: * dwarf2-frame-tailcall.c (tailcall_frame_sniffer): Exit early if DWARF unwinders are disabled. * dwarf2-frame.c: Add dwarf2read.h include. (dwarf2_frame_sniffer): Exit early if DWARF unwinders are disabled. (dwarf2_frame_unwinders_enabled_p): Define. (show_dwarf_unwinders_enabled_p): New function. (_initialize_dwarf2_frame): Register switch to control DWARF unwinder use. * dwarf2-frame.h (dwarf2_frame_unwinders_enabled_p): Declare. * dwarf2read.c (set_dwarf_cmdlist): Remove static keyword. (show_dwarf_cmdlist): Remove static keyword. * dwarf2read.h (set_dwarf_cmdlist): Declare. (show_dwarf_cmdlist): Declare. * NEWS: Document new feature. gdb/doc/ChangeLog: * gdb.texinfo (Maintenance Commands): Add description of maintenance command to control dwarf unwinders. gdb/testsuite/ChangeLog: * gdb.base/maint.exp: Add check that dwarf unwinders control flag is visible.
2018-07-26Implement PowerPC64 .localentry for value 1Alan Modra10-31/+106
This adds support for ".localentry 1", a new st_other STO_PPC64_LOCAL_MASK encoding that signifies a function with a single entry point like ".localentry 0", but unlike a ".localentry 0" function does not preserve r2. include/ * elf/ppc64.h: Specify byte offset to local entry for values of two to six in STO_PPC64_LOCAL_MASK. Clarify r2 return value for such functions when entering via global entry point. Specify meaning of a value of one in STO_PPC64_LOCAL_MASK. bfd/ * elf64-ppc.c (ppc64_elf_size_stubs): Use a ppc_stub_long_branch_r2off for calls to symbols with STO_PPC64_LOCAL_MASK bits set to 1. gas/ * config/tc-ppc.c (ppc_elf_localentry): Allow .localentry values of 1 and 7 to directly set value into STO_PPC64_LOCAL_MASK bits. ld/testsuite/ * ld-powerpc/elfv2.s: Add .localentry f5,1 testcase. * ld-powerpc/elfv2exe.d: Update. * ld-powerpc/elfv2so.d: Update.
2018-07-26Automatic date update in version.inGDB Administrator1-1/+1
2018-07-26[gdb/breakpoints] Fix sigsegv in info prog at exec catchpointTom de Vries5-1/+80
With the test-case contained in this patch and compiled for debug we run into a segfault with trunk gdb: ... $ gdb catch-follow-exec -batch -ex "catch exec" \ -ex "set follow-exec-mode new" -ex "run" -ex "info prog" Catchpoint 1 (exec) process xxx is executing new program: /usr/bin/ls [New inferior 2 (process 0)] [New process xxx] Thread 2.1 "ls" hit Catchpoint 1 (exec'd /usr/bin/ls), in _start () from /lib64/ld-linux-x86-64.so.2 Segmentation fault (core dumped) ... The patch fixes the segfault by returning an error in info_program_command if get_last_target_status returns minus_one_ptid. The test-case is non-standard, because the standard approach runs into PR23368, a problem with gdb going to the background. Build and reg-tested on x86_64-linux. 2018-07-26 Tom de Vries <tdevries@suse.de> PR breakpoints/23366 * infcmd.c (info_program_command): Handle ptid == minus_one_ptid. * gdb.base/catch-follow-exec.c: New test. * gdb.base/catch-follow-exec.exp: New file.
2018-07-25x86: Expand Broadcast to 3 bitsH.J. Lu6-409/+521
Expand Broadcast to 3 bits so that the number of bytes to broadcast can be computed as 1 << (Broadcast - 1). Use it to simplify x86 assembler. gas/ * config/tc-i386.c (Broadcast_Operation): Add bytes. (build_evex_prefix): Use i.broadcast->bytes. (match_broadcast_size): New function. (check_VecOperands): Use the broadcast field to compute the number of bytes to broadcast directly. Set i.broadcast->bytes. Use match_broadcast_size. opcodes/ * i386-gen.c (adjust_broadcast_modifier): New function. (process_i386_opcode_modifier): Add an argument for operands. Adjust the Broadcast value based on operands. (output_i386_opcode): Pass operand_types to process_i386_opcode_modifier. (process_i386_opcodes): Pass NULL as operands to process_i386_opcode_modifier. * i386-opc.h (BYTE_BROADCAST): New. (WORD_BROADCAST): Likewise. (DWORD_BROADCAST): Likewise. (QWORD_BROADCAST): Likewise. (i386_opcode_modifier): Expand broadcast to 3 bits. * i386-tbl.h: Regenerated.
2018-07-26[gdb/symtab] Warn about unresolved DW_AT_upper_bound/DW_AT_countTom de Vries2-2/+22
This patch generates a warning if DW_AT_upper_bound or DW_AT_count is defined, but can't be translated. This is triggered for current gcc in lto mode for vla test-cases. Build and reg-tested on x86_64-linux. 2018-07-26 Tom de Vries <tdevries@suse.de> * dwarf2read.c (read_subrange_type): Warn if DW_AT_upper_bound or DW_AT_count can't be translated to a dynamic prop.
2018-07-25[gdb/exp] Fix exception when printing optimized out vlaTom de Vries4-1/+66
When compiling vla-optimized-out.c with -O3 and a recent gcc, and trying to print the vla a in f1, we run into this gdb exception: ... Cannot find matching parameter at DW_TAG_call_site 0x4003be at main ... This is a regression introduced by 42dc7699a2 "[gdb/exp] Fix printing of type of optimized out vla". This patch fixes the regression by wrapping the ctx.eval call in dwarf2_locexpr_baton_eval in try/catch, similar to what is done in dwarf2_evaluate_loc_desc_full. Build and reg-tested on x86_64-linux. 2018-07-25 Tom de Vries <tdevries@suse.de> * dwarf2loc.c (dwarf2_locexpr_baton_eval): Wrap ctx.eval call in try/catch. * gdb.base/vla-optimized-out-o3.exp: New file. Reuse vla-optimized-out.c.
2018-07-25Notify about breakpoint modification when enabling/disabling single locationJan Vrany5-0/+103
When a single breakpoint location enableness was modified by a CLI command, observers were not notified about it. This issue is now fixed. gdb/ChangeLog: * breakpoint.c (enable_disable_bp_num_loc): Notify observers. gdb/testsuite/ChangeLog: * gdb.mi/mi-breakpoint-location-ena-dis.cc: New file. * gdb.mi/mi-breakpoint-location-ena-dis.exp: New file.
2018-07-25list Tom Tromey as GDB Global MaintainerJoel Brobecker2-0/+5
gdb/ChangeLog: * MAINTAINERS (Global Maintainers): Add Tom Tromey.
2018-07-25Clarify doc for .arch/.cpuThomas Preud'homme2-2/+10
Documentation for .arch and .cpu directives currently says that it accepts the same name as -march/-mcpu command-line options respectively. However it only accept the architecture/CPU part of those options: it does not accept specifying an extension which is done via .arch_extension. This patch clarifies that the extension is not accepted. 2018-07-25 Thomas Preud'homme <thomas.preudhomme@linaro.org> gas/ * doc/c-arm.texi (.arch directive): Clarify that name must not include an extension. (.cpu directive): Likewise.
2018-07-25Fix potential memory leaks in some of the binutils source files.Nick Clifton4-61/+120
* rdcoff.c (parse_coff_struct_type): Free fields array upon early exit. (parse_coff_enum_type): Free names and vals arrays upon early exit. * rddbg.c (read_section_stabs_debugging_info): Free shandle and strings and stabs arrays upon early exit. * readelf.c (get_32bit_section_headers): Free shdrs structure upon early exit. (get_64bit_section_headers): Likewise. (get_32bit_elf_symbols): Generate an error if multiple symbol table index sections are associated with the same symbol section. (get_64bit_elf_symbols): Likewise. (process_dynamic_section): Generate an error if there are multiple dynamic symbol table sections, multiple dynamic string tables or multiple dynamic symbol information sections.