aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-07-24Add parallel build support for perf tests.Doug Evans5-6/+96
gdb/testsuite/ChangeLog: * Makefile.in (check/%.exp): Pass directory for GDB_PARALLEL. (workers/%.worker, build-perf): New rule. (GDB_PERFTEST_MODE): New variable. (check-perf): Use it. (clean): Clean up gdb.perf parallel build subdirs. * lib/build-piece.exp: New file. * lib/cache.exp (gdb_do_cache): Include $GDB_PARALLEL in path name. * lib/gdb.exp (standard_output_file): Include $GDB_PARALLEL in path name. (standard_temp_file): Ditto. (GDB_PARALLEL handling): Make outputs,temp,cache directories as subdirs of $GDB_PARALLEL.
2015-07-24Workaround debian change to default value of --as-needed.Doug Evans3-6/+25
gdb/testsuite/ChangeLog: * lib/future.exp (gdb_default_target_compile): New option "early_flags". * lib/gdb.exp (gdb_compile): Undo debian's change in default of --as-needed.
2015-07-24Print data from individual perf runs.Doug Evans2-0/+13
gdb/testsuite/ChangeLog: * gdb.perf/lib/perftest/measure.py (MeasurementCpuTime::stop): Print result. (MeasurementWallTime::stop): Ditto. (MeasurementVmSizeTime::stop): Ditto.
2015-07-24Call gdb_exit before gdb_skip_xml_test on gdb.base/catch-syscall.expSergio Durigan Junior2-0/+6
The gdb_skip_xml_test procedure explicitly says that it cannot be invoked when GDB is running. However, the testcase for "catch syscall" is wrongly doing that, which is causing a failure on native-extended-gdbserver tests: new FAIL: gdb.base/catch-syscall.exp: set tdesc filename /home/gdb-buildbot/fedora-x86-64-3/fedora-x86-64-native-extended-gdbserver-m32/build/gdb/testsuite/outputs/gdb.base/catch-syscall/trivial.xml (got interactive prompt) This obvious commit fixes this, by calling gdb_exit before gdb_skip_xml_test. Checked in as obvious. gdb/testsuite/ChangeLog 2015-07-24 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.base/catch-syscall.exp: Call gdb_exit before gdb_skip_xml_test.
2015-07-24Fix s390 GNU/Linux build after enum __ptrace_request changesPedro Alves2-10/+16
The buildbot noticed that the enum __ptrace_request series broke the s390 GNU/Linux build: ../../binutils-gdb/gdb/s390-linux-nat.c: In function 'fetch_regs': ../../binutils-gdb/gdb/s390-linux-nat.c:226:54: error: macro "ptrace" requires 4 arguments, but only 3 given if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea) < 0) ^ ../../binutils-gdb/gdb/s390-linux-nat.c: In function 'store_regs': ../../binutils-gdb/gdb/s390-linux-nat.c:243:54: error: macro "ptrace" requires 4 arguments, but only 3 given if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea) < 0) ^ Fix this the same way it's handled everywhere else -- just pass 0 as forth argument, which also handles non-varargs ptrace prototypes in non-glibc libcs, e.g., Bionic (if it ever gets a s390 port...). gdb/ChangeLog: 2015-07-24 Pedro Alves <palves@redhat.com> * s390-linux-nat.c (fetch_regs, store_regs, fetch_fpregs) (s390_stopped_by_watchpoint, s390_prepare_to_resume): Pass 0 as forth argument to ptrace PTRACE_PEEKUSR_AREA/PTRACE_POKEUSR_AREA.
2015-07-24gdb.python/py-events.exp and normal_stop observers orderingPedro Alves4-7/+14
I have patches that: 1 - make the CLI print stop info from a normal_stop observer, like MI does. 2 - happen to change the order in which the Python and CLI/TUI normal_stop observers are installed. With those in place, py-events.exp regresses like shown below [1], because the Python stop events are output before CLI prints stop info, instead of after, and the test doesn't expect that. With the same Python hooks, the order in which MI and Python events is emited today is already undefined, because MI also uses the normal_stop observer for output. I see no reason that we should in general define the order observers, interpreters and scripting languages get their turn at being notified of these events. So this patch makes the test cope with Python->CLI output order too. Tested on x86_64 Fedora 20. gdb/testsuite/ 2015-07-24 Pedro Alves <palves@redhat.com> * gdb.python/py-events.exp: Accept output between the stop event and the prompt. * gdb.python/py-evsignal.exp: Likewise. * gdb.python/py-evthreads.exp: Likewise. [1] - The regressions in question look like: Before said patches: (gdb) continue Continuing. event type: continue Breakpoint 2, first () at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.python/py-events.c:30 30 for (i = 0; i < 2; i++) event type: stop event type: stop stop reason: breakpoint first breakpoint number: 2 breakpoint number: 2 breakpoint number: 3 all threads stopped (gdb) PASS: gdb.python/py-events.exp: continue After said patches: (gdb) continue Continuing. event type: continue event type: stop event type: stop stop reason: breakpoint first breakpoint number: 2 breakpoint number: 2 breakpoint number: 3 all threads stopped Breakpoint 2, first () at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.python/py-events.c:30 30 for (i = 0; i < 2; i++) (gdb) FAIL: gdb.python/py-events.exp: continue
2015-07-24PR gdb/18717: internal error if non-leader thread exits processPedro Alves5-4/+104
If a non-leader thread exits the process while all other threads are ptrace-stopped, native gdb fails an assertion. The test added by this commit catches it: /home/pedro/gdb/mygit/build/../src/gdb/linux-nat.c:3198: internal-error: linux_nat_filter_event: Assertion `lp->resumed' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) FAIL: gdb.threads/non-leader-exit-process.exp: program exits normally (GDB internal error) The fix is just to remove the assertion. With that out of the way, neither GDB not GDBserver handle this perfectly though, so I'm adding a KFAIL: (gdb) continue Continuing. [Thread 0x7ffff7fc0700 (LWP 15350) exited] No unwaited-for children left. Couldn't get registers: No such process. (gdb) KFAIL: gdb.threads/non-ldr-exit.exp: program exits normally (PRMS: gdb/18717) gdb/ChangeLog: 2015-07-24 Pedro Alves <palves@redhat.com> PR gdb/18717 * linux-nat.c (linux_nat_filter_event): Don't assert that the lwp is resumed, and extend the debug log. gdb/testsuite/ChangeLog: 2015-07-24 Pedro Alves <palves@redhat.com> PR gdb/18717 * gdb.threads/non-ldr-exit.c: New file. * gdb.threads/non-ldr-exit.exp: New file.
2015-07-24Fix failed exec error messagePedro Alves2-1/+5
Ref: https://sourceware.org/ml/gdb-patches/2015-07/msg00629.html This fixes the bogus command line in the error message shown when the SHELL environment variable points somewhere that's not something that resembles a shell: $ SHELL=/nonexisting gdb /home/pedro/a.out (gdb) r Starting program: /home/pedro/a.out - Cannot exec /home/pedro/a.out -c exec /home/pedro/a.out . + Cannot exec /nonexisting -c exec /home/pedro/a.out . Error: No such file or directory During startup program exited with code 127. (gdb) gdb/ChangeLog: 2015-07-24 Pedro Alves <palves@redhat.com> * fork-child.c (fork_inferior): Print argv[0] instead of exec_file.
2015-07-24Add 'U' suffix to silence GCC 6 warningH.J. Lu2-7/+17
GCC 6 warns: error: result of ‘63 << 26’ requires 33 bits to represent, but ‘int’ only has 32 bits [-Werror=shift-overflow=] on 0x3f << 26. This patch adds 'U' suffix to make integer constant unsigned. * alpha.c (OP_Jxx): Add 'U' suffix to make it unsigned. (OP_BSR): Likewise. (Jxx_FUNC_JMP): Likewise. (Jxx_FUNC_JSR): Likewise. (Jxx_FUNC_RET): Likewise. (Jxx_FUNC_JSR_COROUTINE): Likewise. (alpha_find_call): Replace 0x3f with 0x3fU.
2015-07-24Use 0xffffffffffffffffLL to silence GCC 6 warningH.J. Lu2-1/+5
GCC 6 warns: error: result of ‘4294967295ll << 32’ requires 65 bits to represent, but ‘long long int’ only has 64 bits [-Werror=shift-overflow=] on ((((bfd_signed_vma) 0xffffffff) << 32) | 0xffffffff). This patch replaces it with bfd_signed_vma) 0xffffffffffffffffLL. * stabs.c (parse_stab_range_type): Use 0xffffffffffffffffLL.
2015-07-24Fix the evaluation of RL78 complex relocs, by making immediate values be ↵Nick Clifton12-4/+59
computed relative to a new absolute symbol. gas * config/tc-rl78.c (rl78_abs_sym): New local variable. (md_begin): Initialise the new symbol. (OPIMM): Define the value to be relative to the new symbol and not the absolute section symbol. ld * emulparams/elf32rl78.sh (OTHER_SECTIONS): Provide a value for the _-rl78_abs__ symbol. tests * gas/all/struct.d: Allow for extra symbols in the output. * gas/macros/test1.d: Likewise. * gas/elf/elf.exp: Add an rl78 machine. * gas/elf/sections2e-rl78: New file. tests * binutils-all/localize-hidden-1.d: Allow for extra symbols in the output. * binutils-all/strip-11.d: Skip for the RL78.
2015-07-24Linux: sys/ptrace.h -> nat/gdb_ptrace.h everywherePedro Alves38-35/+81
So that we pick the enum __ptrace_request fix everywhere. gdb/ChangeLog: 2015-07-24 Pedro Alves <palves@redhat.com> * aarch64-linux-nat.c: Include nat/gdb_ptrace.h instead of sys/ptrace.h. * alpha-linux-nat.c: Likewise. * amd64-linux-nat.c: Likewise. * arm-linux-nat.c: Likewise. * hppa-linux-nat.c: Likewise. * i386-linux-nat.c: Likewise. * ia64-linux-nat.c: Likewise. * linux-fork.c: Likewise. * linux-nat.c: Likewise. * m32r-linux-nat.c: Likewise. * m68klinux-nat.c: Likewise. * mips-linux-nat.c: Likewise. * nat/linux-btrace.c: Likewise. * nat/linux-ptrace.c: Likewise. * nat/linux-ptrace.h * nat/mips-linux-watch.c: Likewise. * nat/x86-linux-dregs.c: Likewise. * ppc-linux-nat.c: Likewise. * s390-linux-nat.c: Likewise. * spu-linux-nat.c: Likewise. * tilegx-linux-nat.c: Likewise. * x86-linux-nat.c: Likewise. * xtensa-linux-nat.c: Likewise. gdb/gdbserver/ChangeLog: 2015-07-24 Pedro Alves <palves@redhat.c: Likewise.om> * linux-aarch64-low.c: Include nat/gdb_ptrace.h instead of sys/ptrace.h. * linux-arm-low.c: Likewise. * linux-cris-low.c: Likewise. * linux-crisv32-low.c: Likewise. * linux-low.c: Likewise. * linux-m68k-low.c: Likewise. * linux-mips-low.c: Likewise. * linux-nios2-low.c: Likewise. * linux-s390-low.c: Likewise. * linux-sparc-low.c: Likewise. * linux-tic6x-low.c: Likewise. * linux-tile-low.c: Likewise. * linux-x86-low.c: Likewise.
2015-07-24C++: handle glibc's ptrace(enum __ptrace_request, ...)Pedro Alves8-21/+215
Building in C++ mode issues ~40 warnings like this: ../../src/gdb/linux-nat.c: In function ‘int linux_handle_extended_wait(lwp_info*, int, int)’: ../../src/gdb/linux-nat.c:2016:51: warning: invalid conversion from ‘int’ to ‘__ptrace_request’ [-fpermissive] ptrace (PTRACE_GETEVENTMSG, pid, 0, &new_pid); The issue is that in glibc, ptrace's first parameter is an enum. That's not a problem if we pick the PTRACE_XXX requests from sys/ptrace.h, as those will be values of the corresponding enum. However, we have fallback definitions for PTRACE_XXX symbols when the system headers miss them (such as PTRACE_GETEVENTMSG above), and those are plain integer constants. E.g., nat/linux-ptrace.h: #define PTRACE_GETEVENTMSG 0x4201 One idea would be to fix this by defining those fallbacks like: -#define PTRACE_GETEVENTMSG 0x4201 +#define PTRACE_GETEVENTMSG ((enum __ptrace_request) 0x4201) However, while glibc's ptrace uses enum __ptrace_request for first parameter: extern long int ptrace (enum __ptrace_request __request, ...) __THROW; other libc's, like e.g., Android's bionic do not -- in that case, the first parameter is int: long ptrace(int request, pid_t pid, void * addr, void * data); So the fix I came up is to make configure/ptrace.m4 also detect the type of the ptrace's first parameter and defin PTRACE_TYPE_ARG1, as already does the for parameters 3-4, and then simply wrap ptrace with a macro that casts the first argument to the detected type. (I'm leaving adding a nicer wrapper for when we drop building in C). While this adds the wrapper, GNU/Linux files won't use it until the next patch, which makes all native GNU/Linux files include gdb_ptrace.h. gdb/ChangeLog: 2015-07-24 Pedro Alves <palves@redhat.com> * ptrace.m4 (ptrace tests): Test in C++ mode. Try with 'enum __ptrace_request as first parameter type instead of int. (PTRACE_TYPE_ARG1): Define. * nat/gdb_ptrace.h [!PTRACE_TYPE_ARG5] (ptrace): Define as wrapper that casts first argument to PTRACE_TYPE_ARG1. * config.in: Regenerate. * configure: Regenerate. gdb/gdbserver/ChangeLog: 2015-07-24 Pedro Alves <palves@redhat.com> * config.in: Regenerate. * configure: Regenerate.
2015-07-24Move gdb_ptrace.h to nat/Pedro Alves3-1/+7
Now that gdbserver's configure defines PTRACE_TYPE_ARGx etc., we'll be able to make gdbserver use gdb_ptrace.h too. Move it to the native target files directory. gdb/ChangeLog: 2015-07-24 Pedro Alves <palves@redhat.com> * gdb_ptrace.h: Move ... * nat/gdb_ptrace.h: ... here. * inf-ptrace.c: Adjust.
2015-07-24make gdbserver use the same ptrace autoconf checks as gdbPedro Alves9-69/+335
This factors the ptrace checks out of gdb's configure.ac to a new ptrace.m4 file, and then makes gdbserver's configure.ac source it too. gdb/ChangeLog: 2015-07-24 Pedro Alves <palves@redhat.com> * acinclude.m4: Include ptrace.m4. * configure.ac: Call GDB_AC_PTRACE and move ptrace checks ... * ptrace.m4: ... to this new file. gdb/gdbserver/ChangeLog: 2015-07-24 Pedro Alves <palves@redhat.com> * acinclude.m4: Include ../ptrace.m4. * configure.ac: Call GDB_AC_PTRACE. * config.in, configure: Regenerate.
2015-07-24Remove proc->priv->new_inferiorYao Qi3-15/+10
As the result of the previous patch, new_inferior is no longer used. This patch is to remove it. gdb/gdbserver: 2015-07-24 Yao Qi <yao.qi@linaro.org> * linux-low.c (linux_create_inferior): Remove setting to proc->priv->new_inferior. (linux_attach): Likewise. (linux_low_filter_event): Likewise. * linux-low.h (struct process_info_private) <new_inferior>: Remove.
2015-07-24Initialise target descrption after skipping extra traps for --wrapperYao Qi8-13/+84
Nowadays, when --wrapper is used, GDBserver skips extra traps/stops in the wrapper program, and stops at the first instruction of the program to be debugged. However, GDBserver created target description in the first stop of inferior, and the executable of the inferior is the wrapper program rather than the program to be debugged. In this way, the target description can be wrong if the architectures of wrapper program and program to be debugged are different. This is shown by some fails in gdb.server/wrapper.exp on buildbot. We are testing i686-linux GDB (Fedora-i686) on an x86_64-linux box (fedora-x86-64-4) in buildbot, such configuration causes fails in gdb.server/wrapper.exp like this: spawn /home/gdb-buildbot-2/fedora-x86-64-4/fedora-i686/build/gdb/testsuite/../../gdb/gdbserver/gdbserver --once --wrapper env TEST=1 -- :2346 /home/gdb-buildbot-2/fedora-x86-64-4/fedora-i686/build/gdb/testsuite/outputs/gdb.server/wrapper/wrapper Process /home/gdb-buildbot-2/fedora-x86-64-4/fedora-i686/build/gdb/testsuite/outputs/gdb.server/wrapper/wrapper created; pid = 8795 Can't debug 64-bit process with 32-bit GDBserver Exiting target remote localhost:2346 localhost:2346: Connection timed out. (gdb) FAIL: gdb.server/wrapper.exp: setting breakpoint at marker See https://sourceware.org/ml/gdb-testers/2015-q3/msg01541.html In this case, program to be debugged ("wrapper") is 32-bit but wrapper program ("/usr/bin/env") is 64-bit, so GDBserver gets the 64-bit target description instead of 32-bit. The root cause of this problem is that GDBserver creates target description too early, and the rationale of fix could be creating target description once the GDBserver skips extra traps and inferior stops at the first instruction of the program we want to debug. IOW, when GDBserver skips extra traps, the inferior's tdesc is NULL, and mywait and its callees shouldn't use inferior's tdesc, so in this patch, we skip code that requires register access, see changes in linux_resume_one_lwp_throw and need_step_over_p. In linux_low_filter_event, if target description isn't initialised and GDBserver attached the process, we create target description immediately, because GDBserver don't have to skip extra traps for attach, IOW, it makes no sense to use --attach and --wrapper together. Otherwise, the process is launched by GDBserver, we keep the status pending, and return. After GDBserver skipped extra traps in start_inferior, we call a target_ops hook arch_setup to initialise target description there. gdb/gdbserver: 2015-07-24 Yao Qi <yao.qi@linaro.org> * linux-low.c (linux_arch_setup): New function. (linux_low_filter_event): If proc->tdesc is NULL and proc->attached is true, call the_low_target.arch_setup. Otherwise, keep status pending, and return. (linux_resume_one_lwp_throw): Don't call get_pc if thread->while_stepping isn't NULL. Don't call get_thread_regcache if proc->tdesc is NULL. (need_step_over_p): Return 0 if proc->tdesc is NULL. (linux_target_ops): Install arch_setup. * server.c (start_inferior): Call the_target->arch_setup. * target.h (struct target_ops) <arch_setup>: New field. (target_arch_setup): New marco. * lynx-low.c (lynx_target_ops): Update. * nto-low.c (nto_target_ops): Update. * spu-low.c (spu_target_ops): Update. * win32-low.c (win32_target_ops): Update.
2015-07-24Set proc->priv->new_inferior out of linux_add_processYao Qi2-5/+15
Nowadays, we set proc->priv->new_inferior to 1 inside linux_add_process, and new_inferior is used as a flag to initialise target description later. linux_add_process is used for the three cases, fork/vfork event (handle_extended_wait), run the program (linux_create_inferior), and attach to the process (linux_attach). In the first case, the child's target description is copied from parent's, so we don't need to initialise target description again later, which means we don't need to set proc->priv->new_inferior to 1 in this case. For the rest of two cases, we need this flag. This patch move the code setting proc->priv->new_inferior to 1 inside linux_add_process to linux_create_inferior and linux_attach. No functionality is changed. gdb/gdbserver: 2015-07-24 Yao Qi <yao.qi@linaro.org> * linux-low.c (linux_add_process): Don't set proc->priv->new_inferior. (linux_create_inferior): Set proc->priv->new_inferior to 1. (linux_attach): Likewise.
2015-07-24Refactor start_inferiorYao Qi2-12/+15
This patch is to refactor function start_inferior that signal_pid is return in one place. gdb/gdbserver: 2015-07-24 Yao Qi <yao.qi@linaro.org> * server.c (start_inferior): Code refactor.
2015-07-24Test --wrapper when restarting process.Yao Qi2-0/+25
My patch series will affect the code starting inferior in GDBserver (callees of start_inferior), so we need tests to cover how start_inferior is used in different cases. In server.c:process_serial_event, start_inferior is used when GBDserver receives 'R' packet, and this patch is to add a test for this path, and see how --wrapper option works when the process is restarted. gdb/testsuite: 2015-07-24 Yao Qi <yao.qi@linaro.org> * gdb.server/ext-wrapper.exp: Test --wrapper option when restarting process.
2015-07-24Set general_thread after restartYao Qi4-1/+87
When I run gdb.server/ext-restart.exp, I get the following GDB internal error, run^M The program being debugged has been started already.^M Start it from the beginning? (y or n) y^M Sending packet: $vKill;53c5#3d...Packet received: OK^M Packet vKill (kill) is supported^M Sending packet: $vFile:close:6#b6...Packet received: F0^M Sending packet: $vFile:close:3#b3...Packet received: F0^M Starting program: /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/gdb.server/ext-restart ^M Sending packet: $QDisableRandomization:1#cf...Packet received: OK^M Sending packet: $R0#82...Sending packet: $qC#b4...Packet received: QCp53c5.53c5^M <-- [1] Sending packet: $qAttached:53c5#c9...Packet received: E01^M warning: Remote failure reply: E01^M .... 0x00002aaaaaaac2d0 in ?? () from target:/lib64/ld-linux-x86-64.so.2^M /home/yao/SourceCode/gnu/gdb/git/gdb/thread.c:88: internal-error: inferior_thread: Assertion `tp' failed.^M A problem internal to GDB has been detected,^M further debugging may prove unreliable.^M Quit this debugging session? (y or n) FAIL: gdb.server/ext-restart.exp: run to main (GDB internal error) Resyncing due to internal error. the test is to restart the program, to make sure GDBserver handles packet 'R' correctly. From the GDBserver output, we can see, Remote debugging from host 127.0.0.1^M Process /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/gdb.server/ext-restart created; pid = 21445^M GDBserver restarting^M Process /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/gdb.server/ext-restart created; pid = 21446^M Killing process(es): 21446 we first start process 21445(0x53c5), kill it and restart a new process 21446. However, in the gdb output above [1], we can see that the reply of qC is still the old process id rather than the new one. Looks general_thread isn't up to date after GDBserver receives R packet. This patch is to update general_thread after call start_inferior. gdb/gdbserver: 2015-07-24 Yao Qi <yao.qi@linaro.org> * server.c (process_serial_event): Set general_thread. gdb/testsuite: 2015-07-24 Yao Qi <yao.qi@linaro.org> * gdb.server/ext-restart.exp: New file.
2015-07-24Test --wrapper in extended-remoteYao Qi3-5/+67
We didn't test --wrapper option in extended-remote before, this patch is to add a test case for it. In order to pass option --wrapper to gdbserver in extended-remote, I add arg in gdbserver_start_extended, and its default value is "", so that other places use gdbserver_start_extended don't have to be updated. gdb/testsuite: 2015-07-24 Yao Qi <yao.qi@linaro.org> * lib/gdbserver-support.exp (gdbserver_start_extended): Add argument options. * gdb.server/ext-wrapper.exp: New file.
2015-07-24Replace -g with -ggdb3 in ld compress testsH.J. Lu4-12/+18
Use -ggdb3 to generate .debug_macro sections, which are bigger and are always compressed. * ld-elf/compress.exp (build_tests): Replace -g with -ggdb3. * ld-elf/zlibbegin.rS: Also expect "GC". * ld-elf/zlibnormal.rS: Likewise.
2015-07-24Remove leading/trailing white spaces in ChangeLogH.J. Lu51-1421/+1421
2015-07-24Correct reloc section nameAlan Modra2-1/+7
* elf.c (_bfd_elf_assign_file_positions_for_non_load): Use .rela prefix for reloc section corresponding to rela section associated with renamed debug section.
2015-07-24bfd_get_section_by_name_if hash chain traversalAlan Modra2-8/+10
This function stops too soon, as I found when the hash chain happened to contain two .debug_macro sections and a .bss section: .debug_macro -> .bss -> .debug_macro * section.c (bfd_get_section_by_name_if): Iterate over entire hash chain.
2015-07-24Automatic date update in version.inGDB Administrator1-1/+1
2015-07-232015-07-23 Ian Coolidge <icoolidge@google.com>Han Shen3-3/+15
Plumb --pic-veneer option for gold. gold/ChangeLog: * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub generation. * options.h (General_options): Add --pic-veneer option.
2015-07-23Fix DT_MIPS_RLD_MAP_REL tag for n64 target and 32-bit host.Joseph Myers2-1/+7
For the case of MIPS n64 target and 32-bit host, the computation of the DT_MIPS_RLD_MAP_REL tag involves sdyn->output_section->vma + sdyn->output_offset (64-bit) being added to b (32-bit host pointer), so losing the high part and resulting in an incorrect DT_MIPS_RLD_MAP_REL tag, and all dynamically linked glibc tests failing for n64. This patch fixes this (spot-tested with glibc tests; however, I don't have a self-contained testcase for this bug). * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections) <DT_MIPS_RLD_MAP_REL>: Add target address to host address difference, not to host pointer.
2015-07-23Fix crash when reading dummy CUs.Doug Evans5-5/+108
Dummy CUs are used by the incremental linker to pre-allocate space in the output file. They have a DWARF header but no contents. gdb/ChangeLog: * dwarf2read.c (dwarf2_per_cu_data): Add comment. (load_cu): Handle dummy CUs. (dw2_do_instantiate_symtab, process_queuef): Ditto. (dwarf2_fetch_die_loc_sect_off, dwarf2_fetch_constant_bytes): Ditto. gdb/testsuite/ChangeLog: * gdb.dwarf2/dw2-dummy-cu.S: New file. * gdb.dwarf2/dw2-dummy-cu.exp: New file.
2015-07-23py-linetable.c: Fix doc of LineTable.source_lines' return typeCiro Santilli2-4/+12
The ltpy_get_all_source_lines function, use to implement the gdb.LineTable.source_lines method, returns a list: source_list = PyDict_Keys (source_dict); return source_list; This patch fixes the function's documentation as well as its docstring to say that it returns a list rather than a FrozenSet. gdb/ChangeLog: * py-linetable.c (ltpy_get_all_source_lines): Adjust function documentation to say that it returns a list rather than a FrozenSet. (linetable_object_methods): Update the docstring of the "source_line" entry. Tested on x86_64-linux.
2015-07-23gdb/gdbtypes: fix handling of typedef layers between array typesPierre-Marie de Rodat7-1/+140
When a dynamic array type contains a typedef-wrapped array, an assertion failure occurs during type resolution. This is what happens in the following Ada case: type Rec_Type is record I : Integer; B : Boolean; end record; type Vec_Type is array (1 .. 4) of Rec_Type; type Array_Type is array (Positive range <>) of Vec_Type; If users try to print or even pass to an inferior call a variable A of type Array_Type, GDB will raise an error: (gdb) print a ../../src/gdb/gdbtypes.c:1807: internal-error: resolve_dynamic_array: Assertion `TYPE_CODE (type) == TYPE_CODE_ARRAY' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) What happens is that during dynamic array type resolution, we first peel TYPE_CODE_TYPEDEF layers wrapping the array element type and check if its type is itself TYPE_CODE_ARRAY. If it is, we pass the typedef-wrapped type to a recursive call to resolve_dynamic_array whereas this function expects only TYPE_CODE_ARRAY types. This patch makes it pass the peeled type to the recursive call so that type resolution can continue smoothly. gdb/ChangeLog: * gdbtypes.c (resolve_dynamic_array): Pass the peeled element type to the recursive call instead of the original (maybe TYPE_CODE_TYPEDEF) type. gdb/testsuite/ChangeLog: * gdb.ada/var_arr_typedef.exp: New testcase. * gdb.ada/var_arr_typedef/pack.adb: New file. * gdb.ada/var_arr_typedef/pack.ads: New file. * gdb.ada/var_arr_typedef/var_arr_typedef.adb: New file.
2015-07-23Return zero in aarch64_linux_can_use_hw_breakpoint if target doesn't support ↵Yao Qi2-8/+27
HW watchpoint/breakpoint Nowadays aarch64_linux_can_use_hw_breakpoint always return one, but it can be smarter, say, if GDB knows target doesn't support HW watchpoint or breakpoint because HW watchpoint/breakpoint is disabled in linux kernel, for example, it can safely return zero. gdb: 2015-07-23 Yao Qi <yao.qi@linaro.org> * aarch64-linux-nat.c (aarch64_linux_can_use_hw_breakpoint): If TYPE is watchpoint, return zero if aarch64_num_wp_regs is zero. If TYPE is breakpoint, return zero if arch64_num_bp_regs is zero.
2015-07-23Fix ubsan signed integer overflowAlan Modra2-3/+8
IMO a fairly useless warning in this case, but technically correct. PR 18708 * i386-dis.c (get64): Avoid signed integer overflow.
2015-07-23Automatic date update in version.inGDB Administrator1-1/+1
2015-07-22Fix memory operand size for vcvtt?ps2u?qq instructionsH.J. Lu15-244/+344
When disassembling AVX512 vcvtt?ps2u?q instructions with data broadcasting enabled, memory operand size should be DWORD. gas/testsuite/ PR binutils/18631 * gas/i386avx512dq-intel.d: Replace "QWORD" with "DWORD" in vcvtt?ps2u?qq instructions disassembly regexes. Add disassembly regex for new test. * gas/i386/avx512dq.d: Likewise. * gas/i386/avx512dq_vl-intel.d: Likewise. * gas/i386/avx512dq_vl.d: Likewise. * gas/i386/x86-64-avx512dq-intel.d: Likewise. * gas/i386/x86-64-avx512dq.d: Likewise. * gas/i386/x86-64-avx512dq_vl-intel.d: Likewise. * gas/i386/x86-64-avx512dq_vl.d: Likewise. * gas/i386/avx512dq.s: Add new test for Intel syntax with memory operand and broadcasting enabled. * gas/i386/avx512dq_vl.s: Likewise. * gas/i386/x86-64-avx512dq.s: Likewise. * gas/i386/x86-64-avx512dq_vl.s: Likewise. opcodes/ PR binutils/18631 * i386-dis-evex.h (EVEX_W_0F78_P_2): Replace "EXxmmq" with "EXEvexHalfBcstXmmq" for the second operand. (EVEX_W_0F79_P_2): Likewise. (EVEX_W_0F7A_P_2): Likewise. (EVEX_W_0F7B_P_2): Likewise.
2015-07-23readelf display of 0x800...000 addendAlan Modra2-10/+8
* readelf.c (dump_relocations): Show MIN_INT addends as negative.
2015-07-22gas line buffer handlingAlan Modra2-55/+54
This fixes a segfault when macro definitions end on the last line of a file, and that line isn't properly terminated with a newline. gas used to throw away the last line in cases like this, whereas in other cases gas added the missing newline. So I've also made gas consistently provide a missing newline. PR gas/18687 * input-scrub.c (input_scrub_next_buffer): Rearrange and simplify loop. Don't drop lines at end of file lacking a newline, add a newline instead. Ensure partial_size is zero whenever partial_where is NULL. Adjust buffer size for extra char. (input_scrub_push, input_scrub_begin): Adjust buffer size here too.
2015-07-22Don't compare symbol addresses directlyH.J. Lu9-25/+127
GCC 5 will fold symbol address comparison, assuming each symbol has a different address, which leads to abort. We should use separate functions to compare symbol address. PR gold/18663 * testsuite/Makefile.am (script_test_1_SOURCES): Set to script_test_1a.cc script_test_1b.cc. (script_test_11_r.o): Replace script_test_11.o with script_test_11a.o script_test_11b.o. (script_test_11.o): Removed. (script_test_11a.o): New. (script_test_11b.o): Likewise. * testsuite/Makefile.in: Regenerated. * testsuite/script_test_1.h: New file. * testsuite/script_test_1b.cc: Likewise. * testsuite/script_test_11.h: Likewise. * testsuite/script_test_11b.c: Likewise. * testsuite/script_test_1.cc: Renamed to ... * testsuite/script_test_1a.cc: This. Include "script_test_1.h". (main): Call check_int and check_ptr. * testsuite/script_test_11.c: Renamed to ... * testsuite/script_test_11a.c: This. Include "script_test_11.h". (main): Call ptr_equal.
2015-07-22Mark global with hidden attributeH.J. Lu4-3/+10
GCC 5 will generate a relocation for protected symbol: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 when compiling for a shared library. It is undefined to access protected symbol in IFUNC selector function inside a shared library. PR gold/18628 * testsuite/ifuncdep2.c (global): Change protected to hidden. * testsuite/ifuncmod1.c (global): Likewise. * testsuite/ifuncmod5.c (global): Likewise.
2015-07-22Fix ppc64 ELFv1 assertion failureAlan Modra2-7/+11
Bogus assembly can hit an assertion in opd_entry_value when the symbol referenced by a function descriptor is undefined. Worse, the code after the assert copies unitialised memory to return the code section. This uninitialised pointer can later be dereferencd, possibly causing a linker segmentation fault. * elf64-ppc.c (opd_entry_value): Remove assertion. Instead, return -1 if symbol referenced is not defined. Tidy.
2015-07-22GOLD aarch64 warning fixAlan Modra2-1/+5
aarch64.cc:2026:50: error: integer overflow in expression [-Werror=overflow] Insntype adr_insn = adrp_insn & ((1 << 31) - 1); * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
2015-07-22Automatic date update in version.inGDB Administrator1-1/+1
2015-07-21Fix problem where __start_ and __stop_ section symbols do not honor version ↵Cary Coutant2-0/+17
script. When creating the special __start_ and __stop_ section symbols, gold does not check the version script to see if they should be local instead of global. 2015-07-21 Cary Coutant <ccoutant@gmail.com> gold/ PR gold/18548 * symtab.cc (Symbol_table::do_define_in_output_data): Check for forced local symbol even when oldsym != NULL. (Symbol_table::do_define_in_output_segment): Likewise. (Symbol_table::do_define_as_constant): Likewise.
2015-07-21Fix typo in PR number.Cary Coutant1-1/+1
Fix internal error when linking an archive library with no preceding objects. gold/ PR gold/18698 * archive.cc (Library_base::should_include_member): Don't use entry point for relocatable links, or if target is not yet valid. * parameters.cc (Parameters::entry): Check target_valid().
2015-07-21Fix internal error when linking an archive library with no preceding objects.Cary Coutant3-5/+16
gold/ PR gold/18696 * archive.cc (Library_base::should_include_member): Don't use entry point for relocatable links, or if target is not yet valid. * parameters.cc (Parameters::entry): Check target_valid().
2015-07-21Move aarch64_linux_get_debug_reg_capacity to nat/aarch64-linux-hw-point.cYao Qi6-103/+72
There are also some duplication on getting HW watchpoint/breakpoint registers info between GDB and GDBserver. This patch moves them to nat/aarch64-linux-hw-point.c. Note that ENABLE_NLS is not defined in GDBserver, so it should be OK to use _( markup. gdb: 2015-07-21 Yao Qi <yao.qi@linaro.org> * aarch64-linux-nat.c (aarch64_linux_get_debug_reg_capacity): Move it to nat/aarch64-linux-hw-point.c. (aarch64_linux_child_post_startup_inferior): Update. * nat/aarch64-linux-hw-point.c (aarch64_linux_get_debug_reg_capacity): New function. * nat/aarch64-linux-hw-point.h (aarch64_linux_get_debug_reg_capacity): Declare it. gdb/gdbserver: 2015-07-21 Yao Qi <yao.qi@linaro.org> * linux-aarch64-low.c (aarch64_arch_setup): Remove code and call aarch64_linux_get_debug_reg_capacity.
2015-07-21btrace: fix case label in btrace_data_appendMarkus Metzger2-1/+5
gdb/ * common/btrace-common.c (btrace_data_append): Change case label.
2015-07-21[ARM] Support correctly spelled ARMv6KZ architecture namesMatthew Wahab9-9/+66
2015-07-20 Matthew Wahab <matthew.wahab@arm.com> gas/ * NEWS: Mention corrected spelling of armv6kz. * config/tc-arm.c (arm_cpus): Replace ARM_ARCH_V6ZK with ARM_ARCH_V6KZ. (arm_archs): Likewise. Also add "armv6kz" and "armv6kzt2". * doc/c-arm.texi: Replace "armv6zk" with "armv6kz". gas/testsuite * gas/arm/attr-march-armv6kz.d: New. * gas/arm/attr-march-armv6kzt2.d: New. include/opcode * arm.h (ARM_AEXT_V6ZK): Rename to ARM_AEXT_V6KZ. (ARM_AEXT_V6ZKT2): Rename to ARM_AEXT_V6KZT2. (ARM_ARCH_V6ZK): Rename to ARM_ARCH_V6KZ. (ARM_ARCH_V6ZKT2): Rename to ARM_ARCH_V6KZT2.
2015-07-21Automatic date update in version.inGDB Administrator1-1/+1