aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-03-18Fix code to check for illegal element numbers when accessing AArch64 vector ↵Nick Clifton2-2/+6
registers in AArch64 sim. * cpustate.c (GET_VEC_ELEMENT): Fix off by one error checking for an invalid element index. (SET_VEC_ELEMENT): Likewise.
2016-03-18[spu] throw error when target_read_memory failsYao Qi2-1/+8
I happen to see that 1 is returned in spu_software_single_step when target_read_memory returns 1. It must be wrong. That patch changes it to throwing an error. Note that I choose to throw error because I find the code in the end of spu_software_single_step throws errors. gdb: 2016-03-18 Yao Qi <yao.qi@linaro.org> * spu-tdep.c (spu_software_single_step): Throw error when target_read_memory fails.
2016-03-18Check lwp_signal_can_be_delivered for enqueue/dequeue pending signalsYao Qi2-10/+21
The enqueue and dequeue signals in linux_resume_one_lwp_throw use one condition and its inverted one. This patch is to move the condition into a function lwp_signal_can_be_delivered, so that the next patch can change the condition in one place. gdb/gdbserver: 2016-03-18 Yao Qi <yao.qi@linaro.org> * linux-low.c (lwp_signal_can_be_delivered): New function. (linux_resume_one_lwp_throw): Use lwp_signal_can_be_delivered.
2016-03-18Set signal to 0 after enqueue_pending_signalYao Qi2-17/+20
Today, we enqueue signal in linux_resume_one_lwp_throw, but set variable 'signal' many lines below with the comment /* Postpone any pending signal. It was enqueued above. */ signal = 0; I feel difficult to associate code across many lines, and we should move the code close to enqueue_pending_signal call. This is what this patch does in general. After this change, variable 'signal' is set to zero very early, so the 'signal' value in the following debugging message makes no sense, so I remove it from the debugging message. The function returns early if lwp->status_pending_p is true, so 'signal' value in the debugging message doesn't matter, AFAICS. Also, I move one debugging message several lines below to make it close the real ptrace call, if (debug_threads) debug_printf ("Resuming lwp %ld (%s, signal %d, stop %s)\n", lwpid_of (thread), step ? "step" : "continue", signal, lwp->stop_expected ? "expected" : "not expected"); so that the debugging message can reflect what GDBserver does. This is a code refactor and only debugging messages are affected. gdb/gdbserver: 2016-03-18 Yao Qi <yao.qi@linaro.org> * linux-low.c (linux_resume_one_lwp_throw): Set 'signal' to 0 if signal is enqueued. Remove 'signal' from one debugging message. Move one debugging message to some lines below. Remove code setting 'signal' to 0.
2016-03-18Remove redundant WIFSTOPPED checkYao Qi2-1/+6
WIFSTOPPED is checked linux_wstatus_maybe_breakpoint, so WIFSTOPPED in "WIFSTOPPED (wstat) && linux_wstatus_maybe_breakpoint (wstat)" is redundant. This patch removes WIFSTOPPED check. gdb/gdbserver: 2016-03-18 Yao Qi <yao.qi@linaro.org> * linux-low.c (linux_low_filter_event): Remove redundant WIFSTOPPED check together with linux_wstatus_maybe_breakpoint.
2016-03-18Remove spurious empty line in changelog entry.Nick Clifton1-0/+5
2016-03-18Fix generation of as.1 manual page so that it can be converted to DocBook ↵Nick Clifton3-1/+8
format. gas * doc/as.texinfo: Place the target specific command line options into their own man page section. etc * texi2pod.pl: Add TARGET to the list of recognised man page sections.
2016-03-18Ensure that the .rdata_pseudo_runtime_reloc sections are not discarded by ↵Awson3-2/+9
gabage collection. PR 19531 * scripttempl/pe.sc (.rdata_runtime_pseudo_reloc): Always KEEP this section. * scripttempl/pep.sc (.rdata_runtime_pseudo_reloc): Likewise.
2016-03-18Fix possible failure in the AVR linker tests.Senthil Kumar Selvaraj9-5/+114
* ld-avr/gc-section-debugline.d: Relax regex check for CU.
2016-03-18Add simulation of MUL and NEG instructions to AArch64 simulator.Nick Clifton5-223/+341
* cpustate.c: Remove spurious spaces from TRACE strings. Print hex equivalents of floats and doubles. Check element number against array size when accessing vector registers. * memory.c: Trace memory reads when --trace-memory is enabled. Remove float and double load and store functions. * memory.h (aarch64_get_mem_float): Delete prototype. (aarch64_get_mem_double): Likewise. (aarch64_set_mem_float): Likewise. (aarch64_set_mem_double): Likewise. * simulator (IS_SET): Always return either 0 or 1. (IS_CLEAR): Likewise. (fldrs_pcrel): Load and store floats using 32-bit memory accesses and doubles using 64-bit memory accesses. (fldrd_pcrel, fldrs_wb, fldrs_abs, fldrs_scale_ext): Likewise. (fldrd_wb, fldrd_abs, fsturs, fsturd, fldurs, fldurd): Likewise. (fstrs_abs, fstrs_wb, fstrs_scale_ext, fstrd_abs): Likewise. (fstrd_wb, fstrd_scale_ext, store_pair_float): Likewise. (store_pair_double, load_pair_float, load_pair_double): Likewise. (do_vec_MUL_by_element): New function. (do_vec_op2): Call do_vec_MUL_by_element. (do_scalar_NEG): New function. (do_double_add): Call do_scalar_NEG.
2016-03-18Automatic date update in version.inGDB Administrator1-1/+1
2016-03-17Add mips and s390 build targets for gold.Cary Coutant3-2/+7
* configure.ac: Add mips and s390 to the gold target check. * configure: Regenerate.
2016-03-17Add MIPS-64 support.Vladimir Radosavljevic2-635/+1413
gold/ * mips.cc (enum Special_relocation_symbol): New enum type. (is_readonly_section): New function. (eh_reloc): Likewise. (Mips_got_entry::is_section_symbol_): New member. (Mips_got_entry::is_section_symbol): New method. (Mips_got_info::record_local_got_symbol): Add is_section_symbol argument. (Mips_relobj::mips_elf_options_section_name): New method. (Mips_output_data_got::record_local_got_symbol): Add is_section_symbol argument, and pass it to Mips_got_info::record_local_got_symbol. (Mips_output_data_got::got_offset): Add addend argument, and pass it to Relobj::local_got_offset. (struct Mips_output_reloc_writer): New type. (class Mips_output_data_reloc): New class. (Mips_output_data_plt::Reloc_section): Change type to Mips_output_data_reloc. (Target_mips::Reloc_section): Likewise. (Mips_reloc_types::get_r_addend): Remove unsigned from return type. (Mips_classify_reloc::get_r_type2): New method. (Mips_classify_reloc::get_r_type3): Likewise. (Mips_classify_reloc::get_r_ssym): Likewise. (Target_mips::Reloca_section): Remove. (Relocate::should_apply_static_reloc): Rename from should_apply_r_mips_32_reloc. (Target_mips::copy_reloc): Replace Reltype parameter with r_type and r_offset. (Mips_relocate_functions::Valtype): New type. (Mips_relocate_functions::Valtype64): New type. (Mips_relocate_functions::check_overflow): New method. (Mips_relocate_functions::mips_reloc_unshuffle): Move to public interface. (Mips_relocate_functions::mips_reloc_shuffle): Likewise. (Mips_relocate_functions::rel16): Add support for resolving relocations for Mips64. (Mips_relocate_functions::rel32): Likewise. (Mips_relocate_functions::reljalr): Likewise. (Mips_relocate_functions::relpc32): Likewise. (Mips_relocate_functions::rel26): Likewise. (Mips_relocate_functions::relpc16): Likewise. (Mips_relocate_functions::relmicromips_pc7_s1): Likewise. (Mips_relocate_functions::relmicromips_pc10_s1): Likewise. (Mips_relocate_functions::relmicromips_pc16_s1): Likewise. (Mips_relocate_functions::do_relhi16): Likewise. (Mips_relocate_functions::do_relgot16_local): Likewise. (Mips_relocate_functions::rello16): Likewise. (Mips_relocate_functions::relgot): Likewise. (Mips_relocate_functions::relgotpage): Likewise. (Mips_relocate_functions::relgotofst): Likewise. (Mips_relocate_functions::relgot_hi16): Likewise. (Mips_relocate_functions::relgot_lo16): Likewise. (Mips_relocate_functions::relgprel): Likewise. (Mips_relocate_functions::relgprel32): Likewise. (Mips_relocate_functions::tlsrelhi16): Likewise. (Mips_relocate_functions::tlsrello16): Likewise. (Mips_relocate_functions::tlsrel32): Likewise. (Mips_relocate_functions::relsub): Likewise. (Mips_relocate_functions::releh): New method. (Mips_relocate_functions::rel64): Likewise. (Mips_got_info::record_local_got_symbol): Add is_section_symbol and pass it to Mips_got_entry. (Mips_got_info::add_local_entries): Pass addend argument to code functions, and for STT_SECTION symbols call add_symbolless_local_addend. (Mips_got_info::add_tls_entries): Pass addend argument to code functions. (Mips_relobj::do_read_symbols): Read gp value that was used to create object. (Mips_output_data_plt::plt_entry): Remove opcode from l[wd] instruction. Opcode for instruction will be selected later. (Target_mips::gc_process_relocs): Add case for SHT_RELA. (Target_mips::scan_relocatable_relocs): Likewise. (Target_mips::emit_relocs_scan): Likewise. (Target_mips::relocate_relocs): Likewise. (Target_mips::do_finalize_sections): Skip objects for merging processor specific flags in which all input sections will be discarded. (mips_get_size_for_reloc): Add case for R_MIPS_EH. (Target_mips::Scan::get_reference_flags): Likewise. (Target_mips::relocate_special_relocatable): Call rel26 method with calculate_only and calculated_value arguments. (Target_mips::Scan::local): Add case for R_MIPS_EH. Don't create a dynamic relocation against a readonly sections, and pass is_section_symbol to Mips_got_info::record_local_got_symbol. (Target_mips::Scan::global): Add case for R_MIPS_EH. Don't create a dynamic relocation against a readonly sections, and pass r_type and r_offset to Target_mips::copy_reloc. (Target_mips::Relocate::relocate): Add support for resolving relocations for Mips64. (Target_mips::mips_info): Add case for Mips64 default dynamic linker name. (Target_selector_mips): Correct emulation names.
2016-03-17Add missing Mips_output_data_la25_stub::do_print_to_mapfile.Vladimir Radosavljevic2-0/+10
gold/ * mips.cc (class Mips_output_data_la25_stub): Add do_print_to_mapfile function.
2016-03-17Fix problem with --emit-relocs for Mips-32.Vladimir Radosavljevic2-1/+6
gold/ * mips.cc (Mips_classify_reloc::put_r_info): Call 32bit version of elf_r_info.
2016-03-17Suggest running gdbserver for a PID in containerJan Kratochvil2-1/+6
currently gdb -p <pid from a container> will print: warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable It correctly states the problem but it does not say how to solve it. Originally I wanted to suggest also the Docker "-p 1234:1234" parameter but I see the containers are more general topic than just Docker (even LxC etc.). According to Gary future GDBs should be able to work even without gdbserver. But currently gdbserver is still required. gdb/ChangeLog 2016-03-17 Jan Kratochvil <jan.kratochvil@redhat.com> * linux-thread-db.c (check_pid_namespace_match): Extend the message.
2016-03-17PR remote/19496, timeout in forking-threads-plus-bkptPedro Alves3-18/+34
This patch addresses a failure in gdb.threads/forking-threads-plus-breakpoint.exp: FAIL: gdb.threads/forking-threads-plus-breakpoint.exp: cond_bp_target=1: detach_on_fork=on: inferior 1 exited (timeout) Cause: A fork event was reported to GDB before GDB knew about the parent thread, followed immediately by a breakpoint event in a different thread. The parent thread was subsequently added via remote_notice_new_inferior in process_stop_reply, but when the thread was added the thread_info.state was set to THREAD_STOPPED. The fork event was then handled correctly, but when the fork parent was resumed via a call to keep_going, the state was unchanged. The breakpoint event was then handled, which caused all the non-breakpoint threads to be stopped. When the breakpoint thread was resumed, all the non-breakpoint threads were resumed via infrun.c:restart_threads. Our old fork parent wasn't restarted, because it still had thread_info.state set to THREAD_STOPPED. Ultimately the program under debug hung waiting for a pthread_join while the old fork parent was stopped forever by GDB. Fix: Since this is non-stop, then the bug is that the thread should have been added in THREAD_RUNNING state. Consider that infrun may be pulling target events out of the target_ops backend into its own event queue, but, not process them immediately. E.g., infrun may be stopping all threads temporarily for a step-over-breakpoint operation for thread A (stop_all_threads). The waitstatus of all threads is thus left pending in the thread structure (save_status), including the fork event of thread B. Right at this point, if the user does "info threads", that should show thread B (the fork parent) running, not stopped, even if internally, gdb is holding it paused for a little bit. Thus if in non-stop mode, always add new threads in the external user-visible THREAD_RUNNING state. Change remote_notice_new_inferior to accept the internal executing state of the thread instead, with EXECUTING set to 1 when we discover a thread that is running on the target (such as through remote_update_thread_list), and 0 when the thread is really paused (such as when we see a stop reply). Tested on x86_64 Linux and Nios II Linux target with x86 Linux host. gdb/ChangeLog: 2016-03-17 Pedro Alves <palves@redhat.com> Don Breazeal <donb@codesourcery.com> PR remote/19496 * infcmd.c (notice_new_inferior): Use the 'leave_running' argument instead of checking the 'non_stop' global. * remote.c (remote_add_thread): New parameter 'executing'. Use it to set the new thread's executing state. (remote_notice_new_inferior): Rename parameter 'running' to 'executing'. Always set the thread state to THREAD_RUNNING in non-stop mode, and to THREAD_STOPPED in all-stop mode. Pass EXECUTING to remote_add_thread and notice_new_inferior. (remote_update_thread_list): Update to pass executing state, not running state.
2016-03-17S390: Add syscall info for syscalls up to 374Andreas Arnez3-0/+56
Represent new Linux syscalls for s390 and s390x in GDB's syscall info. Add the syscalls from 355 (userfaultfd) up to 374 (mlock2) as well as the previously reserved NUMA syscalls 268-270, 287, and 310. gdb/ChangeLog: * syscalls/s390-linux.xml: Add NUMA syscalls and new syscalls up to 374. * syscalls/s390x-linux.xml: Likewise.
2016-03-17S390: Fix output path for s390-multiarch test caseAndreas Arnez2-5/+9
Since test artifacts are organized in a directory hierarchy, the s390-multiarch test case is not executed correctly any more. This is because it uses an obsolete way of constructing the output paths. This fix invokes standard_testfile instead. gdb/testsuite/ChangeLog: * gdb.arch/s390-multiarch.exp: Use standard_testfile instead of maintaining separate logic for constructing the output path.
2016-03-17linux-record: Simplify with record_mem_at_reg()Andreas Arnez2-414/+170
The function record_linux_system_call() often records a memory area whose address is contained in a register. So far this required two function calls: one for fetching the register value, and another one for recording the memory area. These two function calls are now merged into a new local helper function, and all occurrences are adjusted. This reduces the source code and makes it more readable. gdb/ChangeLog: * linux-record.c (record_mem_at_reg): New helper function. (record_linux_system_call): Exploit new helper function where applicable.
2016-03-17linux-record.c: Fix whitespace issuesAndreas Arnez2-949/+954
This patch changes whitespace only, fixing whitespace issues in linux-record.c. gdb/ChangeLog: * linux-record.c: Fix whitespace issues; tabify, remove trailing spaces.
2016-03-17linux-record: Fix bad fall-through for pipe/pipe2Andreas Arnez2-0/+7
This patch added handling for some syscalls to linux-record.c: https://sourceware.org/ml/gdb-patches/2015-10/msg00452.html But for both `pipe' and `pipe2' the patch lacks a statement after an `if', such that the following `break' is interpreted as the `if'-body instead. This adds the missing (return-) statements for the conditionals. gdb/ChangeLog: * linux-record.c (record_linux_system_call): Add missing return statements to handling of pipe and pipe2 syscalls.
2016-03-17Automatic date update in version.inGDB Administrator1-1/+1
2016-03-17testsuite/ChangeLog is no longer supposed to existAlan Modra2-13/+7
move entries to main ChangeLog
2016-03-16PR remote/19496, interrupted syscall in forking-threads-plus-bkptDon Breazeal3-14/+33
This patch addresses "fork:Interrupted system call" (or wait:) failures in gdb.threads/forking-threads-plus-breakpoint.exp. The test program spawns ten threads, each of which do ten fork/waitpid sequences. The cause of the problem was that when one of the fork children exited before the corresponding fork parent could initiate its waitpid for that child, a SIGCHLD and/or SIGSTOP was delivered and interrupted a fork or waitpid in another thread. The fix was to wrap the system calls in a loop to retry the call if it was interrupted, like: do { pid = fork (); } while (pid == -1 && errno == EINTR); Since this is a Linux-only test I figure it is OK to use errno and EINTR. I tried a number of alternative fixes using SIG_IGN, SA_RESTART, pthread_sigblock, and bsd_signal, but none of these worked as well. Tested on Nios II Linux target with x86 Linux host. gdb/testsuite/ChangeLog: 2016-03-16 Don Breazeal <donb@codesourcery.com> * gdb.threads/forking-threads-plus-breakpoint.c (thread_forks): Retry fork and waitpid on interrupted system call errors. * gdb.threads/forking-threads-plus-breakpoint.exp: (do_test): Use with_timeout_factor to increase timeout to 90.
2016-03-16xml-tdesc.c (tdesc_start_enum): Fix c++ build.Doug Evans2-2/+6
gdb/ChangeLog: * xml-tdesc.c (tdesc_start_enum): Fix c++ build.
2016-03-16[ARM] Support ARMv8.2 FP16 simd instructionsJiong Wang10-46/+851
gas/ * config/tc-arm.c (N_S_32): New. (N_F_16_32): Likewise. (N_SUF_32): Support N_F16. (N_IF_32): Likewise. (neon_dyadic_misc): Likewise. (do_neon_cmp): Likewise. (do_neon_cmp_inv): Likewise. (do_neon_mul): Likewise. (do_neon_fcmp_absolute): Likewise. (do_neon_step): Likewise. (do_neon_abs_neg): Likewise. (CVT_FLAVOR_VAR): Likewise. (do_neon_cvt_1): Likewise. (do_neon_recip_est): Likewise. (do_vmaxnm): Likewise. (do_vrint_1): Likewise. (neon_check_type): Check architecture support for FP16 extension. (insns): Update comments. * testsuite/gas/arm/armv8-2-fp16-simd.s: New test source. * testsuite/gas/arm/armv8-2-fp16-simd.d: New testcase for arm mode. * testsuite/gas/arm/armv8-2-fp16-simd-thumb.d: Likewise for thumb mode. * testsuite/gas/arm/armv8-2-fp16-simd-warning.d: New rejection test for arm mode. * testsuite/gas/arm/armv8-2-fp16-simd-warning-thumb.d: Likewise for thumb mode. * testsuite/gas/arm/armv8-2-fp16-simd-warning.l: New expected rejection error file. opcode/ * arm-dis.c (neon_opcodes): Support new FP16 instructions.
2016-03-16Process record: Fix arm-linux syscall argumentsYao Qi2-3/+14
Arguments are passed in r0-r6 on arm linux syscall (both EABI and OABI). This patch is to set arm_linux_record_tdep.arg{1-7} to the right register number. This patch fixes the following test failures... -FAIL: gdb.reverse/getresuid-reverse.exp: check ruid record -FAIL: gdb.reverse/getresuid-reverse.exp: check rgid record -FAIL: gdb.reverse/pipe-reverse.exp: check pipe record -FAIL: gdb.reverse/readv-reverse.exp: check readv record -FAIL: gdb.reverse/readv-reverse.exp: check readv record -FAIL: gdb.reverse/readv-reverse.exp: check readv record -FAIL: gdb.reverse/readv-reverse.exp: check readv record -FAIL: gdb.reverse/waitpid-reverse.exp: check waitpid record gdb: 2016-03-16 Yao Qi <yao.qi@linaro.org> * arm-linux-tdep.c (arm_linux_init_abi): Fix arm_linux_record_tdep.arg1, arm_linux_record_tdep.arg2 and arm_linux_record_tdep.arg3. Set arm_linux_record_tdep.arg4, arm_linux_record_tdep.arg5, arm_linux_record_tdep.arg6, and arm_linux_record_tdep.arg7.
2016-03-16Fix checking bignum values that are being inserted into byte sized containers.Nick Clifton6-8/+80
* read.c (emit_expr_with_reloc): Add code check a bignum with nbytes == 1. * config/rx/rx-parse.y (rx_intop): Accept bignum values for sizes other than 32-bits. * testsuite/gas/elf/bignum.s: New test source file. * testsuite/gas/elf/bignum.d: New test driver file. * testsuite/gas/elf/elf.exp: Run the new test.
2016-03-16Automatic date update in version.inGDB Administrator1-1/+1
2016-03-15PR 18303, Tolerate malformed input for lookup_symbol-called functionsDon Breazeal10-182/+433
lookup_symbol is often called with user input. Consequently, any function called from lookup_symbol{,_in_language} should attempt to deal with malformed input gracefully. After all, malformed user input is not a programming/API error. This patch does not attempt to find/correct all instances of this. It only fixes locations in the code that trigger test suite failures. This patch fixes PR breakpoints/18303, "Assertion: -breakpoint-insert with windows paths of file in non-current directory". The patch includes three new tests related to this. One is just gdb.linespec/ls-errs.exp copied and converted to use C++ instead of C, and to add a case using a file name containing a Windows-style logical drive specifier. The others include an MI test to provide a regression test for the specific case reported in PR 18303, and a C++ test for proper error handling of access to a program variable when using a file scope specifier that refers to a non-existent file. Tested on x86_64 native Linux. gdb/ChangeLog 2016-01-28 Keith Seitz <keiths@redhat.com> PR breakpoints/18303 * cp-namespace.c (cp_lookup_bare_symbol): Change assertion to look for "::" instead of simply ":". (cp_search_static_and_baseclasses): Return null_block_symbol for malformed input. Remove assertions. * cp-support.c (cp_find_first_component_aux): Do not return a prefix length for ':' unless the next character is also ':'. gdb/testsuite/ChangeLog 2016-01-28 Don Breazeal <donb@codesourcery.com> * gdb.cp/scope-err.cc: New test program. * gdb.cp/scope-err.exp: New test script. * gdb.linespec/ls-errs.c (myfunction): Expanded to have multiple lines and "set breakpoint here" comment. * gdb.linespec/ls-errs.exp: Added C++ testing and new test case. Fixed some whitespace and format issues. * gdb.mi/mi-linespec-err-cp.cc: New test program. * gdb.mi/mi-linespec-err-cp.exp: New test script.
2016-03-15Add cole945@ to earlier entry. Fix typo in same entry.Doug Evans1-1/+2
2016-03-15Add cpsr_flags to aarch64 core regs.Doug Evans3-2/+46
gdb/ChangeLog: * features/aarch64-core.xml (cpsr_flags): New flags type. (cpsr): Use it. * features/aarch64.c: Regenerate.
2016-03-15Remove "end" spec.Doug Evans6-79/+87
gdb/ChangeLog: * features/i386/32bit-core.xml (i386_eflags): Remove "end" spec. * features/i386/32bit-sse.xml (i386_eflags): Ditto. * features/i386/64bit-core.xml (i386_eflags): Ditto. * features/i386/64bit-sse.xml (i386_eflags): Ditto. * features/i386/x32-core.xml (i386_eflags): Ditto.
2016-03-15Extend flags to support multibit and enum bitfields.Doug Evans16-209/+724
gdb/ChangeLog: Extend flags to support multibit and enum bitfields. NEWS: Document new features. * c-typeprint.c (c_type_print_varspec_prefix): Handle TYPE_CODE_FLAGS. (c_type_print_varspec_suffix, c_type_print_base): Ditto. * gdbtypes.c (arch_flags_type): Don't assume all fields are one bit. (append_flags_type_field): New function. (append_flags_type_flag): Call it. * gdbtypes.h (append_flags_type_field): Declare. * target-descriptions.c (struct tdesc_type_flag): Delete. (enum tdesc_type_kind) <TDESC_TYPE_BOOL>: New enum value. (enum tdesc_type_kind) <TDESC_TYPE_ENUM>: Ditto. (struct tdesc_type) <u.f>: Delete. (tdesc_predefined_types): Add "bool". (tdesc_predefined_type): New function. (tdesc_gdb_type): Handle TDESC_TYPE_BOOL, TDESC_TYPE_ENUM. Update TDESC_TYPE_FLAGS support. (tdesc_free_type): Handle TDESC_TYPE_ENUM. Update TDESC_TYPE_FLAGS. (tdesc_create_flags): Update. (tdesc_create_enum): New function. (tdesc_add_field): Initialize start,end to -1. (tdesc_add_typed_bitfield): New function. (tdesc_add_bitfield): Call it. (tdesc_add_flag): Allow TDESC_TYPE_STRUCT. Update. (tdesc_add_enum_value): New function. (maint_print_c_tdesc_cmd): Fold TDESC_TYPE_FLAGS support into TDESC_TYPE_STRUCT. Handle TDESC_TYPE_ENUM. * target-descriptions.h (tdesc_create_enum): Declare. (tdesc_add_typed_bitfield, tdesc_add_enum_value): Declare. * valprint.c (generic_val_print_enum_1): New function. (generic_val_print_enum): Call it. (val_print_type_code_flags): Make static. Handle multibit bitfields and enum bitfields. * valprint.h (val_print_type_code_flags): Delete. * xml-tdesc.c (struct tdesc_parsing_data) <current_type_is_flags>: Delete. All uses removed. (tdesc_start_enum): New function. (tdesc_start_field): Handle multibit and enum bitfields. (tdesc_start_enum_value): New function. (enum_value_attributes, enum_children, enum_attributes): New static globals. (feature_children): Add "enum". * features/gdb-target.dtd (enum, evalue): New elements. gdb/doc/ChangeLog: * gdb.texinfo (Target Descriptions): New menu item "Enum Target Types". (Target Description Format): Mention enum types. Update docs on flags types. (Predefined Target Types): Add "bool". (Enum Target Types): New node. gdb/testsuite/ChangeLog: * gdb.xml/extra-regs.xml: Add enum, mixed_flags values. * gdb.xml/tdesc-regs.exp (load_description): New arg xml_file. All callers updated. Add tests for enums, mixed flags register.
2016-03-15Use int instead of LONGEST in tdesc_type sizes.Doug Evans4-13/+75
gdb/ChangeLog: * target-descriptions.c (struct tdesc_type) <u.u.size>: Change type from LONGEST to int. (struct tdesc_type) <u.f.size>: Ditto. (tdesc_set_struct_size): Change type of "size" arg from LONGEST to int. Add assertion size > 0. (tdesc_create_flags): Ditto. * target-descriptions.h (tdesc_set_struct_size): Update. (tdesc_create_flags): Update. * xml-tdesc.c (MAX_FIELD_SIZE, MAX_FIELD_BITSIZE): New macros. (MAX_VECTOR_SIZE): New macro. (tdesc_start_struct): Catch conversion errors from LONGEST to int. (tdesc_start_flags, tdesc_start_field, tdesc_start_vector): Ditto.
2016-03-15maint_print_c_tdesc_cmd: Use type for TYPE_CODE_FLAGS instead of field_type.Doug Evans26-767/+800
gdb/ChangeLog: * target-descriptions.c (maint_print_c_tdesc_cmd): Use "type" for TYPE_CODE_FLAGS instead of "field_type", for consistency. * features/i386/amd64-avx-linux.c: Regenerate. * features/i386/amd64-avx.c: Regenerate. * features/i386/amd64-avx512-linux.c: Regenerate. * features/i386/amd64-avx512.c: Regenerate. * features/i386/amd64-linux.c: Regenerate. * features/i386/amd64-mpx-linux.c: Regenerate. * features/i386/amd64-mpx.c: Regenerate. * features/i386/amd64.c: Regenerate. * features/i386/i386-avx-linux.c: Regenerate. * features/i386/i386-avx.c: Regenerate. * features/i386/i386-avx512-linux.c: Regenerate. * features/i386/i386-avx512.c: Regenerate. * features/i386/i386-linux.c: Regenerate. * features/i386/i386-mmx-linux.c: Regenerate. * features/i386/i386-mmx.c: Regenerate. * features/i386/i386-mpx-linux.c: Regenerate. * features/i386/i386-mpx.c: Regenerate. * features/i386/i386.c: Regenerate. * features/i386/x32-avx-linux.c: Regenerate. * features/i386/x32-avx.c: Regenerate. * features/i386/x32-avx512-linux.c: Regenerate. * features/i386/x32-avx512.c: Regenerate. * features/i386/x32-linux.c: Regenerate. * features/i386/x32.c: Regenerate.
2016-03-15Remove hand-called function from test.Doug Evans3-7/+17
gdb/testsuite/ChangeLog: * gdb.base/skip.c (main): Call test_skip_file_and_function. * gdb.base/skip.exp: Remove hand calling test_skip_file_and_function.
2016-03-15Bind defined symbol locally in PIEH.J. Lu12-6/+75
Symbols defined in PIE should be bound locally, the same as -shared -Bsymbolic. bfd/ PR ld/19827 * elf32-i386.c (elf_i386_check_relocs): Bind defined symbol locally in PIE. (elf_i386_relocate_section): Likewise. * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise. (elf_x86_64_relocate_section): Likewise. ld/ PR ld/19827 * testsuite/ld-i386/i386.exp: Run PR ld/19827 tests. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-i386/pr19827.rd: New file. * testsuite/ld-i386/pr19827a.S: Likewise. * testsuite/ld-i386/pr19827b.S: Likewise. * testsuite/ld-x86-64/pr19827.rd: Likewise. * testsuite/ld-x86-64/pr19827a.S: Likewise. * testsuite/ld-x86-64/pr19827b.S: Likewise.
2016-03-15Add -z noreloc-overflow option to x86-64 ldH.J. Lu22-4/+166
Add -z noreloc-overflow command-line option to the x86-64 ELF linker to disable relocation overflow check. This can be used to avoid relocation overflow check if there will be no dynamic relocation overflow at run-time. bfd/ PR ld/19807 * elf64-x86-64.c (elf_x86_64_relocate_section): Check no_reloc_overflow_check to diable R_X86_64_32/R_X86_64_32S relocation overflow check. include/ PR ld/19807 * bfdlink.h (bfd_link_info): Add no_reloc_overflow_check. ld/ PR ld/19807 * Makefile.am (ELF_X86_DEPS): Add $(srcdir)/emulparams/reloc_overflow.sh. * Makefile.in: Regenerated. * NEWS: Mention -z noreloc-overflow. * ld.texinfo: Document -z noreloc-overflow. * emulparams/elf32_x86_64.sh: Source ${srcdir}/emulparams/reloc_overflow.sh. * emulparams/elf_x86_64.sh: Likewise. * emulparams/reloc_overflow.sh: New file. * testsuite/ld-x86-64/pr19807-1.s: New file. * testsuite/ld-x86-64/pr19807-1a.d: Likewise. * testsuite/ld-x86-64/pr19807-1b.d: Likewise. * testsuite/ld-x86-64/pr19807-2.s: Likewise. * testsuite/ld-x86-64/pr19807-2a.d: Likewise. * testsuite/ld-x86-64/pr19807-2b.d: Likewise. * testsuite/ld-x86-64/pr19807-2c.d: Likewise. * testsuite/ld-x86-64/pr19807-2d.d: Likewise. * testsuite/ld-x86-64/pr19807-2e.d: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run PR ld/19807 tests.
2016-03-15Fix PR gdb/19676: Internal error in linux-thread.db.c if /proc not mountedPedro Alves2-6/+20
If /proc is not mounted, GDB fails an assertion in find_new_threads_once: Continuing. .../src/gdb/linux-thread-db.c:1249: internal-error: find_new_threads_once: Assertion `!target_has_execution' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) That was supposed to catch misuses of td_ta_thr_iter, which is unsafe for live debugging. However, if /proc is not mounted, we still fallback to using it. I didn't bother with a warning, because GDB already prints several others related to failing to open /proc files. gdb/ChangeLog: 2016-03-15 Pedro Alves <palves@redhat.com> PR gdb/19676 * linux-thread-db.c (try_thread_db_load_1): Leave info->td_ta_thr_iter_p NULL iff debugging a live process and we have /proc access. (find_new_threads_once): Assert that we have a non-NULL info->td_ta_thr_iter_p instead of checking whether the target has execution.
2016-03-15Fix PR gdb/19676: Disable displaced stepping if /proc not mountedPedro Alves3-2/+12
On GNU/Linux archs that support displaced stepping, if /proc is not mounted, GDB gets stuck not able to step past breakpoints: (gdb) c Continuing. dl_main (phdr=<optimized out>, phnum=<optimized out>, user_entry=<optimized out>, auxv=<optimized out>) at rtld.c:2163 2163 LIBC_PROBE (init_complete, 2, LM_ID_BASE, r); Cannot find AT_ENTRY auxiliary vector entry. (gdb) c Continuing. dl_main (phdr=<optimized out>, phnum=<optimized out>, user_entry=<optimized out>, auxv=<optimized out>) at rtld.c:2163 2163 LIBC_PROBE (init_complete, 2, LM_ID_BASE, r); Cannot find AT_ENTRY auxiliary vector entry. (gdb) That's because GDB can't figure out where the scratch pad is. This is a regression introduced by the earlier changes to make the Linux native target always work in non-stop mode. This commit makes GDB detect the case and fallback to stepping over breakpoints in-line. gdb/ChangeLog: 2016-03-15 Pedro Alves <palves@redhat.com> PR gdb/19676 * infrun.c (displaced_step_prepare): Also disable displaced stepping on NOT_SUPPORTED_ERROR. * linux-tdep.c (linux_displaced_step_location): If reading auxv fails, throw NOT_SUPPORTED_ERROR instead of generic error.
2016-03-15Fix typo in previous gdb/doc/ commitPedro Alves2-1/+5
Should be s/reliability/reliably/. gdb/doc/ChangeLog: 2016-03-15 Pedro Alves <palves@redhat.com> * gdb.texinfo (Tracepoint Actions): Fix typo.
2016-03-15Document possible unreliability of '$_ret'Pedro Alves2-0/+14
gdb/doc/ChangeLog: 2016-03-15 Pedro Alves <palves@redhat.com> Andreas Arnez <arnez@linux.vnet.ibm.com> Marcin Kościelnicki <koriakin@0x04.net> * gdb.texinfo (Tracepoint Actions): Document possible unreliability of '$_ret'.
2016-03-15Update x86 register name documentation.Ulrich Drepper2-7/+48
* doc/c-i386.texi (Register Naming): Update to details of the latest architecture version.
2016-03-15Automatic date update in version.inGDB Administrator1-1/+1
2016-03-14Regenerate bfd-in2.hH.J. Lu2-1/+5
* bfd-in2.h: Regenerated.
2016-03-14gdb.base/default.exp: Add missing $_as_string to "show convenience" testSimon Marchi2-0/+6
When adding the $_as_string convenience function, I missed a new test failure in default.exp. The tests lists the convenience functions, so $_as_string should be added to the expected list. Fixes: +FAIL: gdb.base/default.exp: show convenience ($_caller_is = <internal function _caller_is> not found) gdb/testsuite/ChangeLog: * gdb.base/default.exp: Add $_as_string to the list of expected convenience functions.
2016-03-14Automatic date update in version.inGDB Administrator1-1/+1
2016-03-13Add more tests for PR ld/19539H.J. Lu10-0/+53
PR ld/19539 * testsuite/ld-i386/i386.exp: Run pr19539. * testsuite/ld-i386/pr19539.d: New file. * testsuite/ld-i386/pr19539.s: Likewise. * testsuite/ld-i386/pr19539.t: Likewise. * testsuite/ld-x86-64/pr19539.s: Likewise. * testsuite/ld-x86-64/pr19539.t: Likewise. * testsuite/ld-x86-64/pr19539a.d: Likewise. * testsuite/ld-x86-64/pr19539b.d: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr19539a and pr19539b.