aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-03-30Add support for the WebAssembly file format and the wasm32 ELF conversion to ↵Pip Cet99-1851/+4355
gas and the binutils. binutils * readelf.c: Add support for wasm32 ELF format WebAssembly files. (guess_is_rela): Likewise. (dump_relocations): Likewise. (is_32bit_abs_reloc): Likewise. (is_none_reloc_): Likewise. * NEWS: Mention the new support. * testsuite/lib/binutils-common.exp (is_elf_format): Mark wasm32 as ELF target. (supports_gnu_unique): Mark wasm32 as supporting STB_GNU_UNIQUE. * testsuite/binutils-all/nm.exp: Mark wasm32 as requiring .size annotations. * testsuite/binutils-all/wasm32: New directory. * testsuite/binutils-all/wasm32/create-wasm.d: New file. * testsuite/binutils-all/wasm32/create-wasm.s: Likewise. * testsuite/binutils-all/wasm32/custom-section.d: Likewise. * testsuite/binutils-all/wasm32/custom-section.s: Likewise. * testsuite/binutils-all/wasm32/invalid-wasm-1.d: Likewise. * testsuite/binutils-all/wasm32/invalid-wasm-1.s: Likewise. * testsuite/binutils-all/wasm32/long-sections.d: Likewise. * testsuite/binutils-all/wasm32/long-sections.s: Likewise. * testsuite/binutils-all/wasm32/parse-wasm.d: Likewise. * testsuite/binutils-all/wasm32/parse-wasm.s: Likewise. * testsuite/binutils-all/wasm32/parse-wasm-2.d: Likewise. * testsuite/binutils-all/wasm32/parse-wasm-2.s: Likewise. * testsuite/binutils-all/wasm32/prepared-section.d: Likewise. * testsuite/binutils-all/wasm32/prepared-section.s: Likewise. * testsuite/binutils-all/wasm32/wasm32.exp: New file, run tests. gas * config/tc-wasm32.h: New file: Add WebAssembly assembler target. * config/tc-wasm32.c: New file: Add WebAssembly assembler target. * Makefile.am: Add WebAssembly assembler target. * configure.tgt: Add WebAssembly assembler target. * doc/c-wasm32.texi: New file: Start documenting WebAssembly assembler. * doc/all.texi: Define WASM32. * doc/as.texinfo: Add WebAssembly entries. * NEWS: Mention the new support. * Makefile.in: Regenerate. * po/gas.pot: Regenerate. * po/POTFILES.in: Regenerate. * testsuite/gas/wasm32: New directory. * testsuite/gas/wasm32/allinsn.d: New file. * testsuite/gas/wasm32/allinsn.s: New file. * testsuite/gas/wasm32/illegal.l: New file. * testsuite/gas/wasm32/illegal.s: New file. * testsuite/gas/wasm32/illegal-2.l: New file. * testsuite/gas/wasm32/illegal-2.s: New file. * testsuite/gas/wasm32/illegal-3.l: New file. * testsuite/gas/wasm32/illegal-3.s: New file. * testsuite/gas/wasm32/illegal-4.l: New file. * testsuite/gas/wasm32/illegal-4.s: New file. * testsuite/gas/wasm32/illegal-5.l: New file. * testsuite/gas/wasm32/illegal-5.s: New file. * testsuite/gas/wasm32/illegal-6.l: New file. * testsuite/gas/wasm32/illegal-6.s: New file. * testsuite/gas/wasm32/illegal-7.l: New file. * testsuite/gas/wasm32/illegal-7.s: New file. * testsuite/gas/wasm32/illegal-8.l: New file. * testsuite/gas/wasm32/illegal-8.s: New file. * testsuite/gas/wasm32/illegal-9.l: New file. * testsuite/gas/wasm32/illegal-9.s: New file. * testsuite/gas/wasm32/illegal-10.l: New file. * testsuite/gas/wasm32/illegal-10.s: New file. * testsuite/gas/wasm32/illegal-11.l: New file. * testsuite/gas/wasm32/illegal-11.s: New file. * testsuite/gas/wasm32/illegal-12.l: New file. * testsuite/gas/wasm32/illegal-12.s: New file. * testsuite/gas/wasm32/illegal-13.l: New file. * testsuite/gas/wasm32/illegal-13.s: New file. * testsuite/gas/wasm32/illegal-14.l: New file. * testsuite/gas/wasm32/illegal-14.s: New file. * testsuite/gas/wasm32/illegal-15.l: New file. * testsuite/gas/wasm32/illegal-15.s: New file. * testsuite/gas/wasm32/illegal-16.l: New file. * testsuite/gas/wasm32/illegal-16.s: New file. * testsuite/gas/wasm32/illegal-17.l: New file. * testsuite/gas/wasm32/illegal-17.s: New file. * testsuite/gas/wasm32/illegal-18.l: New file. * testsuite/gas/wasm32/illegal-18.s: New file. * testsuite/gas/wasm32/illegal-19.l: New file. * testsuite/gas/wasm32/illegal-19.s: New file. * testsuite/gas/wasm32/illegal-20.l: New file. * testsuite/gas/wasm32/illegal-20.s: New file. * testsuite/gas/wasm32/illegal-21.l: New file. * testsuite/gas/wasm32/illegal-21.s: New file. * testsuite/gas/wasm32/illegal-22.l: New file. * testsuite/gas/wasm32/illegal-22.s: New file. * testsuite/gas/wasm32/illegal-24.l: New file. * testsuite/gas/wasm32/illegal-24.s: New file. * testsuite/gas/wasm32/illegal-25.l: New file. * testsuite/gas/wasm32/illegal-25.s: New file. * testsuite/gas/wasm32/reloc.d: New file. * testsuite/gas/wasm32/reloc.s: New file. * testsuite/gas/wasm32/wasm32.exp: New tests for WebAssembly architecture. opcodes * configure.ac: Add (empty) bfd_wasm32_arch target. * configure: Regenerate * po/opcodes.pot: Regenerate. include * opcode/wasm.h: New file to support wasm32 architecture. * elf/wasm32.h: Add R_WASM32_32 relocation. bfd * elf32-wasm32.c: Add relocation code, two relocs. * reloc.c: Add wasm32 relocations. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. * bfd/po/bfd.pot: Regenerate.
2017-03-30Fix classification of `module.type' in D lexer.Iain Buclaw3-0/+120
The two-tier lexer in gdb/d-exp.y, which resolves fully qualified names missed a case where `module.type' was not being classified as one token. And so when the grammar takes over, it matched the remaining tokens against the rule `TypeExp . IdentifierExp', where we were expecting to instead match cast expression `( TypeExp ) UnaryExpression'. Adding a case for TYPE_CODE_MODULE in type_aggregate_p means that classify_inner_name will get a chance to lookup the symbol. This was noticed when using `watch -l', and got the rather confusing response: A syntax error in expression, near `) 0x0add4e55'. So it's been included in the testsuite, along with another test that does effectively the same expression, but explicitly. gdb/ChangeLog: * d-exp.y (type_aggregate_p): Treat TYPE_CODE_MODULE as being aggregate-like. gdb/testsuite/ChangeLog: * gdb.dlang/watch-loc.c: New file. * gdb.dlang/watch-loc.exp: New file.
2017-03-30Automatic date update in version.inGDB Administrator1-1/+1
2017-03-29Fix warning: Invalid entry in .debug_gdb_scripts sectionJan Kratochvil4-1/+48
$ gdb rustc Reading symbols from rustc...Reading symbols from /usr/lib/debug/usr/bin/rustc.debug...done. done. warning: Invalid entry in .debug_gdb_scripts section /usr/bin/rustc Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al [15] .debug_gdb_scripts PROGBITS 00000000000008ed 0008ed 000022 00 AMS 0 0 1 /usr/lib/debug/usr/bin/rustc.debug Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al [15] .debug_gdb_scripts NOBITS 00000000000008ed 000280 000022 00 AMS 0 0 1 There remains questionable whether bfd_get_section_by_name() should not return an error for !SEC_LOAD but I haven't investigated that. gdb/ChangeLog 2017-03-29 Jan Kratochvil <jan.kratochvil@redhat.com> * auto-load.c (auto_load_section_scripts): Check SEC_HAS_CONTENTS. gdb/testsuite/ChangeLog 2017-03-29 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.python/py-section-script.exp (sepdebug): New testcases.
2017-03-29opcodes: sparc: support missing SPARC ASIs from UA2005, UA2007, OSA2011, & ↵Jose E. Marchesi2-0/+34
OSA2015
2017-03-29Add constructor and destructor to thread_infoYao Qi3-60/+76
This patch adds constructor and destructor to thread_info. gdb: 2017-03-29 Yao Qi <yao.qi@linaro.org> * gdbthread.h (struct thread_info): Declare constructor and destructor. Add some in-class member initializers. * thread.c (free_thread): Remove. (init_thread_list): Call delete instead of free_thread. (new_thread): Call thread_info constructor. (thread_info::thread_info): New function. (thread_info::~thread_info): New function. (delete_thread_1): Call delete instead of free_thread. (make_cleanup_restore_current_thread): Move tp and frame to inner block.
2017-03-29PowerPC -Mraw disassemblyAlan Modra8-54/+112
This adds -Mraw for PowerPC objdump, a disassembler option to display the underlying machine instruction rather than aliases. For example, "rlwinm" always rather than "rotlwi" when the instruction is performing a simple rotate. binutils/ * doc/binutils.texi (objdump): Document PowerPC -M options. gas/ * config/tc-ppc.c (md_parse_option): Reject -mraw. include/ * opcode/ppc.h (PPC_OPCODE_RAW): Define. (PPC_OPCODE_*): Make them all unsigned long long constants. opcodes/ * ppc-dis.c (ppc_opts): Set PPC_OPCODE_PPC for "any" flags. Add "raw" option. (lookup_powerpc): Don't special case -1 dialect. Handle PPC_OPCODE_RAW. (print_insn_powerpc): Mask out PPC_OPCODE_ANY on first lookup_powerpc call, pass it on second.
2017-03-29Improve the speed of scanning PE binaries for line number information.Nick Clifton4-12/+60
PR binutils/18025 * coff-bfd.h (struct coff_section_data): Add new fields: saved_bias and bias. * coffgen.c (coff_find_nearest_line_with_names): Cache the bias computed for PE binaries. * dwarf2.c (scan_unit_for_symbols): Only warn once about each missing abbrev.
2017-03-29Automatic date update in version.inGDB Administrator1-1/+1
2017-03-28Fix for PR ld/16044: elf32-cris.c h->plt.refcount inconsistencyHans-Peter Nilsson7-2/+75
2017-03-28arc: Add prologue analysisAnton Kolesov7-22/+1603
Add a prologue analysis that recognizes all instructions that may happen in compiler-generated prologue, including various stores, core register moves, subtraction and ENTER_S instruction that does a lot of prologue actions through microcode. Testcases cover various prologue scenarios, including instructions that are spread across multiple 16-bit encodings (for example there are 7 encodings of store instruction). gdb/ChangeLog: yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com> * arc-tdep.c (arc_frame_cache): Add support for prologue analysis. (arc_skip_prologue): Likewise. (arc_make_frame_cache): Likewise. (arc_pv_get_operand): New function. (arc_is_in_prologue): Likewise. (arc_analyze_prologue): Likewise. (arc_print_frame_cache): Likewise. (MAX_PROLOGUE_LENGTH): New constant. gdb/doc/ChangeLog: yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com> * gdb.texinfo (Synopsys ARC): Document "set debug arc 2". gdb/testsuite/ChangeLog: yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com> * gdb.arch/arc-analyze-prologue.S: New file. * gdb.arch/arc-analyze-prologue.exp: Likewise.
2017-03-28arc: Add disassembler helperAnton Kolesov9-1/+1509
Add disassembler helper for GDB, that uses opcodes structure arc_instruction and adds convenience functions to handle instruction operands. This interface solves at least those problems with arc_instruction: * Some instructions, like "push_s", have implicit operands which are not directly present in arc_instruction. * Operands of particular meaning, like branch/jump targets, have various locations and meaning depending on type of branch/target. * Access to operand value is abstracted into a separate function, so callee code shouldn't bother if operand value is an immediate value or in a register. Testcases included in this commit are fairly limited - they test exclusively branch instructions, something that will be used in software single stepping. Most of the other parts of this disassembler helper are tested during prologue analysis testing. gdb/ChangeLog: yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com> * configure.tgt: Add arc-insn.o. * arc-tdep.c (arc_delayed_print_insn): Make non-static. (dump_arc_instruction_command): New function. (arc_fprintf_disasm): Likewise. (arc_disassemble_info): Likewise. (arc_insn_get_operand_value): Likewise. (arc_insn_get_operand_value_signed): Likewise. (arc_insn_get_memory_base_reg): Likewise. (arc_insn_get_memory_offset): Likewise. (arc_insn_get_branch_target): Likewise. (arc_insn_dump): Likewise. (arc_insn_get_linear_next_pc): Likewise. * arc-tdep.h (arc_delayed_print_insn): Add function declaration. (arc_disassemble_info): Likewise. (arc_insn_get_branch_target): Likewise. (arc_insn_get_linear_next_pc): Likewise. * NEWS: Mention new "maint print arc arc-instruction". gdb/doc/ChangeLog: yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com> * gdb.texinfo (Synopsys ARC): Add "maint print arc arc-instruction". gdb/testsuite/ChangeLog: yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com> * gdb.arch/arc-decode-insn.S: New file. * gdb.arch/arc-decode-insn.exp: Likewise.
2017-03-28arc: Add "maintenance print arc" command prefixAnton Kolesov2-0/+24
Add an "arc" sublist to "maintenance print" command list. The list is empty for now, its purpose is to contain commands that print internal state of some ARC-specific structures. gdb/ChangeLog: yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com> * arc-tdep (maintenance_print_arc_list): New variable. (maintenance_print_arc_command): New function.
2017-03-28arc: Align internal regnums with architectural regnumsAnton Kolesov3-7/+45
Add ARC_LIMM_REGNUM to arc_regnum enumeration and assign a number 62 to it. This ensures that for core registers internal register numbers in this enum are the same as architectural numbers. This allows to use internal register numbers in the contexts where architectural number is implied, for example when disassembling instruction during prologue analysis. gdb/ChangeLog: yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com> * arc-tdep.c (core_v2_register_names, core_arcompact_register_names) Add "limm" and "reserved". (arc_cannot_fetch_register, arc_cannot_store_register): Add ARC_RESERVED_REGNUM and ARC_LIMM_REGNUM. * arc-tdep.h (arc_regnum): Likewise.
2017-03-28Automatic date update in version.inGDB Administrator1-1/+1
2017-03-27gdbserver: xtensa: support THREADPTR registerMax Filippov2-0/+19
Provide aceess to the THREADPTR register to remote gdb. gdb/gdbserver/ 2017-03-27 Max Filippov <jcmvbkbc@gmail.com> * linux-xtensa-low.c (regnum::R_THREADPTR): New enum member. (xtensa_fill_gregset): Call collect_register_by_name for threadptr register. (xtensa_store_gregset): Call supply_register_by_name for threadptr register.
2017-03-27gdb: xtensa-linux: support THREADPTR registerMax Filippov4-0/+23
Make THREADPTR user register accessible. gdb/ 2017-03-27 Max Filippov <jcmvbkbc@gmail.com> * xtensa-linux-nat.c (fill_gregset): Call regcache_raw_collect for THREADPTR register. (supply_gregset_reg): Call regcache_raw_supply for THREADPTR register. * xtensa-tdep.c (XTENSA_DBREGN_UREG): New definition. (xtensa_derive_tdep): Initialize tdep->threadptr_regnum. * xtensa-tdep.h (gdbarch_tdep::threadptr_regnum): New field.
2017-03-27gdb: xtensa: fix test for privileged register numberMax Filippov2-1/+8
There are no a0-a15 pseudoregisters at the top of the register set in call0 registers layout. All registers above gdbarch_num_regs (gdbarch) are privileged. Treat them as such. This fixes the following gdb assertion seen when 'finish' command is invoked: regcache.c:649: internal-error: register_status regcache_raw_read(regcache*, int, gdb_byte*): Assertion `regnum >= 0 && regnum < regcache->descr->nr_raw_registers' failed. gdb/ 2017-03-27 Max Filippov <jcmvbkbc@gmail.com> * xtensa-tdep.c (xtensa_pseudo_register_read): Treat all registers above gdbarch_num_regs (gdbarch) as privileged in call0 ABI.
2017-03-27gdbserver: xtensa: add call0 supportMax Filippov2-0/+35
Correctly handle a0- registers on requests from remote gdb. This fixes 'Register 1 is not available' and subsequent assertion in the remote gdb connecting to the gdbserver: 'findvar.c:291: internal-error: value_of_register_lazy: Assertion `frame_id_p(get_frame_id (frame))' failed.' The register structure is the same for windowed and call0 ABIs because currently linux kernel internally requires windowed registers, so they are always present. gdb/gdbserver/ 2017-03-27 Max Filippov <jcmvbkbc@gmail.com> * linux-xtensa-low.c (xtensa_fill_gregset): Call collect_register for all registers in a0_regnum..a0_regnum + C0_NREGS range. (xtensa_store_gregset): Call supply_register for all registers in a0_regnum..a0_regnum + C0_NREGS range.
2017-03-27gdb: xtensa-linux: add call0 supportMax Filippov2-0/+37
Correctly handle a0- registers. This allows debugging call0 code in linux natively. The register structure is the same for windowed and call0 ABIs because currently linux kernel internally requires windowed registers, so they are always present. gdb/ 2017-03-27 Max Filippov <jcmvbkbc@gmail.com> * xtensa-linux-nat.c (fill_gregset): Call regcache_raw_collect for a single specified register or for all registers in a0_base..a0_base + C0_NREGS range. (supply_gregset_reg): Call regcache_raw_supply for a single specified register or for all registers in a0_base..a0_base + C0_NREGS range.
2017-03-27gdb: gdbserver: xtensa: make C0_NREGS availableMax Filippov3-1/+7
Both gdb and gdbserver need this definition to properly work with call0 ABI. Make it available to both. gdb/ 2017-03-27 Max Filippov <jcmvbkbc@gmail.com> * arch/xtensa.h (C0_NREGS): Add definition. * xtensa-tdep.c (C0_NREGS): Remove definition.
2017-03-27gdb: xtensa: clean up xtensa_default_isa initializationMax Filippov2-4/+9
This fixes segfault in native gdb because isa is not initialized at the point of call to xtensa_isa_maxlength. gdb/ 2017-03-27 Max Filippov <jcmvbkbc@gmail.com> * xtensa-tdep.c (xtensa_scan_prologue, call0_analyze_prologue): Drop xtensa_default_isa initialization. (xtensa_gdbarch_init): Initialize xtensa_default_isa.
2017-03-27dwarf2read.c: Clean up out of bounds handlingPedro Alves2-70/+106
Multiple places in dwarf2read.c open code 1-based to 0-based index conversion and check for out of bounds accesses to lh->include_dirs and lh->file_names. This commit factors those out to a couple methods and uses them throughout. gdb/ChangeLog: 2017-03-27 Pedro Alves <palves@redhat.com> * dwarf2read.c (file_entry) <dir_index>: Add comment. (file_entry::include_dir): New method. (line_header::include_dir_at, line_header::file_name_at): New methods. (setup_type_unit_groups, setup_type_unit_groups) (psymtab_include_file_name): Simplify using the new methods. (lnp_state_machine) <the_line_header>: New field. <file>: Add comment. (lnp_state_machine::current_file): New method. (dwarf_record_line): Simplify using the new methods. (init_lnp_state_machine): Initialize the "the_line_header" field. (dwarf_decode_lines_1, dwarf_decode_lines, file_file_name): Simplify using the new methods.
2017-03-27gdb/cp-name-parser.y: Eliminate make_empty, use cplus_demangle_fill_componentPedro Alves2-46/+21
The demangler exports the cplus_demangle_fill_component function that clients should use to initialize demangle_component components that use the "s_binary" union member. cp-name-parser.y uses it in some places, via the fill_comp wrapper, but not all. Several places instead use a GDB-specific "make_empty" function. Because this function does not call any of the demangler "fill" functions, we had to patch it recently to clear the allocated demangle_component's "d_printing" field, which is supposedly a "private" demangler field. To avoid such problems in the future, this commit switches those places to use "fill_comp" instead, and eliminates the "make_empty" function. gdb/ChangeLog: 2017-03-27 Pedro Alves <palves@redhat.com> * cp-name-parser.y (make_empty): Delete. (demangler_special, nested_name, ptr_operator, array_indicator) (direct_declarator, declarator_1): Use fill_comp instead of make_empty.
2017-03-27cplus_demangle_fill_component: Handle DEMANGLE_COMPONENT_RVALUE_REFERENCEPedro Alves2-0/+6
This patch almost a decade ago: ... 2007-08-31 Douglas Gregor <doug.gregor@gmail.com> * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_RVALUE_REFERENCE. (d_make_comp): Ditto. ... ... missed doing the same change to cplus_demangle_fill_component that was done to d_make_comp. I.e., teach it to only validate that we're not passing in a "right" subtree. GDB has recently (finally) learned about rvalue references, and a change to make it use cplus_demangle_fill_component more ran into an assertion because of this. (GDB is the only user of cplus_demangle_fill_component in both the gcc and binutils-gdb trees.) libiberty/ChangeLog: 2017-03-27 Pedro Alves <palves@redhat.com> * cp-demint.c (cplus_demangle_fill_component): Handle DEMANGLE_COMPONENT_RVALUE_REFERENCE.
2017-03-27Add support for the WebAssembly backend to the BFD library.Pip Cet12-665/+1630
* wasm-module.c: New file to support WebAssembly modules. * wasm-module.h: New file to support WebAssembly modules. * doc/webassembly.texi: Start documenting wasm-module.c. * config.bfd: Add wasm_vec. * targets.c: Likewise. * configure.ac: Likewise. * Makefile.am: Add entries for wasm-module.c. * Makefile.in: Regenerate. * configure: Regenerate. * po/SRC-POTFILES.in: Regenerate.
2017-03-27Fix gdb_xml_debug/gdb_xml_error ATTRIBUTE_PRINTF usePedro Alves4-5/+14
The declarations of gdb_xml_debug and gdb_xml_error are passing "0" as "first-to-check" argument to ATTRIBUTE_PRINTF, as if they were va_args functions. Consequently, the arguments to gdb_xml_debug / gdb_xml_error aren't being checked against the format strings. With that fixed, a couple obvious bugs are exposed, both fixed by this commit. gdb/ChangeLog: 2017-03-27 Pedro Alves <palves@redhat.com> * xml-support.h (gdb_xml_debug): Pass a "first-to-check" argument to ATTRIBUTE_PRINTF. * solib-target.c (library_list_start_list): Print "string" not "version". * xml-tdesc.c (tdesc_start_field): Pass "field_name" to gdb_xml_error call.
2017-03-27PR21303, objdump doesn't show e200z4 insnsAlan Modra6-2/+44
PR 21303 opcodes/ * ppc-dis.c (struct ppc_mopt): Comment. (ppc_opts <e200z4>): Move PPC_OPCODE_VLE from .sticky to .cpu. gas/ * testsuite/gas/ppc/pr21303.d, * testsuite/gas/ppc/pr21303.s: New test * testsuite/gas/ppc/ppc.exp: Run it.
2017-03-27gdb: Make ldirname return a std::stringPedro Alves7-78/+90
Eliminates several uses of cleanups. Tested on x86_64 Fedora 23 with Python 2 and 3. gdb/ChangeLog 2017-03-27 Pedro Alves <palves@redhat.com> * dwarf2read.c (struct file_and_directory): New. (dwarf2_get_dwz_file): Adjust to use std::string. (dw2_get_file_names_reader): Adjust to use file_and_directory. (find_file_and_directory): Adjust to return a file_and_directory object. (read_file_scope): Adjust to use file_and_directory. Remove make_cleanup/do_cleanups calls. (open_and_init_dwp_file): Adjust to use std::string. Remove make_cleanup/do_cleanups calls. * python/python.c (do_start_initialization): Adjust to ldirname returning a std::string. * utils.c (ldirname): Now returns a std::string. * utils.h (ldirname): Change return type to std::string. * xml-syscall.c (xml_init_syscalls_info): Adjust to ldirname returning a std::string. * xml-tdesc.c (file_read_description_xml): Likewise.
2017-03-27oops - forgot to add the bfd/ChangeLog entry...Pip Cet1-0/+14
2017-03-27Add minimal support for WebAssembly backend to the BFD library.Pip Cet13-0/+148
include * elf/wasm32.h: New file to support wasm32 architecture. bfd * cpu-wasm32.c: New file to support wasm32 architecture. * elf32-wasm32.c: New file to support wasm32 architecture. * Makefile.am: Add wasm32 architecture. * archures.c: Likewise. * config.bfd: Likewise. * configure.ac: Likewise. * targets.c: Likewise.
2017-03-27Implement ARC NPS-400 Ultra Ip and Miscellaneous instructions.Rinat Zelig8-356/+759
opcodes * arc-nps400-tbl.h: Add Ultra Ip and Miscellaneous instructions format. * arc-opc.c: Add defines. e.g. F_NJ, F_NM , F_NO_T, F_NPS_SR, F_NPS_M, F_NPS_CORE, F_NPS_ALL. (insert_nps_misc_imm_offset): New function. (extract_nps_misc imm_offset): New function. (arc_num_flag_operands): Add F_NJ, F_NM, F_NO_T. (arc_flag_special_cases): Add F_NJ, F_NM, F_NO_T. include * opcode/arc.h (insn_class_t): Add ULTRAIP and MISC class. gas * testsuite/gas/arc/nps400-12.s: New file. * testsuite/gas/arc/nps400-12.d: New file.
2017-03-27Automatic date update in version.inGDB Administrator1-1/+1
2017-03-25Fix bug with cmn/adds where C flag was incorrectly set.Jim Wilson4-1/+27
sim/aarch64/ * simulator.c (set_flags_for_add32): Cast result to uint32_t in carry flag check. sim/testsuite/sim/aarch64/ * adds.s: Add checks for values -2 and 1, where C is not set.
2017-03-26Automatic date update in version.inGDB Administrator1-1/+1
2017-03-25Automatic date update in version.inGDB Administrator1-1/+1
2017-03-24Remove MAX_REGISTER_SIZE from target.cAlan Hayward4-39/+52
gdb/ * regcache.c (regcache_debug_print_register): New function. * regcache.h (regcache_debug_print_register): New declaration. * target.c (debug_print_register): Remove. (target_fetch_registers): Call regcache_debug_print_register. (target_store_registers): Likewise.
2017-03-24Avoid segfault on invalid directory tablePádraig Brady2-6/+22
gdb was segfaulting during backtrace on a binary here, where fe->dir_index parsed from the DWARF info was seen to access beyond the provided include_dirs array. This commit bounds the access to entries actually written to the array, and was verified to output the backtrace correctly. gdb/ChangeLog: * dwarf2read.c (setup_type_unit_groups): Ensure dir_index doesn't reference beyond the 'lh->include_dirs' array before accessing to it. (psymtab_include_file_name): Likewise. (dwarf_decode_lines_1): Likewise. (dwarf_decode_lines): Likewise. (file_file_name): Likewise.
2017-03-24[GAS/ARM] Fix selected_cpu with default CPU and -mcpuThomas Preud'homme2-2/+7
When GAS is compiled with DEFAULT_CPU set and then run with a -mcpu or -march option, selected_cpu will be set to the default CPU. This means the -mcpu is ignored which is surprising behavior. This commit instead sets selected_cpu from the value passed to -mcpu/-march. 2017-03-24 Thomas preud'homme <thomas.preudhomme@arm.com> gas/ * config/tc-arm.: (md_begin): Set selected_cpu from *mcpu_cpu_opt when CPU_DEFAULT is defined.
2017-03-24readelf: Fix incorrect "Version definition past end of section" message ↵Maciej W. Rozycki1-1/+2
(ChangeLog) Correct ChangeLog entry for commit c9f02c3e2949 ("readelf: Fix incorrect "Version definition past end of section" message").
2017-03-24Automatic date update in version.inGDB Administrator1-1/+1
2017-03-23Remove some unnecessary inferior_ptid setting/restoring when ↵Simon Marchi6-82/+39
fetching/storing registers Now that the to_fetch_registers, to_store_registers and to_prepare_to_store target methods don't rely on the value of inferior_ptid anymore, we can remove a bunch of now unnecessary setting and restoring of inferior_ptid. The asserts added recently in target_fetch_registers and target_store_registers, which validate that inferior_ptid matches the regcache's ptid, must go away. It's the whole point of this effort, to not require inferior_ptid to have a particular value when calling these functions. One thing that I noticed is how sol-thread.c's ps_lgetregs and friends use the current value of inferior_ptid instead of what's passed as argument (ph->ptid), unlike proc-service.c's versions of the same functions. Is it expected? I left it like this in the current patch, but unless there's a good reason for it to be that way, I guess we should make it use the parameter. gdb/ChangeLog: * fbsd-tdep.c (fbsd_corefile_thread): Don't set/restore inferior_ptid. * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * regcache.c (regcache_raw_update, regcache_raw_write): Likewise. * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Likewise. * target.c (target_fetch_registers, target_store_registers): Remove asserts.
2017-03-23Remove MAX_REGISTER_SIZE from sol-thread.cAlan Hayward2-9/+4
gdb/ * sol-thread.c (sol_thread_store_registers): Remove regcache calls.
2017-03-23Handle PRFM in AArch64 process recordYao Qi2-3/+64
This patch fixes the bug of handling PRFM instruction. PRFM is documented in a table with other load and store instructions, but it doesn't do any load or store. This patch also adds a unit test to PRFM instruction. gdb: 2017-03-23 Yao Qi <yao.qi@linaro.org> * aarch64-tdep.c (aarch64_process_record_test): Declare. (_initialize_aarch64_tdep): Register it. (aarch64_record_load_store): Handle PRFM instruction. (aarch64_process_record_test): New function.
2017-03-23Fix code indentationYao Qi2-8/+17
gdb: 2017-03-23 Yao Qi <yao.qi@linaro.org> * aarch64-tdep.c (aarch64_record_load_store): Fix code indentation.
2017-03-23Remove AARCH64_RECORD_FAILUREYao Qi2-1/+4
It is not used at all. gdb: 2017-03-23 Yao Qi <yao.qi@linaro.org> * aarch64-tdep.c: Remove AARCH64_RECORD_FAILURE.
2017-03-23Remove constness of libdir in do_start_initializationAndreas Arnez1-1/+1
The patch "Fix memory leak in python.c:do_start_initialization" (https://sourceware.org/ml/gdb-patches/2017-03/msg00407.html) introduced a compilation error on some platforms: ../../binutils-gdb/gdb/python/python.c: In function bool do_start_initialization(): ../../binutils-gdb/gdb/python/python.c:1556:16: error: invalid conversion from const void* to void* [-fpermissive] xfree (libdir); ^ This is fixed by removing the constness of libdir's data type. gdb/ChangeLog: * python/python.c (do_start_initialization): Remove 'const' from data type of libdir.
2017-03-23Fix memory leak in python.c:do_start_initializationPhilipp Rudo2-1/+7
When intializing Python the path to the python binary is build the following way progname = concat (ldirname (python_libdir), SLASH_STRING, "bin", SLASH_STRING, "python", (char *) NULL); This is problematic as both concat and ldirname allocate memory for the string they return. Thus the memory allocated by ldirname cannot be accessed afterwards causing a memory leak. Fix it by temporarily storing libdir in a variable and xfree it after concat. gdb/ChangeLog: python/python.c (do_start_initialization): Fix memory leak.
2017-03-23Automatic date update in version.inGDB Administrator1-1/+1
2017-03-22Sanitize RISC-V GAS help text, documentationPalmer Dabbelt3-7/+17
It looks like I missed the GAS help text when going through all the documentation last time, so it printed some of the old-format (never upstream) arguments. I fixed this, and when I went to check doc/ I noticed it was missing the '-fpic'/'-fno-pic' options.