aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-08-18Fix symbol versioning problems in PR 18703.Cary Coutant11-21/+171
If a symbol is defined with ".symver foo,foo@VER", the assembler creates two symbols in the object: one unversioned, and one with the (non-default) version "VER". If foo is listed in a version script, gold would then make the first of those symbols the default version, and would ignore the second symbol as a duplicate, without making it a non-default version. While this is arguably reasonable behavior, it doesn't match Gnu ld behavior, so this patch fixes that by allowing the second definition to override the first by resetting the "default version" indication. Several test cases from the Gnu ld testsuite also exposed another related problem, where a symbol defined with ".symver foo,foo@", placed into a shared library, is not handled properly by gold. This patch also fixes that case, binding the symbol to the base version. gold/ PR gold/18703 * dynobj.cc (Versions::record_version): Handle symbol defined with base version. (Versions::symbol_section_contents): Likewise. * symtab.h (Symbol::set_is_not_default): New class method. (Symbol_table::resolve): Add is_default_version parameter. (Symbol_table::should_override): Likewise. * resolve.cc (Symbol_table::resolve): Add is_default_version parameter, and pass to should_override. Adjust all callers and explicit instantiations. (Symbol_table::should_override): Add is_default_value parameter; allow default version in a dynamic object to override existing definition from same object. * symtab.cc (Symbol_table::add_from_object): Handle case where same symbol is defined as unversioned and non-default version in the same object. * testsuite/Makefile.am (ver_test_13): New test case. * testsuite/Makefile.in: Regenerate. * testsuite/ver_test_4.cc: Add test for symbol with base version. * testsuite/ver_test_4.sh: Likewise. * testsuite/ver_test_13.c: New source file. * testsuite/ver_test_13.script: New version script. * testsuite/ver_test_13.sh: New test case.
2015-08-19Automatic date update in version.inGDB Administrator1-1/+1
2015-08-18gdbserver/linux-aarch32-low: build failure when NT_ARM_VFP not definedJoel Brobecker2-0/+10
On some older versions of GNU/Linux, gdbserver now fails to build due to an undefined reference to NT_ARM_VFP. Same issue on Android, where this macros is undefined until Android API level 21 (Android 5.0 "Lollipop"). This patch modifies linux-aarch32-low.c to define that macros when not already defined. gdb/gdbserver/ChangeLog: * linux-aarch32-low.c (NT_ARM_VFP): Define if not already defined.
2015-08-18PR mi/18833 gdb.execute ("set param value", to_string=True) will crash gdb ↵Doug Evans9-47/+234
if using MI gdb/ChangeLog: * cli/cli-logging.c (pop_output_files): Don't restore redirection if MI-like. * mi/mi-out.c: #include "vec.h". (ui_filep): New type. (DEV_VEC_P (ui_filep)): New type. (struct ui_out_data) <buffer, original_buffer>: Delete. (struct ui_out_data) <streams>: New member. (mi_ui_out_impl): Add data_destroy field. (mi_field_string, mi_field_fmt): Update. (mi_flush, mi_redirect, field_separator): Update. (mi_open, mi_close): Update. (mi_out_buffered, mi_out_rewind, mi_out_put): Update. (mi_out_data_ctor, mi_out_data_dtor): New functions. (mi_out_new): Call mi_out_data_ctor. testsuite/gdb/ChangeLog: * lib/gdb.exp (skip_python_tests_prompt): Renamed from skip_python_tests. New arg prompt_regexp. (skip_python_tests): New function. * lib/mi-support.exp (mi_skip_python_tests): New function. * gdb.python/py-mi-objfile-gdb.py: New file. * gdb.python/py-mi-objfile.c: New file. * gdb.python/py-mi-objfile.exp: New file.
2015-08-18Add another test for PR ld/18841H.J. Lu3-5/+44
PR ld/18841 * ld-ifunc/ifunc.exp: Add another test for PR ld/18841. * ld-ifunc/pr18841c.c: New file.
2015-08-18Fix mis-parsing of hex register numbers in 'T' stop replies.Sandra Loosemore2-12/+30
2015-08-18 Sandra Loosemore <sandra@codesourcery.com> gdb/ * remote.c (strprefix): New. (remote_parse_stop_reply): Use strprefix instead of strncmp to ensure exact match of keyword.
2015-08-18Return reloc_class_ifunc for reloc against IFUNCH.J. Lu10-13/+119
elf_XXX_reloc_type_class should return reloc_class_ifunc for relocation against STT_GNU_IFUNC symbol. bfd/ PR ld/18841 * elf-bfd.h (elf_link_hash_table): Add dynsym. * elf32-i386.c (elf_i386_reloc_type_class): Return reloc_class_ifunc for relocation against STT_GNU_IFUNC symbol. * elf64-x86-64.c (elf_x86_64_reloc_type_class): Likewise. * elflink.c (_bfd_elf_link_create_dynamic_sections): Set dynsym. (bfd_elf_size_dynsym_hash_dynstr): Use dynsym. (elf_final_link_info): Remove dynsym_sec. (elf_link_output_extsym): Replace dynsym_sec with dynsym. (bfd_elf_final_link): Remove reference to dynsym_sec. Replace dynsym_sec with dynsym. ld/testsuite/ PR ld/18841 * ld-ifunc/ifunc.exp: Add a test for PR ld/18841. * ld-ifunc/pr18841.out: New file. * ld-ifunc/pr18841a.c: Likewise. * ld-ifunc/pr18841b.c: Likewise.
2015-08-18gdb/doc: Fix build of 'info' manual.Andrew Burgess2-0/+5
In commit 18989b3c5642e2ba533e02737797dcf06134229b I broke the creation of gdb's info manual; I added a new section without adding a suitable menu entry. This commit adds the missing menu entry and fixes the build of gdb's info manual. gdb/doc/ChangeLog: * gdb.texinfo (GDB Files): Add 'File Caching' menu entry.
2015-08-18[AArch64] Cleanup TLS relocation types which don't go through GOT tableJiong Wang2-37/+7
This patch done two types of cleanup: * in aarch64_reloc_got_type and elfNN_aarch64_relocate_section We don't need those redundant "case" check, as they can be merged with the "default" which just "break". * in elfNN_aarch64_gc_sweep_hook and elfNN_aarch64_check_relocs All TLS local executable relocations and some local dynamic relocations (those calculate module offset) actually don't need GOT entry, so remove them from GOT entry counting. 2015-08-18 Jiong Wang <jiong.wang@arm.com> bfd/ * elfnn-aarch64.c (aarch64_reloc_got_type): Delete useless check. (elfNN_aarch64_relocate_section): Likewise. (elfNN_aarch64_gc_sweep_hook): Likewise. (elfNN_aarch64_check_relocs): Likewise.
2015-08-18gdb: Add debug tracing for bfd cache activity.Andrew Burgess5-1/+78
This patch adds a new debug flag bfd-cache, which when set to non-zero produces debugging log messages relating to gdb's bfd cache. gdb/ChangeLog: * gdb_bfd.c (debug_bfd_cache): New variable. (show_bfd_cache_debug): New function. (gdb_bfd_open): Add debug logging. (gdb_bfd_ref): Likewise. (gdb_bfd_unref): Likewise. (_initialize_gdb_bfd): Add new set/show command. * NEWS: Mention new command. gdb/doc/ChangeLog: * gdb.texinfo (File Caching): Document "set/show debug bfd-cache".
2015-08-18gdb: New maintenance command to disable bfd sharing.Andrew Burgess5-9/+79
In some rare maintainer cases it is desirable to be able to disable bfd sharing. This patch adds new commands maintenance set/show commands for bfd-sharing, allowing gdb's bfd cache to be turned off. gdb/ChangeLog: * gdb_bfd.c (bfd_sharing): New variable. (show_bfd_sharing): New function. (gdb_bfd_open): Check bfd_sharing variable. (_initialize_gdb_bfd): Add new set/show command. * NEWS: Mention new command. gdb/doc/ChangeLog: * gdb.texinfo (Maintenance Commands): Move documentation of "main info bfds" to... (File Caching): A New section. Outline bfd caching, and add new description for "main set/show bfd-sharing".
2015-08-18gdb: Improve cache matching criteria for the bfd cache.Andrew Burgess2-1/+53
Within gdb open bfd objects are reused where possible if an attempt is made to reopen a file that is already being debugged. To spot if the on disc file has changed gdb currently examines the mtime of the file and compares it to the mtime of the open bfd in the cache. A problem exists when the on disc file is being rapidly regenerated, as happens, for example, with automated testing. In some cases the file is generated so quickly that the mtime appears not to change, while the on disc file has changed. This patch extends the bfd cache to also hold the file size of the file, the inode of the file, and the device id of the file; gdb can then compare filename, file size, mtime, inode, and device id to determine if an existing bfd object can be reused. gdb/ChangeLog: * gdb_bfd.c (struct gdb_bfd_data): Add size, inode, and device id field. (struct gdb_bfd_cache_search): Likewise. (eq_bfd): Compare the size, inode, and device id fields. (gdb_bfd_open): Initialise the size, inode, and device id fields. (gdb_bfd_ref): Likewise. (gdb_bfd_unref): Likewise.
2015-08-18Add output_type to bfd_link_infoH.J. Lu161-1932/+2279
The "shared" field in bfd_link_info is set for both DSO and and PIE. There are separate fields for executable and relocatable outputs. This patch adds an "output_type" field: enum output_type { type_unknown = 0, type_executable, type_dll, type_relocatable }; and a "pic" field to bfd_link_info to replace shared, executable and relocatable fields so that we can use the "output_type" field to check for output type and the "pic" field check if output is PIC. Macros, bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie, are provided to check for output features. bfd/ * bfd/aoutx.h: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * bfd/bout.c: Likewise. * bfd/coff-alpha.c: Likewise. * bfd/coff-arm.c: Likewise. * bfd/coff-i386.c: Likewise. * bfd/coff-i960.c: Likewise. * bfd/coff-m68k.c: Likewise. * bfd/coff-mcore.c: Likewise. * bfd/coff-mips.c: Likewise. * bfd/coff-ppc.c: Likewise. * bfd/coff-rs6000.c: Likewise. * bfd/coff-sh.c: Likewise. * bfd/coff-tic80.c: Likewise. * bfd/coff-x86_64.c: Likewise. * bfd/coff64-rs6000.c: Likewise. * bfd/coffgen.c: Likewise. * bfd/cofflink.c: Likewise. * bfd/ecoff.c: Likewise. * bfd/ecofflink.c: Likewise. * bfd/elf-bfd.h: Likewise. * bfd/elf-eh-frame.c: Likewise. * bfd/elf-ifunc.c: Likewise. * bfd/elf-m10200.c: Likewise. * bfd/elf-m10300.c: Likewise. * bfd/elf-s390-common.c: Likewise. * bfd/elf-vxworks.c: Likewise. * bfd/elf.c: Likewise. * bfd/elf32-arm.c: Likewise. * bfd/elf32-avr.c: Likewise. * bfd/elf32-bfin.c: Likewise. * bfd/elf32-cr16.c: Likewise. * bfd/elf32-cr16c.c: Likewise. * bfd/elf32-cris.c: Likewise. * bfd/elf32-crx.c: Likewise. * bfd/elf32-d10v.c: Likewise. * bfd/elf32-dlx.c: Likewise. * bfd/elf32-epiphany.c: Likewise. * bfd/elf32-fr30.c: Likewise. * bfd/elf32-frv.c: Likewise. * bfd/elf32-ft32.c: Likewise. * bfd/elf32-h8300.c: Likewise. * bfd/elf32-hppa.c: Likewise. * bfd/elf32-i370.c: Likewise. * bfd/elf32-i386.c: Likewise. * bfd/elf32-i860.c: Likewise. * bfd/elf32-ip2k.c: Likewise. * bfd/elf32-iq2000.c: Likewise. * bfd/elf32-lm32.c: Likewise. * bfd/elf32-m32c.c: Likewise. * bfd/elf32-m32r.c: Likewise. * bfd/elf32-m68hc11.c: Likewise. * bfd/elf32-m68hc1x.c: Likewise. * bfd/elf32-m68k.c: Likewise. * bfd/elf32-mcore.c: Likewise. * bfd/elf32-mep.c: Likewise. * bfd/elf32-metag.c: Likewise. * bfd/elf32-microblaze.c: Likewise. * bfd/elf32-moxie.c: Likewise. * bfd/elf32-msp430.c: Likewise. * bfd/elf32-mt.c: Likewise. * bfd/elf32-nds32.c: Likewise. * bfd/elf32-nios2.c: Likewise. * bfd/elf32-or1k.c: Likewise. * bfd/elf32-ppc.c: Likewise. * bfd/elf32-rl78.c: Likewise. * bfd/elf32-rx.c: Likewise. * bfd/elf32-s390.c: Likewise. * bfd/elf32-score.c: Likewise. * bfd/elf32-score7.c: Likewise. * bfd/elf32-sh-symbian.c: Likewise. * bfd/elf32-sh.c: Likewise. * bfd/elf32-sh64.c: Likewise. * bfd/elf32-spu.c: Likewise. * bfd/elf32-tic6x.c: Likewise. * bfd/elf32-tilepro.c: Likewise. * bfd/elf32-v850.c: Likewise. * bfd/elf32-vax.c: Likewise. * bfd/elf32-visium.c: Likewise. * bfd/elf32-xc16x.c: Likewise. * bfd/elf32-xstormy16.c: Likewise. * bfd/elf32-xtensa.c: Likewise. * bfd/elf64-alpha.c: Likewise. * bfd/elf64-hppa.c: Likewise. * bfd/elf64-ia64-vms.c: Likewise. * bfd/elf64-mmix.c: Likewise. * bfd/elf64-ppc.c: Likewise. * bfd/elf64-s390.c: Likewise. * bfd/elf64-sh64.c: Likewise. * bfd/elf64-x86-64.c: Likewise. * bfd/elflink.c: Likewise. * bfd/elfnn-aarch64.c: Likewise. * bfd/elfnn-ia64.c: Likewise. * bfd/elfxx-mips.c: Likewise. * bfd/elfxx-sparc.c: Likewise. * bfd/elfxx-tilegx.c: Likewise. * bfd/i386linux.c: Likewise. * bfd/linker.c: Likewise. * bfd/m68klinux.c: Likewise. * bfd/pdp11.c: Likewise. * bfd/pe-mips.c: Likewise. * bfd/peXXigen.c: Likewise. * bfd/reloc.c: Likewise. * bfd/reloc16.c: Likewise. * bfd/sparclinux.c: Likewise. * bfd/sunos.c: Likewise. * bfd/vms-alpha.c: Likewise. * bfd/xcofflink.c: Likewise. include/ * include/bfdlink.h (output_type): New enum. (bfd_link_executable): New macro. (bfd_link_dll): Likewise. (bfd_link_relocatable): Likewise. (bfd_link_pic): Likewise. (bfd_link_pie): Likewise. (bfd_link_info): Remove shared, executable, pie and relocatable. Add output_type and pic. ld/ * ld/ldctor.c: Replace shared, executable, relocatable and pie fields with bfd_link_executable, bfd_link_dll, bfd_link_relocatable, bfd_link_pic and bfd_link_pie. * ld/ldemul.c: Likewise. * ld/ldfile.c: Likewise. * ld/ldlang.c: Likewise. * ld/ldmain.c: Likewise. * ld/ldwrite.c: Likewise. * ld/lexsup.c: Likewise. * ld/pe-dll.c: Likewise. * ld/plugin.c: Likewise. * ld/emultempl/aarch64elf.em: Likewise. * ld/emultempl/aix.em: Likewise. * ld/emultempl/alphaelf.em: Likewise. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/armelf.em: Likewise. * ld/emultempl/avrelf.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/cr16elf.em: Likewise. * ld/emultempl/elf-generic.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/genelf.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/hppaelf.em: Likewise. * ld/emultempl/irix.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68hc1xelf.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/m68kelf.em: Likewise. * ld/emultempl/metagelf.em: Likewise. * ld/emultempl/mipself.em: Likewise. * ld/emultempl/mmo.em: Likewise. * ld/emultempl/msp430.em: Likewise. * ld/emultempl/nds32elf.em: Likewise. * ld/emultempl/needrelax.em: Likewise. * ld/emultempl/nios2elf.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/ppc32elf.em: Likewise. * ld/emultempl/ppc64elf.em: Likewise. * ld/emultempl/sh64elf.em: Likewise. * ld/emultempl/solaris2.em: Likewise. * ld/emultempl/spuelf.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/tic6xdsbt.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/v850elf.em: Likewise. * ld/emultempl/vms.em: Likewise. * ld/emultempl/vxworks.em: Likewise.
2015-08-18x86/Linux: disable all-stop on top of non-stopPedro Alves3-0/+21
Markus reported that ASNS breaks target record-btrace. In particular, the gdb.btrace/multi-thread-step.exp test fails (both with BTS and PT tracing) with a crash in py-inferior.c: Program received signal SIGSEGV, Segmentation fault. 0x00000000006aa40d in add_thread_object (tp=0x27d32d0) at /users/mmetzger/team/gdb/git/gdb/python/py-inferior.c:337 337 entry->next = inf_obj->threads; My machine doesn't support BTS nor PT, so I missed this... Disabling ASNS temporarily on x86 until this is addressed. Tested on x86_64 Fedora 20. gdb/ChangeLog: 2015-08-18 Pedro Alves <palves@redhat.com> * linux-nat.c (linux_nat_always_non_stop_p): If the linux_ops target implements to_always_non_stop_p, call it. * x86-linux-nat.c (x86_linux_always_non_stop_p): New function. (x86_linux_create_target): Install it as to_always_non_stop_p method.
2015-08-18Use $SED in bfd MakefileAlan Modra3-28/+34
PR 18667 * Makefile.am: Use $(SED) in place of sed throughout. * Makefile.in: Regenerate.
2015-08-18PPC64: Allow .TOC. in linker script to override backend calculated valueAlan Modra4-4/+49
bfd/ * elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't redefine .TOC. if already defined, and set linker_def. (ppc64_elf_set_toc): Use .TOC. value if defined other than by the backend. ld/ * ldexp.c (exp_fold_tree_1): Clear linker_def on symbol assignment.
2015-08-18Automatic date update in version.inGDB Administrator1-1/+1
2015-08-17ui-out.c (default_ui_out_impl): Add comment.Doug Evans2-1/+5
gdb/ChangeLog: * ui-out.c (default_ui_out_impl): Add comment.
2015-08-17[D] Implement looking up members of D enums.Iain Buclaw3-3/+24
In D, all named enums are explicitly scoped (the C++ equivalent of enum class) so they should be handled as such in the language-specific symbol lookup routines. However so as to support D compilers that don't emit enums as DW_AT_enum_class, need to make sure that appropriate checks for TYPE_DECLARED_CLASS are done. gdb/ChangeLog * d-exp.y (type_aggregate_p): New function. (PrimaryExpression : TypeExp '.' IdentifierExp): Use it. (classify_inner_name): Likewise. * d-namespace.c (d_lookup_nested_symbol): Handle TYPE_CODE_ENUM.
2015-08-17Move strace -m/explicit location test to strace.expKeith Seitz3-4/+10
One of the build slaves shows this error running explicit.exp: (gdb) strace -m gdbfoobarbaz Remote failure reply: E.In-process agent library not loaded in process. Fast and static tracepoints unavailable. (gdb) FAIL: gdb.linespec/explicit.exp: strace -m gdbfoobarbaz There are two big problems with this test: 1) The expected output is actually not what the test is meant to test for. 2) This test should really only run where it is supported. This is most easily fixed by moving the test to gdb.trace/strace.exp. gdb/testsuite/ChangeLog * gdb.linespec/explicit.exp: Move strace test from here ... * gdb.trace/strace.exp: ... to here.
2015-08-17Regen binutils/configureAlan Modra2-67/+30
Looks like previous regen wasn't using current sources. * configure: Regenerate.
2015-08-17Trailing space in opcodes/ generated filesAlan Modra5-845/+835
HJ recently removed trailing space in binutils files, but unfortunately they return when regenerating files in opcodes. This fixes the regen process. * cgen.sh: Trim trailing space from cgen output. * ia64-gen.c (print_dependency_table): Don't generate trailing space. (print_dis_table): Likewise. * opc2c.c (dump_lines): Likewise. (orig_filename): Warning fix. * ia64-asmtab.c: Regenerate.
2015-08-17Automatic date update in version.inGDB Administrator1-1/+1
2015-08-17Rationalize ARM .alignAlan Modra4-48/+14
* gas/config/tc-arm.c (s_align): Delete. (md_pseudo_table): Use s_align_ptwo for "align". * gas/config/tc-arm.h (TC_ALIGN_ZERO_IS_DEFAULT): Define. * read.c (s_align): Modify for TC_ALIGN_ZERO_IS_DEFAULT.
2015-08-15psymtab.c (add_psymbol_to_bcache): Remove "val" arg.Doug Evans7-78/+59
gdb/ChangeLog: * psymtab.c (add_psymbol_to_bcache): Remove "val" arg. All callers updated. (add_psymbol_to_list): Ditto.
2015-08-16Automatic date update in version.inGDB Administrator1-1/+1
2015-08-15Add end_psymtab_common, have all debug info readers call it.Doug Evans9-72/+82
gdb/ChangeLog: * dbxread.c (dbx_end_psymtab): Renamed from end_psymtab. All callers updated. Call end_psymtab_common. * dwarf2read.c (process_psymtab_comp_unit_reader): Call end_psymtab_common. (build_type_psymtabs_reader): Ditto. * psympriv.h (sort_pst_symbols): Delete. (end_psymtab_common): Declare. * psymtab.c (sort_pst_symbols): Make static. (end_psymtab_common): New function. * xcoffread.c (xcoff_end_psymtab): Call end_psymtab_common.
2015-08-15Use macros for some enum bit field sizes.Doug Evans4-14/+44
gdb/ChangeLog: * defs.h (LANGUAGE_BITS): Define. * psympriv.h (partial_symbol) <domain>: Use SYMBOL_DOMAIN_BITS. (partial_symbol) <aclass>: Use SYMBOL_ACLASS_BITS. * symtab.h (general_symbol_info> <language>: Usage LANGUAGE_BITS. (minimal_symbol_type): Add nr_minsym_types. (MINSYM_TYPE_BITS): Define. (minimal_symbol) <type>: Use MINSYM_TYPE_BITS. (domain_enum_tag): Add NR_DOMAINS. (SYMBOL_DOMAIN_BITS): Change from 4 to 3. (SYMBOL_ACLASS_BITS): Define from 6 to 5.
2015-08-15objfiles.h,psympriv.h,psymtab.c: Whitespace.Doug Evans4-222/+236
gdb/ChangeLog: * objfiles.h: Whitespace cleanup. * psympriv.h: Whitespace cleanup. * psymtab.c: Whitespace/coding convention cleanup.
2015-08-15Fix invoking "[kill|detach] inferiors" on inferiors that are not runningPatrick Palka5-0/+108
Invoking either of the above commands on an inferior that's not running triggers the following assert failure: .../binutils-gdb/gdb/thread.c:514: internal-error: any_thread_of_process: Assertion `pid != 0' failed. The fix is straightforward. This patch also adds a test to check the basic functionality of these commands, along with testing this fix in particular. Tested on x86_64 Linux. gdb/ChangeLog: * inferior.c (detach_inferior_command): Don't call any_thread_of_process when pid is 0. (kill_inferior_command): Likewise. gdb/testsuite/ChangeLog: * gdb.base/kill-detach-inferiors-cmd.exp: New test file. * gdb.base/kill-detach-inferiors-cmd.c: New test file.
2015-08-14perftest/utils.py (select_file): Kill any existing inferior before selecting ↵Doug Evans2-0/+6
a new file. gdb/testsuite/ChangeLog: * gdb.perf/lib/perftest/utils.py (select_file): Kill any existing inferior before selecting a new file.
2015-08-14New /s modifier for the disassemble command.Doug Evans15-59/+1045
The "source centric" /m option to the disassemble command is often unhelpful, e.g., in the presence of optimized code. This patch adds a /s modifier that is better. For one, /m only prints instructions from the originating source file, leaving out instructions from e.g., inlined functions from other files. gdb/ChangeLog: PR gdb/11833 * NEWS: Document new /s modifier for the disassemble command. * cli/cli-cmds.c (disassemble_command): Add support for /s. (_initialize_cli_cmds): Update online docs of disassemble command. * disasm.c: #include "source.h". (struct deprecated_dis_line_entry): Renamed from dis_line_entry. All uses updated. (dis_line_entry): New struct. (hash_dis_line_entry, eq_dis_line_entry): New functions. (allocate_dis_line_table): New functions. (maybe_add_dis_line_entry, line_has_code_p): New functions. (dump_insns): New arg end_pc. All callers updated. (do_mixed_source_and_assembly_deprecated): Renamed from do_mixed_source_and_assembly. All callers updated. (do_mixed_source_and_assembly): New function. (gdb_disassembly): Handle /s (DISASSEMBLY_SOURCE). * disasm.h (DISASSEMBLY_SOURCE_DEPRECATED): Renamed from DISASSEMBLY_SOURCE. All uses updated. (DISASSEMBLY_SOURCE): New macro. * mi/mi-cmd-disas.c (mi_cmd_disassemble): New modes 4,5. gdb/doc/ChangeLog: * gdb.texinfo (Machine Code): Update docs for mixed source/assembly disassembly. (GDB/MI Data Manipulation): Update docs for new disassembly modes. gdb/testsuite/ChangeLog: * gdb.mi/mi-disassemble.exp: Update. * gdb.base/disasm-optim.S: New file. * gdb.base/disasm-optim.c: New file. * gdb.base/disasm-optim.h: New file. * gdb.base/disasm-optim.exp: New file.
2015-08-14Rename `typename' in d-exp.y to avoid C++ reserved wordKeith Seitz2-3/+8
A recent patch introduced a variable named `typename' into d-exp.y, and one of the --enable-with-cxx build slaves consequently failed to compile this. This patch simply adds an underscore into the name to avoid the reserved word. gdb/ChangeLog * d-exp.y (PrimaryExpression : TypeExp '.' IdentifierExp): Rename `typename' to `type_name' to avoid C++ reserved word.
2015-08-15Automatic date update in version.inGDB Administrator1-1/+1
2015-08-14Rename location accessor macro parameters to silence ARIKeith Seitz2-6/+12
The locations patch I recently committed contains macro definitions such as: This causes an ARI error to be emitted by the server ("Do not use PTR, ISO C 90 implies `void *'"). While this ARI error is bogus in this context, it is just easiest to squash the error completely by renaming the macro parameters. gdb/ChangeLog * location.c (EL_TYPE, EL_LINESPEC, EL_PROBE, EL_ADDRESS) (EL_EXPLICIT, EL_STRING): Change macro parameter to "P" to silence ARI errors.
2015-08-14Add missing ChangeLog entry for previous commit.Keith Seitz1-0/+5
2015-08-14mi_make_breakpoint: add "evaluated-by" optionKeith Seitz1-2/+12
For some time now, GDB has permitted target-side evaluation of breakpoint conditions. On targets that support this feature, GDB may output an "evaluated-by" field into the breakpoint reply. This patch adds handling for this option, and outputs a default pattern to optionally recognize (and ignore) this pattern in the reply. gdb/testsuite/ChangeLog * lib/mi-support.exp (mi_make_breakpoint): Add option/handling for "evaluated-by".
2015-08-14Fix ARI warnings in d-exp.yIain Buclaw2-10/+18
This fixes four ARI warnings found in d-exp.y. This is comprised of three uses of the && or || at the end of a line, and one use of sprintf. gdb/ChangeLog * d-exp.y (PrimaryExpression : TypeExp '.' IdentifierExp): Use xstrprintf instead of malloc and sprintf. (PrimaryExpression : IdentifierExp): Avoid operator at end of line. (lex_one_token): Likewise.
2015-08-14Add support for DT_MIPS_RLD_MAP_REL.Matthew Fortune4-20/+91
This tag allows debugging of MIPS position independent executables and provides access to shared library information. gdb/gdbserver/ * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP_REL. gdb/ * solib-svr4.c (read_program_header): Add base_addr argument to report the runtime address of the segment. (find_program_interpreter): Update read_program_header call to pass a NULL pointer for the new argument. (scan_dyntag): Add ptr_addr argument to report the runtime address of the tag payload. (scan_dyntag_auxv): Likewise and use thew new base_addr argument of read_program_header to get the base address of the dynamic segment. (elf_locate_base): Update uses of scan_dyntag, scan_dyntag_auxv and read_program_header. (elf_locate_base): Scan for and handle DT_MIPS_RLD_MAP_REL.
2015-08-14Add myself to gdb MAINTAINERSMatthew Fortune2-0/+5
gdb/ * MAINTAINERS (Write After Approval): Add Matthew Fortune.
2015-08-14Revert "Fix encoding or OpenRisk1000 PC relative relocations."Alan Modra2-3/+8
This reverts commit dbac553d28887561e3f154654ec8e70195d89943. PR ld/18759 * elf32-or1k.c: Revert 2015-08-11 change.
2015-08-14Automatic date update in version.inGDB Administrator1-1/+1
2015-08-13[D] Move classification of symbols from the grammar to the lexer.Iain Buclaw2-363/+448
This makes it so that alternating '.' and identifier tokens are resolved to symbols as early as possible, which should all the addition of D properties - such as EXP.sizeof and EXP.typeof - without the shift/reduce conflicts that would occur in the current parsing strategy. gdb/ChangeLog * d-exp.y (%union): Add voidval. (%token): Add UNKNOWN_NAME as a token to represent an unclassified name in the lexing stage. (PostfixExpression): Move symbol completion handling in grammar here from PrimaryExpression. (PrimaryExpression): Move routines to handle resolving identifier tokens in the grammar here from push_expression_name. (IdentifierExp): Remove the handling of alternating '.' and identifier tokens. (TypeExp): Allow TypeExp to be wrapped in parenthesis in the grammar. (BasicType): Remove C-style typename rules. (d_type_from_name, d_module_from_name, push_variable) (push_fieldnames, push_type_name, push_module_name) (push_expression_name): Remove. (lex_one_token): Rename from yylex. Replace pstate with par_state. (token_and_value): New type. (token_fifo, popping, name_obstack): New globals. (classify_name): New function. (classify_inner_name): Likewise. (yylex): Likewise. (d_parse): Initialize token_fifo, popping and name_obstack.
2015-08-13[D] Support looking up symbols in the current and imported modules.Iain Buclaw5-3/+585
In D, there is the notion of modules, and importing from one to the other, whether it is a basic, selective or renamed import declaration. module A; import X; void foo() { import Y : bar; } If the compiler emits DW_TAG_imported_declaration at the appropriate locations, then we can make use of what gdb stores in using_direct when performing nonlocal symbol lookups. gdb/ChangeLog * Makefile.in (SFILES): Add d-namespace.c. (COMMON_OBS): Add d-namespace.o. * d-lang.c (d_language_defn): Use d_lookup_symbol_nonlocal as the la_lookup_symbol_nonlocal callback function pointer. * d-lang.h (d_lookup_symbol_nonlocal): New declaration. (d_lookup_nested_symbol): New declaration. * d-namespace.c: New file.
2015-08-13gdb.base/dso2dso.exp: Improve testcase documentation.Joel Brobecker2-4/+14
gdb/testsuite/ChangeLog: * gdb.base/dso2dso.exp: Improve the testcase's documentation.
2015-08-13Fix Python frame unwinder issue caught by ValgrindPedro Alves2-1/+6
Valgrind shows: ==17026== Invalid write of size 8 ==17026== at 0x54AA80: pending_frame_invalidate (py-unwind.c:477) ==17026== by 0x5AB934: do_my_cleanups (cleanups.c:155) ==17026== by 0x5AB9AF: do_cleanups (cleanups.c:177) ==17026== by 0x54B009: pyuw_sniffer (py-unwind.c:606) ==17026== by 0x755DAC: frame_unwind_try_unwinder (frame-unwind.c:105) ==17026== by 0x755EEE: frame_unwind_find_by_frame (frame-unwind.c:160) ==17026== by 0x750FFA: compute_frame_id (frame.c:454) ==17026== by 0x753BD6: get_prev_frame_if_no_cycle (frame.c:1781) ==17026== by 0x754292: get_prev_frame_always_1 (frame.c:1955) ==17026== by 0x7542DA: get_prev_frame_always (frame.c:1971) ==17026== by 0x7547BE: get_prev_frame (frame.c:2213) ==17026== by 0x7532BD: unwind_to_current_frame (frame.c:1450) ==17026== Address 0xd27b570 is 16 bytes inside a block of size 32 free'd ==17026== at 0x4A07577: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==17026== by 0x54B276: gdb_Py_DECREF (python-internal.h:185) ==17026== by 0x54B298: py_decref (py-utils.c:34) ==17026== by 0x5AB934: do_my_cleanups (cleanups.c:155) ==17026== by 0x5AB9AF: do_cleanups (cleanups.c:177) ==17026== by 0x54B009: pyuw_sniffer (py-unwind.c:606) ==17026== by 0x755DAC: frame_unwind_try_unwinder (frame-unwind.c:105) ==17026== by 0x755EEE: frame_unwind_find_by_frame (frame-unwind.c:160) ==17026== by 0x750FFA: compute_frame_id (frame.c:454) ==17026== by 0x753BD6: get_prev_frame_if_no_cycle (frame.c:1781) ==17026== by 0x754292: get_prev_frame_always_1 (frame.c:1955) ==17026== by 0x7542DA: get_prev_frame_always (frame.c:1971) ==17026== Simply invalidate the object before releasing it. gdb/ChangeLog: 2015-08-13 Pedro Alves <palves@redhat.com> * python/py-unwind.c (pyuw_sniffer): Install the invalidate cleanup after the decref cleanup, not before.
2015-08-13Mass rename `explicit' -> `explicit_loc'.Keith Seitz8-127/+162
BuildBot reminded me that "explicit" is a reserved keyword in C++. This patch simply renames all the (illegal) uses of "explicit". This should fix the build errors with --enable-build-with-cxx bots. gdb/ChangeLog * break-catch-throw.c (re_set_exception_catchpoint) Rename reserved C++ keyword "explicit" to "explicit_loc". * breakpoint.c (create_overlay_event_breakpoint) (create_longjmp_master_breakpoint) (create_std_terminate_master_breakpoint) (create_exception_master_breakpoint, update_static_tracepoint): Rename reserved C++ keyword "explicit" to "explicit_loc". * completer.c (collect_explicit_location_matches) (explicit_location_completer): Rename reserved C++ keyword "explicit" to "explicit_loc". * linespec.c (struct linespec) <explicit>: Rename to "explicit_loc". (canonicalize_linespec, create_sals_line_offset) (convert_linespec_to_sals, convert_explicit_location_to_sals) (event_location_to_sals, decode_objc): Rename reserved C++ keyword "explicit" to "explicit_loc". * location.c (struct event_location) <explicit>: Rename to "explicit_loc". (initialize_explicit_location, new_explicit_location) (explicit_location_to_string_internal, explicit_location_to_linespec): Rename reserved C++ keyword "explicit" to "explicit_loc". * location.h (explicit_location_to_string) (explicit_location_to_linespec, initialize_explicit_location) (new_explicit_location): Rename reserved C++ keyword "explicit" to "explicit_loc". * mi/mi-cmd-break.c (mi_cmd_break_insert_1): Rename reserved C++ keyword "explicit" to "explicit_loc".
2015-08-13Issue an error for read-only segment with dynamic IFUNC relocationsH.J. Lu10-0/+73
To load an ELF binary with DT_TEXTREL tag, the dynamic linker calls __mprotect on the read-only segment with PROT_READ|PROT_WRITE before applying dynamic relocation. It leads to segfault when performing IFUNC relocations since the read-only segment has no execute permission. This patch changes x86 linker to issue an error for read-only segment with dynamic IFUNC relocations. Other backends with IFUNC support may need a similar change. bfd/ PR ld/18801 * elf32-i386.c (elf_i386_size_dynamic_sections): Issue an error for read-only segment with dynamic IFUNC relocations. * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise. ld/testsuite/ PR ld/18801 * ld-i386/i386.exp: Run pr18801. * ld-x86-64/x86-64.exp: Likewise. * ld-i386/pr18801.d: New file. * ld-i386/pr18801.s: Likewise. * ld-x86-64/pr18801.d: Likewise. * ld-x86-64/pr18801.s: Likewise.
2015-08-13Fixes for unpredictable nops and 26-bit versions of teq,tst,cmn,cmp.Andre Vieira6-19/+58
opcodes * arm-dis.c (print_insn_arm): Disassembling for all targets V6 and higher with ARM instruction set will now mark the 26-bit versions of teq,tst,cmn and cmp as UNPREDICTABLE. (arm_opcodes): Fix for unpredictable nop being recognized as a teq. test * gas/arm/nops.d: New. * gas/arm/nops.s: New. * gas/arm/inst.d: Changed expectation file for 26-bit teq, tst, cmn and cmp.
2015-08-13Add ChangeLog for check_ifunc_attribute_availableH.J. Lu1-0/+1