aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-03-21S390: Enable re-attaching with native-extended-gdbserverAndreas Arnez2-44/+62
On s390x, when running attach.exp with native-extended-gdbserver, gdbserver crashes in find_regno like this: .../regcache.c:252: A problem internal to GDBserver has been detected. Unknown register tdb0 requested On the GDB side it looks like this: (gdb) attach 31568 Attaching to process 31568 Remote connection closed The test case attempts to attach to a new process via the already running gdbserver. Thus s390_arch_setup is called a second time, and that's where the problem occurs. In order to determine the word width (32 or 64 bits), s390_arch_setup reads the pswm register through the regcache. For that it uses a temporary tdesc which is supposed to work for all s390 targets, since the actual tdesc has not been determined yet. But in this second round this doesn't work, because s390_regsets has been updated already and now contains regsets not described by the temporary tdesc, such as the one containing tdb0. This is fixed by rearranging the logic in s390_arch_setup. gdb/gdbserver/ChangeLog: * linux-s390-low.c (s390_get_hwcap): Replace tdesc parameter by the word size. Add comment. (s390_get_wordsize): New function. (s390_arch_setup): No longer select a temporary tdesc to fetch the pswm with it. Instead, use s390_get_wordsize to determine the word size first and derive the correct tdesc from that directly.
2018-03-21PowerPC64 synthetic symbolsAlan Modra2-9/+20
STT_FILE and a bunch of other symbol types aren't proper symbols to mark the start of a function's code. * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Trim uninteresting symbols. Use size_t counts. Delete redundant opd test.
2018-03-21Delete unused elf32-ppc.c codeAlan Modra2-24/+4
Local symbols were being read but not used. * elf32-ppc.c (ppc_elf_tls_optimize): Delete locsyms.
2018-03-21Make tls_mask unsigned in elf32-ppc.cAlan Modra2-6/+14
* elf32-ppc.c (struct ppc_elf_link_hash_entry): Make tls_mask field unsigned. (update_local_sym_info): Likewise for local_got_tls_masks. (ppc_elf_tls_optimize): Likewise for lgot_masks.
2018-03-21Correct multi-toc tprel relocsAlan Modra2-2/+10
Commit f15d0b545b trimmed some unnecessary TPREL relocs, but missed changing another place where they are allocated. * elf64-ppc.c (ppc_size_one_stub): Fix comment typo. (ppc64_elf_layout_multitoc): Allocate relocs for tprel as we do in size_dynamic_sections.
2018-03-21Don't exceed reloc array boundsAlan Modra3-4/+14
* elf64-ppc.c (ppc64_elf_relocate_section): Don't access rel[1] without first checking array bounds. * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2018-03-21Automatic date update in version.inGDB Administrator1-1/+1
2018-03-20ld/testsuite: XFAIL pr20995-2 on aarch64*-*-elf*Roland McGrath2-2/+7
ld/ * testsuite/ld-elf/shared.exp (pr20995-2): XFAIL on aarch64*-*-elf*, another target without RELRO.
2018-03-20Fix misleading indentation error.Stephen Roberts2-12/+16
This patch fixes a compile error introduced by my previous change, which caused the indentation of the following code block to become incorrect. ChangeLog: 2018-03-20 Stephen Roberts <stephen.roberts@arm.com> * gdb/symtab.c (find_pc_sect_line): fixed indentation.
2018-03-20Adjust testsuite/ld-plugin/pr22983.dH.J. Lu2-4/+11
* testsuite/ld-plugin/pr22983.d: Allow leading underscore as well as extra lines between symbols.
2018-03-20Replace the linear search in find_pc_sect_line with a binary search.Stephen Roberts6-11/+216
This patch addresses slowness when setting breakpoints, especially in heavily templatized code. Profiling showed that find_pc_sect_line in symtab.c was the performance bottleneck. The original logic performed a linear search over ordered data. This patch uses a binary search, as suggested by comments around the function. There are no behavioural changes, but gdb is now faster at setting breakpoints in template code. Tested using on make check on an x86 target. The optimisation speeds up the included template-breakpoints.py performance test by a factor of 7 on my machine. ChangeLog: 2018-03-20 Stephen Roberts <stephen.roberts@arm.com> * gdb/symtab.c (find_pc_sect_line): now uses binary search. gdb/testsuite/ * gdb.perf/template-breakpoints.cc: New file. * gdb.perf/template-breakpoints.exp: New file. * gdb.perf/template-breakpoints.py: New file.
2018-03-20gc.exp: Remove extraneous LD flags from the personality testMaciej W. Rozycki2-1/+6
Complement commit 8988502d7534 ("MIPS/LD/testsuite: Correct dynamic links with VR4100, VR4300 and VR5000") and commit bf48520113c4 ("gc.exp: Fix a typo: $LFLAGS -> $LDFLAGS"), and remove extraneous additional LD flags explicitly passed to the personality test on invocation. This passing has accidentally leaked from a WIP version of the former change. With the actual version committed the $LDFLAGS global variable is used instead for `run_dump_test' to use implicitly, so that `-call_shared' precedes `-lpersonality' on the linker's command line, as otherwise a shared `libpersonality.so' library wouldn't be considered for linking, causing the test to fail. ld/ * testsuite/ld-gc/gc.exp: Remove extraneous LD flags from the personality test.
2018-03-20Updated Russian and Spanish translations for the binutils/ sub-directory.Nick Clifton3-4758/+12056
* po/es.po: Updated Spanish translation. * po/ru.po: Updated Russian translation.
2018-03-20Set non_ir_ref_dynamic if a symbol is made dynamicH.J. Lu8-1/+70
If a symbol is made dynamic by --dynamic-list, it has non-IR reference. bfd/ PR ld/22983 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Set non_ir_ref_dynamic if a symbol is made dynamic by --dynamic-list. ld/ PR ld/22983 * testsuite/ld-plugin/lto.exp: Run PR ld/22983 test. * testsuite/ld-plugin/pr22983.d: New file. * testsuite/ld-plugin/pr22983.t: Likewise. * testsuite/ld-plugin/pr22983a.c: Likewise. * testsuite/ld-plugin/pr22983b.c: Likewise.
2018-03-20Automatic date update in version.inGDB Administrator1-1/+1
2018-03-19Support bare-identifier field initializers in RustTom Tromey5-0/+36
In Rust one can initialize a struct member from an identically-named local variable by simply mentioning the member name in the initializer, like: let x = 0; let y = Struct { x }; This initializes "Struct::x" from "x". This patch adds this form of initializer to the Rust expression parser and adds a test. Tested on x86-64 Fedora 26 using rustc 1.23. 2018-03-19 Tom Tromey <tom@tromey.com> * rust-exp.y (struct_expr_tail, struct_expr_list): Add plain "IDENT" production. 2018-03-19 Tom Tromey <tom@tromey.com> * gdb.rust/simple.rs (main): Add local variables field1, field2, y0. * gdb.rust/simple.exp: Test bare identifier form of struct initializer.
2018-03-19Convert observers to C++Tom Tromey86-1234/+999
This converts observers from using a special source-generating script to be plain C++. This version of the patch takes advantage of C++11 by using std::function and variadic templates; incorporates Pedro's patches; and renames the header file to "observable.h" (this change eliminates the need for a clean rebuild). Note that Pedro's patches used a template lambda in tui-hooks.c, but this failed to compile on some buildbot instances (presumably due to differing C++ versions); I replaced this with an ordinary template function. Regression tested on the buildbot. gdb/ChangeLog 2018-03-19 Pedro Alves <palves@redhat.com> Tom Tromey <tom@tromey.com> * unittests/observable-selftests.c: New file. * common/observable.h: New file. * observable.h: New file. * ada-lang.c, ada-tasks.c, agent.c, aix-thread.c, annotate.c, arm-tdep.c, auto-load.c, auxv.c, break-catch-syscall.c, breakpoint.c, bsd-uthread.c, cli/cli-interp.c, cli/cli-setshow.c, corefile.c, dummy-frame.c, event-loop.c, event-top.c, exec.c, extension.c, frame.c, gdbarch.c, guile/scm-breakpoint.c, infcall.c, infcmd.c, inferior.c, inflow.c, infrun.c, jit.c, linux-tdep.c, linux-thread-db.c, m68klinux-tdep.c, mi/mi-cmd-break.c, mi/mi-interp.c, mi/mi-main.c, objfiles.c, ppc-linux-nat.c, ppc-linux-tdep.c, printcmd.c, procfs.c, python/py-breakpoint.c, python/py-finishbreakpoint.c, python/py-inferior.c, python/py-unwind.c, ravenscar-thread.c, record-btrace.c, record-full.c, record.c, regcache.c, remote.c, riscv-tdep.c, sol-thread.c, solib-aix.c, solib-spu.c, solib.c, spu-multiarch.c, spu-tdep.c, stack.c, symfile-mem.c, symfile.c, symtab.c, thread.c, top.c, tracepoint.c, tui/tui-hooks.c, tui/tui-interp.c, valops.c: Update all users. * tui/tui-hooks.c (tui_bp_created_observer) (tui_bp_deleted_observer, tui_bp_modified_observer) (tui_inferior_exit_observer, tui_before_prompt_observer) (tui_normal_stop_observer, tui_register_changed_observer): Remove. (tui_observers_token): New global. (attach_or_detach, tui_attach_detach_observers): New functions. (tui_install_hooks, tui_remove_hooks): Use tui_attach_detach_observers. * record-btrace.c (record_btrace_thread_observer): Remove. (record_btrace_thread_observer_token): New global. * observer.sh: Remove. * observer.c: Rename to observable.c. * observable.c (namespace gdb_observers): Define new objects. (observer_debug): Move into gdb_observers namespace. (struct observer, struct observer_list, xalloc_observer_list_node) (xfree_observer_list_node, generic_observer_attach) (generic_observer_detach, generic_observer_notify): Remove. (_initialize_observer): Update. Don't include observer.inc. * Makefile.in (generated_files): Remove observer.h, observer.inc. (clean mostlyclean): Likewise. (observer.h, observer.inc): Remove targets. (SUBDIR_UNITTESTS_SRCS): Add observable-selftests.c. (COMMON_SFILES): Use observable.c, not observer.c. * .gitignore: Remove observer.h. gdb/doc/ChangeLog 2018-03-19 Tom Tromey <tom@tromey.com> * observer.texi: Remove. gdb/testsuite/ChangeLog 2018-03-19 Tom Tromey <tom@tromey.com> * gdb.gdb/observer.exp: Remove.
2018-03-19Testsuite: Fix ambiguous "break" due to libinproctraceAndreas Arnez26-50/+79
Some of GDB's trace test cases define a function end() and place a breakpoint there with "break end". However, when libinproctrace is linked to the binary, there are multiple methods named "end", such as std::string::end() from the C++ library or format_pieces::end() from common/format.h. GDB then creates multiple breakpoints instead of just a single one, and some FAILs result, such as these: FAIL: gdb.trace/trace-mt.exp: ftrace on: break end FAIL: gdb.trace/trace-mt.exp: ftrace off: break end Fix this by adding the "-qualified" option to the break commands. For consistency, change all occurrences of "break end" (and similar) in all trace test cases, even if the current behavior does not cause problems. Also, consequently use the gdb_breakpoint convenience proc. gdb/testsuite/ChangeLog: * gdb.trace/actions-changed.exp: Call gdb_breakpoint with the "qualified" option when setting breakpoints. * gdb.trace/backtrace.exp: Likewise. * gdb.trace/circ.exp: Likewise. * gdb.trace/collection.exp: Likewise. * gdb.trace/disconnected-tracing.exp: Likewise. * gdb.trace/ftrace-lock.exp: Likewise. * gdb.trace/ftrace.exp: Likewise. * gdb.trace/infotrace.exp: Likewise. * gdb.trace/packetlen.exp: Likewise. * gdb.trace/passc-dyn.exp: Likewise. * gdb.trace/qtro.exp: Likewise. * gdb.trace/read-memory.exp: Likewise. * gdb.trace/report.exp: Likewise. * gdb.trace/signal.exp: Likewise. * gdb.trace/status-stop.exp: Likewise. * gdb.trace/strace.exp: Likewise. * gdb.trace/tfind.exp: Likewise. * gdb.trace/trace-break.exp: Likewise. * gdb.trace/trace-condition.exp: Likewise. * gdb.trace/trace-mt.exp: Likewise. * gdb.trace/tstatus.exp: Likewise. * gdb.trace/tsv.exp: Likewise. * gdb.trace/unavailable-dwarf-piece.exp: Likewise. * gdb.trace/unavailable.exp: Likewise. * gdb.trace/while-dyn.exp: Likewise.
2018-03-19Updated Spanish translation for the bfd/ sub-directory, and updated Ukranian ↵Nick Clifton4-2341/+5006
translation for the gas/ sub-directory. bfd * po/es.po: Updated Spanish translation. gas * po/uk.po: Updated Ukranian translation.
2018-03-18Remove some cleanups from solib.cTom Tromey2-6/+10
This removes some cleanups from solib.c, replacing them with gdb::def_vector. Regression tested by the buildbot. gdb/ChangeLog 2018-03-18 Tom Tromey <tom@tromey.com> * solib.c (gdb_bfd_lookup_symbol_from_symtab): Use gdb::def_vector. (bfd_lookup_symbol_from_dyn_symtab): Likewise.
2018-03-19Automatic date update in version.inGDB Administrator1-1/+1
2018-03-18Automatic date update in version.inGDB Administrator1-1/+1
2018-03-17Change auto_load_objfile_script_1 to use std::stringTom Tromey2-18/+12
This replaces some manual string manipulation in auto_load_objfile_script_1 with std::string, simplifying the code and allowing the removal of some cleanups. Tested by the buildbot. 2018-03-17 Tom Tromey <tom@tromey.com> * auto-load.c (auto_load_objfile_script_1): Use std::string.
2018-03-17Remove target_fileio_close_cleanupTom Tromey2-16/+38
This removes target_fileio_close_cleanup in favor of a new RAII class. The new class is similar to scoped_fd but calls target_fileio_close_cleanup rather than close. Regression tested by the buildbot. gdb/ChangeLog 2018-03-17 Tom Tromey <tom@tromey.com> * target.c (class scoped_target_fd): New. (target_fileio_close_cleanup): Remove. (target_fileio_read_alloc_1): Use scoped_target_fd.
2018-03-17Automatic date update in version.inGDB Administrator1-1/+1
2018-03-16Add silent Makefile rulesSimon Marchi9-57/+180
Many projects (e.g. the Linux kernel) and build systems use "silent" rules, which means that they'll only print a summary of what's being done instead of printing all the detailed command lines. While chatting on the #gdb IRC channel, I realized a few people (including me) thought it would be nice to have it in GDB too. The idea is that too much text is not useful, the important information gets lost. If there's only the essential information, it's more likely to be useful. Most of the time, when I look at the build output, it's to see how it's progressing. By just printing a brief summary of each operation, I can easily spot what's currently being compiled and therefore how the build progresses (with time you know the order in which files are compiled almost by heart). As with other projects (Linux, automake-based things, probably others), it's possible to print the complete command lines by passing V=1 to make (or any other non-zero value). I had one hesitation about this: when people report build failures, we are more likely to miss the full compile command line. We'll probably sometimes need to ask people to include the build log with "make V=1". I don't think it's a big downside, if other projects the size of the Linux kernel can live with it, I'm sure we can too. gdb/ChangeLog: * silent-rules.mk: New. * Makefile.in: Include silent-rules.mk (srcdir, VPATH, top_srcdir): Move up. (COMPILE): Add ECHO_CXX. (test-cp-name-parser$(EXEEXT)): Add ECHO_CXXLD. (init.c): Add ECHO_INIT_C. (gdb$(EXEEXT)): Add SILENCE and ECHO_CXXLD. (version.c): Add ECHO_GEN. (printcmd.o): Add ECHO_CXX. (target-float.o): Add ECHO_CXX. (ada-exp.o): Add ECHO_CXX. (stamp-xml): Add SILENCE and ECHO_GEN_XML_BUILTIN. (insight$(EXEEXT)): Add ECHO_CXXLD. * gnulib/configure.ac: Add AM_SILENT_RULES. * gnulib/aclocal.m4: Re-generate. * gnulib/configure: Re-generate. * gnulib/import/Makefile.in: Re-generate. gdb/gdbserver/ChangeLog: * Makefile.in: Include silent-rules.mk. (srcdir, abs_top_srcdir, abs_srcdir, VPATH): Move up. (COMPILE): Add ECHO_CXX. (gdbserver$(EXEEXT)): Add SILENCE and ECHO_CXXLD. (gdbreplay$(EXEEXT)): Add SILENCE and ECHO_CXXLD. ($(IPA_LIB)): Add SILENCE and ECHO_CXXLD. (version-generated.c): Add ECHO_GEN. (stamp-xml): Add SILENCE and ECHO_GEN_XML_BUILTIN_GENERATED. (IPAGENT_COMPILE): Add ECHO_CXX. (%-generated.c): Add ECHO_REGDAT.
2018-03-16Remove make_cleanup_free_section_addr_infoTom Tromey12-261/+180
This removes make_cleanup_free_section_addr_info. Instead -- per Simon's suggestion -- this changes section_addr_info to be a std::vector. Regression tested by the buildbot. gdb/ChangeLog 2018-03-16 Tom Tromey <tom@tromey.com> * xcoffread.c (xcoff_symfile_offsets): Change type of "addrs". * utils.h (make_cleanup_free_section_addr_info): Don't declare. * utils.c (do_free_section_addr_info) (make_cleanup_free_section_addr_info): Remove. * symfile.h (struct other_sections): Add constructor. (struct section_addr_info): Remove. (section_addr_info): New typedef. (struct sym_fns) <sym_offsets>: Change type of parameter. (build_section_addr_info_from_objfile) (relative_addr_info_to_section_offsets, addr_info_make_relative) (default_symfile_offsets, symbol_file_add) (symbol_file_add_from_bfd) (build_section_addr_info_from_section_table): Update. (alloc_section_addr_info, free_section_addr_info): Don't declare. * symfile.c (alloc_section_addr_info): Remove. (build_section_addr_info_from_section_table): Change return type. Update. (build_section_addr_info_from_bfd) (build_section_addr_info_from_objfile): Likewise. (free_section_addr_info): Remove. (relative_addr_info_to_section_offsets): Change type of "addrs". (addrs_section_compar): Now a std::sort comparator. (addrs_section_sort): Change return type. (addr_info_make_relative): Change type of "addrs". Update. (default_symfile_offsets, syms_from_objfile_1) (syms_from_objfile, symbol_file_add_with_addrs): Likewise. (symbol_file_add_separate): Update. (symbol_file_add): Change type of "addrs". Update. (add_symbol_file_command): Update. Remove cleanups. * symfile-mem.c (symbol_file_add_from_memory): Update. Remove cleanups. * symfile-debug.c (debug_sym_offsets): Change type of "info". * solib.c (solib_read_symbols): Update. * objfiles.c (objfile_relocate): Update. Remove cleanups. * machoread.c (macho_symfile_offsets): Update. * jit.c (jit_bfd_try_read_symtab): Update.
2018-03-16Fix tspeed test case: copy libinproctrace to targetAndreas Arnez2-0/+6
The tspeed test case does not execute correctly because libinproctrace.so is not copied to the target. This is fixed. gdb/testsuite/ChangeLog: * gdb.trace/tspeed.exp: Add invocation of gdb_load_shlib to ensure that libinproctrace is copied to the target.
2018-03-16RISC-V: Emit better warning for unknown CSR.Jim Wilson5-6/+26
gas/ * config/tc-riscv.c (check_absolute_expr): Expand comment. New parameter maybe_csr. If maybe_csr and O_symbol, print CSR name. (riscv_ip): Add new argument to check_absolute_expr calls. * testsuite/gas/riscv/bad-csr.d: New. * testsuite/gas/riscv/bad-csr.l: New. * testsuite/gas/riscv/bad-csr.s: New.
2018-03-15Add selftest for substitute_path_componentSimon Marchi3-0/+66
This patch add some unit tests for the substitute_path_component function. gdb/ChangeLog: * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add unittests/utils-selftests.c. * unittests/utils-selftests.c: New file.
2018-03-16Automatic date update in version.inGDB Administrator1-1/+1
2018-03-15xtensa: bfd: fix assertion in xlate_offset_with_removed_textMax Filippov2-3/+21
Linking objects containing jumps targeting the end of a section triggers assertion in the xlate_offset_with_removed_text. Such jumps may be generated by a compiler as a dead code and not removed at -O0. Allow such jumps. While at it make bsearch argument match comparison function expectations and use bfd_vma for address fields in the struct xlate_map_entry. bfd/ 2018-03-15 Max Filippov <jcmvbkbc@gmail.com> * elf32-xtensa.c (xlate_map_entry): Change types of address fields from 'unsigned' to 'bfd_vma'. (xlate_offset_with_removed_text): Use struct xlate_map_entry as the key argument to bsearch. Allow offsets past the end of a section, use the last map entry for translation of such offsets.
2018-03-15RISC-V: Don't enable relaxation in relocatable linkAndreas Schwab2-5/+14
PR ld/22949 * emultempl/riscvelf.em (riscv_elf_before_allocation): Don't enable relaxation in relocatable link.
2018-03-15nds32: Remove the unsupported target feature.Kuan-Lin Chen4-2792/+22
2018-03-15Automatic date update in version.inGDB Administrator1-1/+1
2018-03-14Missing testcase files for last commit.Jim Wilson2-0/+90
2018-03-14RISC-V: Add .insn support.Jim Wilson7-27/+786
gas/ChangeLog 2018-03-07 Kito Cheng <kito.cheng@gmail.com> * config/tc-riscv.c (opcode_name_list): New. (opcode_names_hash): Likewise. (init_opcode_names_hash): Likewise. (opcode_name_lookup): Likewise. (validate_riscv_insn): New argument length, and add new format which used in .insn directive. (md_begin): Refine hash table initialization logic into init_opcode_hash. (init_opcode_hash): New. (my_getOpcodeExpression): Parse opcode name for .insn. (riscv_ip): New argument hash, able to handle .insn directive. (s_riscv_insn): Handler for .insn directive. (riscv_pseudo_table): New entry for .insn. * doc/c-riscv.texi: Add documentation for .insn directive. * testsuite/gas/riscv/insn.d: Add testcase for .insn directive. * testsuite/gas/riscv/insn.s: Likewise. include/ChangeLog 2018-03-07 Kito Cheng <kito.cheng@gmail.com> * opcode/riscv.h (OP_MASK_FUNCT3): New. (OP_SH_FUNCT3): Likewise. (OP_MASK_FUNCT7): Likewise. (OP_SH_FUNCT7): Likewise. (OP_MASK_OP2): Likewise. (OP_SH_OP2): Likewise. (OP_MASK_CFUNCT4): Likewise. (OP_SH_CFUNCT4): Likewise. (OP_MASK_CFUNCT3): Likewise. (OP_SH_CFUNCT3): Likewise. (riscv_insn_types): Likewise. opcodes/ChangeLog 2018-03-07 Kito Cheng <kito.cheng@gmail.com> * riscv-opc.c (riscv_insn_types): New.
2018-03-14Special case NULL when using printf's %s formatTom Tromey7-0/+39
This changes the printf command's %s and %ls formats to special-case NULL, and print "(null)" for these. This is PR cli/14977. This behavior seems a bit friendlier; I was undecided on whether other invalid pointers should be handled specially somehow, so for the time being I've left those out. gdb/ChangeLog 2018-03-14 Tom Tromey <tom@tromey.com> PR cli/14977: * printcmd.c (printf_c_string, printf_wide_c_string): Special case for NULL. gdb/gdbserver/ChangeLog 2018-03-14 Tom Tromey <tom@tromey.com> PR cli/14977: * ax.c (ax_printf): Special case for NULL. gdb/testsuite/ChangeLog 2018-03-14 Tom Tromey <tom@tromey.com> PR cli/14977: * gdb.base/printcmds.exp (test_printf): Add printf test of %s with a null pointer. * gdb.base/wchar.exp: Likewise.
2018-03-14Allow - in %p for printfTom Tromey4-2/+18
PR cli/19918 points out that a printf format like "%-5p" will cause a gdb crash. The bug is problem is that printf_pointer doesn't take the "-" flag into account. gdb/ChangeLog 2018-03-14 Tom Tromey <tom@tromey.com> PR cli/19918: * printcmd.c (printf_pointer): Allow "-" in format. gdb/testsuite/ChangeLog 2018-03-14 Tom Tromey <tom@tromey.com> PR cli/19918: * gdb.base/printcmds.exp (test_printf): Add printf test using '-' flag.
2018-03-14Add usage to printf commandTom Tromey2-2/+7
This patch adds the "Usage:" text to the printf command's help text, and tries to improve the text a tiny bit. gdb/ChangeLog 2018-03-14 Tom Tromey <tom@tromey.com> * printcmd.c (_initialize_printcmd): Add usage to printf.
2018-03-14Update my email addressYao Qi2-4/+8
gdb: 2018-03-14 Yao Qi <qiyao@sourceware.org> * MAINTAINERS: Update my email address.
2018-03-14PowerPC64 debian bug 886264, out-of-line save/restore functionsAlan Modra2-15/+25
This calculation in relocate_section if (stub_entry->stub_type == ppc_stub_save_res) relocation += (stub_sec->output_offset + stub_sec->output_section->vma + stub_sec->size - htab->sfpr->size - htab->sfpr->output_offset - htab->sfpr->output_section->vma); to adjust from the original out-of-line save/restore function address in sfpr to a copy at the end of stub_sec goes wrong when stub_sec is padded, because the copy is no longer at the end of stub_sec. The solution is to pad before copying sfpr, so the copy is always at the end of stub_sec. * elf64-ppc.c (sfpr_define): Adjust for stub_sec size having sfpr size added before defining alias symbols. (ppc64_elf_build_stubs): Add stub section padding before copying sfpr contents and defining save/restore alias symbols.
2018-03-14GC: Also check the local debug definition sectionH.J. Lu5-11/+45
Extend commit b7c871edcd83ccdc5fcd8148a7f433efd6b52255 Author: H.J. Lu <hjl.tools@gmail.com> Date: Wed May 17 07:57:15 2017 -0700 Mark debug sections referenced by kept debug sections to handle the local debug definition section. bfd/ PR ld/20882 * elflink.c (elf_gc_mark_debug_section): Also check the local debug definition section. ld/ PR ld/20882 * testsuite/ld-gc/pr20882.d: Also dump and check .debug_abbrev section. * testsuite/ld-gc/pr20882b.s: Add .debug_abbrev section.
2018-03-14gc.exp: Fix a typo: $LFLAGS -> $LDFLAGSH.J. Lu2-1/+5
* testsuite/ld-gc/gc.exp: Fix a typo: $LFLAGS -> $LDFLAGS.
2018-03-14Automatic date update in version.inGDB Administrator1-1/+1
2018-03-13Remove two cleanups using std::stringTom Tromey3-37/+26
This patches removes cleanups from a couple of spots by using std::string rather than manual memory management. Regression tested by the buildbot, though note that I don't believe the buildbot actually exercises the machoread code. gdb/ChangeLog 2018-03-13 Tom Tromey <tom@tromey.com> * machoread.c (macho_check_dsym): Change filenamep to a std::string*. (macho_symfile_read): Update. * symfile.c (load_command): Use std::string.
2018-03-13Prevent a buffer overrun when parsing corrupt STABS debug information.Nick Clifton2-1/+10
PR 22957 * stabs.c (pop_binincl): Fail if the file index is off the end of the stack.
2018-03-13Updated Russian and Brazilian Portuguese translations.Nick Clifton6-1056/+1284
ld * po/pt_BR.po: Updated Brazilian Portuguese translation. opcodes * po/pt_BR.po: Updated Brazilian Portuguese translation. gas * po/ru.po: Updated Russian translation.
2018-03-13Add range changing to STABS parsing functions, in order to prevent buffer ↵Nick Clifton2-144/+284
overruns. PR 22955 * stabs.c (parse_number): Add p_end parameter and use it to check the validity of the pp parameter. Add checks to prevent walking off the end of the string buffer. (parse_stab_string): Likewise. (parse_stab_type): Likewise. (parse_stab_type_number): Likewise. (parse_stab_range_type): Likewise. (parse_stab_sun_builtin_type): Likewise. (parse_stab_sun_floating_type): Likewise. (parse_stab_enum_type): Likewise. (parse_stab_struct_type): Likewise. (parse_stab_baseclasses): Likewise. (parse_stab_struct_fields): Likewise. (parse_stab_cpp_abbrev): Likewise. (parse_stab_one_struct_field): Likewise. (parse_stab_members): Likewise. (parse_stab_tilde_field): Likewise. (parse_stab_array_type): Likewise. * parse_stab: Compute the end of the string and then pass it on to individual parser functions.
2018-03-13Prevent memory access violations when attempting to parse an x86_64 PE ↵Nick Clifton4-8/+66
binary containing corrupt unwind information. PR 22113 incldue * coff/pe.h (struct pex64_unwind_info): Add a rawUnwindCodesEnd field. bfd * pei-x86_64.c (pex64_get_unwind_info): Change to a boolean function. Add an end address parameter. Check access of the data pointer to make sure that they do not extend beyond the end address. Return FALSE if any check fails. Add the end address pointer to the ui structure. (pex64_xdata_print_uwd_codes): Check accesses of the raw unwind codes to make sure that they do not extend beyond the end address pointer. Print an error message and return immediately if any check fails.