deliverable/binutils-gdb.git
9 years agosrc-release.sh: Convert src-release to a shell script
Will Newton [Thu, 7 Aug 2014 13:38:55 +0000 (14:38 +0100)] 
src-release.sh: Convert src-release to a shell script

This began as an attempt to make a few small changes to src-release
but heeding the comments at the top of the file it seemed it might be
wise to convert it to a shell script instead which should hopefully
be more maintainable.

This shell script contains most of the functionality of the Makefile
version. It can be run like this:

  # This will build gdb and compress with bzip2, gzip and xz
  ./src-release.sh -bgx gdb

The functionality that has been removed is building tarballs for insight
and gnats, which were broken in the current repository layout and
gas+binutils which amounted to basically the same thing as binutils so
didn't seem worth keeping. The script always builds a tar file,
compression is optional, so no need for specific commands to build tar
files rather than compressed tar files.

The build of gas releases has been fixed, as has extraction of version
numbers which had been broken since the switch to configure.ac files
and AC_INIT.

I also removed the code for distcleaning the intl sub-directory as it
seems like that issue has been fixed.

The script is capable of compressing with bzip2, gzip and xz which
should cover all formats available on gnu.org.

I tested it by producing release tarballs which are substantially
identical to the ones produced by the src-release script.

ChangeLog:

2014-08-27  Will Newton  <will.newton@linaro.org>

* src-release.sh: New file.
* src-release: Remove file.

9 years agodaily update
Alan Modra [Wed, 27 Aug 2014 00:01:12 +0000 (09:31 +0930)] 
daily update

9 years agorl78.h (RL78_RELAXA_MASK): New. Relax types are enums, not bits
DJ Delorie [Tue, 26 Aug 2014 21:01:04 +0000 (17:01 -0400)] 
rl78.h (RL78_RELAXA_MASK): New.  Relax types are enums, not bits

9 years agoDisambiguate test for relaxation type.
DJ Delorie [Tue, 26 Aug 2014 18:03:29 +0000 (14:03 -0400)] 
Disambiguate test for relaxation type.

* elf32-rl78.c (rl78_elf_relax_section): Disambiguate test for
relaxation type.

9 years ago[ARM] Update selected_cpu based on info got during parsing
Jiong Wang [Tue, 26 Aug 2014 15:18:36 +0000 (16:18 +0100)] 
[ARM] Update selected_cpu based on info got during parsing

  gas/
    * config/tc-arm.c (aeabi_set_public_attributes): Update intended_arch based
    on the info we got during parsing.
    (arm_handle_align): Make sure the p2align expanding logic under thumb
    unchanged.

  gas/testsuite/
    * gas/arm/blx-bl-convert.d: New testcase.
    * gas/arm/blx-bl-convert.l: Warning expectation.
    * gas/arm/blx-bl-convert.s: Source file.

9 years ago[AArch64] Improve copy relocation support on four absolute relocation types
Jiong Wang [Tue, 26 Aug 2014 14:48:47 +0000 (15:48 +0100)] 
[AArch64] Improve copy relocation support on four absolute relocation types

2014-08-26  Jiong Wang  <jiong.wang@arm.com>

  bfd/
* elfnn-aarch64.c (elfNN_aarch64_check_relocs): Initialize non_got_ref
properly for MOVW_G0/1/2_NC and MOVW_G3.  Reject them when linking
shared library.
(elfNN_aarch64_gc_sweep_hook): Add check on these relocs.

  ld/testsuite/
* ld-aarch64/copy-relocs-so.s: New test file.
* ld-aarch64/copy-relocs-exe.s: Likewise.
* ld-aarch64/copy-relocs.d: New expectation file.
* ld-aarch64/emit-relocs-264-bad.d: New test file.
* ld-aarch64/emit-relocs-266-bad.d: Likewise.
* ld-aarch64/emit-relocs-268-bad.d: Likewise.
* ld-aarch64/emit-relocs-269-bad.d: Likewise.
* ld-aarch64/aarch64-elf.exp: Run new added test.

9 years agoFix linker testsuite failures for Aarch64.
Nick Clifton [Tue, 26 Aug 2014 14:06:49 +0000 (15:06 +0100)] 
Fix linker testsuite failures for Aarch64.
Resolves PR 17312

* ld-aarch64/eh-frame-foo.s: Use 8-byte offset for X30.
* ld-aarch64/eh-frame-bar.s: Likewise.
* ld-aarch64/eh-frame.d: Updated to match current readelf output.
* ld-elf/eh5.d: Allow any register names.

9 years agoMIPS: Make the CODE10 operand code consistent between ISAs
Maciej W. Rozycki [Tue, 26 Aug 2014 12:44:34 +0000 (13:44 +0100)] 
MIPS: Make the CODE10 operand code consistent between ISAs

This change moves the microMIPS 10-bit uninterpreted immediate code
embedded at bits 25..16 in the SYSCALL, WAIT, SDBBP and HYPCALL
instructions from `B' over to `+J' which is the operand code used in
the standard MIPS instruction set for a similar code embedded at bits
20..11, currently used by HYPCALL only in that set.

opcodes/
* micromips-opc.c (decode_micromips_operand): Rename `B' to `+J'.
(micromips_opcodes): Use "+J" in place of "B" for "hypcall",
"sdbbp", "syscall" and "wait".

include/opcode/
* mips.h: Document the move of `MICROMIPSOP_*_CODE10' from `B'
over to `+J'.

9 years agoMIPS/gas: SAA/SAAD macro clean-ups
Maciej W. Rozycki [Tue, 26 Aug 2014 12:18:30 +0000 (13:18 +0100)] 
MIPS/gas: SAA/SAAD macro clean-ups

This change removes code duplication for the SAA macro in line with other
such macros and also adds a !microMIPS internal consistency guard as
there's no microMIPS encoding of the underlying SAA/SAAD instructions.

* config/tc-mips.c (macro) <M_SAA_AB>: Remove duplicate code and
jump to...
<M_SAAD_AB>: ... here.  Assert that !microMIPS.

9 years agoMIPS/gas/testsuite: Remove ECOFF offset alternatives
Maciej W. Rozycki [Tue, 26 Aug 2014 11:57:42 +0000 (12:57 +0100)] 
MIPS/gas/testsuite: Remove ECOFF offset alternatives

This complements commit 16e5e222b6eae6f110ea72bf627585c095a453a8,
removing offset values embedded in dump patterns that served ECOFF
binaries.

* gas/mips/l_d.d: Remove ECOFF offset alternatives.
* gas/mips/mips1@l_d.d: Likewise.
* gas/mips/ld.d: Likewise.
* gas/mips/mips1@ld.d: Likewise.
* gas/mips/mips1@ld-forward.d: Likewise.
* gas/mips/s_d.d: Likewise.
* gas/mips/mips1@s_d.d: Likewise.
* gas/mips/sd.d: Likewise.

9 years agoFix a typo in the selection pattern for the or1knd cpu.
Nick Clifton [Tue, 26 Aug 2014 09:22:38 +0000 (10:22 +0100)] 
Fix a typo in the selection pattern for the or1knd cpu.

* config.bfd: Fix typo in or1knd selection.

9 years ago2014-08-26 Jan-Benedict Glaw <jbglaw@lug-owl.de>
Jan-Benedict Glaw [Tue, 26 Aug 2014 08:36:09 +0000 (10:36 +0200)] 
2014-08-26  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

* config/tc-moxie.h (md_convert_frag): Silence warning.

9 years agodaily update
Alan Modra [Tue, 26 Aug 2014 00:00:37 +0000 (09:30 +0930)] 
daily update

9 years agoFix clang compilation errors in gdb.mi/basics.c.
Doug Evans [Mon, 25 Aug 2014 19:40:54 +0000 (12:40 -0700)] 
Fix clang compilation errors in gdb.mi/basics.c.

gdb/testsuite/ChangeLog:

* gdb.mi/basics.c (callee3, callee2, callee1): Specify result type.
(main): Ditto.

9 years agogdb.threads/thread-execl.exp: #include <stdio.h>.
Doug Evans [Mon, 25 Aug 2014 19:23:50 +0000 (12:23 -0700)] 
gdb.threads/thread-execl.exp: #include <stdio.h>.

gdb/testsuite/ChangeLog:

* gdb.threads/thread-execl.exp: #include <stdio.h>.

9 years agolinux-nat.c (linux_nat_close): Don't pass NULL for "this".
Doug Evans [Mon, 25 Aug 2014 19:19:01 +0000 (12:19 -0700)] 
linux-nat.c (linux_nat_close): Don't pass NULL for "this".

gdb/ChangeLog:

* linux-nat.c (linux_nat_close): Don't pass NULL for "this".
Pass NULL instead of 0 for context pointer.

9 years agoFix grammatical error in comments
Yao Qi [Mon, 25 Aug 2014 12:01:45 +0000 (20:01 +0800)] 
Fix grammatical error in comments

gdb:

2014-08-25  Yao Qi  <yao@codesourcery.com>

* dwarf2read.c: Fix grammatical error.

9 years agogas tests for the sparc instructions ldfsr, stfsr, ldx, ldxa, stx, stxa, ldxfsr,...
Jose E. Marchesi [Mon, 25 Aug 2014 11:08:31 +0000 (13:08 +0200)] 
gas tests for the sparc instructions ldfsr, stfsr, ldx, ldxa, stx, stxa, ldxfsr, stxfsr, ldxefsr.

- V8 instructions:  ldfsr, stfsr
- V9 instructions:  ldx, ldxa, stx, stxa, ldxfsr, stxfsr
- V9b instructions: ldxefsr

Tested on sparc64-*-linux-gnu.

[gas/testsuite/Changelog]

2014-08-25  Jose E. Marchesi  <jose.marchesi@oracle.com>

* gas/sparc/ldx_stx.s: New file.
* gas/sparc/ldx_stx.d: Likewise.

* gas/sparc/ldx_efsr.s: New file.
* gas/sparc/ldx_efsr.d: Likewise.

* gas/sparc/ld_st_fsr.s: New file.
* gas/sparc/ld_st_fsr.d: Likewise.

* gas/sparc/sparc.exp: Run the tests ldx_stx, ldx_efsr and
ld_st_fsr.

9 years agodaily update
Alan Modra [Mon, 25 Aug 2014 00:00:41 +0000 (09:30 +0930)] 
daily update

9 years agoUpdate comments in scan_partial_symbols and add_partial_subprogram
Yao Qi [Fri, 15 Aug 2014 11:06:02 +0000 (19:06 +0800)] 
Update comments in scan_partial_symbols and add_partial_subprogram

I read comment of scan_partial_symbols about NEED_PC and how *LOWPC
and *HIGHPC are updated:

   DW_AT_ranges).  If NEED_PC is set, then this function will set
   *LOWPC and *HIGHPC to the lowest and highest PC values found in CU
   and record the covered ranges in the addrmap.

NEED_PC is only used in the callee of scan_partial_symbols,
add_partial_subprogram,

  if (pdi->tag == DW_TAG_subprogram)
    {
      if (pdi->has_pc_info)
        {
          if (pdi->lowpc < *lowpc)
            *lowpc = pdi->lowpc;
          if (pdi->highpc > *highpc)
            *highpc = pdi->highpc;
  if (need_pc)

*LOWPC and *HIGHPC is updated regardless of NEED_PC.  When NEED_PC is
true, addrmap is updated.  It would be clear to rename NEED_PC to
SET_ADDRMAP.  That is what this patch does.  Beside this, this patch
also adjust comments in related functions.

gdb:

2014-08-24  Yao Qi  <yao@codesourcery.com>

* dwarf2read.c (scan_partial_symbols):  Update comments.
Rename argument 'need_pc' with 'set_addrmap'.
(add_partial_namespace): Rename argument 'need_pc' with
'set_addrmap'.
(add_partial_module): Likewise.
(add_partial_subprogram): Likewise.  Update comments.
(dwarf2_name): Fix typo.

9 years agoset print symbol off in py-value.exp and scm-value.exp
Yao Qi [Thu, 7 Aug 2014 08:10:51 +0000 (16:10 +0800)] 
set print symbol off in py-value.exp and scm-value.exp

I see the following fails on arm-none-eabi target,

print sn^M
$14 = 0x0 <_ftext>^M
(gdb) FAIL: gdb.python/py-value.exp: print sn

print sn^M
$14 = 0x0 <_ftext>^M
(gdb) FAIL: gdb.guile/scm-value.exp: print sn

as <_ftext> is unexpected.  This patch is to set print symbol off to
avoid printing this.

gdb/testsuite:

2014-08-24  Yao Qi  <yao@codesourcery.com>

* gdb.guile/scm-value.exp (test_lazy_strings): Set print
symbol off.
* gdb.python/py-value.exp (test_lazy_strings): Likewise.

9 years agodaily update
Alan Modra [Sun, 24 Aug 2014 00:01:13 +0000 (09:31 +0930)] 
daily update

9 years agoFix m32r-elf sim, default hardware to off.
Hans-Peter Nilsson [Sat, 23 Aug 2014 02:53:28 +0000 (04:53 +0200)] 
Fix m32r-elf sim, default hardware to off.

The situation here is similar to that of the other nearby (previous)
sims fixed; it fails at the dv_sockser_install declaration in
sim/m32r/tconfig.in.  But, as opposed to e.g. frv, this *does* have a
definition of UART_INCHAR_ADDR et al.  It's somewhat tempting to keep
sim-hardware enabled here but, I'm disabling it for the same reasons
as for frv.  Unsurprisingly (as m32r seems to be the template), the
same confusing lines are in sim/m32r/Makefile.in as in
sim/frv/Makefile.in at that time, deleted in 73e76d20.  Again, commit
73e76d20 (for m32r as well as for frv) attempted to move the
non-existing dv-sockser.o use to $(m32r_extra_objs) but missed that
AC_SUBST would only affect @m32r_extra_objs@ and not
$(m32r_extra_objs) per se so nothing happened.  As for frv, I'm
removing the $(m32r_extra_objs) too, to avoid confusion.  Make
check-sim for m32r-elf shows no regressions (5 failures; 100 expected
passes) compared to bf3d9781ec049 (before the recent config.in regen,
after sim-hardware mostly-enabled) and eed23bb4a1 (before the
sim-hardware mostly-enabled; 2013-03-23).

sim/m32r:
* configure.ac: Default simulator hardware to off again.  Remove
dead m32r_extra_objs substitution.
* configure: Regenerate.
* Makefile.in: Remove unused frv_extra_objs.

9 years agoFix sh64-elf sim, default hardware to off.
Hans-Peter Nilsson [Sat, 23 Aug 2014 02:40:36 +0000 (04:40 +0200)] 
Fix sh64-elf sim, default hardware to off.

See nearby (previous) commit for the iq2000 sim; this similarly fails
at the dv_sockser_install declaration in sim/sh64/tconfig.in.  I'm
disabling simulator hardware to be consistent with the state before
94c63d78f (2013-03-23) and with the actions for the frv sim and the
iq2000 sim.  Make check-sim for sh64-elf shows no regressions (25
failures; 357 expected passes) compared to bf3d9781ec049 (before the
recent config.in regen, after sim-hardware mostly-enabled) and
eed23bb4a1 (before the sim-hardware mostly-enabled; 2013-03-23).

sim/sh64:
* configure.ac: Default simulator hardware to off again
without emitting errors when off or dv-sockser.o unavailable.
* configure: Regenerate.

9 years agoFix iq2000-elf sim, default hardware to off.
Hans-Peter Nilsson [Sat, 23 Aug 2014 02:27:26 +0000 (04:27 +0200)] 
Fix iq2000-elf sim, default hardware to off.

See nearby (previous) commit for the frv sim; this similarly fails at
the dv_sockser_install declaration in sim/iq2000/tconfig.in.  There's
no HAVE_DV_SOCKSER conditionals here and no other dv-sockser.o
artefacts so maybe there is no further fallout, but I'm going to
disable sim-hardware just be consistent with the state before
94c63d78f (2013-03-23) and with the actions for the frv sim.  Make
check-sim for iq2000-elf shows no failures but that's in no small part
because it has no test-suite.

sim/iq2000:
* configure.ac: Default simulator hardware to off again
without emitting errors when off or dv-sockser.o unavailable.
* configure: Regenerate.

9 years agoFix frv-elf sim, default hardware to off.
Hans-Peter Nilsson [Sat, 23 Aug 2014 02:16:58 +0000 (04:16 +0200)] 
Fix frv-elf sim, default hardware to off.

At 2974be626, frv-elf fails at the dv_sockser_install declaration in
sim/frv/tconfig.in.  But, with the trivial #include's added (see other
sims tconfig.in, like cris or mn10300), it *still* fails building
sim/frv/devices.c because of a missing UART_INCHAR_ADDR.  I have no
insight into what'd be a valid value, except that there's a definition
in m32r, which was probably used as a template with frv not finished.
Simulated hardware should not have been be enabled, and was indeed not
enabled by default before 94c63d78f (2013-03-23), where it seems to
have been enabled for no simulator-specific reason.  Except
dv-sockser.o wasn't enabled even then: sim/frv/config.in wasn't
regenerated, so HAVE_DV_SOCKSER was never defined.  Maybe people were
fooled by this in sim/frv/Makefile.in at that time (these two lines
were later deleted, in 73e76d20):
CONFIG_DEVICES = dv-sockser.o
CONFIG_DEVICES =
(As it seems people have missed it before: the second line overrides
the first...)  I'm guessing these lines were part of the
never-completed hardware-support.  Commit 73e76d20 attempted to move
the imagined dv-sockser.o from $(CONFIG_DEVICES) to $(frv_extra_objs)
but missed that AC_SUBST would only affect @frv_extra_objs@ (not
$(frv_extra_objs) per se) so nothing happened regarding sockser:
dv-sockser.o was not compiled and HAVE_DV_SOCKSER was not defined.
I'm removing the $(frv_extra_objs) too, to avoid confusion.  The best
action seems to be disabling all hardware support by default again
until a specific sim maintainer finishes the work.
Make check-sim for frv-elf shows no failures after this.

sim/frv:
* configure.ac: Default simulator hardware to off again.  Remove
dead frv_extra_objs substitution.
* configure: Regenerate.
* Makefile.in: Remove unused frv_extra_objs.

9 years agoFix pr 17276.
Doug Evans [Sat, 23 Aug 2014 00:25:59 +0000 (17:25 -0700)] 
Fix pr 17276.

See the description here:
https://sourceware.org/ml/gdb-patches/2014-08/msg00283.html

This patch keeps track of whether the current line has seen a
non-zero discriminator, and if so coalesces consecutive entries
for the same line (by ignoring all entries after the first).

gdb/ChangeLog:

PR 17276
* dwarf2read.c (dwarf_record_line_p): New function.
(dwarf_decode_lines_1): Ignore subsequent line number entries
for the same line if any entry had a non-zero discriminator.

gdb/testsuite/ChangeLog:

* gdb.dwarf2/dw2-single-line-discriminators.S: New file.
* gdb.dwarf2/dw2-single-line-discriminators.c: New file.
* gdb.dwarf2/dw2-single-line-discriminators.exp: New file.

9 years agodaily update
Alan Modra [Sat, 23 Aug 2014 00:12:52 +0000 (09:42 +0930)] 
daily update

9 years agoCreate a typedef for record_line: record_line_ftype.
Doug Evans [Fri, 22 Aug 2014 23:20:05 +0000 (16:20 -0700)] 
Create a typedef for record_line: record_line_ftype.

gdb/ChangeLog:

* buildsym.h (record_line_ftype): New typedef.
(record_line): Use it.
* dwarf2read.c (dwarf_record_line, dwarf_finish_line): New functions.
(dwarf_decode_lines_1): Call them.

9 years agoaarch64: Adjust dwarf2 encoding factors
Richard Henderson [Fri, 22 Aug 2014 21:42:39 +0000 (14:42 -0700)] 
aarch64: Adjust dwarf2 encoding factors

* config/tc-aarch64.h (DWARF2_LINE_MIN_INSN_LENGTH): Set to 4.
(DWARF2_CIE_DATA_ALIGNMENT): Set to -8.

9 years agoaarch64: Fix CFA encoding of vector registers
Richard Henderson [Fri, 22 Aug 2014 21:41:43 +0000 (14:41 -0700)] 
aarch64: Fix CFA encoding of vector registers

* config/tc-aarch64.c (tc_aarch64_regname_to_dw2regnum): Fix
register number for vector register types.

9 years agoaarch64: Decode dwarf2 register numbers
Richard Henderson [Fri, 22 Aug 2014 21:40:10 +0000 (14:40 -0700)] 
aarch64: Decode dwarf2 register numbers

* dwarf.h (init_dwarf_regnames_aarch64): Declare.
* dwarf.c (dwarf_regnames_aarch64): New.
(init_dwarf_regnames_aarch64): New.
(init_dwarf_regnames): Call it.
* objdump.c (dump_dwarf): Likewise.

9 years agoPower/GAS: Don't set VLE annotation for non-VLE processors/instructions
Maciej W. Rozycki [Fri, 22 Aug 2014 15:52:20 +0000 (16:52 +0100)] 
Power/GAS: Don't set VLE annotation for non-VLE processors/instructions

Only set the VLE flag if the instruction has been pulled via the VLE
instruction set.  This way the flag is guaranteed to be set for VLE-only
instructions or for VLE-only processors, however it'll remain clear for
dual-mode instructions on dual-mode and, more importantly, standard-mode
processors.

gas/
* config/tc-ppc.c (md_assemble): Only set the PPC_APUINFO_VLE
flag if both the processor and opcode flags match.

ld/testsuite/
* ld-powerpc/apuinfo-vle.rd: New test.
* ld-powerpc/apuinfo-vle.s: New test source.
* ld-powerpc/apuinfo.rd: Adjust according to GAS PPC_APUINFO_VLE
handling change.
* ld-powerpc/powerpc.exp: Run the new test.

9 years agoARM/opcodes: Fix negative hexadecimal offset disassembly
Maciej W. Rozycki [Fri, 22 Aug 2014 15:42:12 +0000 (16:42 +0100)] 
ARM/opcodes: Fix negative hexadecimal offset disassembly

2014-08-21  Nathan Sidwell  <nathan@codesourcery.com>
            Maciej W. Rozycki  <macro@codesourcery.com>

opcodes/
* arm-dis.c (print_arm_address): Negate the GPR-relative offset
returned if the U bit is set.

2014-08-21  Paul Brook  <paul@codesourcery.com>

gas/testsuite/
* gas/arm/arch7a-mp.d: Adjust according to `print_arm_address'
offset fix.
* gas/arm/arch7r-mp.d: Likewise.

9 years agoARM/gas: Fix a build failure with GCC 4.3.3
Maciej W. Rozycki [Fri, 22 Aug 2014 15:30:36 +0000 (16:30 +0100)] 
ARM/gas: Fix a build failure with GCC 4.3.3

cc1: warnings being treated as errors
.../gas/config/tc-arm.c: In function 'add_to_lit_pool':
.../gas/config/tc-arm.c:3193: error: 'imm1' may be used uninitialized in this function

* config/tc-arm.c (add_to_lit_pool): Preinitialize `imm1'.

9 years agoFix file-alignment for objcopy for pe-coff
Kai Tietz [Wed, 20 Aug 2014 15:39:21 +0000 (17:39 +0200)] 
Fix file-alignment for objcopy for pe-coff

2014-08-22  Kai Tietz  <ktietz@redhat.com>

PR binutils/11822
* coffcode.h (coff_compute_section_file_positions): Keep
FileAlignment valid as set.

9 years agoCopy .py files to remote host
Yao Qi [Thu, 14 Aug 2014 06:16:56 +0000 (14:16 +0800)] 
Copy .py files to remote host

Some gdb.python/*.exp tests fail because the .py files aren't copied
to the (remote) host.  This patch is to copy needed .py files to host.
Most of gdb.python/*.exp tests do this.

As it is still controversial to delete *.py files on host, we don't do
that in this patch.

gdb/testsuite:

2014-08-22  Yao Qi  <yao@codesourcery.com>

* gdb.python/py-finish-breakpoint.exp: Copy .py file to host.
* gdb.python/py-finish-breakpoint2.exp: Likewise.
* gdb.python/python.exp: Likewise.  Use .py file on the host
instead of the build.

9 years ago * emulparams/armelf_fbsd.sh (TEXT_START_ADDR): Increase alignment to 64kB boundar...
Andreas Tobler [Fri, 22 Aug 2014 04:33:45 +0000 (06:33 +0200)] 
* emulparams/armelf_fbsd.sh (TEXT_START_ADDR): Increase alignment to 64kB boundary like in armelf_linux.sh

9 years agoRemove workaround to libbabeltrace 1.1.0 issue
Yao Qi [Thu, 21 Aug 2014 02:48:33 +0000 (10:48 +0800)] 
Remove workaround to libbabeltrace 1.1.0 issue

When GDB uses recent version of babeltrace, such as 1.2.x, we'll see
such error emitted from babeltrace library,

 (gdb) target ctf .../gdb/testsuite/gdb.trace/actions.ctf
 [error] Invalid CTF stream: content size is smaller than packet headers.
 [error] Stream index creation error.
 [error] Open file stream error.

The problem can be reproduce out of GDB too, using babeltrace,

 $ babeltrace ./fake-packet.ctf/
 [error] Invalid CTF stream: content size is smaller than packet headers.
 [error] Stream index creation error.
 [error] Open file stream error.

Recent babeltrace library becomes more strict on CTF, and complains
about one "faked packet" GDB adds, when saving trace data in ctf
format from GDB.  babeltrace 1.1.0 has a bug that it can't read trace
data smaller than a certain size (see https://bugs.lttng.org/issues/450).
We workaround it in GDB to append some meaningless data in a faked
packet to make sure trace file is large enough (see ctf.c:ctf_end).
The babeltrace issue was fixed in 1.1.1 release.  However, babeltrace
recent release (since 1.1.2) starts to complain about such faked
packet.  Here is a table shows that whether faked packet or no faked
packet is "supported" by various babeltrace releases,

        faked packet      no faked packet
1.1.0      Yes                 No
1.1.1      Yes                 Yes
1.1.2      No                  Yes
1.2.0      No                  Yes

We decide to get rid of this workaround in GDB, and people can build GDB
with libbabeltrace >= 1.1.1.  In this way, both configure and ctf.c is
simpler.

Run gdb.trace/* tests in the following combinations:

 wo/ this pattch  1.1.0
 w/  this patch   1.1.1
 w/  this patch   1.1.2
 w/  this patch   1.2.0

No test results change.

gdb:

2014-08-22  Yao Qi  <yao@codesourcery.com>

* ctf.c (CTF_FILE_MIN_SIZE): Remove.
(ctf_end): Remove code.

9 years agoDelete redundant struct cie field
Alan Modra [Thu, 21 Aug 2014 23:42:09 +0000 (09:12 +0930)] 
Delete redundant struct cie field

cie->output_sec is used to when merging CIEs to ensure that only CIEs
from the same output section are merged.  I noticed an assignment to
this field in _bfd_elf_parse_eh_frame, and thought "That's wrong,
output_section isn't set properly when _bfd_elf_parse_eh_frame is
called from gc-sections code".  It turns out that this assignment is
premature, and in fact a dead store.  find_merged_cie overwrites with
the correct value before the field is ever used.  On looking a little
more it becomes apparent that cie->cie_inf.u.cie.u.sec->output_section
holds the same value, so cie->output_sec is redundant.

* elf-eh-frame.c (struct cie): Delete "output_sec" field.
(cie_eq, cie_compute_hash): Use output_section from cie_inf instead.

9 years agoIndex PowerPC64 linker generated .eh_frame in .eh_frame_hdr
Alan Modra [Thu, 21 Aug 2014 23:37:35 +0000 (09:07 +0930)] 
Index PowerPC64 linker generated .eh_frame in .eh_frame_hdr

I noticed recently that .eh_frame FDEs generated by the linker for
call stubs and .glink weren't being indexed in .eh_frame_hdr, due to
bfd_elf_discard_info being run before the linker generated .eh_frame
sections were available for parsing.  This patch moves code around in
elf64-ppc.c and ppc64elf.em to avoid that problem.

Another problem fixed here is that --gc-sections parses .eh_frame
early, and the existing machinery allows only one go at parsing the
.eh_frame sections.  That resulted in the linker generated .eh_frame
CIEs not being merged and no .eh_frame_hdr index entries for those
FDEs.  It turns out that all the info from parsing .eh_frame is
attached to the section, so order of parsing isn't important, and
after parsing sec_info_type being set will prevent a section being
parsed again.  At least, when parsing doesn't hit an error.  So there
isn't really any need for "parsed_eh_frame".  "merge_cies" is also
redundant, which means _bfd_elf_{begin,end}_eh_frame_parsing can also
disappear.

bfd/
* elf-bfd.h (struct eh_frame_hdr_info): Delete merge_cies and
parsed_eh_frames.
(_bfd_elf_begin_eh_frame_parsing): Delete.
(_bfd_elf_end_eh_frame_parsing): Delete.
* elf-eh-frame.c (_bfd_elf_begin_eh_frame_parsing): Delete.
(_bfd_elf_end_eh_frame_parsing): Delete.
(_bfd_elf_parse_eh_frame): Don't test parsed_eh_frame.  Test
!info->relocatable in place of merge_cies.
* elflink.c (bfd_elf_gc_sections, bfd_elf_discard_info): Adjust.
* elf64-ppc.c (glink_eh_frame_cie): Pad to multiple of 8.
(ppc64_elf_size_stubs): Likewise pad stub FDE.
(ppc64_elf_build_stubs): Move code setting glink .eh_frame to..
(ppc64_elf_size_stubs): ..here and..
(ppc64_elf_finish_dynamic_sections): ..here.
ld/
* emultempl/ppc64elf.em (gld${EMULATION_NAME}_after_allocation): Call
bfd_elf_discard_info after generating glink .eh_frame.  Delete
redundant test on ppc64_elf_setup_section_lists status.

9 years agodaily update
Alan Modra [Fri, 22 Aug 2014 00:32:05 +0000 (10:02 +0930)] 
daily update

9 years agoFix 'gcore' with exited threads
Jan Kratochvil [Thu, 21 Aug 2014 18:36:20 +0000 (20:36 +0200)] 
Fix 'gcore' with exited threads

Program received signal SIGABRT, Aborted.
[...]
(gdb) gcore foobar
Couldn't get registers: No such process.
(gdb) info threads
[...]
(gdb) gcore foobar
Saved corefile foobar
(gdb)

gcore tries to access the exited thread:
[Thread 0x7ffff7fce700 (LWP 6895) exited]
ptrace(PTRACE_GETREGS, 6895, 0, 0x7fff18167dd0) = -1 ESRCH (No such process)

Without the TRY_CATCH protection testsuite FAILs for:
gcore .../gdb/testsuite/gdb.threads/gcore-thread0.test
Cannot find new threads: debugger service failed
(gdb) FAIL: gdb.threads/gcore-thread.exp: save a zeroed-threads corefile
+
core .../gdb/testsuite/gdb.threads/gcore-thread0.test
".../gdb/testsuite/gdb.threads/gcore-thread0.test" is not a core dump: File format not recognized
(gdb) FAIL: gdb.threads/gcore-thread.exp: core0file: re-load generated corefile (bad file format)
Maybe the TRY_CATCH could be more inside update_thread_list().

Similar update_thread_list() call is IMO missing in procfs_make_note_section()
but I do not have where to verify that change.

gdb/ChangeLog
2014-08-21  Jan Kratochvil  <jan.kratochvil@redhat.com>

* linux-tdep.c (linux_corefile_thread_callback): Ignore THREAD_EXITED.
(linux_make_corefile_notes): call update_thread_list, protected against
exceptions.

gdb/testsuite/ChangeLog
2014-08-21  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.threads/gcore-stale-thread.c: New file.
* gdb.threads/gcore-stale-thread.exp: New file.

9 years agoinfcmd.c: Remove stale TODO
Pedro Alves [Thu, 21 Aug 2014 16:09:24 +0000 (17:09 +0100)] 
infcmd.c: Remove stale TODO

This TODO has been stale for over 2 years.  In bd5635a1 (1991), we
already see the comment, when we only had a bare attach_command:

 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /*
  * TODO:
  * Should save/restore the tty state since it might be that the
  * program to be debugged was started on this tty and it wants
  * the tty in some state other than what we want.  If it's running
  * on another terminal or without a terminal, then saving and
  * restoring the tty state is a harmless no-op.
  * This only needs to be done if we are attaching to a process.
  */

 /*
  * attach_command --
  * takes a program started up outside of gdb and ``attaches'' to it.
  * This stops it cold in its tracks and allows us to start tracing it.
  * For this to work, we must be able to send the process a
  * signal and we must have the same effective uid as the program.
  */
 void
 attach_command (args, from_tty)
      char *args;
      int from_tty;
 {
   target_attach (args, from_tty);
 }
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Later in b5a3d2aa (1992) target_terminal_init, etc. calls are added to
attach_command, and in 7e97eb28 (1992) we see:

+      /* If we attached to the process, we might or might not be sharing
+        a terminal.  Avoid printing error msg if we are unable to set our
+        terminal's process group to his process group ID.  */
+      if (!attach_flag) {
+       OOPSY ("ioctl TIOCSPGRP");

Clearly the TODO has been stale for a long while.

I considered preserving the text elsewhere, but then thought the
comments in inflow.c already have all the necessary info.

gdb/ChangeLog:

* infcmd.c (attach_command): Remove comment.

9 years agoMIPS/opcodes: Remove microMIPS 48-bit LI instruction
Maciej W. Rozycki [Thu, 21 Aug 2014 11:57:00 +0000 (12:57 +0100)] 
MIPS/opcodes: Remove microMIPS 48-bit LI instruction

The 48-bit LI instruction encoding has been removed from the microMIPS
ISA and no implementation ever made that included it.

* micromips-opc.c (micromips_opcodes): Remove #ifdef-ed out
48-bit "li" encoding.

9 years agoPowerPC64/BFD: Fix ppc64_elf_set_toc indentation
Maciej W. Rozycki [Thu, 21 Aug 2014 11:31:58 +0000 (12:31 +0100)] 
PowerPC64/BFD: Fix ppc64_elf_set_toc indentation

* elf64-ppc.h (ppc64_elf_set_toc): Fix indentation.

9 years agoRemove useless gcore command detection
Pedro Alves [Thu, 21 Aug 2014 10:36:59 +0000 (11:36 +0100)] 
Remove useless gcore command detection

Checking whether the gcore command is included in the GDB build as
proxy for checking whether core dumping is supported by the target is
useless, as gcore.o has been in COMMON_OBS since git 9b4eba8e:

    2009-10-26  Michael Snyder  <msnyder@vmware.com>
                Hui Zhu  <teawater@gmail.com>

        * Makefile.in (SFILES): Add gcore.c.
        (COMMON_OBS): Add gcore.o.
        * config/alpha/alpha-linux.mh (NATDEPFILES): Delete gcore.o.
        * config/alpha/fbsd.mh (NATDEPFILES): Ditto.
...

IOW, the command is always included in the build.

Instead, nowadays, tests bail out if actually trying to generate a
core fails with an indication the target doesn't support it.  See
gdb_gcore_cmd and callers.

Tested on x86_64 Fedora 20.

gdb/testsuite/ChangeLog:

* gdb.base/gcore-buffer-overflow.exp: Remove "help gcore" test.
* gdb.base/gcore-relro-pie.exp: Likewise.
* gdb.base/gcore-relro.exp: Likewise.
* gdb.base/gcore.exp: Likewise.
* gdb.base/print-symbol-loading.exp: Likewise.
* gdb.threads/gcore-thread.exp: Likewise.
* lib/gdb.exp (gdb_gcore_cmd): Don't expect "Undefined command".

9 years agobfd/ChangeLog
Terry Guo [Thu, 21 Aug 2014 10:00:35 +0000 (18:00 +0800)] 
bfd/ChangeLog
2014-08-21  Tony Wang  <tony.wang@arm.com>

* elf32-arm.c (elf32_arm_final_link_relocate): Implement
the veneer routine for R_ARM_THM_JUMP19.
(arm_type_of_stub): Add conditional clause for R_ARM_THM_JUMP19
(elf32_arm_size_stub): Ditto.

ld/testsuite/ChangeLog
2014-08-21  Tony Wang  <tony.wang@arm.com>

* ld-arm/jump-reloc-veneers-cond.s: New test.
* ld-arm/farcall-cond-thumb-arm.s: Ditto.
* ld-arm/jump-reloc-veneers-cond-short.d: Expected output
for target without a veneer generation.
* ld-arm/jump-reloc-veneers-cond-long.d: Expected output
for target with a veneer generation.
* ld-arm/farcall-cond-thumb-arm.d: Expected output for
inter working veneer generation.
* ld-arm/arm-elf.exp: Add tests for conditional branch veneer.

9 years agogdb: Fix aarch64 native build issue caused by use of LONGEST
Will Newton [Thu, 21 Aug 2014 08:38:00 +0000 (09:38 +0100)] 
gdb: Fix aarch64 native build issue caused by use of LONGEST

Recent gdb code refactor changes LONGEST from a macro to a typedef,
thus the use of it in aarch64-linux-nat.c is no longer valid.

2014-08-21  Bin Cheng  <bin.cheng@arm.com>

* aarch64-linux-nat.c (dr_changed_t): Change the type from
unsigned LONGEST to ULONGEST.

9 years agoMIPS/gas/testsuite: mips.exp indentation fixes
Maciej W. Rozycki [Thu, 21 Aug 2014 00:52:13 +0000 (01:52 +0100)] 
MIPS/gas/testsuite: mips.exp indentation fixes

* gas/mips/mips.exp: Correct indentation.

9 years agoGAS: Replace leading spaces with tabs across dw2gencfi.c
Maciej W. Rozycki [Wed, 20 Aug 2014 19:40:10 +0000 (20:40 +0100)] 
GAS: Replace leading spaces with tabs across dw2gencfi.c

* dw2gencfi.c (make_debug_seg): Replace leading spaces with tabs.
(dot_cfi_val_encoded_addr, output_cfi_insn): Likewise.
(output_cie, cfi_change_reg_numbers, cfi_finish): Likewise.

9 years agoARM/ld: Correct macro formatting in armelf.em
Maciej W. Rozycki [Wed, 20 Aug 2014 19:17:18 +0000 (20:17 +0100)] 
ARM/ld: Correct macro formatting in armelf.em

* emultempl/armelf.em (OPTION_STUBGROUP_SIZE): Fix formatting.
(OPTION_NO_MERGE_EXIDX_ENTRIES, OPTION_LONG_PLT): Likewise.

9 years agoIntegrate PR 12649's race detector directly in the testsuite machinery
Pedro Alves [Wed, 20 Aug 2014 17:55:54 +0000 (18:55 +0100)] 
Integrate PR 12649's race detector directly in the testsuite machinery

This integrates Jan Kratochvil's nice race reproducer from PR
testsuite/12649 into the testsuite infrustructure directly.

With this, one only has to do either 'make check-read1' or 'make check
READ1="1"' to preload the read1.so library into expect.

Currently only enabled for glibc/GNU systems, and if
build==host==target.

gdb/testsuite/ChangeLog:

* Makefile.in (EXTRA_RULES, CC): New variables, get from
configure.
(EXPECT): Handle READ1 being set.
(all): Depend on EXTRA_RULES.
(check-read1, expect-read1, read1.so, read1): New rules.
* README (Testsuite Parameters): Document the READ1 make variable.
(Race detection): New section.
* configure: Regenerate.
* configure.ac: If build==host==target, and running under a
GNU/glibc system, add read1 to the extra Makefile rules.
(EXTRA_RULES): AC_SUBST it.
* lib/read1.c: New file.

gdb/ChangeLog:

* Makefile.in (check-read1): New rule.

9 years agoFix PR ld/17277: bogus dynamic relocs and TEXTREL for ARM PC-relative relocs
Roland McGrath [Wed, 20 Aug 2014 17:12:57 +0000 (10:12 -0700)] 
Fix PR ld/17277: bogus dynamic relocs and TEXTREL for ARM PC-relative relocs

bfd/
PR ld/17277
* elf32-arm.c (elf32_arm_check_relocs): Increment P->pc_count for
all reloc types with pc_relative set in the howto, not just for
R_ARM_REL32 and R_ARM_REL32_NOI.
(allocate_dynrelocs_for_symbol): Update comment.
(elf32_arm_gc_sweep_hook): For all reloc types with pc_relative
set in the howto, set call_reloc_p and may_need_local_target_p but
not may_become_dynamic_p; not only for R_ARM_REL32 and R_ARM_REL32_NOI.
(elf32_arm_check_relocs): Likewise.

ld/testsuite/
PR ld/17277
* ld-arm/pcrel-shared.s: New file.
* ld-arm/pcrel-shared.rd: New file.
* ld-arm/arm-elf.exp (armelftests_common): Add it.

9 years agoARM: Add support for armeb-*-eabi*
Will Newton [Mon, 4 Aug 2014 09:52:04 +0000 (10:52 +0100)] 
ARM: Add support for armeb-*-eabi*

At the moment it is possible to configure binutils for these triples
but the resulting linker defaults to little endian with huge numbers
of testsuite failures, which on the face of it does not appear to make
much sense.

This patch makes the behaviour similar to armeb-elf and the testsuite
is clean.

bfd/ChangeLog:

2014-08-20  Will Newton  <will.newton@linaro.org>

* config.bfd: Default armeb-*-eabi* to big endian.

ld/ChangeLog:

2014-08-20  Will Newton  <will.newton@linaro.org>

* configure.tgt: Default armeb-*-eabi* to big endian.

9 years ago[ARM] Fix vcmp with #0.0
Kyrylo Tkachov [Wed, 20 Aug 2014 15:49:53 +0000 (16:49 +0100)] 
[ARM] Fix vcmp with #0.0

* config/tc-arm.c (parse_ifimm_zero): New function.
(enum operand_parse_code): Add OP_RSVD_FI0 value.
(parse_operands): Handle OP_RSVD_FI0.
(asm_opcode_insns): Use RSVD_FI0 for second operand of vcmp, vcmpe.

* gas/arm/ual-vcmp.s: New file.
* gas/arm/ual-vcmp.d: Likewise.
* gas/arm/vcmp-zero-bad.s: Likewise.
* gas/arm/vcmp-zero-bad.d: Likewise.
* gas/arm/vcmp-zero-bad.l: Likewise.

9 years agoEnabling the HIGH_ENTROPY_VA flag allows the operating system to use
Nick Clifton [Wed, 20 Aug 2014 15:10:29 +0000 (16:10 +0100)] 
Enabling the HIGH_ENTROPY_VA flag allows the operating system to use
addresses outside of the 32-bit range before memory exhaustion. This
results in a higher entropy implementation of ASLR when used with the
DYNAMIC_BASE flag.

* include/coff/pe.h: Add HIGH_ENTROPY_VA flag
* ld/emultempl/pep.em: Add --high-entropy-va switch
* ld/ld.texinfo: Document the --high-entropy-va switch

9 years agoFix handling of typedefs to types having a data_location attribute.
Joel Brobecker [Wed, 20 Aug 2014 12:50:38 +0000 (14:50 +0200)] 
Fix handling of typedefs to types having a data_location attribute.

Consider an array described in the debugging information as being
a typedef of an array type for which there is a DW_AT_data_location
attribute. Trying to print the value of that array currently yields
incorrect element values. For instance:

    (gdb) print foo.three_tdef
    $1 = (6293760, 0, 6293772)

The problem occurs because we check for the data_location attribute
only on the typedef type, whereas we should be checking for the
typedef's target type.  As a result, GDB erroneously thinks that
there is no data_location, and therefore starts reading the array's
content from the address of the descriptor instead of the data_location
address.

gdb/ChangeLog:

        * value.c (value_from_contents_and_address): Strip resolved_type's
        typedef layers before checking its TYPE_DATA_LOCATION.

gdb/testsuite/ChangeLog:

        * gdb.dwarf2/data-loc.exp: Add additional tests exercising
        the handling of variables declared as a typedef to an array
        which a DW_AT_data_location attribute.

9 years agovalue.c (value_contents_bits_eq): Initialize l,h for gcc -Wall.
Pedro Alves [Wed, 20 Aug 2014 10:05:31 +0000 (11:05 +0100)] 
value.c (value_contents_bits_eq): Initialize l,h for gcc -Wall.

2014-08-20  Pedro Alves  <palves@redhat.com>

gdb/
* value.c (value_contents_bits_eq): Initialize l,h for gcc -Wall.

9 years agoAdjust comments with example in it
Yao Qi [Wed, 20 Aug 2014 03:36:42 +0000 (11:36 +0800)] 
Adjust comments with example in it

We would like to wrap examples, output or code snippet in comments with
blank lines, and move */ to a new line if the comment is ended with the
example.

gdb:

2014-08-20  Yao Qi  <yao@codesourcery.com>

* amd64-tdep.c (amd64_classify): Add a blank line after the
example.  Move "*/" to a new line.
* arm-tdep.c (arm_vfp_cprc_sub_candidate): Likewise.
* arm-wince-tdep.c (arm_pe_skip_trampoline_code): Likewise.
* dwarf2read.c (psymtab_include_file_name): Likewise.

9 years agoAdd copyright notice to linker script files.
Nick Clifton [Wed, 20 Aug 2014 09:34:58 +0000 (10:34 +0100)] 
Add copyright notice to linker script files.

9 years agoFix typo in f7f2534e
Alan Modra [Wed, 20 Aug 2014 00:27:59 +0000 (09:57 +0930)] 
Fix typo in f7f2534e

* Makefile.am: Typo fix.
* Makefile.in: Regenerate.
* po/POTFILES.in: Regenerate.

9 years agodaily update
Alan Modra [Wed, 20 Aug 2014 00:01:14 +0000 (09:31 +0930)] 
daily update

9 years agoHandle partially optimized out values similarly to unavailable values
Pedro Alves [Tue, 19 Aug 2014 23:07:40 +0000 (00:07 +0100)] 
Handle partially optimized out values similarly to unavailable values

This fixes PR symtab/14604, PR symtab/14605, and Jan's test at
https://sourceware.org/ml/gdb-patches/2014-07/msg00158.html, in a tree
with bddbbed reverted:

 2014-07-22  Pedro Alves  <palves@redhat.com>

  * value.c (allocate_optimized_out_value): Don't mark value as
  non-lazy.

The PRs are about variables described by the DWARF as being split over
multiple registers using DWARF piece information, but some of those
registers being marked as optimised out (not saved) by a later frame.
GDB currently incorrectly mishandles these partially-optimized-out
values.

Even though we can usually tell from the debug info whether a local or
global is optimized out, handling the case of a local living in a
register that was not saved in a frame requires fetching the variable.
GDB also needs to fetch a value to tell whether parts of it are
"<unavailable>".  Given this, it's not worth it to try to avoid
fetching lazy optimized-out values based on debug info alone.

So this patch makes GDB track which chunks of a value's contents are
optimized out like it tracks <unavailable> contents.  That is, it
makes value->optimized_out be a bit range vector instead of a boolean,
and removes the struct lval_funcs check_validity and check_any_valid
hooks.

Unlike Andrew's series which this is based on (at
https://sourceware.org/ml/gdb-patches/2013-08/msg00300.html, note some
pieces have gone in since), this doesn't merge optimized out and
unavailable contents validity/availability behind a single interface,
nor does it merge the bit range vectors themselves (at least yet).
While it may be desirable to have a single entry point that returns
existence of contents irrespective of what may make them
invalid/unavailable, several places want to treat optimized out /
unavailable / etc. differently, so each spot that potentially could
use it will need to be careful considered on case-by-case basis, and
best done as a separate change.

This fixes Jan's test, because value_available_contents_eq wasn't
considering optimized out value contents.  It does now, and because of
that it's been renamed to value_contents_eq.

A new intro comment is added to value.h describing "<optimized out>",
"<not saved>" and "<unavailable>" values.

gdb/
PR symtab/14604
PR symtab/14605
* ada-lang.c (coerce_unspec_val_to_type): Use
value_contents_copy_raw.
* ada-valprint.c (val_print_packed_array_elements): Adjust.
* c-valprint.c (c_val_print): Use value_bits_any_optimized_out.
* cp-valprint.c (cp_print_value_fields): Let the common printing
code handle optimized out values.
(cp_print_value_fields_rtti): Use value_bits_any_optimized_out.
* d-valprint.c (dynamic_array_type): Use
value_bits_any_optimized_out.
* dwarf2loc.c (entry_data_value_funcs): Remove check_validity and
check_any_valid fields.
(check_pieced_value_bits): Delete and inline ...
(check_pieced_synthetic_pointer): ... here.
(check_pieced_value_validity): Delete.
(check_pieced_value_invalid): Delete.
(pieced_value_funcs): Remove check_validity and check_any_valid
fields.
(read_pieced_value): Use mark_value_bits_optimized_out.
(write_pieced_value): Switch to use
mark_value_bytes_optimized_out.
(dwarf2_evaluate_loc_desc_full): Copy the value contents instead
of assuming the whole value is optimized out.
* findvar.c (read_frame_register_value): Remove special handling
of optimized out registers.
(value_from_register): Use mark_value_bytes_optimized_out.
* frame-unwind.c (frame_unwind_got_optimized): Use
mark_value_bytes_optimized_out.
* jv-valprint.c (java_value_print): Adjust.
(java_print_value_fields): Let the common printing code handle
optimized out values.
* mips-tdep.c (mips_print_register): Remove special handling of
optimized out registers.
* opencl-lang.c (lval_func_check_validity): Delete.
(lval_func_check_any_valid): Delete.
(opencl_value_funcs): Remove check_validity and check_any_valid
fields.
* p-valprint.c (pascal_object_print_value_fields): Let the common
printing code handle optimized out values.
* stack.c (read_frame_arg): Remove special handling of optimized
out values.  Fetch both VAL and ENTRYVAL before comparing
contents.  Adjust to value_available_contents_eq rename.
* valprint.c (valprint_check_validity)
(val_print_scalar_formatted): Use value_bits_any_optimized_out.
(val_print_array_elements): Adjust.
* value.c (struct value) <optimized_out>: Now a VEC(range_s).
(value_bits_any_optimized_out): New function.
(value_entirely_covered_by_range_vector): New function, factored
out from value_entirely_unavailable.
(value_entirely_unavailable): Reimplement.
(value_entirely_optimized_out): New function.
(insert_into_bit_range_vector): New function, factored out from
mark_value_bits_unavailable.
(mark_value_bits_unavailable): Reimplement.
(struct ranges_and_idx): New struct.
(find_first_range_overlap_and_match): New function, factored out
from value_available_contents_bits_eq.
(value_available_contents_bits_eq): Rename to ...
(value_contents_bits_eq): ... this.  Check both unavailable
contents and optimized out contents.
(value_available_contents_eq): Rename to ...
(value_contents_eq): ... this.
(allocate_value_lazy): Remove reference to the old optimized_out
boolean.
(allocate_optimized_out_value): Use
mark_value_bytes_optimized_out.
(require_not_optimized_out): Adjust to check whether the
optimized_out vec is empty.
(ranges_copy_adjusted): New function, factored out from
value_contents_copy_raw.
(value_contents_copy_raw): Also copy the optimized out ranges.
Assert the destination ranges aren't optimized out.
(value_contents_copy): Update comment, remove call to
require_not_optimized_out.
(value_contents_equal): Adjust to check whether the optimized_out
vec is empty.
(set_value_optimized_out, value_optimized_out_const): Delete.
(mark_value_bytes_optimized_out, mark_value_bits_optimized_out):
New functions.
(value_entirely_optimized_out, value_bits_valid): Delete.
(value_copy): Take a VEC copy of the 'optimized_out' field.
(value_primitive_field): Remove special handling of optimized out.
(value_fetch_lazy): Assert that lazy values have no unavailable
regions.  Use value_bits_any_optimized_out.  Remove some special
handling for optimized out values.
* value.h: Add intro comment about <optimized out> and
<unavailable>.
(struct lval_funcs): Remove check_validity and check_any_valid
fields.
(set_value_optimized_out, value_optimized_out_const): Remove.
(mark_value_bytes_optimized_out, mark_value_bits_optimized_out):
New declarations.
(value_bits_any_optimized_out): New declaration.
(value_bits_valid): Delete declaration.
(value_available_contents_eq): Rename to ...
(value_contents_eq): ... this, and extend comments.

gdb/testsuite/
PR symtab/14604
PR symtab/14605
* gdb.dwarf2/dw2-op-out-param.exp: Remove kfail branches and use
gdb_test.

9 years agoFix -fsanitize=address on unreadable inferior strings
Jan Kratochvil [Tue, 19 Aug 2014 20:55:10 +0000 (22:55 +0200)] 
Fix -fsanitize=address on unreadable inferior strings

echo 'void f(char *s){}main(){f((char *)1);}'|gcc -g -x c -;../gdb ./a.out -ex 'b f' -ex r
====ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000aaccf at pc 0x96eea7 bp 0x7fff75bdbc90 sp 0x7fff75bdbc80
READ of size 1 at 0x6020000aaccf thread T0
    #0 0x96eea6 in extract_unsigned_integer .../gdb/findvar.c:108
    #1 0x9df02b in val_print_string .../gdb/valprint.c:2513
[...]
0x6020000aaccf is located 1 bytes to the left of 8-byte region [0x6020000aacd0,0x6020000aacd8)
allocated by thread T0 here:
    #0 0x7f45fad26b97 in malloc (/lib64/libasan.so.1+0x57b97)
    #1 0xdb3409 in xmalloc common/common-utils.c:45
    #2 0x9d8cf9 in read_string .../gdb/valprint.c:1845
    #3 0x9defca in val_print_string .../gdb/valprint.c:2502
[..]
====ABORTING

gdb/
2014-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>

Fix -fsanitize=address on unreadable inferior strings.
* valprint.c (val_print_string): Fix access before BUFFER.

9 years agoRemove stale comment
Pedro Alves [Tue, 19 Aug 2014 17:18:31 +0000 (18:18 +0100)] 
Remove stale comment

This comment is no longer true for watchpoints since commit 31e77af2
(PR breakpoints/7143 - Watchpoint does not trigger when first set).

gdb/testsuite/

* gdb.base/watchpoint-hw-hit-once.c (main): Update comment.

9 years agoConvert target_structs vector to VEC
Simon Marchi [Fri, 15 Aug 2014 20:34:34 +0000 (16:34 -0400)] 
Convert target_structs vector to VEC

I thought that this home made implementation of a vector could be
replaced by the more standard VEC. The implementation seems to predate
the introduction of vec.h, so that would explain why it exists.

Ran make check before and after, no new failures.

gdb/ChangeLog:

2014-08-19  Simon Marchi  <simon.marchi@ericsson.com>

* target.c (target_struct_size): Remove.
(target_struct_allocsize): Remove.
(DEFAULT_ALLOCSIZE): Remove.
(target_ops_p): New typedef.
(DEF_VEC_P (target_ops_p)): New vector type.
(target_structs): Change type to VEC (target_ops_p).
(add_target_with_completer): Replace "push" code by VEC_safe_push.
(find_default_run_target): Rewrite for loop following changes to
target_structs.

9 years agoThis patch adds support for FreeBSD ARM in gas.
Nick Clifton [Tue, 19 Aug 2014 14:51:43 +0000 (15:51 +0100)] 
This patch adds support for FreeBSD ARM in gas.
Before FreeBSD-8 there was/is no arm support from the OS side.
FreeBSD-9.x added ARM support but only for the OABI.
From FreeBSD-10 upwards there is EABI support.

    * Makefile.am: Add FreeBSD ARM support.
    * Mafefile.in: Regenerate.
    * configure.tgt: Add FreeBSD ARM support.
    * config/te-armfbsdeabi.h: New file.
    * config/te-armfbsdvfp.h: Likewise.

9 years agoThis patch set mainly aims at improving the S/390 disassembler's
Andreas Arnez [Tue, 19 Aug 2014 14:42:13 +0000 (15:42 +0100)] 
This patch set mainly aims at improving the S/390 disassembler's
readability and also fixes some minor issues.

  S/390: Split disassembler routine into smaller functions
  S/390: Fix disassembler's treatment of signed/unsigned operands
  S/390: Fix off-by-one error in disassembler initialization
  S/390: Simplify opcode search loop in disassembler
  S/390: Drop function pointer dereferences in disassembler
  S/390: Various minor simplifications in disassembler

9 years agovalue_from_pointer: remove call to resolve_dynamic_type
Joel Brobecker [Tue, 19 Aug 2014 12:55:22 +0000 (14:55 +0200)] 
value_from_pointer: remove call to resolve_dynamic_type

The given type is expected to always be a TYPE_CODE_PTR, for which
resolve_dynamic_type does nothing.  So this patch removes this call.

gdb/ChangeLog:

        * value.c (value_from_pointer): Remove use of resolve_dynamic_type.
        Adjust code accordingly.  Adjust function description comment.

9 years agoSet breakpoint on the right line
Yao Qi [Tue, 12 Aug 2014 01:14:08 +0000 (09:14 +0800)] 
Set breakpoint on the right line

In gdb.base/watchpoint-hw-hit-once.exp, test scans source and set
breakpoint on the line having "break-at-exit",

  gdb_breakpoint [gdb_get_line_number "break-at-exit"]

However, in watchpoint-hw-hit-once.c, there are two lines having
this key word:

  dummy = 1; /* Stub to catch break-at-exit after WATCHEE has been hit.  */
  dummy = 2; /* break-at-exit */

so the test sets breakpoint on the first one, while I think it is
expected to set breakpoint on the second one, as far as I can tell
from the comments in watchpoint-hw-hit-once.c:

  /* Stub lines are present as no breakpoints/watchpoint gets hit if current PC
     already stays on the line PC while entering "step"/"continue".  */

This patch is to change the source matching pattern so that test
can correctly set breakpoint on the right line.  This patch fixes
a fail we found on arm-none-eabi target.

(gdb) PASS: gdb.base/watchpoint-hw-hit-once.exp: continue
continue^M
Continuing.^M
^M
*** EXIT code 0^M
[Inferior 1 (Remote target) exited normally]^M
(gdb) FAIL: gdb.base/watchpoint-hw-hit-once.exp: continue to break-at-exit (the program exited)

Run it again on x86_64-linux, no result changes.

gdb/testsuite:

2014-08-19  Yao Qi  <yao@codesourcery.com>

* gdb.base/watchpoint-hw-hit-once.exp: Set breakpoint on the
right line.

9 years agoSupport _Complex in hard-VFP abi
Yao Qi [Mon, 11 Aug 2014 11:02:58 +0000 (19:02 +0800)] 
Support _Complex in hard-VFP abi

Hi,
When we pass "-mfloat-abi=hard" flag in the GDB testing, we see the
following fails,

FAIL: gdb.base/callfuncs.exp: p t_float_complex_values(fc1, fc2)
FAIL: gdb.base/callfuncs.exp: p t_float_complex_many_args(fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4, fc1, fc2, fc3, fc4)
FAIL: gdb.base/callfuncs.exp: p t_double_complex_values(dc1, dc2)
FAIL: gdb.base/callfuncs.exp: p t_double_complex_many_args(dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4)
FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_values(ldc1, ldc2)
FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_many_args(ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4)
FAIL: gdb.base/callfuncs.exp: call inferior func with struct - returns float _Complex
FAIL: gdb.base/callfuncs.exp: call inferior func with struct - returns double _Complex

The hard-VFP ABI was supported by GDB overal, done by this patch
https://sourceware.org/ml/gdb-patches/2009-07/msg00686.html but
"vectors and complex types are not currently supported", mentioned in
the patch.  As a result, these tests fail.

This patch is to support _Complex types in hard-VFP abi.  As specified
in "7.1.1, Procedure Call Standard for the ARM Arch", the layout of
_Complex types is a struct, which is identical to the layout on amd64,
so I copy Mark's comments to amd64 support.

Regression tested on arm-none-eabi target.  OK to apply?

gdb:

2014-08-19  Yao Qi  <yao@codesourcery.com>

* arm-tdep.c (arm_vfp_cprc_sub_candidate): Handle _Complex
types.

9 years agoFix --diable-shared --enable-plugins build breakage
Alan Modra [Tue, 19 Aug 2014 12:29:56 +0000 (21:59 +0930)] 
Fix --diable-shared --enable-plugins build breakage

Directories that don't use libtool need to add -ldl (on most *nix
hosts) to provide dlopen for libbfd.

config/
* plugins.m4 (AC_PLUGINS): If plugins are enabled, add -ldl to
LIBS via AC_SEARCH_LIBS.
gdb/
* acinclude.m4 (GDB_AC_CHECK_BFD): Don't add -ldl.
* config.in: Regenerate.
sim/ppc/
* configure.ac: Invoke AC_PLUGINS.
* config.in: Regenerate.

and regen lots of configure files.

9 years agoReplace static variables in the MSP430 simulator with fields in the cpu state structure.
Nick Clifton [Tue, 19 Aug 2014 10:34:14 +0000 (11:34 +0100)] 
Replace static variables in the MSP430 simulator with fields in the cpu state structure.

* msp430-sim.c: Move static hardware multiply support variables
from here...
* msp430-sim.h (msp430_cpu_state): ... into here ...
* msp430-sim.c (get_op, put_op): ... and update references to use
the msp430_cpu_state structure.

9 years agoIntroduce common-debug.h
Gary Benson [Wed, 30 Jul 2014 15:21:55 +0000 (16:21 +0100)] 
Introduce common-debug.h

This introduces common-debug.h.  This holds the functions debug_printf
and debug_vprintf, two functions that the common code can use to print
debugging messages.  Clients of the common code are expected to
implement debug_vprintf; a debug_vprintf function is written from
scratch for GDB, and gdbserver's existing debug_printf is repurposed
as debug_vprintf.

common/agent.c is changed to use debug_vprintf rather than
defining the macro DEBUG_AGENT depending on GDBSERVER.

nat/i386-dregs.c is changed to use the externally-implemented
debug_printf, rather than defining it itself.

gdb/ChangeLog:

* common/common-debug.h: New file.
* common/common-debug.c: Likewise.
* debug.c: Likewise.
* Makefile.in (SFILES): Add common/common-debug.c.
(HFILES_NO_SRCDIR): Add common/common-debug.h.
(COMMON_OBS): Add common-debug.o and debug.o.
(common-debug.o): New rule.
* common/common-defs.h: Include common-debug.h.
* common/agent.c (debug_agent_printf): New function.
(DEBUG_AGENT): Redefine.
* nat/i386-dregs.c (debug_printf): Undefine.

gdb/gdbserver/ChangeLog:

* Makefile.in (SFILES): Add common/common-debug.c.
(OBS): Add common-debug.o.
(common-debug.o): New rule.
* debug.h (debug_printf): Don't declare.
* debug.c (debug_printf): Renamed and rewritten as...
(debug_vprintf): New function.

9 years agoMove print-utils.h to common-defs.h
Gary Benson [Wed, 30 Jul 2014 15:14:21 +0000 (16:14 +0100)] 
Move print-utils.h to common-defs.h

This commit moves the inclusion of print-utils.h to common-defs.h
and removes all other inclusions.

gdb/ChangeLog:

* common/common-defs.h: Include print-utils.h.
* utils.h: Do not include print-utils.h.

gdb/gdbserver/ChangeLog:

* utils.h: Do not include print-utils.h.

9 years agoIntroduce common-types.h
Gary Benson [Wed, 30 Jul 2014 14:31:10 +0000 (15:31 +0100)] 
Introduce common-types.h

This introduces common-types.h.  This file defines various standard
types used by gdb and gdbserver.

Currently these types are conditionally defined based on GDBSERVER.
The long term goal is to remove all such tests; however, this is
difficult as currently gdb uses definitions from BFD.  In the meantime
this is still a step in the right direction.

gdb/ChangeLog:

* common/common-types.h: New file.
* Makefile.in (HFILES_NO_SRCDIR): Add common/common-types.h.
* common/common-defs.h: Include common-types.h.
* defs.h (gdb_byte, CORE_ADDR, CORE_ADDR_MAX, LONGEST)
(ULONGEST): Remove.

gdb/gdbserver/ChangeLog:

* server.h: Add static assertion.
(gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.

9 years agoIntroduce common/errors.h
Gary Benson [Wed, 30 Jul 2014 13:09:07 +0000 (14:09 +0100)] 
Introduce common/errors.h

This introduces common/errors.h.  This holds some error- and warning-
related declarations that can be used by the code in common, nat and
target.  Some of the declared functions must be provided by the client
as documented by the header file comments.

gdb/ChangeLog:

* common/errors.h: New file.
* common/errors.c: Likewise.
* Makefile.in (SFILES): Add common/errors.c.
(HFILES_NO_SRCDIR): Add common/errors.h.
(COMMON_OBS): Add errors.o.
(errors.o): New rule.
* common/common-defs.h: Include errors.h.
* utils.h (perror_with_name, error, verror, warning, vwarning):
Don't declare.
* common/common-utils.h: (malloc_failure, internal_error):
Likewise.

gdb/gdbserver/ChangeLog:

* Makefile.in (SFILES): Add common/errors.c.
(OBS): Add errors.o.
(IPA_OBS): Add errors-ipa.o.
(errors.o): New rule.
(errors-ipa.o): Likewise.
* utils.h (perror_with_name, error, warning): Don't declare.
* utils.c (warning): Renamed and rewritten as...
(vwarning): New function.
(error): Renamed and rewritten as...
(verror): New function.
(internal_error): Renamed and rewritten as...
(internal_verror): New function.

9 years agoEnsure internal_vproblem always prints the message
Gary Benson [Tue, 5 Aug 2014 09:20:05 +0000 (10:20 +0100)] 
Ensure internal_vproblem always prints the message

While working on internal_vproblem I noticed that the error/warning
message is suppressed if problem->should_quit is internal_problem_yes
or internal_problem_no.  This behaviour seems wrong.  This commit
modifies internal_vproblem to emit the message regardless of the
user's settings.

gdb/
2014-08-19  Gary Benson  <gbenson@redhat.com>

* utils.c (internal_vproblem): Always print the message.

9 years agodaily update
Alan Modra [Tue, 19 Aug 2014 00:01:12 +0000 (09:31 +0930)] 
daily update

9 years agoboards/fission.exp: Explicitly pass -ggnu-pubnames for clang.
David Blaikie [Mon, 18 Aug 2014 19:07:49 +0000 (12:07 -0700)] 
boards/fission.exp: Explicitly pass -ggnu-pubnames for clang.

* boards/fission.exp: Explicitly pass -ggnu-pubnames for clang.

9 years agogdb.dwarf2/data-loc.exp: Remove second DW_AT_upper bound in array range.
Joel Brobecker [Mon, 18 Aug 2014 17:41:57 +0000 (19:41 +0200)] 
gdb.dwarf2/data-loc.exp: Remove second DW_AT_upper bound in array range.

The testcase generates an assembly file where a second DW_AT_upper_bound
attribute gets generated in the array range.  This was definitely
unintentional, and I only noticed this after pushing the testcase,
when dumping one more time the DWARF data using readelf.

This patch fixes it.

gdb/testsuite/ChangeLog:

        * gdb.dwarf2/data-loc.exp: Remove second DW_AT_upper bound
        attribute in array range.

9 years agoada-typeprint.c (print_range): Initialize lo,hi for gcc -Wall.
Doug Evans [Mon, 18 Aug 2014 17:04:18 +0000 (10:04 -0700)] 
ada-typeprint.c (print_range): Initialize lo,hi for gcc -Wall.

* ada-typeprint.c (print_range): Initialize lo,hi for gcc -Wall.

9 years agoThis fixes the processing of BFD_RELOC_RL78_DIFF fixups when the size is less
Nick Clifton [Mon, 18 Aug 2014 16:34:03 +0000 (17:34 +0100)] 
This fixes the processing of BFD_RELOC_RL78_DIFF fixups when the size is less
than 4.  This affects DWARF debug info generation in particular.

* config/tc-rl78.c (md_apply_fix): Correct handling of small sized
RELOC_RL78_DIFF fixups.

9 years agoDW_AT_data_location and DW_OP_push_object_address testcase.
Joel Brobecker [Wed, 13 Aug 2014 23:45:59 +0000 (16:45 -0700)] 
DW_AT_data_location and DW_OP_push_object_address testcase.

This testcase allows us to test the proper processing of both
DW_AT_data_location and DW_OP_push_object_address using a hand-crafted
testcase duplicating how we expect the Ada compiler to represent
unbounded arrays.

gdb/testsuite/ChangeLog:

        * gdb.dwarf2/data-loc.c, gdb.dwarf2/data-loc.exp: New files.

9 years ago[Ada] "ptype" of array where bound value uses DW_OP_push_object_address
Joel Brobecker [Thu, 14 Aug 2014 22:57:00 +0000 (15:57 -0700)] 
[Ada] "ptype" of array where bound value uses DW_OP_push_object_address

Consider an Ada array type where the DWARF debugging info for
at least one of the bounds involves an expression containing
a DW_OP_push_object_address operation. Trying to "ptype" that
type currently yields:

    (gdb) ptype foo.array_type
    type = array (Location address is not set.

This patch improves ada-typeprint by adding handling of the situation
where an array range type has dynamic bounds.  In that case, it prints
the array bounds using Ada's typical syntax for unbounded ranges "<>":

    (gdb) ptype array_type
    type = array (<>) of integer

gdb/ChangeLog:

        * ada-typeprint.c (type_is_full_subrange_of_target_type):
        Return 0 if TYPE is dynamic.
        (print_range): Add handling of dynamic ranges.

9 years agoAdd support for DW_AT_data_location.
Joel Brobecker [Mon, 11 Aug 2014 23:37:10 +0000 (16:37 -0700)] 
Add support for DW_AT_data_location.

gdb/ChangeLog:

        * gdbtypes.h (struct main_type): Add field "data_location".
        (TYPE_DATA_LOCATION, TYPE_DATA_LOCATION_BATON)
        (TYPE_DATA_LOCATION_ADDR, TYPE_DATA_LOCATION_KIND): New macros.
        * gdbtypes.c (is_dynamic_type): Return 1 if the type has
        a dynamic data location.
        (resolve_dynamic_type): Add DW_AT_data_location handling.
        (copy_recursive, copy_type): Copy the data_location information
        when present.
        * dwarf2read.c (set_die_type): Add DW_AT_data_location handling.
        * value.c (value_from_contents_and_address): Add
        DW_AT_data_location handling.

9 years agoAdd support for DW_OP_push_object_address.
Joel Brobecker [Mon, 11 Aug 2014 23:36:04 +0000 (16:36 -0700)] 
Add support for DW_OP_push_object_address.

gdb/ChangeLog:

        * dwarf2expr.h (struct dwarf_expr_context_funcs): Uncomment
        field "get_object_address".
        * dwarf2expr.c (execute_stack_op): Add handling for
        DW_OP_push_object_address.
        * dwarf2loc.h (dwarf2_evaluate_property): Add "address" field.
        * dwarf2loc.c (struct dwarf_expr_baton): Add field "obj_address".
        (dwarf_expr_push_dwarf_reg_entry_value): Set baton_local.obj_address.
        (dwarf_expr_get_obj_addr): New function.
        (dwarf_expr_ctx_funcs): Add get_object_address field.
        (dwarf2_evaluate_loc_desc_full): Set baton.obj_address.
        (dwarf2_locexpr_baton_eval): Add parameter "addr".  Use it.
        (dwarf2_evaluate_property): Add parameter "address".  Use it.
        (needs_get_obj_addr): New function.
        (needs_frame_ctx_funcs): Add get_object_address field.
        (dwarf2_compile_expr_to_ax): Add DW_OP_push_object_address handling.
        * gdbtypes.c (resolve_dynamic_range): Add "addr" field.  Use it.
        (resolve_dynamic_array): Likewise.

9 years agoada_evaluate_subexp<OP_VAR_VALUE>: Avoid static fixing when possible.
Joel Brobecker [Thu, 14 Aug 2014 21:00:02 +0000 (14:00 -0700)] 
ada_evaluate_subexp<OP_VAR_VALUE>: Avoid static fixing when possible.

Now that the OP_VAR_VALUE section of this function has been reorganized
a bit, we can fall-back on standard evaluation when static fixing is
not required. This patch does that, but being exclusive about when
static fixing has to be used, rather than doing it all the time when
noside is EVAL_AVOID_SIDE_EFFECTS.

This will pave the way for later when we want to evaluate entities
that have no GNAT encodings related to them but dynamic properties
instead. In that case, we expect the standard evaluation to resolve
those dynamic properties for us, even in no-side-effect mode.

gdb/ChangeLog:

        * ada-lang.c (ada_evaluate_subexp) <OP_VAR_VALUE>:
        When noside is EVAL_AVOID_SIDE_EFFECTS, only return a statically
        fixed value for records and unions for which some GNAT encodings
        are present.

9 years agoavoid "if ... else if ... else" logic in ada-lang.c::ada_evaluate_subexp
Joel Brobecker [Thu, 14 Aug 2014 20:36:24 +0000 (13:36 -0700)] 
avoid "if ... else if ... else" logic in ada-lang.c::ada_evaluate_subexp

The OP_VAR_VALUE branch in ada_evaluate_subexp is written with
multiple "if ... else if ... else if ... else ..." block. But
in practice, these blocks  all either goto out of that block of
code, or return.

This patch rewrites this code slightly by replacing the "else if"-s
by simple "if"s. This should better reflect the ideal processing
where we try to do a standard eval whenever possible, and only
do something else when the standard eval does not work. On a pratical
level, this patch makes it easier to fall through to the default
processing when none of the special situations are detected, thus
making it easier to add more handlers of those special situations;
or to remove them as they no longer become necessary!

gdb/ChangeLog:

        * ada-lang.c (ada_evaluate_subexp) <OP_VAR_VALUE>: Slight code
        rewrite to avoid "else if" and "else" constructs.  Should be
        a no-op in practice.

9 years agoFix indentation level in ada-lang.c::ada_evaluate_subexp.
Joel Brobecker [Thu, 14 Aug 2014 20:26:34 +0000 (13:26 -0700)] 
Fix indentation level in ada-lang.c::ada_evaluate_subexp.

I just happen to notice that a lexical block was missing one
indentation level.

gdb/ChangeLog:

        * ada-lang.c (ada_evaluate_subexp) <OP_VAR_VALUE>: Fix identation
        of lexical block.

9 years agoLTO plugin with older gcc
Alan Modra [Mon, 18 Aug 2014 09:08:24 +0000 (18:38 +0930)] 
LTO plugin with older gcc

* ld-plugin/lto.exp: Use gcc -print-file-name to find lto plugin.

9 years agoPowerPC fix for ifunc broken by d1eca1e4
Alan Modra [Mon, 18 Aug 2014 08:44:56 +0000 (18:14 +0930)] 
PowerPC fix for ifunc broken by d1eca1e4

This probably could be fixed by making changes in relocate_section for
ifunc, but it's simpler to disable the optimisation for ifunc.

* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't attempt to
use dynrelocs for ifunc.
* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Similarly.

9 years agoPR 17287, DT_NEEDED of unneeded libraries affects --as-needed
Alan Modra [Mon, 18 Aug 2014 05:13:03 +0000 (14:43 +0930)] 
PR 17287, DT_NEEDED of unneeded libraries affects --as-needed

PR 17287
bfd/
* elflink.c (on_needed_list): Only consider libraries that have
been loaded.
ld/
* ld.texinfo (--as-needed): Clarify that references from libraries
must be from needed libraries.
ld/testsuite/
* ld-plugin/needed3.c: New file.
* ld-elf/shared.exp: Add needed3 test.

9 years agoReturn error status from bfd_elf_discard_info.
Alan Modra [Mon, 18 Aug 2014 00:03:35 +0000 (09:33 +0930)] 
Return error status from bfd_elf_discard_info.

bfd/
* elflink.c (bfd_elf_discard_info): Return int error status.
* stabs.c (_bfd_discard_section_stabs): Comment typo fix.
* bfd-in.h (bfd_elf_discard_info): Updata prototype.
* bfd-in2.h: Regenerate.
ld/
* emultempl/aarch64elf.em (gld${EMULATION_NAME}_after_allocation):
Handle error status from bfd_elf_discard_info.
* emultempl/armelf.em: Likewise.
* emultempl/elf32.em: Likewise.
* emultempl/hppaelf.em: Likewise.
* emultempl/metagelf.em: Likewise.
* emultempl/nios2elf.em: Likewise.
* emultempl/ppc64elf.em: Likewise.
* emultempl/tic6xdsbt.em: Likewise.
* emultempl/vms.em: Likewise.

9 years agoCast result of TC_PARSE_CONS_EXPRESSION
Alan Modra [Mon, 18 Aug 2014 00:01:01 +0000 (09:31 +0930)] 
Cast result of TC_PARSE_CONS_EXPRESSION

* read.c (parse_mri_cons): Warning fix.

9 years agodaily update
Alan Modra [Mon, 18 Aug 2014 00:00:46 +0000 (09:30 +0930)] 
daily update

9 years agodaily update
Alan Modra [Sun, 17 Aug 2014 00:00:44 +0000 (09:30 +0930)] 
daily update

9 years agoAdd new argument NOSIDE to find_overload_match.
Siva Chandra [Wed, 9 Jul 2014 17:25:48 +0000 (10:25 -0700)] 
Add new argument NOSIDE to find_overload_match.

This is a fix for PR c++/17132.
If this new argument is set to EVAL_AVOID_SIDE_EFFECTS, then the object's
memory will not be read while picking the best overload match.

gdb/

* eval.c: Update all calls to find_overload_match.
* valarith.c: Likewise.
(value_user_defined_cpp_op, value_user_defined_op): New
argument NOSIDE.  Update all callers.
* valops.c (find_overload_match): New argument NOSIDE.
* value.h (find_overload_match): Update signature.

gdb/testsuite

* gdb.cp/pr17132.cc: New file.
* gdb.cp/pr17132.exp: New file.

9 years agoFix xmethod Python so that it works with Python3.
Siva Chandra [Tue, 5 Aug 2014 01:07:43 +0000 (18:07 -0700)] 
Fix xmethod Python so that it works with Python3.

gdb/

* python/lib/gdb/command/xmethods.py (set_xm_status1): Use the
'items' methods instead of 'iteritems' method on dictionaries.

gdb/testsuite/

* gdb.python/py-xmethods.py (A_getarrayind)
(E_method_char_worker.__call__, E_method_int_worker.__call__):
Use 'print' with function call syntax.
(E_method_matcher.match): Fix tab vs space indentation mixup.

This page took 0.076052 seconds and 4 git commands to generate.