aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-12-02revert previous patch so that I can re-commit with correct authorDoug Evans19-682/+14
2014-12-02New python events: infcall, register/memory changed.Doug Evans19-14/+682
gdb/ChangeLog: * NEWS: Mention new Python events. * Makefile.in (SUBDIR_PYTHON_OBS): Add py-infevents.o. (SUBDIR_PYTHON_SRCS): Add py-infevents.c. (py-infevents.o): New rule. * doc/observer.texi (inferior_call_pre, inferior_call_post) (memory_changed, register_changed): New observers. * infcall.c (call_function_by_hand): Notify observer before and after inferior call. * python/py-event.h (inferior_call_kind): New enum. (emit_inferior_call_event): New prototype. (emit_register_changed_event): New prototype. (emit_memory_changed_event): New prototype. * python/py-events.h (events_object): New registries inferior_call, memory_changed and register_changed. * python/py-evts.c (gdbpy_initialize_py_events): Add the inferior_call, memory_changed and register_changed registries. * python/py-infevents.c: New. * python/py-inferior.c (python_on_inferior_call_pre) (python_on_inferior_call_post, python_on_register_change) (python_on_memory_change): New functions. (gdbpy_initialize_inferior): Attach python handler to new observers. * python/py-infthread.c(gdbpy_create_ptid_object): New. (thpy_get_ptid) Use gdbpy_create_ptid_object. * python/python-internal.h: (gdbpy_create_ptid_object) (gdbpy_initialize_inferior_call_pre_event) (gdbpy_initialize_inferior_call_post_event) (gdbpy_initialize_register_changed_event) (gdbpy_initialize_memory_changed_event): New prototypes. * python/python.c (_initialize_python): Initialize new events. * valops.c (value_assign): Notify register_changed observer. gdb/doc/ChangeLog: * python.texi (Events In Python): Document new events InferiorCallPreEvent, InferiorCallPostEvent, MemoryChangedEvent and RegisterChangedEvent. gdb/testsuite/ChangeLog: * gdb.python/py-events.py (inferior_call_handler): New. (register_changed_handler, memory_changed_handler): New. (test_events.invoke): Register new handlers. * gdb.python/py-events.exp: Add tests for inferior call, memory_changed and register_changed events.
2014-12-02python/py-infthread.c: Whitespace fixes.Doug Evans2-8/+10
gdb/ChangeLog: * python/py-infthread.c: Whitespace fixes.
2014-12-02 * MAINTAINERS: Fix my email address.Denis Chertykov2-1/+5
2014-12-02execl-update-breakpoints.exp: Move whole segment instead of .text sectionAndreas Arnez2-8/+28
The test case builds two copies of the program, one with the compile option "ldflags=-Wl,-Ttext=0x1000000" and the other with the address changed to 0x2000000. However, when linking with ld.bfd, the resulting executables crash early in ld.so on S390 and i386. Analysis of the crash: The default linker script establishes a certain order of loadable sections, and the option "-Ttext" effectively splits these into an "unaffected" lot (everything before .text) and an "affected" lot. The affected lot is placed at the given address, whereas the unaffected lot stays at its default address. The unaffected lot starts at an aligned address plus Elf header sizes, which is good if it is the first LOAD segment (like on AMD64). But if the affected lot comes first instead (like on S390 and i386), the PHDR doesn't fit there and is placed *outside* any LOAD segments. Then the PHDR is not mapped when the loader gets control, and the loader runs into a segmentation fault while trying to access it. Since we are lucky about the order of segments on AMD64, the test succeeds there, but the resulting binaries are unusually large -- 2.1M each, with lots of padding within. When replacing '-Ttext' by '-Ttext-segment', the linker moves all segments consistently, the binaries have normal sizes, and the test case succeeds on all mentioned platforms. Since old versions of the gold linker don't support '-Ttext-segment', the patch also adds logic for falling back to '-Ttext'. gdb/testsuite/ChangeLog: * gdb.base/execl-update-breakpoints.exp: Specify the link address with '-Ttext-segment' instead of '-Ttext'. Fall back to '-Ttext' if the linker doesn't understand this.
2014-12-02[MIPS] When calculating a relocation using an undefined weak symbol don't ↵Andrew Bennett8-11/+137
check for overflow. In MIPS the relocation calculation only ignores the overflow checks for undefined weak symbols on relocations associated with j/jal. This patch extends this to the relocations used by the: b* instructions; pc/gp relative symbol offsets; and the lwpc/ldpc MIPS r6 instructions. bfd/ * elfxx-mips.c (mips_elf_calculate_relocation): Only check for overflow on non-weak undefined symbols. ld/testsuite/ * ld-mips-elf/mips-elf.exp: Add in undefined weak overflow tests for o32, n32 and n64. * ld-mips-elf/undefweak-overflow.s: New test. * ld-mips-elf/undefweak-overflow.d: New test. * ld-mips-elf/undefweak-overflow-n32.d: New test. * ld-mips-elf/undefweak-overflow-n64.d: New test.
2014-12-02ppc64_elf_edit_opd revampAlan Modra2-128/+163
This patch sorts .opd relocs (see pr17666) and allows .opd sections with a mix of 16 and 24 byte entries to be edited. * elf64-ppc.c (OPD_NDX): Define. Use throughout for sizing/indexing _opd_sec_data array, halving required memory. (sort_r_offset): New function. (ppc64_elf_edit_opd): Sort incoming relocs. Accept .opd sections with a mix of 16 and 24 byte OPD entries. Don't attempt to honour --non-overlapping-opd for .opd sections with unexpected relocs. Simplify opd entry size calculations by first finding the reloc for the next entry. Make edit loop handle one opd entry per iteration, with an inner loop handling relocs per entry.
2014-12-02S390: Fix 'expedite' for s390-te-linux64Andreas Arnez3-2/+8
Fix a typo in the expedited registers for s390-te-linux64. gdb/ChangeLog: * features/Makefile (s390-te-linux64-expedite): Replace non-existant r14 and r15 by r14l and r15l, respectively. * regformats/s390-te-linux64.dat: Regenerate.
2014-12-02Automatic date update in version.inGDB Administrator1-1/+1
2014-12-01Add support for -z global.Dmitriy Ivanov3-0/+11
gold/ * layout.cc (Layout::finish_dynamic_section): When '-z global' is specified set DF_1_GLOBAL in DT_FLAGS_1 flags. * options.h (General_options): New -z option (global).
2014-12-01Fix extraneous warning about executable stack.Cary Coutant2-3/+17
PR gold/17578 notes that gold will print a warning about an executable stack when the -z execstack option is given, even when there is no --warn_execstack option. The warning is completely useless and unexpected, since the user explicitly requested an executable stack, and did not even ask for warnings. This patch fixes that, and adds an extra warning when --warn_execstack and -z noexecstack are both given and an input file requires an executable stack. gold/ PR gold/17578 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack is given. (Layout::create_executable_stack_info): Warn when -z noexecstack is given but some inputs require executable stack.
2014-12-01Properly check for an out of range row indexH.J. Lu2-1/+6
* dwarf.c (process_cu_tu_index): Properly check for an out of range row index.
2014-12-01More fixes for memory access violations exposed by fuzzed binaries.Nick Clifton13-63/+207
PR binutils/17512 * dwarf.h (struct dwarf_section): Add user_data field. * dwarf.c (frame_need_space): Check for an over large register number. (display_debug_frames): Check the return value from frame_need_space. Check for a CFA expression that is so long the start address wraps around. (debug_displays): Initialise the user_data field. * objdump.c (load_specific_debug_section): Save the BFD section pointer in the user_data field of the dwarf_section structure. (free_debug_section): Update BFD section data when freeing section contents. * readelf.c (load_specific_debug_section): Initialise the user_data field. * archive.c (do_slurp_coff_armap): Add range checks to prevent running off the end of the string table. * compress.c (bfd_get_full_section_contents): Return a NULL pointer for zero sized sections. Do not attempt to copy a buffer onto itself. * elf-attrs.c (_bfd_elf_parse_attributes): Check for an empty header. Add range checks to avoid running off the end of the section. * elf.c (bfd_elf_get_str_section): Seek before allocating so that if the seek fails, no memory is allocated. (bfd_elf_string_from_elf_section): Do not allocate a string from a non string section. It only leads to trouble later on. (_bfd_elf_print_private_bfd_data): Check for there being too little external dynamic data. (bfd_section_from_shdr): Replace assertion with a failure mode. (bfd_section_from_shdr): When walking a loaded group section use the internal structure size, not the external size. Check for the group section being empty. * elf32-i386.c (elf_i386_rtype_to_howto): Replace assertion with a failure mode. * elfcode.h (elf_slurp_reloc_table): Likewise. * reloc.c (bfd_perform_relocation): Avoid seg-fault if the howto parameter is NULL.
2014-12-01Remove duplicate commentSimon Marchi2-4/+4
gdb/ChangeLog: * objfiles.c (allocate_objfile): Remove duplicate comment.
2014-12-01Add tests for PR ld/16452 and PR ld/16457H.J. Lu7-0/+42
PR ld/16452 PR ld/16457 * ld-elf/pr16452.map: New file. * ld-elf/pr16452.od: Likewise. * ld-elf/pr16452a.c: Likewise. * ld-elf/pr16452b.c: Likewise. * ld-elf/pr16457.od: Likewise. * ld-elf/shared.exp (build_tests): Add tests for PR ld/16452 and PR ld/16457.
2014-12-01Fix Python help() test for Python 3Simon Marchi2-1/+5
The message displayed when using help() changed a bit with time, so this adjusts the test accordingly. gdb/testsuite/ChangeLog: * gdb.python/python.exp: Change expected reply to help().
2014-12-01Use core regset iterators on GNU HurdUlrich Weigand4-38/+36
Remove native-only core file handling on GNU Hurd. Instead, enable the x86 target generic core regset logic on the Hurd by providing an appropriate register offset map. Thanks to Samuel Thibault for testing! gdb/ * config/i386/i386gnu.mh (NATDEPFILES): Remove core-regset.o. * i386gnu-nat.c: Do not include <sys/procfs.h> or "gregset.h". (CREG_OFFSET, creg_offset, CREG_ADDR): Remove. (supply_gregset, supply_fpregset): Remove. * i386gnu-tdep.c (i386gnu_gregset_reg_offset): New variable. (i386gnu_init_abi): Set tdep->gregset_reg_offset, gregset_num_regs, and sizeof_gregset.
2014-12-01Add checks for memory access violations exposed by fuzzed archives.Nick Clifton5-11/+79
PR binutils/17531 * dwarf.c (process_cu_tu_index): Check for an out of range row index. * elfcomm.c (adjust_relative_path): Change name_len parameter to an unsigned long. Check for path length overflow. (process_archive_index_and_symbols): Check for invalid header size. (setup_archive): Add checks for invalid archives. (get_archive_member_name): Add range checks. * elfcomm.h (adjust_relative_path): Update prototyoe. * readelf.c (process_archive): Add range checks.
2014-12-01Don't enable gdbtk in testsuiteYao Qi3-195/+7
When I skim configure.ac and Makefile.in in gdb/testsuite, I happen to see that directory gdb.gdbtk is added to subdirs, however it doesn't exist. gdb/testsuite/gdb.gdbtk was removed by the patch below, [rfa] git repo fixup: delete gdb/testsuite/gdb.gdbtk http://thread.gmane.org/gmane.comp.gdb.patches/61489 and we should cleanup configure.ac accordingly. gdb/testsuite: 2014-12-01 Yao Qi <yao@codesourcery.com> * configure.ac: Remove AC_ARG_ENABLE for gdbtk. Don't invoke AC_CONFIG_SUBDIRS(gdb.gdbtk). * configure: Re-generated.
2014-12-01Automatic date update in version.inGDB Administrator1-1/+1
2014-11-30Add add-auto-load-scripts-directory.Jan Kratochvil5-0/+50
There is already "add-auto-load-safe-path" which works like "set auto-load safe-path" but in append mode. There was missing an append equivalent for "set auto-load scripts-directory". ABRT has directory /var/cache/abrt-di/ as an alternative one to /usr/lib/debug/ . Therefore ABRT needs to use -iex parameters to add this /var/cache/abrt-di/ directory as a first-class debuginfo directory. Using absolute "set auto-load scripts-directory" would hard-code the path possibly overriding local system directory additions; besides it would not be nice anyway. gdb/ChangeLog 2014-11-30 Jan Kratochvil <jan.kratochvil@redhat.com> Add add-auto-load-scripts-directory. * NEWS (Changes since GDB 7.8): Add add-auto-load-scripts-directory. * auto-load.c (add_auto_load_dir): New function. (_initialize_auto_load): Install it. gdb/doc/ChangeLog 2014-11-30 Jan Kratochvil <jan.kratochvil@redhat.com> Add add-auto-load-scripts-directory. * gdb.texinfo (Auto-loading): Add add-auto-load-scripts-directory link. (objfile-gdbdotext file): Add add-auto-load-scripts-directory.
2014-11-30Fix add-auto-load-safe-path typo.Jan Kratochvil2-3/+8
gdb/doc/ChangeLog 2014-11-30 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.texinfo (Auto-loading safe path): Fix add-auto-load-safe-path description typo.
2014-11-30frame.c: Fix the check for FID_STACK_INVALID in frame_id_eq()Martin Galvan2-1/+6
I noticed in frame_id_eq() we were checking for the "l" frame_id being invalid twice instead of checking both "l" and "r", so this patch corrects it. gdb/ChangeLog: * frame.c (frame_id_eq): Fix the check for FID_STACK_INVALID.
2014-11-30Power4 should treat mftb as extended mfspr mnemonicAlan Modra5-9/+19
On further reading of ISA manual it appears gas should have been treating mftb and mftbu as extended mnemonics for mfspr, for ISA 2.03 and later. opcodes/ * ppc-opc.c (powerpc_opcodes): Make mftb* generate mfspr for power4 and later. gas/testsuite/ * gas/ppc/a2.d: Update for mftb change. * gas/ppc/476.d: Likewise.
2014-11-30Don't output symbol version definitions for non-DT_NEEDED libsAlan Modra2-2/+13
PR 16452, 16457 * elflink.c (_bfd_elf_link_find_version_dependencies): Exclude symbols from libraries that won't be listed in DT_NEEDED. (elf_link_output_extsym): Don't output verdefs for such symbols.
2014-11-30Automatic date update in version.inGDB Administrator1-1/+1
2014-11-29Check that thread stack temps are not already enabled before enabling them.Siva Chandra2-1/+7
This fixes a regression introduced by 6c659fc2c7cd2da6d2b9a3d7c38597ad3821832a. gdb/ChangeLog: * eval.c (evaluate_subexp): Check that thread stack temporaries are not already enabled before enabling them.
2014-11-29[arm] compute framereg and framesize when neededYao Qi2-16/+23
I find local variables framereg and framesize is only used when cache isn't NULL. This patch to move the code into "if (cache)" block. gdb: 2014-11-29 Yao Qi <yao@codesourcery.com> * arm-tdep.c (arm_analyze_prologue): Move local variables 'framereg' and 'framesize' to inner block. Move code to inner block too.
2014-11-28Enable chained function calls in C++ expressions.Siva Chandra13-24/+523
gdb/ChangeLog: * eval.c: Include gdbthread.h. (evaluate_subexp): Enable thread stack temporaries before evaluating a complete expression and clean them up after the evaluation is complete. * gdbthread.h: Include common/vec.h. (value_ptr): New typedef. (VEC (value_ptr)): New vector type. (value_vec): New typedef. (struct thread_info): Add new fields stack_temporaries_enabled and stack_temporaries. (enable_thread_stack_temporaries) (thread_stack_temporaries_enabled_p, push_thread_stack_temporary) (get_last_thread_stack_temporary) (value_in_thread_stack_temporaries): Declare. * gdbtypes.c (class_or_union_p): New function. * gdbtypes.h (class_or_union_p): Declare. * infcall.c (call_function_by_hand): Store return values of class type as temporaries on stack. * thread.c (enable_thread_stack_temporaries): New function. (thread_stack_temporaries_enabled_p, push_thread_stack_temporary) (get_last_thread_stack_temporary): Likewise. (value_in_thread_stack_temporaries): Likewise. * value.c (value_force_lval): New function. * value.h (value_force_lval): Declare. gdb/testsuite/ChangeLog: * gdb.cp/chained-calls.cc: New file. * gdb.cp/chained-calls.exp: New file. * gdb.cp/smartp.exp: Remove KFAIL for "p c2->inta".
2014-11-29Automatic date update in version.inGDB Administrator1-1/+1
2014-11-28Remove broken nios2 assembler dwim support.Sandra Loosemore11-169/+45
2014-11-28 Sandra Loosemore <sandra@codesourcery.com> include/opcode/ * nios2.h (NIOS2_INSN_ADDI, NIOS2_INSN_ANDI): Delete. (NIOS2_INSN_ORI, NIOS2_INSN_XORI): Delete. (NIOS2_INSN_OPTARG): Renumber. opcodes/ * nios2-opc.c (nios2_r1_opcodes): Remove deleted attributes from descriptors. gas/ * config/tc-nios2.c (can_evaluate_expr, get_expr_value): Delete. (output_addi, output_andi, output_ori, output_xori): Delete. (md_assemble): Remove calls to deleted functions. gas/testsuite/ * gas/nios2/nios2.exp: Make "movi" a list test. * gas/nios2/movi.s: Adjust comments, add another case. * gas/nios2/movi.l: New. * gas/nios2/movi.d: Delete.
2014-11-28Fix prints in tests for Python 3Simon Marchi9-30/+41
Python 3's print requires to use parentheses, so this patch adds them where they were missing. gdb/testsuite/ChangeLog: * gdb.ada/py_range.exp: Add parentheses to calls to print. * gdb.dwarf2/symtab-producer.exp: Same. * gdb.gdb/python-interrupts.exp: Same. * gdb.gdb/python-selftest.exp: Same. * gdb.python/py-linetable.exp: Same. * gdb.python/py-type.exp: Same. * gdb.python/py-value-cc.exp: Same. * gdb.python/py-value.exp: Same.
2014-11-28Correct fabs and fneg insns in simulatorOleg Endo2-3/+21
It seems that the implementation of the SH fabs and fneg insns in the simulator is not correct. They use the FP_UNARY macro which checks the FPSCR.PR setting and raises an exception if PR = 1 (double precision) and the register number is not even (i.e. a valid DF reg number). For normal unary FP insns this is fine. However, fneg and fabs perform the same (integer) operations regardless of the FPSCR.PR setting. This issue initially popped up here https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63260 I've checked some of the failing tests mentioned in GCC PR 63260 above with the patch applied and the failures go away. sim/sh/ChangeLog (tiny patch): * gencode.c (fabs, fneg): Implement as integer operation instead of using the FP_UNARY macro.
2014-11-28Fix amd64 dwarf register number mapping (MMX register and higher)Pierre Muller2-1/+13
Dwarf register numbers are defined in "System V Application Binary Interface AMD64 Architecture Processor Supplement Draft Version 0.99.6" The amd64_dwarf_regmap array is missing the 8 MMX registers in Figure 3.36: DWARF Register Number Mapping page 57. This leads to a wrong value for the registers past this point. gdb/ChangeLog: Pushed by Joel Brobecker <brobecker@adacore.com>. * amd64-tdep.c (amd64_dwarf_regmap array): Add missing MMX registers. Tested on x86_64-linux.
2014-11-28Remove (dead-code) native core file sniffers on Linux targetsUlrich Weigand5-73/+11
Since Andreas Arnez' recent patch series, all Linux targets install gdbarch_iterate_over_regset_sections routines. This means that on Linux native targets, old-style core sniffers are never used. Most Linux targets haven't been using such sniffers for a long time anyway, but a couple remain: ia64 and sparc use core-regset.o, and m68k installs its own core_fns. All this is now dead code, which this commit removes. gdb/ 2014-11-28 Ulrich Weigand  <uweigand@de.ibm.com> * config/ia64/linux.mh (NATDEPFILES): Remove core-regset.o. * config/sparc/linux.mh (NATDEPFILES): Likewise. * config/sparc/linux64.mh (NATDEPFILES): Likewise. * m68klinux-nat.c (fetch_core_registers): Remove. (linux_elf_core_fns): Remove. (_initialize_m68k_linux_nat): Do not call deprecated_add_core_fns.
2014-11-28gdb_realpath: Rework comment about handling on Windows.Joel Brobecker2-9/+32
Rework the comment to explain why we're still relying on GetFullPathName even though gnulib ensures that canonicalize_file_name is now available on all platforms, including Windows. gdb/ChangeLog: * utils.c (gdb_realpath): Rework comment about handling on Windows.
2014-11-28Import rename moduleYao Qi24-35/+4303
This patch is to import rename module. gdb: 2014-11-28 Yao Qi <yao@codesourcery.com> * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add rename. * gnulib/aclocal.m4: Re-generated. * gnulib/config.in: Re-generated. * gnulib/configure: Re-generated. * gnulib/import/Makefile.am: Re-generated. * gnulib/import/Makefile.in: Re-generated. * gnulib/import/m4/gnulib-cache.m4: Re-generated. * gnulib/import/m4/gnulib-comp.m4: Re-generated. * import/basename-lgpl.c: New file. * import/dirname-lgpl.c: New file. * import/dirname.h: New file. * import/m4/dirname.m4: New file. * import/m4/malloc.m4: New file. * import/m4/rename.m4: New file. * import/m4/rmdir.m4: New file. * import/m4/stdio_h.m4: New file. * import/malloc.c: New file. * import/rename.c: New file. * import/rmdir.c: New file. * import/same-inode.h: New file. * import/stdio.c: New file. * import/stdio.in.h: New file. * import/stripslash.c: New file.
2014-11-28Use canonicalize_file_name unconditionallyYao Qi5-69/+19
gdb: 2014-11-28 Yao Qi <yao@codesourcery.com> * configure.ac (AC_CHECK_FUNCS): Remove canonicalize_file_name and realpath. * config.in: Re-generated. * configure: Re-generated. * utils.c (gdb_realpath): Remove code calling realpath, canonicalize_file_name and pathconf. [!_WIN32]: Call canonicalize_file_name.
2014-11-28Import canonicalize-lgplYao Qi21-67/+3315
This patch is to import canonicalize-lgpl module, which provides readlpath and canonicalize_file_name. gdb: 2014-11-28 Yao Qi <yao@codesourcery.com> * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add canonicalize-lgpl. * aclocal.m4: Re-generated. * config.in: Re-generated. * configure: Re-generated. * import/Makefile.am: Re-generated. * import/Makefile.in: Re-generated. * import/m4/gnulib-cache.m4: Re-generated. * import/m4/gnulib-comp.m4: Re-generated. * import/canonicalize-lgpl.c: New file. * import/extra/snippet/_Noreturn.h: New file. * import/m4/canonicalize.m4: New file. * import/m4/double-slash-root.m4: New file. * import/m4/eealloc.m4: New file. * import/m4/malloca.m4: New file. * import/m4/nocrash.m4: New file. * import/m4/stdlib_h.m4: New file. * import/malloca.c: New file. * import/malloca.h: New file. * import/malloca.valgrind: New file.
2014-11-28Use lstat unconditionallyYao Qi5-7/+9
Since lstat gnulib module is imported, we can use it unconditionally. lstat usage was introduced by this patch https://sourceware.org/ml/gdb-patches/2012-01/msg00390.html during the review, it was suggested to import gnulib lstat module, but we didn't do that. gdb: 2014-11-28 Yao Qi <yao@codesourcery.com> * configure.ac (AC_CHECK_FUNCS): Remove lstat. * config.in, configure: Regenerate. * symfile.c (find_separate_debug_file_by_debuglink): Remove code checking HAVE_LSTAT is defined.
2014-11-28Import lstatYao Qi11-79/+400
This patch is to import lstat gnulib module. gdb: 2014-11-28 Yao Qi <yao@codesourcery.com> * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add lstat. * gnulib/aclocal.m4: Re-generated. * gnulib/config.in: Re-generated. * gnulib/configure: Re-generated. * gnulib/import/Makefile.am: Re-generated. * gnulib/import/Makefile.in: Re-generated. * gnulib/import/m4/gnulib-cache.m4: Re-generated. * gnulib/import/m4/gnulib-comp.m4: Re-generated. * gnulib/import/lstat.c: New file. * gnulib/import/m4/lstat.m4: New file.
2014-11-28Use readlink unconditionallyYao Qi10-15/+19
Since readlink module is imported, we can use it unconditionally. This patch is to remove configure checks and HAVE_READLINK checks in code. It was mentioned in the patch below [RFA/commit] gdbserver: return ENOSYS if readlink not supported. https://sourceware.org/ml/gdb-patches/2012-02/msg00148.html to use readlink in gdbserver, but we chose something simple at that moment. gdb: 2014-11-28 Yao Qi <yao@codesourcery.com> * configure.ac (AC_CHECK_FUNCS): Remove readlink. * config.in, configure: Re-generate. * inf-child.c (inf_child_fileio_readlink): Don't check HAVE_READLINK is defined. gdb/gdbserver: 2014-11-28 Yao Qi <yao@codesourcery.com> * configure.ac(AC_CHECK_FUNCS): Remove readlink. * config.in, configure: Re-generate. * hostio.c (handle_unlink): Remove code checking HAVE_READLINK is defined.
2014-11-28Import readlinkYao Qi15-67/+1245
This patch is to import readlink gnulib module. stat module is imported too, but it isn't used by gdb. gdb: 2014-11-28 Yao Qi <yao@codesourcery.com> * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add readlink. * gnulib/aclocal.m4: Re-generated. * gnulib/config.in: Likewise. * gnulib/configure: Likewise. * gnulib/import/Makefile.am: Likewise. * gnulib/import/Makefile.in: Likewise. * gnulib/import/m4/gnulib-cache.m4: Likewise. * gnulib/import/m4/gnulib-comp.m4: Likewise. * gnulib/import/dosname.h: New file * gnulib/import/m4/largefile.m4: New file. * gnulib/import/m4/readlink.m4: New file. * gnulib/import/m4/stat.m4: New file. * gnulib/import/readlink.c: New file. * gnulib/import/stat.c: New file.
2014-11-28Fix date in changelogYao Qi1-1/+1
2014-11-28Sanity checks on version sectionAlan Modra2-12/+30
* elf.c (_bfd_elf_slurp_version_tables): Exit loops when vn_next/ vna_next/vd_next/vda_next is zero. Correct counts.
2014-11-28Don't deprecate powerpc mftb insnAlan Modra2-7/+15
mftb is marked phased out in the architecture manual, but we can keep it as an extended mnemonic for mftbl. * ppc-opc.c (powerpc_opcodes <mftb>): Don't deprecate for power7. (TB): Delete. (insert_tbr, extract_tbr): Validate tbr number.
2014-11-28Fix build breakage on 32-bit targets with 64-bit bfdAlan Modra2-5/+18
* readelf.c (get_32bit_elf_symbols): Cast bfd_size_type values to unsigned long for %lx. (get_64bit_elf_symbols, process_section_groups): Likewise.
2014-11-28Match library name prefixed with sysrootYao Qi2-1/+14
We enable systemtap probe in glibc recently, and see the following gdb fail, (gdb) set solib-absolute-prefix /. ... Stopped due to shared library event:^M Inferior loaded /./foo/bar/gdb.base/break-probes-solib.so ... (gdb) FAIL: gdb.base/break-probes.exp: run til our library loads (the program exited) $binfile_lib is /foo/bar/gdb.base/break-probes-solib.so, but the sysroot is prefixed in solib.c:solib_find, as comments described: Global variable GDB_SYSROOT is used as a prefix directory to search for shared libraries if they have an absolute path. so the output becomes "/./foo/bar/gdb.base/break-probes-solib.so", which is still correct. However, the test repeatedly continue the program and tries to match $binfile_lib, finally, the program exits and the test fails. This patch is to adjust the pattern to match $sysroot$binfile_lib instead of $binfile_lib. gdb/testsuite: 2014-11-28 Yao Qi <yao@codesourcery.com> * gdb.base/break-probes.exp: Match library name prefixed with sysroot.
2014-11-28Automatic date update in version.inGDB Administrator1-1/+1
2014-11-27Fixes an infinite loop in readelf parsing a corrupt binary, and other minor ↵Espen Grindhaug2-20/+80
corrections. PR binutils/17531 * readelf.c (get_data): Move excessive length check to earlier on in the function and allow for wraparound in the arithmetic. (get_32bit_elf_symbols): Terminate early if the section size is zero. Check for an invalid sh_entsize. Check for an index section with an invalid size. (get_64bit_elf_symbols): Likewise. (process_section_groups): Check for an invalid sh_entsize.