aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-05-03[gdb] Fix -Wparentheses warningsKyrylo Tkachov2-37/+50
2016-05-03 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * symfile.c (find_pc_overlay): Add braces to avoid -Wparentheses warning. (find_pc_mapped_section): Likewise. (list_overlays_command): Likewise.
2016-05-03Automatic date update in version.inGDB Administrator1-1/+1
2016-05-02Fix detach.exp remote checkSimon Marchi2-5/+4
This test seems to work with both native-gdbserver and native-extended-gdbserver, so I removed the remote check. When running with native-gdbserver (a stub-like target), detach makes gdbserver stop and gdb disconnect. runto_main just spawns a brand new gdbserver. So it tests the exact same thing twice. It doesn't hurt though. With native-extended-gdbserver, the test is probably a bit more useful (and similar to native). It tests running/detaching twice using the same gdb/gdbserver instances, since with extended-remote, you can detach/attach/run all you want, unlike with remote. gdb/testsuite/ChangeLog: * gdb.base/detach.exp: Remove is_remote check.
2016-05-02Fix annota-input-while-running.exp remote checkSimon Marchi2-19/+12
The comment says that we can't use runto_main here becore it doesn't know how to handle annotation. Instead, the test puts a breakpoint at main and calls run by hand. Therefore, it can't work with stub targets, since they can't "run". The check should be then changed to check the use_gdb_stub variable instead of [is_remote target]. But as an alternative, we can just use runto_main and enable annotations after, since the "run to main" part is not really part of what we want to test. I also removed the "set test..." line that is unused. gdb/testsuite/ChangeLog: * gdb.base/annota-input-while-running.exp: Don't check for [is_remote target]. Enable annotations after running to main. Remove unused "set test..." line.
2016-05-02Fix startup on MS-Windows when 'gdb.ini' is found in $HOMEEli Zaretskii2-3/+11
* windows-nat.c (_initialize_check_for_gdb_ini): Fix off-by-one error in allocation of space for "$HOME/.gdbinit" string. This caused GDB to abort on startup whenever a '~/gdb.ini' file was actually found, because xsnprintf would hit an assertion violation.
2016-05-02Automatic date update in version.inGDB Administrator1-1/+1
2016-05-01Automatic date update in version.inGDB Administrator1-1/+1
2016-04-30Automatic date update in version.inGDB Administrator1-1/+1
2016-04-29Set interpreter in x86 create_dynamic_sectionsH.J. Lu3-28/+31
Set interpreter in x86 create_dynamic_sections to make this information available to x86 check_relocs. * elf32-i386.c (elf_i386_size_dynamic_sections): Move interp setting to ... (elf_i386_create_dynamic_sections): Here. * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Move interp setting to ... (elf_x86_64_create_dynamic_sections): Here.
2016-04-29Pass GOT_RELOC to UNDEFINED_WEAK_RESOLVED_TO_ZEROH.J. Lu3-11/+47
When UNDEFINED_WEAK_RESOLVED_TO_ZERO is checked to convert load via GOT, has_got_reloc is always TRUE. This patch adds GOT_RELOC, which is TRUE in x86 convert_load, to UNDEFINED_WEAK_RESOLVED_TO_ZERO. * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Take GOT_RELOC and replace (EH)->has_got_reloc with GOT_RELOC. (elf_i386_fixup_symbol): Pass has_got_reloc to UNDEFINED_WEAK_RESOLVED_TO_ZERO. (elf_i386_allocate_dynrelocs): Likewise. (elf_i386_relocate_section): Likewise. (elf_i386_finish_dynamic_symbol): Likewise. (elf_i386_convert_load): Pass TRUE to UNDEFINED_WEAK_RESOLVED_TO_ZERO. * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Take GOT_RELOC and replace (EH)->has_got_reloc with GOT_RELOC. (elf_x86_64_fixup_symbol): Pass has_got_reloc to UNDEFINED_WEAK_RESOLVED_TO_ZERO. (elf_x86_64_allocate_dynrelocs): Likewise. (elf_x86_64_relocate_section): Likewise. (elf_x86_64_finish_dynamic_symbol): Likewise. (elf_x86_64_convert_load): Pass TRUE to UNDEFINED_WEAK_RESOLVED_TO_ZERO.
2016-04-29Download source only on remote hostH.J. Lu3-7/+32
There is no need to download source if we aren't on remote host. Otherwise, each ld test run on local host leaves behind a couple test files. * config/default.exp (NOPIE_CFLAGS): Download source only on remote host. (NOPIE_LDFLAGS): Likewise. * testsuite/lib/ld-lib.exp (check_lto_available): Likewise. (check_lto_fat_available): Likewise. (check_lto_shared_available): Likewise. (check_ifunc_available): Likewise. (check_ifunc_attribute_available): Likewise.
2016-04-29Enhance readelf's recognition of AVR relocation types.Pitchumani Sivanupandi2-37/+57
* readelf.c (is_32bit_pcrel_reloc): Return true if reloc is 32-bit PC relocation for AVR target. (is_none_reloc): Return true if reloc is any of AVR diff relocations.
2016-04-29i386: Don't relocate section when check_relocs failedH.J. Lu2-16/+34
No need to relocate section when check_relocs failed. * elf32-i386.c (check_relocs_failed): New. (elf_i386_check_relocs): Set check_relocs_failed on error. (elf_i386_relocate_section): Skip if check_relocs failed.
2016-04-29X86-64: Set check_relocs_failed on errorH.J. Lu2-17/+29
When checking relocations, set check_relocs_failed on error. * elf64-x86-64.c (elf_x86_64_check_relocs): Set check_relocs_failed on error.
2016-04-29Enhance support for copying and stripping Solaris and ARM binaries.Nick Clifton10-143/+361
PR 19938 bfd * elf-bfd.h (struct elf_backend_data): Rename elf_backend_set_special_section_info_and_link to elf_backend_copy_special_section_fields. * elfxx-target.h: Likewise. * elf.c (section_match): Ignore the SHF_INFO_LINK flag when comparing section flags. (copy_special_section_fields): New function. (_bfd_elf_copy_private_bfd_data): Copy the EI_ABIVERSION field. Perform two scans over special sections. The first one looks for a direct mapping between the output section and an input section. The second scan looks for a possible match based upon section characteristics. * elf32-arm.c (elf32_arm_copy_special_section_fields): New function. Handle setting the sh_link field of SHT_ARM_EXIDX sections. * elf32-i386.c (elf32_i386_set_special_info_link): Rename to elf32_i386_copy_solaris_special_section_fields. * elf32-sparc.c (elf32_sparc_set_special_section_info_link): Rename to elf32_sparc_copy_solaris_special_section_fields. * elf64-x86-64.c (elf64_x86_64_set_special_info_link): Rename to elf64_x86_64_copy_solaris_special_section_fields. binutils* readelf.c (get_solaris_segment_type): New function. (get_segment_type): Call it.
2016-04-29Automatic date update in version.inGDB Administrator1-1/+1
2016-04-28Don't show deprecated commands in helpSimon Marchi2-1/+9
Just like completion doesn't show deprecated commands, I think that help should not list them, so that we don't incite users to use them. gdb/ChangeLog: * cli/cli-decode.c (help_cmd_list): Do not list commands that are deprecated.
2016-04-28Add test for tracepoint enable/disableSimon Marchi3-0/+171
This patch adds a test for tracepoints enabling/disabling, which didn't work properly for fast tracepoints on big endian systems. gdb/testsuite/ChangeLog: * gdb.trace/trace-enable-disable.exp: New file. * gdb.trace/trace-enable-disable.c: New file.
2016-04-28Fix write endianness/size problem for fast tracepoint enabled flagPar Olsson2-1/+14
I am sending this fix on behalf of Par Olsson, as a follow-up of this one: https://www.sourceware.org/ml/gdb-patches/2015-10/msg00196.html This problem is exposed when enabling/disabling fast tracepoints on big endian machines. The flag is defined as an int8_t, but is written from gdbserver as an integer (usually 32 bits). When the agent code reads it as an int8_t, it only considers the most significant byte, which is always 0. Also, we were writing 32 bits in an 8 bits field, so the write would overflow, but since the following bytes are padding (the next field is an uint64_t), it luckily didn't cause any issue on little endian systems. The fix was originally tested on ARM big endian systems, but I don't have access to such a system. However, thanks to Marcin's PowerPC fast tracepoint patches and gcc110 (big endian Power7) on the gcc compile farm, I was able to reproduce the problem, test the fix and write a test (the following patch). gdb/gdbserver/ChangeLog: YYYY-MM-DD Par Olsson <par.olsson@windriver.com> * tracepoint.c (write_inferior_int8): New function. (cmd_qtenable_disable): Write enable flag using write_inferior_int8.
2016-04-28ftrace tests: Use gdb_load_shlib result to lookup IPA in info sharedlibrarySimon Marchi8-14/+25
Some fast tracepoints tests make sure that the in-process agent library is properly loaded, by searching for the library name in "info sharedlibrary". Originally, it would search for the full path. Since patch "Make ftrace tests work with remote targets" [1], the "runtime" location of the IPA, in the standard output directory, is not the same as the original location, in the gdbserver build directory. Therefore, the patch changed the checks: gdb_test "info sharedlibrary" ".*${libipa}.*" "IPA loaded" to gdb_test "info sharedlibrary" ".*[file tail ${libipa}].*" "IPA loaded" so that only the "libinproctrace.so" part would be searched for. Antoine (in CC) pointed out that I missed some, so I have to update them. In the mean time, I noticed that I missed a few test failures: adding the SONAME to the IPA makes it possible for the test executable to erroneously pick up libinproctrace.so from /usr/lib if the test harness failed to put the libinproctrace.so we want to test in the right place. To mitigate that kind of error in the future, we can use the return value of gdb_load_shlib (the path of the "runtime" version of the library) and use that to search in the output of info sharedlibrary. When testing locally, gdb_load_shlib returns the full normalized path of the destination library, which the test executable should use e.g.: /path/to/gdb/testsuite/outputs/gdb.trace/thetest/libinproctrace.so My testing showed that it was the same path that gdb displayed in info sharedlibrary. If the test executable picks up another libinproctrace.so, the test will fail. When testing remotely, gdb_load_shlib/gdb_remote_download only returns us "libinproctrace.so", so the situation doesn't really change. If there is a rogue libinproctrace.so in /usr/lib on the target and we fail to download ours, it might cover up a test failure. But that situation is probably still better than the original one, where it wasn't possible to test remotely using the IPA at all. [1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=6e774b13c3b81ac2599812adf058796948ce7e95 gdb/testsuite/ChangeLog: * gdb.arch/ftrace-insn-reloc.exp: Save gdb_load_shlib result, use it in info sharedlibrary test. * gdb.trace/ftrace-lock.exp: Likewise. * gdb.trace/ftrace.exp: Likewise. * gdb.trace/range-stepping.exp: Likewise. * gdb.trace/trace-break.exp: Likewise. * gdb.trace/trace-condition.exp: Likewise. * gdb.trace/trace-mt.exp: Likewise.
2016-04-28Updated Chinese (simplified) translations for bfd, binutils and gold.Nick Clifton6-216/+215
2016-04-28Remove need_step_over from struct lwp_infoYao Qi2-20/+0
Hi, I happen to see that field need_step_over in struct lwp_info is only used to print a debug info. need_step_over is set in linux_wait_1 when breakpoint_here is true, however, we check breakpoint_here too in need_step_over_p and do the step over. I think we don't need field need_step_over, and check breakpoint_here directly in need_step_over_p. This field was added in this patch https://sourceware.org/ml/gdb-patches/2010-03/msg00605.html and the code wasn't changed much since then. This patch is to remove it. gdb/gdbserver: 2016-04-28 Yao Qi <yao.qi@linaro.org> * linux-low.h (struct lwp_info) <need_step_over>: Remove. * linux-low.c (linux_wait_1): Update. (need_step_over_p): Likewise.
2016-04-28Add support to AArch64 disassembler for verifying instructions. Add ↵Nick Clifton10-1332/+1272
verifier for LDPSW. PR target/19722 opcodes * aarch64-dis.c (aarch64_opcode_decode): Run verifier if present. * aarch64-opc.c (verify_ldpsw): New function. * aarch64-opc.h (verify_ldpsw): New prototype. * aarch64-tbl.h: Add initialiser for verifier field. (LDPSW): Set verifier to verify_ldpsw. binutils* testsuite/binutils-all/aarch64/illegal.s: New test. * testsuite/binutils-all/aarch64/illegal.d: New test driver. include * opcode/aarch64.h (struct aarch64_opcode): Add verifier field.
2016-04-28Automatic date update in version.inGDB Administrator1-1/+1
2016-04-27Limit ld-elf/compressed1b.d to Linux/GNU targetsH.J. Lu2-0/+5
Since not all ELF targets use the elf.em emulation to support ld option: --compress-debug-sections=zlib-gnu, limit compressed1b.d to Linux/GNU targets. * testsuite/ld-elf/compressed1b.d: Only run for Linux/GNU targets.
2016-04-27Rename gdb_load_shlibs to gdb_load_shlibSimon Marchi54-85/+147
Rename gdb_load_shlibs to gdb_load_shlib to reflect that it can only load a single shlib at the time. gdb/testsuite/ChangeLog: * lib/gdb.exp (gdb_load_shlibs): Rename to... (gdb_load_shlib): ... this. * gdb.arch/ftrace-insn-reloc.exp: Adjust gdb_load_shlibs -> gdb_load_shlib. * gdb.base/catch-load.exp (one_catch_load_test): Likewise. * gdb.base/ctxobj.exp: Likewise. * gdb.base/dprintf-pending.exp: Likewise. * gdb.base/dso2dso.exp: Likewise. * gdb.base/fixsection.exp: Likewise. * gdb.base/gcore-relro.exp: Likewise. * gdb.base/gdb1555.exp: Likewise. * gdb.base/global-var-nested-by-dso.exp: Likewise. * gdb.base/gnu-ifunc.exp: Likewise. * gdb.base/hbreak-in-shr-unsupported.exp: Likewise. * gdb.base/jit-so.exp (one_jit_test): Likewise. * gdb.base/pending.exp: Likewise. * gdb.base/print-file-var.exp: Likewise. * gdb.base/print-symbol-loading.exp: Likewise. * gdb.base/shlib-call.exp: Likewise. * gdb.base/shreloc.exp: Likewise. * gdb.base/so-impl-ld.exp: Likewise. * gdb.base/solib-disc.exp: Likewise. * gdb.base/solib-nodir.exp: Likewise. * gdb.base/solib-overlap.exp: Likewise. * gdb.base/solib-symbol.exp: Likewise. * gdb.base/solib-weak.exp (do_test): Likewise. * gdb.base/sym-file.exp: Likewise. * gdb.base/symtab-search-order.exp: Likewise. * gdb.base/type-opaque.exp: Likewise. * gdb.base/unload.exp: Likewise. * gdb.base/watchpoint-solib.exp: Likewise. * gdb.compile/compile.exp: Likewise. * gdb.cp/gdb2384.exp: Likewise. * gdb.cp/infcall-dlopen.exp: Likewise. * gdb.cp/re-set-overloaded.exp: Likewise. * gdb.fortran/library-module.exp: Likewise. * gdb.opt/solib-intra-step.exp: Likewise. * gdb.python/py-finish-breakpoint.exp: Likewise. * gdb.python/py-shared.exp: Likewise. * gdb.reverse/solib-precsave.exp: Likewise. * gdb.reverse/solib-reverse.exp: Likewise. * gdb.server/solib-list.exp: Likewise. * gdb.threads/dlopen-libpthread.exp: Likewise. * gdb.threads/tls-shared.exp: Likewise. * gdb.threads/tls-so_extern.exp: Likewise. * gdb.trace/change-loc.exp: Likewise. * gdb.trace/ftrace-lock.exp: Likewise. * gdb.trace/ftrace.exp: Likewise. * gdb.trace/mi-tracepoint-changed.exp (test_reconnect): Likewise. * gdb.trace/pending.exp: Likewise. * gdb.trace/range-stepping.exp: Likewise. * gdb.trace/strace.exp (strace_remove_socket): Likewise. (strace_info_marker): Likewise. (strace_probe_marker): Likewise. (strace_trace_on_same_addr): Likewise. (strace_trace_on_diff_addr): Likewise. * gdb.trace/trace-break.exp: Likewise. * gdb.trace/trace-condition.exp: Likewise. * gdb.trace/trace-mt.exp: Likewise.
2016-04-27Make gdb_load_shlibs return the destination path of the librarySimon Marchi11-15/+38
This patch makes gdb_load_shlibs return the destination path of the copied library. To make the procedure implementation and interface more straightforward, it also changes it so that it accepts a single shared library path at the time. Therefore, calls that are passed multiple libraries: gdb_load_shlibs $lib1 $lib2 must be changed to separate calls: gdb_load_shlibs $lib1 gdb_load_shlibs $lib2 A subtle impact is the solib-search-path handling. In the former version, solib-search-path is set using the directory of the first passed lib (further calls overwrite the value). In the later version, the directory of the library passed to the last call to gdb_load_shlibs remnains. I don't think that's a problem in practice, since if we had tests that needed multiple different paths in solib-search-path, they wouldn't work in the first place. Changed in v2: * Split behavioural and rename changes in two separate patches. gdb/testsuite/ChangeLog: * lib/gdb.exp (gdb_load_shlibs): Accept a single argument. Return result of gdb_remote_download. * gdb.base/ctxobj.exp: Split gdb_load_shlibs call. * gdb.base/dso2dso.exp: Likewise. * gdb.base/global-var-nested-by-dso.exp: Likewise. * gdb.base/print-file-var.exp: Likewise. * gdb.base/shlib-call.exp: Likewise. * gdb.base/shreloc.exp: Likewise. * gdb.base/solib-overlap.exp: Likewise. * gdb.base/solib-weak.exp (do_test): Likewise. * gdb.base/unload.exp: Likewise.
2016-04-27Workaround gdbserver<7.7 for setfsJan Kratochvil2-0/+23
With current FSF GDB HEAD and old FSF gdbserver I expected I could do: gdb -ex 'file target:/root/redhat/threadit' -ex 'target remote :1234' (supplying that unsupported qXfer:exec-file:read by "file") But that does not work because: Sending packet: $vFile:setfs:0#bf...Packet received: OK Packet vFile:setfs (hostio-setfs) is supported ... Sending packet: $vFile:setfs:104#24...Packet received: OK "target:/root/redhat/threadit": could not open as an executable file: Invalid argument GDB documentation says: The valid responses to Host I/O packets are: An empty response indicates that this operation is not recognized. This "empty response" vs. "OK" was a bug in gdbserver < 7.7. It was fixed by: commit e7f0d979dd5cc4f8b658df892e93db69d6d660b7 Author: Yao Qi <yao@codesourcery.com> Date: Tue Dec 10 21:59:20 2013 +0800 Fix a bug in matching notifications. Message-ID: <1386684626-11415-1-git-send-email-yao@codesourcery.com> https://sourceware.org/ml/gdb-patches/2013-12/msg00373.html 2013-12-10 Yao Qi <yao@codesourcery.com> * notif.c (handle_notif_ack): Return 0 if no notification matches. with unpatched old FSF gdbserver and patched FSF GDB HEAD: gdb -ex 'file target:/root/redhat/threadit' -ex 'target remote :1234' Sending packet: $vFile:setfs:0#bf...Packet received: OK Packet vFile:setfs (hostio-setfs) is NOT supported ... (gdb) info sharedlibrary From To Syms Read Shared Object Library 0x00007ffff7ddbae0 0x00007ffff7df627a Yes (*) target:/lib64/ld-linux-x86-64.so.2 0x00007ffff7bc48a0 0x00007ffff7bcf514 Yes (*) target:/lib64/libpthread.so.0 gdb/ChangeLog 2016-04-26 Jan Kratochvil <jan.kratochvil@redhat.com> * remote.c (remote_start_remote): Detect PACKET_vFile_setfs.support.
2016-04-27Skip debug sections when estimating distancesH.J. Lu4-15/+33
Skip debug sections when estimating distances between output sections since compressed_size is used to compress debug sections and debug sections aren't excluded from distances between output sections. bfd/ PR ld/20006 * elf64-x86-64.c (elf_x86_64_convert_load): Skip debug sections when estimating distances between output sections. ld/ PR ld/20006 * testsuite/ld-elfvsb/elfvsb.exp (COMPRESS_LDFLAG): New. (visibility_run): Pass COMPRESS_LDFLAG to visibility_test on ELF targets.
2016-04-27Skip gdb.base/branch-to-self.exp if gdb,nosignals existsYao Qi2-0/+10
I get a timeout fail in branch-to-self.exp when it is compiled by a bare-mental target running qemu, which doesn't have signal. The test should be skipped if gdb,nosignals exists, and that is what this patch does. gdb/testsuite: 2016-04-27 Yao Qi <yao.qi@linaro.org> * gdb.base/branch-to-self.exp: Skip it if gdb,nosignals exists.
2016-04-27c_value_print: Revert 'val' to a reference for TYPE_CODE_STRUCTMartin Galvan2-8/+14
Currently c_value_print will turn struct reference values into pointers before doing a set of RTTI checks. This was introduced as a fix to PR c++/15401. If there's RTTI the pointer will be adjusted and converted back to a reference. However, if there's no RTTI the value will still be treated as a pointer during the remainder of the function. This patch moves the conversion down so that it's always performed when needed. Notice this currently has not user-visible effects, so can be seen as a small code cleanup. However, it'll be necessary for the bug-fix for handling synthetic C++ references. It causes no testsuite regressions. gdb/ChangeLog: 2016-04-26 Martin Galvan <martin.galvan@tallertechnologies.com> * c-valprint.c (c_value_print): Always convert val back to reference type if we converted it to a pointer type.
2016-04-27Tweak doc on command tfindYao Qi2-1/+7
Hi, command "tfind" will find the first trace snapshot if no trace snapshot is selected, but this behavior isn't documented. This patch completes the doc of command "tfind" without argument. gdb/doc: 2016-04-27 Yao Qi <yao.qi@linaro.org> * gdb.texinfo (tfind): Complete doc about tfind without argument.
2016-04-27Avoid non-C++-enabled babeltrace versionsAndreas Arnez3-0/+8
In some babeltrace versions before 1.2.0, the header file iterator.h declares the enum values `BT_SEEK_*' within the struct declaration of bt_iter_pos. The enum values are supposed to be globally-scoped, which works for C, but not for C++. Later babeltrace versions declare the enum outside the struct: https://lists.lttng.org/pipermail/lttng-dev/2013-September/021411.html Now that GDB is compiled with C++, the GDB build fails on a system with an affected babeltrace version: the compiler complains about a missing declaration of BT_SEEK_BEGIN in ctf.c. This patch enhances the configure check to recognize such babeltrace versions as unusable for GDB. gdb/ChangeLog: * configure.ac: Enhance configure check for babeltrace to reject non-C++-enabled versions. * configure: Regenerate.
2016-04-27Pass --compress-debug-sections=none to ldH.J. Lu3-2/+8
Since ld may generate compressed debug sections by default, pass --compress-debug-sections=none to ld to avoid compressed debug sections. * ld-elf/compressed1b.d: Pass --compress-debug-sections=none to ld. * ld-elf/compressed1c.d: Likewise.
2016-04-27Fix a typo in the check for SNANs in the RX simulator.Nick Clifton2-1/+7
PR target/20000 * fpu.c (check_exceptions): Fix typo checking for signalling NANs.
2016-04-27Add support for the --trace-decode option to the AArch64 simulator.Nick Clifton2-7/+317
* simulator.c: Add TRACE_DECODE statements to all emulation functions.
2016-04-27Fix powerpc64 ld testsuite failAlan Modra2-2/+7
PR target/19985 * configure.tgt: Don't use var+=.
2016-04-27Provide xmemdup0Alan Modra2-15/+13
and some tidies in as.h * as.h (inline, __PTR_TO_INT, __INT_TO_PTR): Don't define. (xmemdup0): New inline function.
2016-04-27Cache result of scan for __start_* and __stop_* sectionsAlan Modra5-26/+83
include/ * bfdlink.h (struct bfd_link_hash_entry): Add "section" field to undef. Formatting. bfd/ * elflink.c (_bfd_elf_is_start_stop): New function. (_bfd_elf_gc_mark_rsec): Use it. * elf-bfd.h (_bfd_elf_is_start_stop): Declare.
2016-04-26add casts to avoid arithmetic on void *Trevor Saunders3-5/+11
arithmetic on void * is undefined in ISO C, so we should avoid it. In GNU C sizeof void * is defined as 1, and that is pretty clearly what this code wants, so change it to do arithmetic on bfd_byte *. Unfortunately most of the argument types come from virtual function interfaces so changing the types to bfd_byte * isn't trivial though it might make the code clearer. So for the moment its easiest to leave the variable types as void * and cast before doing arithmetic. bfd/ChangeLog: 2016-04-26 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * elf32-rx.c (rx_set_section_contents): Avoid arithmetic on void *. * mmo.c (mmo_get_section_contents): Likewise. (mmo_set_section_contents): Likewise.
2016-04-27Automatic date update in version.inGDB Administrator1-1/+1
2016-04-26fort_dyn_array: Use value constructor instead of raw-buffer manipulation.Keven Boell4-79/+58
Instead of pre-computing indices into a fortran array re-use the value_* interfaces to subscript a fortran array. The benefit of using the new interface is that it takes care of dynamic types and resolve them when needed. This fixes issues when printing structures with dynamic arrays from toplevel. Before: (gdb) p twov $1 = ( (( ( 6352320, 0, -66, -1, 267) ( 343476, 1, -15, 1, 0) ( 5, 0, 5, 0, 1) ... After: (gdb) p twov $1 = ( (( ( 1, 1, 1, 1, 1) ( 1, 1, 321, 1, 1) ( 1, 1, 1, 1, 1) ... 2016-04-26 Sanimir Agovic <sanimir.agovic@intel.com> Keven Boell <keven.boell@intel.com> Bernhard Heckel <bernhard.heckel@intel.com> gdb/Changelog: * f-valprint.c (f77_create_arrayprint_offset_tbl): Remove function. (F77_DIM_SIZE, F77_DIM_OFFSET): Remove macro. (f77_print_array_1): Use value_subscript to subscript a value array. (f77_print_array): Remove call to f77_create_arrayprint_offset_tbl. (f_val_print): Use value_field to construct a field value. gdb/testsuite/Changelog: * vla-type.exp: Print structure from toplevel.
2016-04-26fort_dyn_array: Support evaluation of dynamic elements inside arrays.Bernhard Heckel5-2/+89
Resolve type of an array's element to be printed in case it is dynamic. Otherwise we don't use the correct boundaries nor the right location. Before: ptype fivearr(1) type = Type five Type one integer(kind=4) :: ivla(34196784:34196832,34197072:34197120,34197360:34197408) End Type one :: tone End Type five After: ptype fivearr(1) type = Type five Type one integer(kind=4) :: ivla(2,4,6) End Type one :: tone End Type five 2016-04-26 Bernhard Heckel <bernhard.heckel@intel.com> gdb/Changelog: * valarith.c (value_address): Resolve dynamic types. gdb/testsuite/Changelog: * gdb.fortran/vla-type.f90: Add test for static and dynamic arrays of dynamic types. * gdb.fortran/vla-type.exp: Add test for static and dynamic arrays of dynamic types.
2016-04-26fort_dyn_array: Enable dynamic member types inside a structure.Bernhard Heckel8-6/+292
Fortran supports dynamic types for which bounds, size and location can vary during their lifetime. As a result of the dynamic behaviour, they have to be resolved at every query. This patch will resolve the type of a structure field when it is dynamic. 2016-04-26 Bernhard Heckel <bernhard.heckel@intel.com> 2016-04-26 Keven Boell <keven.boell@intel.com> Before: (gdb) print threev%ivla(1) Cannot access memory at address 0x3 (gdb) print threev%ivla(5) no such vector element After: (gdb) print threev%ivla(1) $9 = 1 (gdb) print threev%ivla(5) $10 = 42 gdb/Changelog: * NEWS: Add new supported features for fortran. * gdbtypes.c (remove_dyn_prop): New. (resolve_dynamic_struct): Keep type length for fortran structs. * gdbtypes.h: Forward declaration of new function. * value.c (value_address): Return dynamic resolved location of a value. (set_value_component_location): Adjust the value address for single value prints. (value_primitive_field): Support value types with a dynamic location. (set_internalvar): Remove dynamic location property of internal variables. gdb/testsuite/Changelog: * gdb.fortran/vla-type.f90: New file. * gdb.fortran/vla-type.exp: New file.
2016-04-26Always count the NULL entry in dynamic symbol tableH.J. Lu3-19/+24
There is an unused NULL entry at the head of dynamic symbol table which we must account for in our count even if the table is empty or unused since it is intended for the mandatory DT_SYMTAB tag (.dynsym section) in .dynamic section. * elf-bfd.h (elf_link_hash_table): Update comments for dynsymcount. * elflink.c (_bfd_elf_link_renumber_dynsyms): Always count for the unused NULL entry at the head of dynamic symbol table. (bfd_elf_size_dynsym_hash_dynstr): Remove dynsymcount != 0 checks.
2016-04-26Automatic date update in version.inGDB Administrator1-1/+1
2016-04-25Allow powerpc64le-linux-gnu toolchain to support big endian targets as well.Nick Clifton2-2/+11
PR target/19985 * configure.tgt: Include big endian PPC64 emulations with little endian PPC64 targets.
2016-04-25AVR: Allow the start address of the .text section to be set by --section-start.Senthil Kumar Selvaraj2-1/+5
* scripttempl/avrtiny.sc (.text): Do not set LMA to zero.
2016-04-25New test case gdb.base/branch-to-self.expYao Qi3-0/+114
gdb/testsuite: 2016-04-25 Yao Qi <yao.qi@linaro.org> * gdb.base/branch-to-self.c: New file. * gdb.base/branch-to-self.exp: New file.
2016-04-25Resume the inferior with signal rather than stepping overYao Qi2-3/+21
When GDBserver steps over a breakpoint using software single step, it enqueues the signal, single step and deliver the signal in the next resume if step over is not needed. In this way, the program won't receive the signal if the conditional breakpoint is set a branch to self instruction, because the step over is always needed. This patch removes the restriction that don't deliver the signal to the inferior if we are trying to reinsert a breakpoint for software single step and change the decision on resume vs. step-over when the LWP has pending signals to deliver. gdb/gdbserver: 2016-04-25 Yao Qi <yao.qi@linaro.org> * linux-low.c (lwp_signal_can_be_delivered): Adjust. (need_step_over_p): Return zero if the LWP has pending signals can be delivered on software single step target.