aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-01-14Move some ppc macros to nat/ppc-linux.hYao Qi6-81/+111
When I use PPC_FEATURE_BOOKE in GDBserver, I find it is defined in GDB but not in GDBserver. After taking a further look, I find some macros are duplicated between ppc-linux-nat.c and linux-ppc-low.c, so this patch is to move them into nat/ppc-linux.h. gdb/gdbserver: 2015-01-14 Yao Qi <yao@codesourcery.com> * linux-ppc-low.c: Include "nat/ppc-linux.h". (PPC_FEATURE_HAS_VSX): Move to nat/ppc-linux.h. (PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Likewise. (PT_ORIG_R3, PT_TRAP): Likewise. (PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise. (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise. (PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise. gdb: 2015-01-14 Yao Qi <yao@codesourcery.com> * ppc-linux-nat.c (PT_ORIG_R3, PT_TRAP): Move to nat/ppc-linux.h. (PPC_FEATURE_CELL, PPC_FEATURE_BOOKE): Likewise. (PPC_FEATURE_HAS_DFP): Likewise. (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise. (PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise. (PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise. Include "nat/ppc-linux.h". * nat/ppc-linux.h: New file. * Makefile.in (HFILES_NO_SRCDIR): Add nat/ppc-linux.h.
2015-01-14PR17525 - breakpoint commands not executed when program run from -x scriptPedro Alves6-2/+147
Executing a gdb script that runs the inferior (from the command line with -x), and has it hit breakpoints with breakpoint commands that themselves run the target, is currently broken on async targets (Linux, remote). While we're executing a command list or a script, we force the interpreter to be sync, which results in some functions nesting an event loop and waiting for the target to stop, instead of returning immediately and having the top level event loop handle the stop. The issue with this bug is simply that bpstat_do_actions misses checking whether the interpreter is sync. When we get here, in the case of executing a script (or, when the interpreter is sync), the program has already advanced to the next breakpoint, through maybe_wait_sync_command_done. We need to process its breakpoints immediately, just like with a sync target. Tested on x86_64 Fedora 20. gdb/ 2015-01-14 Pedro Alves <palves@redhat.com> PR gdb/17525 * breakpoint.c: Include "interps.h". (bpstat_do_actions_1): Also check whether the interpreter is async. gdb/testsuite/ 2015-01-14 Pedro Alves <palves@redhat.com> Joel Brobecker <brobecker@adacore.com> PR gdb/17525 * gdb.base/bp-cmds-execution-x-script.c: New file. * gdb.base/bp-cmds-execution-x-script.exp: New file. * gdb.base/bp-cmds-execution-x-script.gdb: New file.
2015-01-14PR cli/17828: -batch -ex r breaks terminalPedro Alves5-0/+230
Commit d3d4baed (PR python/17372 - Python hangs when displaying help()) had the side effect of causing 'gdb -batch' to leave the terminal in the wrong state if the program was run. E.g,. $ echo 'main(){*(int*)0=0;}' | gcc -x c -; ./gdb/gdb -batch -ex r ./a.out Program received signal SIGSEGV, Segmentation fault. 0x00000000004004ff in main () $ If you start typing the next command, seemingly nothing happens - GDB left the terminal with echo disabled. The issue is that that "r" ends up in fetch_inferior_event, which calls reinstall_readline_callback_handler_cleanup, which causes readline to prep the terminal (raw, echo disabled). But "-batch" causes GDB to exit before the top level event loop is first started, and then nothing de-preps the terminal. The reinstall_readline_callback_handler_cleanup function's intro comment mentions: "Need to do this as we go back to the event loop, ready to process further input." but the implementation forgets the case of when the interpreter is sync, which indicates we won't return to the event loop yet, or as in the case of -batch, we have not started it yet. The fix is to not install the readline callback in that case. For the test, in this case, checking that command echo still works is sufficient. Comparing stty output before/after running GDB is even better. Because stty may not be available, the test tries both ways. In any case, since expect's spawn (what we use to start gdb) creates a new pseudo tty, another expect spawn or tcl exec after GDB exits would not see the wrong terminal settings. So instead, the test spawns a shell and runs stty and GDB in it. Tested on x86_64 Fedora 20. gdb/ 2015-01-14 Pedro Alves <palves@redhat.com> PR cli/17828 * infrun.c (reinstall_readline_callback_handler_cleanup): Don't reinstall if the interpreter is sync. gdb/testsuite/ 2015-01-14 Pedro Alves <palves@redhat.com> PR cli/17828 * gdb.base/batch-preserve-term-settings.c: New file. * gdb.base/batch-preserve-term-settings.exp: New file.
2015-01-13Enhance gdb.lookup_objfile so that it works with a symlinked binary.Doug Evans6-2/+52
gdb/Changelog: * objfiles.c (objfile_filename): New function. * objfiles.h (objfile_filename): Declare it. (objfile_name): Add function comment. * python/py-objfile.c (objfpy_lookup_objfile_by_name): Try both the bfd file name (which may be realpath'd), and the original name. gdb/testsuite/ChangeLog: * gdb.python/py-objfile.exp: Test gdb.lookup_objfile on symlinked binary.
2015-01-14Automatic date update in version.inGDB Administrator1-1/+1
2015-01-13[ARM] vcmp/vcmpe should accept #0x0 as an operandJiong Wang6-9/+38
gas/ 2015-01-13 Matthew Wahab <matthew.wahab@arm.com> * config/tc-arm.c (parse_ifimm_zero): Accept #0x0 as a synonym for #0, restoring previous behaviour. gas/testsuite/ 2015-01-13 Matthew Wahab <matthew.wahab@arm.com> * gas/arm/ual-vcmp.s: Add vcmp, vcmpe with #0x0 operand. * gas/ual/vcmp.d: Update expected output. * gas/ual/vcmp-zero-bad.l: Likewise
2015-01-13gdb/testsuite: Make clean mostlyclean should not delete *.py.Joel Brobecker2-1/+5
A sanity-check in my release scripts caught something: After having created the tarballs, I verify that no checked-in file disappeared in the process, and lo and behod, it found that the following file got wiped: - gdb/testsuite/dg-extract-results.py: And it's not part of the tarball either. I don't understand while we delete all *.py files in gdb/testsuite, since I don't see a rule that expected to create one. A run of the testsuite also doesn't seem to be creating .py files there. I traced this to the following commit, which unfortunately provided no explanation. Perhaps we used to run some tests in the gdb/testsuite directory and caused files to be left behind there. Perhaps we still do today? In the meantime, Executive Decision: In order to allow me to create tarballs without losing files, I removed it. It's easy to put something back if we find out why it might still be needed. gdb/testsuite/ChangeLog: * Makefile.in (clean mostlyclean): Do not delete *.py. Tested on x86_64-linux by running the src-release.sh script again, and this time, dg-extract-results.py no longer gets wiped.
2015-01-13Update NEWS post GDB 7.9 branch creation.Joel Brobecker2-1/+9
gdb/ChangeLog: * NEWS: Create a new section for the next release branch. Rename the section of the current branch, now that it has been cut.
2015-01-13Bump version to 7.9.50.DATE-cvs.Joel Brobecker2-1/+6
Now that the GDB 7.9 branch has been created, we can bump the version number. gdb/ChangeLog: GDB 7.9 branch created (92fc2e6978d9a7c8324c7e851dbee59e22ec7a37): * version.in: Bump version to 7.9.50.DATE-cvs.
2015-01-13[AArch64] Fix function pointer variable with -Bsymbolic-functionsJiong Wang6-1/+29
bfd/ChangeLog 2015-01-13 Thomas Preud'homme <thomas.preudhomme@arm.com> * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use SYMBOLIC_BIND to check if a symbol should be bound symbolically. ld/testsuite/ChangeLog 2015-01-13 Thomas Preud'homme <thomas.preudhomme@arm.com> * ld-aarch64/aarch64-elf.exp: Added relocs-257-symbolic-func test. * ld-aarch64/relocs-257-symbolic-func.d: New file. * ld-aarch64/relocs-257-symbolic-func.s: Likewise.
2015-01-13[AArch64] Enable overflow check for TLSLE_MOVW_TPREL_G2Jiong Wang6-1/+41
bfd/ * elfnn-aarch64.c: (elfNN_aarch64_howto_table): Enable overflow check for TLSLE_MOVW_TPREL_G2. ld/testsuite/ * ld-aarch64/tprel_g2_overflow.s: New testcase. * ld-aarch64/tprel_g2_overflow.d: New expectation file. * ld-aarch64/aarch64-elf.exp: Run new testcase.
2015-01-13[AArch64] Enable overflow check for R_AARCH64_TLSLE_ADD_TPREL_HI12Jiong Wang7-2/+69
bfd/ PR ld/17415 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Mark R_AARCH64_TLSLE_ADD_TPREL_HI12 as complain_overflow_unsigned. * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Correct the bit mask. ld/testsuite/ PR ld/17415 * ld-aarch64/pr17415.s: Source file for new test. * ld-aarch64/pr17415.d: Expect file for new test. * ld-aarch64/aarch64-elf.exp: Run the new test.
2015-01-13[ARI] Remove trailing new-line in argument of call to warning.gdb-7.9-branchpointJoel Brobecker2-1/+6
gdb/ChangeLog: * nat/linux-procfs.c (linux_proc_attach_tgid_threads): Remove trailing new-line in argument of call to warning.
2015-01-13[ARI] Remove trailing new-line in argument of call to warning.Joel Brobecker2-1/+6
gdb/ChangeLog: * linux-nat.c (attach_proc_task_lwp_callback): Remove trailing new-line in argument of call to "warning".
2015-01-13[python/Ada] gdb.lookup_type fails to looking primitive typeJoel Brobecker4-1/+100
The following change... commit 1994afbf19892c9e614a034fbf1a5233e9addce3 Date: Tue Dec 23 07:55:39 2014 -0800 Subject: Look up primitive types as symbols. ... caused the following regression: % gdb (gdb) set lang ada (gdb) python print gdb.lookup_type('character') Traceback (most recent call last): File "<string>", line 1, in <module> gdb.error: No type named character. Error while executing Python code. This is because the language_lookup_primitive_type_as_symbol call was moved to the la_lookup_symbol_nonlocal hook. A couple of implementations have been upated accordingly, but the Ada version has not. This patch fixes this omission. gdb/ChangeLog: * ada-lang.c (ada_lookup_symbol_nonlocal): If name not found in static block, then try searching for primitive types. gdb/testsuite/ChangeLog: * gdb.python/py-lookup-type.exp: New file.
2015-01-13Automatic date update in version.inGDB Administrator1-1/+1
2015-01-12Append to input history file instead of overwriting itPatrick Palka4-4/+84
This patch makes readline append new history lines to the GDB history file on exit instead of overwriting the entire history file on exit. This change allows us to run multiple simultaneous GDB sessions without having each session overwrite the added history of each other session on exit. Care must be taken to ensure that the history file doesn't get corrupted when multiple GDB processes are trying to simultaneously append to and then truncate it. Safety is achieved in such a situation by using an intermediate local history file to mutually exclude multiple processes from simultaneously performing write operations on the global history file. gdb/ChangeLog: * top.h (gdb_add_history): Declare. * top.c (command_count): New variable. (gdb_add_history): New function. (gdb_safe_append_history): New static function. (quit_force): Call it. (command_line_input): Use gdb_add_history instead of add_history. * event-top.c (command_line_handler): Likewise.
2015-01-12Properly check abbrev sizeH.J. Lu2-4/+9
abbrev_base is independent of abbrev_size. We should use abbrev_base + abbrev_size to check abbrev section size. * dwarf.c (process_debug_info): Properly check abbrev size.
2015-01-12Another fix for memory access errors trigegred by running readelf on a ↵Nick Clifton2-22/+39
corrupt binary. PR binutils/17531 * dwarf.c (display_debug_addr): Use xcalloc to allocate the debug_addr_info array. Check for an address_base that is too large.
2015-01-12[darwin/gdb] Use <setjmp.h> instead of <machine/setjmp.h>James Clarke2-1/+7
The `machine/setjmp.h' header is no longer present on OS X 10.10, and is non-standard. Instead, `darwin-nat.c' should be using the standard `setjmp.h' header. gdb/ChangeLog: 2015-01-12 James Clarke <jrtc27@jrtc27.com> (tiny patch) PR gdb/17046 * darwin-nat.c: Replace <machine/setjmp.h> #include by <setjmp.h> #include.
2015-01-12gdb.python/py-prompt.exp: restore GDBFLAGSPedro Alves2-0/+6
The previous change to py-prompt.exp made it return without restoring GDBFLAGS, resulting in breaking the following tests: $ make check RUNTESTFLAGS="--target_board=native-gdbserver --directory=gdb.python" ... Running src/gdb/testsuite/gdb.python/py-prompt.exp ... Running src/gdb/testsuite/gdb.python/py-section-script.exp ... ERROR: (timeout) GDB never initialized after 10 seconds. ERROR: no fileid for gdbuild ERROR: Couldn't send python print ('test') to GDB. ERROR: no fileid for gdbuild ERROR: Couldn't send python print (sys.version_info[0]) to GDB. ERROR: no fileid for gdbuild ERROR: Couldn't send python print (sys.version_info[1]) to GDB. ERROR: no fileid for gdbuild ERROR: no fileid for gdbuild ... gdb/testsuite/ 2015-01-12 Pedro Alves <palves@redhat.com> * gdb.python/py-prompt.exp: When the board can't spawn for attach, restore GDBFLAGS before returning.
2015-01-12More fixes for memory access errors when running readelf on fuzzed binaries.Nick Clifton3-3/+30
PR binutils/17531 * dwarf.c (process_debug_info): Check for abbrev_base being larger than the section size. (process_cu_tu_index): Use xcalloc2 to allocate the CU and TU arrays. (xcalloc2): New function. Like xcalloc, but checks for overflow. * dwarf.h (xcalloc2): Prototype.
2015-01-12gas: allow labeling of CFI instructionsJan Beulich9-2/+130
When runtime patching code (like e.g. done by the Linux kernel) there may be cases where the set of stack frame alterations differs between unpatched and patched code. Consequently the corresponding unwind data needs patching too. Locating the right places within an FDE, however, is rather cumbersome without a way to insert labels in the resulting section. Hence this patch introduces a new directive, .cfi_label. Note that with the way CFI data gets emitted currently (at the end of the assembly process) this can't support local FB- and dollar-labels. gas/ 2015-01-12 Jan Beulich <jbeulich@suse.com> * gas/dw2gencfi.c (cfi_add_label, dot_cfi_label): New. (cfi_pseudo_table): Add "cfi_label". (output_cfi_insn): Handle CFI_label. (select_cie_for_fde): Als terminate CIE when encountering CFI_label. * dw2gencfi.h (cfi_add_label): Declare. (struct cfi_insn_data): New member "sym_name". (CFI_label): New. * read.c (read_symbol_name): Drop "static". * read.h (read_symbol_name): Declare. gas/testsuite/ 2015-01-12 Jan Beulich <jbeulich@suse.com> gas/cfi/cfi-label.d, gas/cfi/cfi-label.s: New. gas/cfi/cfi.exp: Run new tests.
2015-01-12Fix GDB crash caused by discarding grouped debug sectionsTerry Guo2-6/+57
Keep a group containing just debug sections or the other special sections we currently mark against garbage collection. * elflink.c (_bfd_elf_gc_mark_debug_special_section_group): New function. (_bfd_elf_gc_mark_extra_sections): Use it.
2015-01-12Fix build without makeinfo from release binutils tarAlan Modra3-4/+62
PR 17817 * Makefile.am (aoutx.stamp): cp -p $srcdir/aoutx.texi to keep timestamps so that makeinfo need not be installed. (archive.stamp, archures.stamp, bfdt.stamp, cache.stamp, coffcode.stamp, core.stamp, elf.stamp, elfcode.stamp, mmo.stamp, format.stamp, libbfd.stamp, bfdio.stamp, bfdwin.stamp, opncls.stamp, reloc.stamp, section.stamp, syms.stamp, targets.stamp, init.stamp, hash.stamp, linker.stamp): Similarly. (bfdver.texi): Use test rather than [ ] in commands. * Makefile.in: Regenerate.
2015-01-12[testsuite patch] Fix new FAIL: py-frame.exp: test Frame.read_register(rip)Jan Kratochvil2-4/+15
for x86_64 -m32 run one gets: +FAIL: gdb.python/py-frame.exp: test Frame.read_register(rip) I do not have x32 OS here but the %rip test should PASS there I think. On Sun, 11 Jan 2015 14:58:06 +0100, Yao Qi wrote: With your patch applied, this test is skipped on 'x86_64 -m32'. I prefer to increasing the test coverage, so how about extending the test for 'x86_64 -m32'? I mean test Frame.read_register(eip)... gdb/testsuite/ChangeLog 2015-01-12 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.python/py-frame.exp (test Frame.read_register(rip)): Use is_amd64_regs_target and is_x86_like_target.
2015-01-12arm: properly range check immediate operands of VSHL and VQSHLJan Beulich5-3/+59
These two, other than VQSHLU, didn't have their immediates properly range checked so far. (Re-sending unchanged from the original v2 due to never having got an answer to https://sourceware.org/ml/binutils/2013-04/msg00121.html.) gas/ 2015-01-12 Jan Beulich <jbeulich@suse.com> * gas/config/tc-arm.c (do_neon_shl_imm): Check immediate range. (do_neon_qshl_imm): Likewise. gas/testsuite/ 2015-01-12 Jan Beulich <jbeulich@suse.com> * gas/arm/neon-addressing-bad.s: Add test for invalid VSHL, VQSHL, and VQSHLU immediates. * gas/arm/neon-addressing-bad.l: Update accordingly.
2015-01-12Assorted compiler warning fixesAlan Modra5-5/+17
The C standard doesn't guarantee a function pointer can be cast to void* and vice versa. binutils/ * prdbg.c (print_debugging_info): Don't use void* for function pointer param. * budbg.h (print_debugging_info): Update prototype. gas/ * read.c (s_altmacro, s_reloc): Make definition static.
2015-01-11dwarf2read.c (compute_delayed_physnames): Use TYPE_FN_FIELD_PHYSNAME.Doug Evans2-1/+6
gdb/ChangeLog: * dwarf2read.c (compute_delayed_physnames): Use TYPE_FN_FIELD_PHYSNAME.
2015-01-12Automatic date update in version.inGDB Administrator1-1/+1
2015-01-11Require numeric attributes to specify the form.Doug Evans7-18/+35
gdb/testsuite/ChangeLog: * lib/dwarf.exp (Dwarf): Flag an error if a numeric attribute value is given without an explicit form. * gdb.dwarf2/arr-subrange.exp: Specify forms for all numeric attributes. * gdb.dwarf/corrupt.exp: Ditto. * gdb.dwarf2/enum-type.exp: Ditto. * gdb.trace/entry-values.exp: Ditto. * gdb.trace/unavailable-dwarf-piece.exp: Ditto.
2015-01-11Temporarily revert symbol lookup cache.Doug Evans5-828/+14
clear_symtab_users calls breakpoint_re_set before observer_notify_new_objfile(NULL), and thus symbol lookup done during breakpoint_re_set will see a stale cache. Presumably we just need to move the call to observer_notify_new_objfile(NULL) to before breakpoint_re_set, but need to check for other such issues, and 7.9 is scheduled to branch tomorrow. Reverts commits: b2fb95e006c29e2cbe4b30523879fe3640f906ad 400678a494713abf8f7ea2367f213109a2c4b886 d98b9ccbccf36563dad92f6093a93655b38bc51b 77087adf50cedf78cc216ac6eb3b2863839d713c gdb/ChangeLog: * symtab.c (eq_symbol_entry): Use SYMBOL_SEARCH_NAME and symbol_matches_domain for symbol comparisons. * symtab.c (symbol_cache_mark_found): Improve function comment. Rename parameter objfile to objfile_context. (symbol_cache_mark_not_found): Improve function comment. Add symbol lookup cache. * NEWS: Document new options and commands. * symtab.c (symbol_cache_key): New static global. (DEFAULT_SYMBOL_CACHE_SIZE, MAX_SYMBOL_CACHE_SIZE): New macros. (SYMBOL_LOOKUP_FAILED): New macro. (symbol_cache_slot_state): New enum. (block_symbol_cache): New struct. (symbol_cache): New struct. (new_symbol_cache_size, symbol_cache_size): New static globals. (hash_symbol_entry, eq_symbol_entry): New functions. (symbol_cache_byte_size, resize_symbol_cache): New functions. (make_symbol_cache, free_symbol_cache): New functions. (get_symbol_cache, symbol_cache_cleanup): New function. (set_symbol_cache_size, set_symbol_cache_size_handler): New functions. (symbol_cache_lookup, symbol_cache_clear_slot): New function. (symbol_cache_mark_found, symbol_cache_mark_not_found): New functions. (symbol_cache_flush, symbol_cache_dump): New functions. (maintenance_print_symbol_cache): New function. (maintenance_flush_symbol_cache): New function. (symbol_cache_stats): New function. (maintenance_print_symbol_cache_statistics): New function. (symtab_new_objfile_observer): New function. (symtab_free_objfile_observer): New function. (lookup_static_symbol, lookup_global_symbol): Use symbol cache. (_initialize_symtab): Init symbol_cache_key. New parameter maint symbol-cache-size. New maint commands print symbol-cache, print symbol-cache-statistics, flush-symbol-cache. Install new_objfile, free_objfile observers. gdb/doc/ChangeLog: * gdb.texinfo (Symbols): Document new commands "maint print symbol-cache", "maint print symbol-cache-statistics", "maint flush-symbol-cache". Document new option "maint set symbol-cache-size".
2015-01-11PR gdb/15830Doug Evans10-53/+159
gdb/ChangeLog: PR gdb/15830 * NEWS: The "maint demangle" command is renamed as "demangle". * demangle.c: #include cli/cli-utils.h, language.h. (demangle_command): New function. (_initialize_demangle): Add new command "demangle". * maint.c (maintenance_demangle): Stub out. (_initialize_maint_cmds): Update help text for "maint demangle", and mark as deprecated. gdb/doc/ChangeLog: * gdb.texinfo (Debugging C Plus Plus): Mention "demangle". (Symbols): Ditto. (Maintenance Commands): Delete docs for "maint demangle". gdb/testsuite/ChangeLog: * gdb.base/maint.exp: Remove references to "maint demangle". * gdb.cp/demangle.exp: Update. "maint demangle" -> "demangle". Add tests for explicitly specifying language to demangle. * gdb.dlang/demangle.exp: Ditto.
2015-01-11Fix build on OpenBSD.Mark Kettenis2-1/+7
gdb/ChangeLog: * inf-ptrace.c (inf_ptrace_follow_fork): Adjust now that inferior_thread is a function.
2015-01-11symtab.c (eq_symbol_entry): Use SYMBOL_SEARCH_NAME and symbol_matches_domain.Doug Evans2-7/+38
gdb/ChangeLog: * symtab.c (eq_symbol_entry): Use SYMBOL_SEARCH_NAME and symbol_matches_domain for symbol comparisons.
2015-01-11tweak previous entryDoug Evans1-1/+1
2015-01-11Improve comments for symbol_cache_mark_{not_,}found.Doug Evans2-4/+16
gdb/ChangeLog: * symtab.c (symbol_cache_mark_found): Improve function comment. Rename parameter objfile to objfile_context. (symbol_cache_mark_not_found): Ditto.
2015-01-11Only discard space for pc-relative relocs symbolsH.J. Lu7-3/+53
When building PIE, we should only discard space for pc-relative relocs symbols which turn out to need copy relocs. bfd/ PR ld/17827 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): For PIE, only discard space for pc-relative relocs symbols which turn out to need copy relocs. ld/testsuite/ PR ld/17827 * ld-x86-64/pr17689.out: Updated. * ld-x86-64/pr17689b.S: Likewise. * ld-x86-64/pr17827.rd: New file. * ld-x86-64/x86-64.exp: Run PR ld/17827 test.
2015-01-10Add symbol lookup cache.Doug Evans5-14/+785
gdb/ChangeLog: Add symbol lookup cache. * NEWS: Document new options and commands. * symtab.c (symbol_cache_key): New static global. (DEFAULT_SYMBOL_CACHE_SIZE, MAX_SYMBOL_CACHE_SIZE): New macros. (SYMBOL_LOOKUP_FAILED): New macro. (symbol_cache_slot_state): New enum. (block_symbol_cache): New struct. (symbol_cache): New struct. (new_symbol_cache_size, symbol_cache_size): New static globals. (hash_symbol_entry, eq_symbol_entry): New functions. (symbol_cache_byte_size, resize_symbol_cache): New functions. (make_symbol_cache, free_symbol_cache): New functions. (get_symbol_cache, symbol_cache_cleanup): New function. (set_symbol_cache_size, set_symbol_cache_size_handler): New functions. (symbol_cache_lookup, symbol_cache_clear_slot): New function. (symbol_cache_mark_found, symbol_cache_mark_not_found): New functions. (symbol_cache_flush, symbol_cache_dump): New functions. (maintenance_print_symbol_cache): New function. (maintenance_flush_symbol_cache): New function. (symbol_cache_stats): New function. (maintenance_print_symbol_cache_statistics): New function. (symtab_new_objfile_observer): New function. (symtab_free_objfile_observer): New function. (lookup_static_symbol, lookup_global_symbol): Use symbol cache. (_initialize_symtab): Init symbol_cache_key. New parameter maint symbol-cache-size. New maint commands print symbol-cache, print symbol-cache-statistics, flush-symbol-cache. Install new_objfile, free_objfile observers. doc/ChangeLog: * gdb.texinfo (Symbols): Document new commands "maint print symbol-cache", "maint print symbol-cache-statistics", "maint flush-symbol-cache". Document new option "maint set symbol-cache-size".
2015-01-11Automatic date update in version.inGDB Administrator1-1/+1
2015-01-10Fix use of wrong struct i387_xsave field in i387_cache_to_xsaveJoel Brobecker2-1/+7
gdb/gdbserver/ChangeLog: * i387-fp.c (i387_cache_to_xsave): In look over num_avx512_zmmh_high_registers, replace use of struct i387_xsave zmmh_low_space field by use of zmmh_high_space. Tested on x86_64-linux, using boards/native-gdbserver.exp.
2015-01-10gas/avr: Prevent incorrect overflow errors for diff fixups.Andrew Burgess5-0/+42
When fixups are converted to a difference type within md_apply_fix, we previously left the contents of VALP (the value that was initially computed within write.c:fixup_segment) unchanged. This is harmless, except that this value is used within write.c:fixup_segment once we return from md_apply_fix to perform an overflow check. In some cases, the value computed in write.c:fixup_segment is so wrong that an overflow error can be triggered. These errors are incorrect. This patch avoids the overflow errors by adjusting the value in write.c:fixup_segment using the VALP pointer in md_apply_fix. A test for this issue is included. gas/ChangeLog: * config/tc-avr.c (md_apply_fix): Update the contents of VALP for diff fixups. gas/testsuite/ChangeLog: * gas/avr/large-debug-line-table.d: New file. * gas/avr/large-debug-line-table.s: New file.
2015-01-10Automatic date update in version.inGDB Administrator1-1/+1
2015-01-09Don't align start of segment unless alignment is larger than page size.Cary Coutant2-1/+8
This fixes an issue where a page-aligned data section, combined with -z relro, could lead to a gap between text and data segments larger than a page, and we would fail to overlap the segments in the file. gold/ * layout.cc (Layout::set_segment_offsets): Don't align start of segment unless alignment is larger than page size.
2015-01-09Don't munge yacc's #line directivesPatrick Palka2-1/+5
The #line directives within GDB's autogenerated yacc files (e.g. c-exp.c) are being incorrectly munged, causing these directives to refer to nonexistent source files, e.g. #line 36 "/home/patrick/binutils-gdb/gdb//home/patrick/binutils-gdb/gdb/c-exp.y" as opposed to #line 36 "/home/patrick/binutils-gdb/gdb/c-exp.y" The munging happens due to a sed expression added by commit 954d8cae whose intended purpose[1] was to work around the fact that ylwrap emitted #line directives without any directory information, e.g. #line 36 "c-exp.y" So the sed expression was meant to munge such directives to refer to absolute paths instead. But the behavior of ylwrap was changed some years ago[2] to emit absolute paths within #line directives. And when our local copy of ylwrap was synced by commit e30465112, the sed expression in question became unnecessary, and indeed harmful. This patch removes the now-obsolete sed expression. The emitted #line directives are now correct without it. gdb/ChangeLog: * Makefile.in (.y.c): Don't munge yacc's #line directives. [1]: https://sourceware.org/ml/gdb-patches/2010-11/msg00265.html [2]: http://git.savannah.gnu.org/cgit/automake.git/commit/lib/ylwrap?id=b6359a5f3
2015-01-09Fixes a bug in the previous delat to tekhex.c which meant that valid tekhex ↵Nick Clifton2-2/+9
files were being rejected. * tekhex.c (getvalue): Fix thinko in test for correct extraction of value. (getsym): Return false if there was not enough data to extract the symbol.
2015-01-09This patch adds the necessary support to the assembler to allow wiringPhilipp Tomsich3-1/+20
the X-Gene scheduling description up in the respective GCC backend. * config/tc-arm.c (arm_cpus): Add support for APM X-Gene 1 and X-Gene 2. * doc/c-arm.texi (ARM Options): Mention xgene1 and xgene2.
2015-01-09Consolidate the custom TUI query hook with the default query hookPatrick Palka4-114/+29
This patch primarily rewrites defaulted_query() to use gdb_readline_wrapper() to prompt the user for input, like prompt_for_continue() does. The motivation for this rewrite is to be able to reuse the default query hook in TUI, obviating the need for a custom TUI query hook. However, having TUI use the default query mechanism exposed a couple of latent bugs in tui_redisplay_readline() related to the handling of multi-line prompts, in particular GDB's multi-line quit prompt. The first issue is an off-by-one error in the calculation of the height of the prompt. The check in question should be col <= prev_col, not c < prev_col, to properly account for the case when a prompt contains multiple consecutive newlines. Failing to do so makes TUI have the wrong idea of the vertical height of the prompt. This patch fixes the column check. The second issue is that cur_line does not get updated to reflect the cursor position if the user's prompt cursor is at the end of the prompt (i.e. if rl_point == rl_end). cur_line only gets updated if rl_point lies between 0..rl_end-1 because that is the bounds of the for loop responsible for updating cur_line. This patch changes the loop's bounds to 0..rl_end so that cur_line always gets updated. With these two bug fixes out of the way, the default query mechanism works well in TUI even with multi-line prompts like GDB's quit prompt. gdb/ChangeLog: * utils.c (defaulted_query): Rewrite to use gdb_readline_wrapper to prompt for input. * tui/tui-hooks.c (tui_query_hook): Remove. (tui_install_hooks): Don't set deprecated_query_hook. * tui/tui-io.c (tui_redisplay_readline): Fix off-by-one error in height calculation. Always update the command window's cur_line.
2015-01-09add non-stop test that stresses thread starvation issuesPedro Alves3-0/+250
This commit adds a non-stop mode test originally inspired by signal-while-stepping-over-bp-other-thread.exp, that exposes the thread starvation issues fixed by the previous patches. It sets a set of threads stepping in parallel, and has one of them get a signal. Without the previous fixes, this would fail with timeouts. gdb/testsuite/ 2015-01-09 Pedro Alves <palves@redhat.com> * gdb.threads/non-stop-fair-events.c: New file. * gdb.threads/non-stop-fair-events.exp: New file.
2015-01-09[gdbserver] linux-low.c: better starvation avoidance, handle non-stop mode tooPedro Alves8-346/+506
This patch applies the same starvation avoidance improvements of the previous patch to the Linux gdbserver side. Without this, the test added by the following commit (gdb.threads/non-stop-fair-events.exp) always fails with time outs. gdb/gdbserver/ 2015-01-09 Pedro Alves <palves@redhat.com> * linux-low.c (step_over_bkpt): Move higher up in the file. (handle_extended_wait): Don't store the stop_pc here. (get_stop_pc): Adjust comments and rename to ... (check_stopped_by_breakpoint): ... this. Record whether the LWP stopped for a software breakpoint or hardware breakpoint. (thread_still_has_status_pending_p): New function. (status_pending_p_callback): Use thread_still_has_status_pending_p. If the event is no longer interesting, resume the LWP. (handle_tracepoints): Add assert. (maybe_move_out_of_jump_pad): Remove cancel_breakpoints call. (wstatus_maybe_breakpoint): New function. (cancel_breakpoint): Delete function. (check_stopped_by_watchpoint): New function, factored out from linux_low_filter_event. (lp_status_maybe_breakpoint): Delete function. (linux_low_filter_event): Remove filter_ptid argument. Leave thread group exits pending here. Store the LWP's stop PC. Always leave events pending. (linux_wait_for_event_filtered): Pull all events out of the kernel, and leave them all pending. (count_events_callback, select_event_lwp_callback): Consider all events. (cancel_breakpoints_callback, linux_cancel_breakpoints): Delete. (select_event_lwp): Only give preference to the stepping LWP in all-stop mode. Adjust comments. (ignore_event): New function. (linux_wait_1): Delete 'retry' label. Use ignore_event. Remove references to cancel_breakpoints. Adjust to renames. Also give equal priority to all LWPs that have had events in non-stop mode. If reporting a software breakpoint event, unadjust the LWP's PC. (linux_wait): If linux_wait_1 returned an ignored event, retry. (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback): Adjust. (linux_resume_one_lwp): Store the LWP's PC. Adjust. (resume_status_pending_p): Use thread_still_has_status_pending_p. (linux_stopped_by_watchpoint): Adjust. (linux_target_ops): Remove reference to linux_cancel_breakpoints. * linux-low.h (enum lwp_stop_reason): New. (struct lwp_info) <stop_pc>: Adjust comment. <stopped_by_watchpoint>: Delete field. <stop_reason>: New field. * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust. * mem-break.c (software_breakpoint_inserted_here) (hardware_breakpoint_inserted_here): New function. * mem-break.h (software_breakpoint_inserted_here) (hardware_breakpoint_inserted_here): Declare. * target.h (struct target_ops) <cancel_breakpoints>: Remove field. (cancel_breakpoints): Delete. * tracepoint.c (clear_installed_tracepoints, stop_tracing) (upload_fast_traceframes): Remove references to cancel_breakpoints.