binutils-gdb.git
10 years agold/testsuite
Yufeng Zhang [Wed, 18 Dec 2013 15:16:41 +0000 (15:16 +0000)]
ld/testsuite

2013-12-18  Vidya Praveen  <vidyapraveen@arm.com>

* lib/ld-lib.exp (check_lto_available): Support cflags, ldflags and
test by compiling for an executable rather than shared library.

10 years ago * config/tc-rx.c (rx_include): Rename 'eof' to 'last_char' in
Nick Clifton [Wed, 18 Dec 2013 11:51:25 +0000 (11:51 +0000)]
* config/tc-rx.c (rx_include): Rename 'eof' to 'last_char' in
order to avoid conflict with same named variable in MinGW system
header file.

10 years ago * peXXigen.c (rsrc_print_section): Use ptrdiff_t as the type for
Nick Clifton [Wed, 18 Dec 2013 10:30:25 +0000 (10:30 +0000)]
* peXXigen.c (rsrc_print_section): Use ptrdiff_t as the type for
pointer arithmetic.

10 years agoAdd target_xfer_partial_ftype
Yao Qi [Mon, 4 Nov 2013 09:53:56 +0000 (17:53 +0800)]
Add target_xfer_partial_ftype

This patch adds a typedef target_xfer_partial_ftype.  When we change
the signature of xfer_partial functions (for example, adding a new
parameter), we don't have to modify all of their declarations.

This patch also updates the type of parameters of target_xfer_partial
from "void *" to "gdb_byte *".

gdb:

2013-12-18  Yao Qi  <yao@codesourcery.com>

* target.h (target_xfer_partial_ftype): New typedef.
(target_xfer_partial): Update declaration.
* auxv.h (memory_xfer_auxv): Likewise.
* ia64-hpux-nat.c (super_xfer_partial): Likewise.
* ia64-linux-nat.c (super_xfer_partial): Likewise.
* linux-nat.c (super_xfer_partial): Likewise.
* procfs.c (procfs_xfer_partial): Likewise.
* record-full.c (record_full_beneath_to_xfer_partial):
(tmp_to_xfer_partial): Likewise.
* sparc-nat.c (inf_ptrace_xfer_partial): Likewise.
* target.c (default_xfer_partial): Likewise.
(current_xfer_partial): Likewise.
(target_xfer_partial): Change parameter type to 'gdb_byte *'.

10 years agoReplace sprintf with xsnprintf
Yao Qi [Mon, 4 Nov 2013 03:16:37 +0000 (11:16 +0800)]
Replace sprintf with xsnprintf

gdb:

2013-12-18  Yao Qi  <yao@codesourcery.com>

* linux-nat.c (linux_proc_xfer_partial): Call xsnprintf instead
of sprintf.
(linux_nat_detach, linux_child_pid_to_exec_file): Likewise.
(linux_proc_pending_signals): Likewise.

10 years agoFix the format of one ChangeLog entry
Yao Qi [Wed, 18 Dec 2013 03:30:54 +0000 (11:30 +0800)]
Fix the format of one ChangeLog entry

I notice that two lines of a recent changelog entry are not prefixed
with tab.  They are prefixed with a space and a tab.  This patch
is to remove the space.

gdb:

2013-12-18  Yao Qi  <yao@codesourcery.com>

* ChangeLog: Fix the format of one entry.

10 years agoAdd system register and embedded debug register support.
Kuan-Lin Chen [Thu, 12 Dec 2013 05:43:51 +0000 (13:43 +0800)]
Add system register and embedded debug register support.
Add two more as test files for user special and system register.
Fix typo.

2013-12-17  Kuan-Lin Chen  <kuanlinchentw@gmail.com>

* gas/nds32/nds32.exp: Add system and user special register tests.
* gas/nds32/sys-reg.s: New test.
* gas/nds32/sys-reg.d: Likewise.
* gas/nds32/usr-spe-reg.s: Likewise.
* gas/nds32/usr-spe-reg.d: Likewise.
* gas/nds32/alu-2.d: Delete the new blank line at EOF.
* gas/nds32/br-1.d: Likewise.
* gas/nds32/br-2.d: Likewise.
* gas/nds32/ji-jr.d: Likewise.
* gas/nds32/lsi.d: Likewise.
* nds32-dis.c (sr_map): Add system register table for disassembling.
(usr_map): Fix typo.
* nds32-asm.c (keyword_sr): Add embedded debug registers.

10 years agoARI fix in value.c::value_entirely_unavailable
Joel Brobecker [Wed, 18 Dec 2013 02:42:49 +0000 (06:42 +0400)]
ARI fix in value.c::value_entirely_unavailable

gdb/ChangeLog:

        * value.c (value_entirely_unavailable): ARI fix: Move trailing
        binary operator to the next line.  No actual code change.

10 years agodaily update
Alan Modra [Tue, 17 Dec 2013 23:00:45 +0000 (09:30 +1030)]
daily update

10 years agoCall _bfd_elf_post_process_headers
H.J. Lu [Tue, 17 Dec 2013 22:36:45 +0000 (14:36 -0800)]
Call _bfd_elf_post_process_headers

* elf32-arm.c (elf32_arm_post_process_headers): Call
_bfd_elf_post_process_headers.

10 years agoCall _bfd_elf_post_process_headers
H.J. Lu [Tue, 17 Dec 2013 22:10:03 +0000 (14:10 -0800)]
Call _bfd_elf_post_process_headers

* elf32-spu.c (spu_elf_post_process_headers): Call
_bfd_elf_post_process_headers.
* elfxx-mips.c (_bfd_mips_post_process_headers): Likewise.

10 years agoDefault elf_backend_post_process_headers to set OSABI
H.J. Lu [Tue, 17 Dec 2013 21:40:46 +0000 (13:40 -0800)]
Default elf_backend_post_process_headers to set OSABI

* elf-bfd.h (_bfd_elf_set_osabi): Renamed to ...
(_bfd_elf_post_process_headers): This.
* elf.c (_bfd_elf_compute_section_file_positions): Always
call elf_backend_post_process_headers.
(_bfd_elf_set_osabi): Renamed to ...
(_bfd_elf_post_process_headers): This.
* elf32-hppa.c (elf_backend_post_process_headers): Removed.
* elf32-i370.c (elf_backend_post_process_headers): Likewise.
* elf32-msp430.c (elf_backend_post_process_headers): Likewise.
* elf32-ppc.c (elf_backend_post_process_headers): Likewise.
* elf32-sparc.c (elf_backend_post_process_headers): Likewise.
* elf64-hppa.c (elf_backend_post_process_headers): Likewise.
* elf64-ppc.c (elf_backend_post_process_headers): Likewise.
* elf64-sparc.c (elf_backend_post_process_headers): Likewise.
* elf64-x86-64.c (elf_backend_post_process_headers): Likewise.
*  (elf_backend_post_process_headers): Likewise.
*  (elf_backend_post_process_headers): Likewise.
* elf32-i386.c (elf_backend_post_process_headers): Don't
define as _bfd_elf_set_osabi.
(elf_i386_fbsd_post_process_headers): Updated.
* elf32-mips.c (elf_fbsd_post_process_headers): Removed.
(elf_backend_post_process_headers): Likewise.
* elf32-tic6x.c (elf32_tic6x_set_osabi): Removed.
(elf_backend_post_process_headers): Likewise.
* elf64-mips.c (elf_fbsd_post_process_headers): Removed.
(elf_backend_post_process_headers): Likewise.
* elfn32-mips.c (elf_fbsd_post_process_headers): Removed.
(elf_backend_post_process_headers): Likewise.
* elfnn-aarch64.c (elfNN_aarch64_post_process_headers): Updated.
* elfxx-target.h (elf_backend_post_process_headers): Default
to _bfd_elf_post_process_headers.

10 years ago"tfind" across unavailable-stack frames.
Pedro Alves [Tue, 17 Dec 2013 20:47:36 +0000 (20:47 +0000)]
"tfind" across unavailable-stack frames.

Like when stepping, the current stack frame location is expected to be
printed as result of tfind command, if that results in moving to a
different function.  In tfind_1 we see:

  if (from_tty
      && (has_stack_frames () || traceframe_number >= 0))
    {
      enum print_what print_what;

      /* NOTE: in imitation of the step command, try to determine
         whether we have made a transition from one function to
         another.  If so, we'll print the "stack frame" (ie. the new
         function and it's arguments) -- otherwise we'll just show the
         new source line.  */

      if (frame_id_eq (old_frame_id,
                       get_frame_id (get_current_frame ())))
        print_what = SRC_LINE;
      else
        print_what = SRC_AND_LOC;

      print_stack_frame (get_selected_frame (NULL), 1, print_what, 1);
      do_displays ();
    }

However, when we haven't collected any registers in the tracepoint
(collect $regs), that doesn't actually work:

 (gdb) tstart
 (gdb) info tracepoints
 Num     Type           Disp Enb Address    What
 1       tracepoint     keep y   0x080483b7 in func0
                                            at ../.././../git/gdb/testsuite/gdb.trace/circ.c:28
         collect testload
     installed on target
 2       tracepoint     keep y   0x080483bc in func1
                                            at ../.././../git/gdb/testsuite/gdb.trace/circ.c:32
         collect testload
     installed on target
 (gdb) c
 Continuing.

 Breakpoint 3, end () at ../.././../git/gdb/testsuite/gdb.trace/circ.c:72
 72    }
 (gdb) tstop
 (gdb) tfind start
 Found trace frame 0, tracepoint 1
 #0  func0 () at ../.././../git/gdb/testsuite/gdb.trace/circ.c:28
 28    }
 (gdb) tfind
 Found trace frame 1, tracepoint 2
 32    }
 (gdb)

When we don't have info about the stack available
(UNWIND_UNAVAILABLE), frames end up with outer_frame_id as frame ID.
And in the scenario above, the issue is that both frames before and
after the second tfind (the frames for func0 an func1) have the same
id (outer_frame_id), so the frame_id_eq check returns false, even
though the frames were of different functions.  GDB knows that,
because the PC is inferred from the tracepoint's address, even if no
registers were collected.

To fix this, this patch adds support for frame ids with a valid code
address, but <unavailable> stack address, and then makes the unwinders
use that instead of the catch-all outer_frame_id for such frames.  The
frame_id_eq check in tfind_1 then automatically does the right thing
as expected.

I tested with --directory=gdb.trace/ , before/after the patch, and
compared the resulting gdb.logs, then adjusted the tests to expect the
extra output that came out.  Turns out that was only circ.exp, the
original test that actually brought this issue to light.

Tested on x86_64 Fedora 17, native and gdbserver.

gdb/
2013-12-17  Pedro Alves  <palves@redhat.com>

* frame.h (enum frame_id_stack_status): New enum.
(struct frame_id) <stack_addr>: Adjust comment.
<stack_addr_p>: Delete field, replaced with ...
<stack_status>: ... this new field.
(frame_id_build_unavailable_stack): Declare.
* frame.c (frame_addr_hash, fprint_field, outer_frame_id)
(frame_id_build_special): Adjust.
(frame_id_build_unavailable_stack): New function.
(frame_id_build, frame_id_build_wild): Adjust.
(frame_id_p, frame_id_eq, frame_id_inner): Adjust to take into
account frames with unavailable stack.

* amd64-tdep.c (amd64_frame_this_id)
(amd64_sigtramp_frame_this_id, amd64_epilogue_frame_this_id): Use
frame_id_build_unavailable_stack.
* dwarf2-frame.c (dwarf2_frame_this_id): Likewise.
* i386-tdep.c (i386_frame_this_id, i386_epilogue_frame_this_id)
(i386_sigtramp_frame_this_id):  Likewise.

gdb/testsuite/
2013-12-17  Pedro Alves  <palves@redhat.com>

* gdb.trace/circ.exp: Expect frame info to be printed when
switching between frames with unavailable stack, but different
functions.

10 years agoUse _bfd_elf_copy_private_bfd_data
H.J. Lu [Tue, 17 Dec 2013 19:48:18 +0000 (11:48 -0800)]
Use _bfd_elf_copy_private_bfd_data

PR binutils/16318
* elf32-arm.c (elf32_arm_copy_private_bfd_data): Call
_bfd_elf_copy_private_bfd_data.
* elf32-bfin.c (bfin_elf_copy_private_bfd_data): Removed.
(elf32_bfinfdpic_copy_private_bfd_data): Likewise.
(bfd_elf32_bfd_copy_private_bfd_data): Don't define.
* elf32-frv.c (frv_elf_copy_private_bfd_data): Removed.
(elf32_frvfdpic_copy_private_bfd_data): Likewise.
(bfd_elf32_bfd_copy_private_bfd_data): Don't define.
* elf32-iq2000.c (iq2000_elf_copy_private_bfd_data): Removed.
(bfd_elf32_bfd_copy_private_bfd_data): Don't define.
* elf32-lm32.c (lm32_elf_copy_private_bfd_data): Removed.
(lm32_elf_fdpic_copy_private_bfd_data): Call
_bfd_elf_copy_private_bfd_data.
* elf32-mep.c (mep_elf_copy_private_bfd_data): Removed.
(bfd_elf32_bfd_copy_private_bfd_data): Don't define.
* elf32-msp430.c (elf32_msp430_copy_private_bfd_data): Removed.
(bfd_elf32_bfd_copy_private_bfd_data): Don't define.
* elf32-mt.c (mt_elf_copy_private_bfd_data): Removed.
(bfd_elf32_bfd_copy_private_bfd_data): Don't define.
* elf32-sh.c (sh_elf_set_private_flags): Removed.
(sh_elf_copy_private_data): Call _bfd_elf_copy_private_bfd_data
and sh_elf_set_mach_from_flags.
*  elfnn-aarch64.c (elfNN_aarch64_copy_private_bfd_data): Removed.
(bfd_elfNN_bfd_copy_private_bfd_data): Don't define.

10 years agoRename index to indx
H.J. Lu [Tue, 17 Dec 2013 18:10:16 +0000 (10:10 -0800)]
Rename index to indx

* peXXigen.c (rsrc_process_section): Rename index to indx.

10 years agoConvert the unavailable vector to be bit, not byte, based.
Andrew Burgess [Tue, 17 Dec 2013 17:18:44 +0000 (17:18 +0000)]
Convert the unavailable vector to be bit, not byte, based.

  https://sourceware.org/ml/gdb-patches/2013-12/msg00144.html

The vector of unavailable parts of a value is currently byte based.  Given
that we can model a value down to the bit level, we can potentially loose
information with the current implementation.  After this patch we model the
unavailable information in bits.

gdb/ChangeLog

* dwarf2loc.c (read_pieced_value): Mark bits, not bytes
unavailable, use correct bit length.
* value.c (struct value): Extend comment on unavailable to
indicate that it is bit based.
(value_bits_available): New function.
(value_bytes_available): Call value_bits_available.
(value_entirely_available): Check against the bit length, not byte
length.
(mark_value_bits_unavailable): New function.
(mark_value_bytes_unavailable): Move contents to
mark_value_bits_unavailable, call to same.
(memcmp_with_bit_offsets): New function.
(value_available_contents_bits_eq): New function, takes the
functionality from value_available_contents_eq but uses
memcmp_with_bit_offsets now, and is bit not byte based.
(value_available_contents_eq): Move implementation into
value_available_contents_bits_eq, call to same.
(value_contents_copy_raw): Work on bits, not bytes.
(unpack_value_bits_as_long_1): Check availability in bits, not
bytes.
* value.h (value_bits_available): Declare new function.
(mark_value_bits_unavailable): Declare new function.

gdb/testsuite/ChangeLog

* gdb.trace/unavailable-dwarf-piece.c: New file.
* gdb.trace/unavailable-dwarf-piece.exp: New file.

10 years agoProperly handle ljmp/lcall with invalid MODRM byte
Michael Zolotukhin [Tue, 17 Dec 2013 17:06:57 +0000 (09:06 -0800)]
Properly handle ljmp/lcall with invalid MODRM byte

gas/testsuite/

2013-12-17  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>

* gas/i386/disassem.s: New.
* gas/i386/disassem.d: Likewise.
* gas/i386/x86-64-disassem.s: Likewise.
* gas/i386/x86-64-disassem.d: Likewise.
* gas/i386/i386.exp: Run disassem and x86-64-disassem.

opcodes/

2013-12-17  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>

* i386-dis.c (MOD_FF_REG_3): New.
(MOD_FF_REG_5): Likewise.
(mod_table): Add MOD_FF_REG_3 and MOD_FF_REG_5.
(reg_table): Use MOD_FF_REG_3 and MOD_FF_REG_5.

10 years ago * peXXigen.c: Include wchar.h if available.
Nick Clifton [Tue, 17 Dec 2013 15:39:13 +0000 (15:39 +0000)]
* peXXigen.c: Include wchar.h if available.
Include safe-ctype.h.
(HighBitSet, SetHighBit, WithoutHighBit): New macros.
(pe_print_resource_entries): Rename to
rsrc_print_resource_entries.  Handle names that are not RVAs.
(pe_print_resource_directory): Rename to
rsrc_print_resource_directory.
(pe_print_rsrc): Rename to rsrc_print_section.  Corrupt
computation of RVA bias.
(rsrc_count_entries): New function.
(rsrc_count_directory): New function.
(rsrc_parse_entry): New function.
(rsrc_parse_entries): New function.
(rsrc_parse_directory): New function.
(rsrc_write_string): New function.
(rsrc_compute_rva): New function.
(rsrc_write_leaf): New function.
(rsrc_write_entry): New function.
(rsrc_write_directory): New function.
(u16_mbtouc): New function.
(rsrc_cmp): New function.
(rsrc_print_name): New function.
(rsrc_resource_name): New function.
(rsrc_merge_string_entries): New function.
(rsrc_sort_entries): New function.
(rsrc_attach_chain): New function.
(rsrc_merge): New function.
(rsrc_process_section): New function - merges the contents of a
.rsrc section.
(_bfd_XXi_final_link_postscript): Call rsrc_process_section.
* configure.in (AC_CHECK_HEADERS): Add wchar.h
* config.in: Regenerate.
* configure: Regenerate.

10 years agodaily update
Alan Modra [Mon, 16 Dec 2013 23:00:38 +0000 (09:30 +1030)]
daily update

10 years ago Fix compilation error for cygwin native build.
Pierre Muller [Mon, 16 Dec 2013 22:44:43 +0000 (23:44 +0100)]
    Fix compilation error for cygwin native build.
        * windows-nat.c (windows_ensure_ntdll_loaded) [__USEWIDE]:
        Call wcstombs.

10 years ago* configure.ac: Add user-friendly check for native x86_64-linux multilibs. * configur...
fxcoudert [Fri, 13 Dec 2013 21:42:02 +0000 (21:42 +0000)]
* configure.ac: Add user-friendly check for native x86_64-linux multilibs. * configure: Regenerate.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205975 138bc75d-0d04-0410-961f-82ee72b054a4

10 years agoAdd support to show the symbolic names of the MIPS CP1 registers.
Andrew Bennett [Mon, 16 Dec 2013 16:39:47 +0000 (16:39 +0000)]
Add support to show the symbolic names of the MIPS CP1 registers.

2013-12-16  Andrew Bennett  <andrew.bennett@imgtec.com>

gas/testsuite/gas/mips/
* mips.exp: Add CP1 register name tests.
* cp1-names-mips32.d: New test.
* cp1-names-mips32r2.d: New test.
* cp1-names-mips64.d: New test.
* cp1-names-mips64r2.d: New test.
* cp1-names-numeric.d: New test.
* cp1-names-r3000.d: New test.
* cp1-names-r4000.d: New test.
* cp1-names-sb1.d: New test.
* cp1-names.s: New test.
* micromips-insn32.d: Add the correct symbolic names for the CP1
registers.
* micromips-noinsn32.d: Likewise.
* micromips-trap.d: Likewise.
* micromips.d: Likewise.

opcodes/
* mips-dis.c: Add mips_cp1_names pointer.
(mips_cp1_names_numeric): New array.
(mips_cp1_names_mips3264): New array.
(mips_arch_choice): Add cp1_names.
(mips_arch_choices): Add relevant cp1 register name array to each of
the elements.
(set_default_mips_dis_options): Add support for setting up the
mips_cp1_names pointer.
(parse_mips_dis_option): Add support for the cp1-names command line
variable.  Also setup the mips_cp1_names pointer.
(print_reg): Print out name of the cp1 register.

10 years agoFix missing newline in error message
Andreas Schwab [Mon, 16 Dec 2013 16:22:14 +0000 (17:22 +0100)]
Fix missing newline in error message

* elf64-ppc.c (ppc64_elf_relocate_section): Add newline to error
message.

10 years agoRange of element index is too large on MIPS MSA element selection instructions.
Andrew Bennett [Mon, 16 Dec 2013 15:19:34 +0000 (07:19 -0800)]
Range of element index is too large on MIPS MSA element selection instructions.

The element index range for the following MIPS MSA instructions: sldi, splati,
copy_s, copy_u, insert and insve is 1 bit too large.  This patch fixes this issue.

ChangeLog:

gas/testsuite/gas/mips/
* msa.s: Reduced maximum element index range for sldi, splati,
copy_s, copy_u, insert and insve instructions.
* msa64.s: Likewise.
* micromips@msa.d: Likewise.
* micromips@msa64.d: Likewise.
* msa.d: Likewise.
* msa64.d: Likewise.

include/opcode/
* mips.h: Updated description of +o, +u, +v and +w for MIPS and
microMIPS.

opcodes/
* micromips-opc.c (decode_micromips_operand): Reduced range of +o, +u,
+v and +w.
(micromips_opcodes): Reduced element index range for sldi, splati,
copy_s, copy_u, insert and insve instructions.
* opcodes/mips-opc.c (decode_mips_operand): Reduced range of +o, +u,
+v and +w.
(mips_builtin_opcodes): Reduced element index range for sldi, splati,
copy_s, copy_u, insert and insve instructions.

10 years agoPR 16329: remote debugging broken on Solaris.
Pedro Alves [Mon, 16 Dec 2013 14:04:52 +0000 (14:04 +0000)]
PR 16329: remote debugging broken on Solaris.

Like on GNU/Linux (linux-thread-db.c), the Solaris solaris-threads
target (handles libthread_db.so) shouldn't be pushed when remote
debugging.

This uses the same predicate used by linux-thread-db.c.

gdb/
2013-12-16  Pedro Alves  <palves@redhat.com>

PR 16329
* sol-thread.c (check_for_thread_db): If the target can't run or
isn't a core, return without pushing.

10 years agodaily update
Alan Modra [Sun, 15 Dec 2013 23:00:37 +0000 (09:30 +1030)]
daily update

10 years agoRevert "Do not overwrite so_list's so_name in solib_map_sections"
Joel Brobecker [Fri, 13 Dec 2013 17:21:37 +0000 (18:21 +0100)]
Revert "Do not overwrite so_list's so_name in solib_map_sections"

This reverts commit 07293be44859c607a36c313e51bec2dcdcd3c243, as it
causes an unintended change of behavior with GDB/MI's =library-loaded
events: The host-name="<path>" part of the event is now showing the
target-side path instead of the host-side path.

This revert affects Darwin and AIX systems, however, where the BFD
is either artificial or icomplete, leading to the outputt of
"info shared" not containing the information we'd like. For instance,
on Darwin, we would see:

    (top-gdb) info shared
    From                To                  Syms Read   Shared Object Library
    0x00007fff8d060de4  0x00007fff8d09ce1f  Yes (*)     i386:x86-64
    0x00007fff8af08b10  0x00007fff8b1c6f73  Yes (*)     i386:x86-64

To compensate for that, we overwrite the filename of the associated bfd.

gdb/ChangeLog:

Revert the following commit:
* solib.c (solib_map_sections): Remove code overwriting
SO->SO_NAME with the bfd's filename.

Make the following changes required after the revert above:
* solib-aix.c (solib_aix_bfd_open): Set the filename of the
returned bfd to a copy of the synthetic pathname.
* solib-darwin.c (darwin_bfd_open): Set the filename of the
returned bfd to a copy of PATHNAME.

10 years agoPerf test case: skip-prologue
Yao Qi [Fri, 22 Nov 2013 09:00:57 +0000 (17:00 +0800)]
Perf test case: skip-prologue

This patch add a perf test case on skip-prologue by inserting
breakpoints on two functions many times, in order to exercise
skip-prologue.

gdb/testsuite:

2013-12-15  Yao Qi  <yao@codesourcery.com>

* gdb.perf/skip-prologue.c: New.
* gdb.perf/skip-prologue.exp: New.
* gdb.perf/skip-prologue.py: New.

10 years agodaily update
Alan Modra [Sat, 14 Dec 2013 23:00:39 +0000 (09:30 +1030)]
daily update

10 years agoCorrect elf_merge_st_other arguments for weak symbols
Alan Modra [Sat, 14 Dec 2013 02:40:04 +0000 (13:10 +1030)]
Correct elf_merge_st_other arguments for weak symbols

* elflink.c (_bfd_elf_merge_symbol): If merging a new weak
symbol that will be skipped, we don't have a new definition.

10 years agodaily update
Alan Modra [Fri, 13 Dec 2013 23:01:01 +0000 (09:31 +1030)]
daily update

10 years ago2013-12-13 Jan-Benedict Glaw <jbglaw@lug-owl.de>
Jan-Benedict Glaw [Fri, 13 Dec 2013 16:43:59 +0000 (17:43 +0100)]
2013-12-13  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

* nds32-dis.c (mnemonic_96): Fix typo.

[BR]: https://sourceware.org/ml/binutils/2013-12/msg00184.html

10 years agonameless LOAD_DLL_DEBUG_EVENT causes ntdll.dll to be missing
Joel Brobecker [Thu, 12 Dec 2013 17:53:45 +0000 (12:53 -0500)]
nameless LOAD_DLL_DEBUG_EVENT causes ntdll.dll to be missing

This is the gdbserver-equivalent of the change made in GDB to handle
the case, in x64 windows version 2012, where the kernel produces
a LOAD_DLL_DEBUG_EVENT where the name of the associated DLL cannot
be determined at that time, and thus has to be processed later.

The visible symptom is that ntdll.dll is missing from the list of
shared libraries known to be mapped by the inferior, with other
side-effects such as failure to unwind through code provided by
that DLL (such as exception handling routines).

gdb/gdbserver/ChangeLog:

* Makefile.in (safe-ctype.o, lbasename.o): New rules.
* configure.srv: Add safe-ctype.o and lbasename.o to srv_tgtobj
for all targets that use win32-low.c.
* win32-low.c (win32_ensure_ntdll_loaded): New function.
(do_initial_child_stuff): Add call to win32_ensure_ntdll_loaded.

10 years agoDo the target-waiting within do_initial_child_stuff on Windows.
Pedro Alves [Thu, 12 Dec 2013 16:12:30 +0000 (11:12 -0500)]
Do the target-waiting within do_initial_child_stuff on Windows.

This is a preparatory patch that achieves two goals:

  . Makes the initial event handling more similar to GDB's;
  . Opens the door for implementing post-inititial-handling
    operations.

At the moment, this is only done on Windows, where the
post-initial-handling is going to be needed (in the context of
Windows 2012). And because we're close to creating the gdb 7.7
branch, making that change for all platforms is a little more
risk that we'd like. So the change is currently implemented
on Windows.

gdb/gdbserver/ChangeLog:

        * target.c (mywait): Set OURSTATUS->KIND to TARGET_WAITKIND_STOPPED
        if equal to TARGET_WAITKIND_LOADED.
        * win32-low.c (cached_status): New static global.
        (win32_wait): Add declaration.
        (do_initial_child_stuff): Flush all initial pending debug events
        up to the initial breakpoint.
        (win32_wait): If CACHED_STATUS was set, return that instead
        of doing a real wait.  Remove the code resuming the execution
        of the inferior after receiving a TARGET_WAITKIND_LOADED event
        during the initial phase.  Also remove the code changing
        OURSTATUS->KIND from TARGET_WAITKIND_LOADED to
        TARGET_WAITKIND_STOPPED.

10 years ago * config/tc-msp430.c (mcu_types): Add some more 430X mcu names.
Nick Clifton [Fri, 13 Dec 2013 12:32:21 +0000 (12:32 +0000)]
* config/tc-msp430.c (mcu_types): Add some more 430X mcu names.
(OPTION_INTR_NOPS): Define.
(gen_interrupt_nops): Default to FALSE.
(md_parse_opton): Add support for OPTION_INTR_NOPS.
(md_longopts): Add -mn.
(md_show_usage): Add -mn.
(msp430_operands): Generate NOPs for all MCUs not just 430Xv2.
* doc/c-msp430.c: Document -mn.

10 years ago * lib/ld-lib.exp (default_ld_link): Use ldflags from board description
Vidya Praveen [Fri, 13 Dec 2013 12:02:26 +0000 (12:02 +0000)]
* lib/ld-lib.exp (default_ld_link): Use ldflags from board description
file.
(default_ld_simple_link): Likewise.
(default_ld_compile): Use cflags from board description file.

10 years agoAdd support for Andes NDS32:
Kuan-Lin Chen [Fri, 13 Dec 2013 11:52:32 +0000 (11:52 +0000)]
Add support for Andes NDS32:

BFD:
* Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Add nds32
files.
* Makefile.in: Regenerate.
* archures.c (bfd_nds32_arch): Add nds32 target.
* bfd-in2.h: Regenerate.
* config.bfd (nds32*le-*-linux): Add bfd_elf32_nds32lelin_vec
and bfd_elf32_nds32belin_vec.
(nds32*be-*-linux*): Likewise.
(nds32*le-*-*): Add bfd_elf32_nds32le_vec and bfd_elf32_nds32be_vec.
(nds32*be-*-*): Likewise.
* configure.in (bfd_elf32_nds32be_vec): Add elf32-nds32.lo.
(bfd_elf32_nds32le_vec): Likewise.
(bfd_elf32_nds32belin_vec): Likewise.
(bfd_elf32_nds32lelin_vec): Likewise.
* configure: Regenerate.
* cpu-nds32.c: New file for nds32.
* elf-bfd.h: Add NDS32_ELF_DATA.
* elf32-nds32.c: New file for nds32.
* elf32-nds32.h: New file for nds32.
* libbfd.h: Regenerate.
* reloc.c: Add relocations for nds32.
* targets.c (bfd_elf32_nds32be_vec): New declaration for nds32.
(bfd_elf32_nds32le_vec): Likewise.
(bfd_elf32_nds32belin_vec): Likewise.
(bfd_elf32_nds32lelin_vec): Likewise.

BINUTILS:
* readelf.c: Include elf/nds32.h
(guess_is_rela): Add case for EM_NDS32.
(dump_relocations): Add case for EM_NDS32.
(decode_NDS32_machine_flags): New.
(get_machine_flags): Add case for EM_NDS32.
(is_32bit_abs_reloc): Likewise.
(is_16bit_abs_reloc): Likewise.
(process_nds32_specific): New.
(process_arch_specific): Add case for EM_NDS32.
* NEWS: Announce Andes nds32 support.
* MAINTAINERS: Add nds32 maintainers.
  TESTSUITE:
* binutils-all/objdump.exp: Add NDS32 cpu.
* binutils-all/readelf.r: Skip extra reloc created by NDS32.

GAS:
* Makefile.am (TARGET_CPU_CFILES): Add config/tc-nds32.c.
(TARGET_CPU_HFILES): Add config/tc-nds32.h.
* Makefile.in: Regenerate.
* configure.in (nds32): Add nds32 target extension config support.
* configure.tgt : Add case for nds32-*-elf* and nds32-*-linux*.
* configure: Regenerate.
* config/tc-nds32.c: New file for nds32.
* config/tc-nds32.h: New file for nds32.
* doc/Makefile.am (CPU_DOCS): Add c-nds32.texi.
* doc/Makefile.in: Regenerate.
* doc/as.texinfo: Add nds32 options.
* doc/all.texi: Set NDS32.
* doc/c-nds32.texi: New file dor nds32 document.
* NEWS: Announce Andes nds32 support.
  TESTSUITE:
* gas/all/gas.exp: Add expected failures for NDS32.
* gas/elf/elf.exp: Likewise.
* gas/lns/lns.exp: Use alternate test.
* gas/macros/irp.d: Skip for NDS32.
* gas/macros/macros.exp: Skip some tests for the NDS32.
* gas/macros/rept.d: Skip for NDS32.
* gas/macros/test3.d: Skip for NDS32.
* gas/nds32: New directory.
* gas/nds32/alu-1.s: New test.
* gas/nds32/alu-1.d: Likewise.
* gas/nds32/alu-2.s: Likewise.
* gas/nds32/alu-2.d: Likewise.
* gas/nds32/br-1.d: Likewise.
* gas/nds32/br-1.s: Likewise.
* gas/nds32/br-2.d: Likewise.
* gas/nds32/br-2.s: Likewise.
* gas/nds32/ji-jr.d: Likewise.
* gas/nds32/ji-jr.s: Likewise.
* gas/nds32/ls.d: Likewise.
* gas/nds32/ls.s: Likewise.
* gas/nds32/lsi.d: Likewise.
* gas/nds32/lsi.s: Likewise.
* gas/nds32/to-16bit-v1.d: Likewise.
* gas/nds32/to-16bit-v1.s: Likewise.
* gas/nds32/to-16bit-v2.d: Likewise.
* gas/nds32/to-16bit-v2.s: Likewise.
* gas/nds32/to-16bit-v3.d: Likewise.
* gas/nds32/to-16bit-v3.s: Likewise.
* gas/nds32/nds32.exp: New test driver.

LD:
* Makefile.am (ALL_EMULATION_SOURCES): Add nds32 target.
* Makefile.in: Regenerate.
* configure.tgt: Add case for nds32*le-*-elf*, nds32*be-*-elf*,
nds32*le-*-linux-gnu*, and nds32*be-*-linux-gnu*.
* emulparams/nds32belf.sh: New file for nds32.
* emulparams/nds32belf_linux.sh: Likewise.
* emulparams/nds32belf16m.sh: Likewise.
* emulparams/nds32elf.sh: Likewise.
* emulparams/nds32elf_linux.sh: Likewise.
* emulparams/nds32elf16m.sh: Likewise.
* emultempl/nds32elf.em: Likewise.
* scripttempl/nds32elf.sc}: Likewise.
* gen-doc.texi: Set NDS32.
* ld.texinfo: Set NDS32.
* NEWS: Announce Andes nds32 support.
  TESTSUITE:
* lib/ld-lib.exp: Add NDS32 to list of targets that do not support
shared library generation.
* ld-nds32: New directory.
* ld-nds32/branch.d: New test.
* ld-nds32/branch.ld: New test.
* ld-nds32/branch.s: New test.
* ld-nds32/diff.d: New test.
* ld-nds32/diff.ld: New test.
* ld-nds32/diff.s: New test.
* ld-nds32/gp.d: New test.
* ld-nds32/gp.ld: New test.
* ld-nds32/gp.s: New test.
* ld-nds32/imm.d: New test.
* ld-nds32/imm.ld: New test.
* ld-nds32/imm.s: New test.
* ld-nds32/imm_symbol.s: New test.
* ld-nds32/relax_jmp.d: New test.
* ld-nds32/relax_jmp.ld: New test.
* ld-nds32/relax_jmp.s: New test.
* ld-nds32/relax_load_store.d: New test.
* ld-nds32/relax_load_store.ld: New test.
* ld-nds32/relax_load_store.s: New test.
* ld-nds32/nds32.exp: New file.

OPCODES:
* Makefile.am (TARGET_LIBOPCODES_CFILES): Add nds32-asm.c
and nds32-dis.c.
* Makefile.in: Regenerate.
* configure.in: Add case for bfd_nds32_arch.
* configure: Regenerate.
* disassemble.c (ARCH_nds32): Define.
* nds32-asm.c: New file for nds32.
* nds32-asm.h: New file for nds32.
* nds32-dis.c: New file for nds32.
* nds32-opc.h: New file for nds32.

INCLUDE:
* dis-asm.h (print_insn_nds32): Add nds32 target.
* elf/nds32.h: New file for nds32.
* opcode/nds32.h: New file for nds32.

10 years agowrong dimension found in ada-lang.c:ada_array_bound_from_type
Joel Brobecker [Wed, 27 Nov 2013 13:42:24 +0000 (17:42 +0400)]
wrong dimension found in ada-lang.c:ada_array_bound_from_type

This function has the following code:

  elt_type = type;
  for (i = n; i > 1; i--)
    elt_type = TYPE_TARGET_TYPE (type);

For multi-dimension arrays, the code above tries to find the array
type corresponding to the dimension we're trying to inspect.
The problem is that, past the second dimension, the loop does
nothing other than repeat the first iteration. There is a little
thinko where it got the TYPE_TARGET_TYPE of TYPE instead of ELT_TYPE!

To my surprise, I was unable to produce an Ada exemple that demonstrated
the problem.  That's because the examples I created all trigger a parallel
___XA type which we then use in place of the ELT_TYPE in order to
determine the bounds - see the code that immediately follows our
loop above:

    index_type_desc = ada_find_parallel_type (type, "___XA");
    ada_fixup_array_indexes_type (index_type_desc);
    if (index_type_desc != NULL)
    [...]

So, in order to avoid depending on an Ada example where the compiler
can potentially decide one way or the other, I decided to use an
artificial example, written in C. With ...

  int multi[1][2][3];

... forcing the language to Ada, and trying to print the 'last,
we get:

    (gdb) p multi'last(1)
    $1 = 0
    (gdb) p multi'last(2)
    $2 = 1
    (gdb) p multi'last(3)
    $3 = 1   <<<---  This should be 2!

Additionally, I noticed that a couple of check_typedef's were missing.
This patch adds them. And since the variable in question only gets
used within an "else" block, I moved the variable declaration and
use inside that block - making it clear what the scope of the variable
is.

gdb/ChangeLog:

        * ada-lang.c (ada_array_bound_from_type): Move the declaration
        and assignment of variable "elt_type" inside the else block
        where it is used.  Add two missing check_typedef calls.
        Fix bug where we got TYPE's TYPE_TARGET_TYPE, where in fact
        we really wanted to get ELT_TYPE's TYPE_TARGET_TYPE.

gdb/testsuite/ChangeLog:

        * gdb.ada/arraydim: New testcase.

10 years agoSmall style violation fix in ada_array_bound_from_type
Joel Brobecker [Wed, 27 Nov 2013 13:54:43 +0000 (17:54 +0400)]
Small style violation fix in ada_array_bound_from_type

gdb/ChangeLog:

        * ada-lang.c (ada_array_bound_from_type): Remove unwanted space
        between 'struct type *' and 'arr_type'.

10 years ago2013-12-12 Siva Chandra Reddy <sivachandra@google.com>
Siva Chandra [Thu, 12 Dec 2013 23:18:27 +0000 (15:18 -0800)]
2013-12-12  Siva Chandra Reddy  <sivachandra@google.com>

PR python/16113
* NEWS (Python Scripting): Add entry for the new feature and the
new attribute of gdb.Field objects.
* python/py-type.c (gdbpy_is_field): New function
(convert_field): Add 'parent_type' attribute to gdb.Field
objects.
* python/py-value.c (valpy_getitem): Allow subscript value to be
a gdb.Field object.
(value_has_field): New function
(get_field_flag): New function
* python/python-internal.h (gdbpy_is_field): Add declaration.

testsuite/
* gdb.python/py-value-cc.cc: Improve test case.
* gdb.python/py-value-cc.exp: Add new tests to test usage of
gdb.Field objects as subscripts on gdb.Value objects.

doc/
* gdb.texinfo (Values From Inferior): Add a note about using
gdb.Field objects as subscripts on gdb.Value objects.
(Types In Python): Add description about the new attribute
"parent_type" of gdb.Field objects.

10 years agodaily update
Alan Modra [Thu, 12 Dec 2013 23:00:37 +0000 (09:30 +1030)]
daily update

10 years agoAlso copy EI_OSABI field
H.J. Lu [Thu, 12 Dec 2013 22:41:15 +0000 (14:41 -0800)]
Also copy EI_OSABI field

bfd/

PR binutils/16318
* elf.c (_bfd_elf_copy_private_bfd_data): Remove BFD_ASSERT.
Set e_flags only if elf_flags_init is FALSE.  Copy EI_OSABI
field.

binutils/testsuite/

PR binutils/16318
* binutils-all/strip-10.d: Check OS/ABI.

10 years agoRemove bfd_elf32_bfd_set_private_bfd_flags
H.J. Lu [Thu, 12 Dec 2013 22:24:03 +0000 (14:24 -0800)]
Remove bfd_elf32_bfd_set_private_bfd_flags

* elf32-sh.c (bfd_elf32_bfd_set_private_bfd_flags): Removed.

10 years agoAdd "#..."
H.J. Lu [Thu, 12 Dec 2013 21:48:54 +0000 (13:48 -0800)]
Add "#..."

* ld-elf/ehdr_start-userdef.d: Add "#...".

10 years agoAdd @cindex for section documenting the -list-features GDB/MI command.
Joel Brobecker [Tue, 10 Dec 2013 11:51:38 +0000 (12:51 +0100)]
Add @cindex for section documenting the -list-features GDB/MI command.

gdb/doc/ChangeLog:

        * gdb.texinfo (GDB/MI Miscellaneous Commands): Add @cindex
        entry for section docuumenting the -list-features GDB/MI command.

10 years agoSet ET_EXEC for -pie -Ttext-segment=
H.J. Lu [Thu, 12 Dec 2013 15:41:27 +0000 (07:41 -0800)]
Set ET_EXEC for -pie -Ttext-segment=

bfd/

* elf.c (assign_file_positions_except_relocs): Set e_type in ELF
header to ET_EXEC for -pie -Ttext-segment=.

2013-12-10  H.J. Lu  <hongjiu.lu@intel.com>

* ld-pie/vaddr-0.d: New file.
* ld-pie/vaddr-1.d: Likewise.
* ld-pie/vaddr.s: Likewise.

10 years agobreakpoint.c:insert_bp_location: Constify local.
Pedro Alves [Thu, 12 Dec 2013 10:44:42 +0000 (10:44 +0000)]
breakpoint.c:insert_bp_location: Constify local.

gdb/
2013-12-12  Pedro Alves  <palves@redhat.com>

* breakpoint.c (insert_bp_location): Make 'hw_bp_err_string' local
const, and remove casts.

10 years agoEliminate UNSUPPORTED_ERROR.
Pedro Alves [Wed, 11 Dec 2013 09:49:08 +0000 (09:49 +0000)]
Eliminate UNSUPPORTED_ERROR.

I have a case that could use an exception for "unsupported feature".
I found UNSUPPORTED_ERROR, but looking deeper, I think as is, reusing
it for other things would be fragile.  E.g., if the Python script
sourced by source_script_from_stream triggers any other missing
functionality that would result in UNSUPPORTED_ERROR being propagated
out to source_script_from_stream, that would confuse the error for
Python not being built into GDB.

This patch thus redoes things a little.  Instead of using an exception
for the "No Python" scenario, check whether Python is configured in
before actually trying to source the file.  It adds a new function
instead of using #ifdef HAVE_PYTHON directly, as that is better at
avoiding bitrot, as both Python and !Python paths are visible to the
compiler this way.

Tested on Fedora 17, with and without Python.

gdb/
2013-12-12  Pedro Alves  <palves@redhat.com>

* cli/cli-cmds.c (source_script_from_stream) Use have_python
instead of catching UNSUPPORTED_ERROR.
* exceptions.h (UNSUPPORTED_ERROR): Delete.
* python/python.c (source_python_script) [!HAVE_PYTHON]: Internal
error if called.
* python/python.h (have_python): New static inline function.

10 years ago * dwarf2read.c (lookup_dwo_cutu): Include name of dwp file in
Doug Evans [Wed, 11 Dec 2013 23:52:12 +0000 (15:52 -0800)]
* dwarf2read.c (lookup_dwo_cutu): Include name of dwp file in
"can't find DWO" warning.

10 years agodaily update
Alan Modra [Wed, 11 Dec 2013 23:00:48 +0000 (09:30 +1030)]
daily update

10 years agold/testsuite/ld-aarch64: Fixup IFUNC tests to work on all targets
Will Newton [Tue, 10 Dec 2013 22:02:05 +0000 (22:02 +0000)]
ld/testsuite/ld-aarch64: Fixup IFUNC tests to work on all targets

Make the ifunc-21 and ifunc-22 tests more generic to support
aarch64_be and ELF targets.

ld/testsuite/ChangeLog:

2013-12-11  Will Newton  <will.newton@linaro.org>

* ld-aarch64/ifunc-21.d: Make test more generic to support
aarch64_be and ELF targets.
* ld-aarch64/ifunc-22.d: Likewise.

10 years agoRemove shared object from -Ttext-segment
H.J. Lu [Wed, 11 Dec 2013 18:28:02 +0000 (10:28 -0800)]
Remove shared object from -Ttext-segment

* ld.texinfo: Remove shared object from -Ttext-segment.

10 years agoAdd a test for --as-needed with symbol versioning
H.J. Lu [Wed, 11 Dec 2013 16:00:34 +0000 (08:00 -0800)]
Add a test for --as-needed with symbol versioning

* ld-elf/shared.exp (build_tests): Add libneeded2a.so,
libneeded2b.so, libneeded2c.o and needed2.

* ld-elf/needed2.ver: New file.
* ld-elf/needed2a.c: Likewise.
* ld-elf/needed2b.c: Likewise.
* ld-elf/needed2c.c: Likewise.

10 years agoSanitize access to gdbarch on the SDT probe API (and fix ARM bug)
Sergio Durigan Junior [Wed, 11 Dec 2013 01:53:25 +0000 (23:53 -0200)]
Sanitize access to gdbarch on the SDT probe API (and fix ARM bug)

This patch sanitizes the access to gdbarch made by various functions of
the SDT probe API.  Before this patch, gdbarch was being accessed via
the probe's objfile; however, this proved to cause a bug on 32-bit ARM
targets because during the parsing of the probe's arguments the code
needed to access some pseudo-registers of the architecture, and this
information is not fully correct on the objfile's gdbarch.

Basically, the approach taken was to instead pass the current/selected
frame to the parsing and evaluation functions, so that they can extract
the gdbarch directly from the frame.  It solved the ARM bug reported
above, and also contributed to make the API cleaner.

Tested on x86_64 and 32-bit ARM.

2013-12-11  Sergio Durigan Junior  <sergiodj@redhat.com>

* break-catch-throw.c (fetch_probe_arguments): Pass selected frame
to get_probe_argument_count and evaluate_probe_argument.
* probe.c (get_probe_argument_count): Adjust declaration to accept
frame.  Pass frame to probe_ops's get_probe_argument_count.
(evaluate_probe_argument): Likewise, for evaluate_probe_argument.
(probe_safe_evaluate_at_pc): Pass frame to
get_probe_argument_count and evaluate_probe_argument.
* probe.h (struct probe_ops) <get_probe_argument_count,
evaluate_probe_argument>: Adjust declarations to accept frame.
(get_probe_argument_count, evaluate_probe_argument): Likewise.
* solib-svr4.c (solib_event_probe_action): Get current frame.
Pass it to get_probe_argument_count.
(svr4_handle_solib_event): Get current frame.  Pass it to
get_probe_argument_count and evaluate_probe_argument.
* stap-probe.c (stap_parse_probe_arguments): Adjust declaration to
accept gdbarch.  Do not obtain it from the probe's objfile.
(stap_get_probe_argument_count): Adjust declaration to accept
frame.  Obtain gdbarch from the frame.  Call generic
can_evaluate_probe_arguments.  Pass gdbarch to
stap_parse_probe_arguments.
(stap_get_arg): Adjust declaration to accept gdbarch.  Pass it to
stap_parse_probe_arguments.
(stap_evaluate_probe_argument): Adjust declaration to accept
frame.  Obtain gdbarch from the frame.  Pass gdbarch to
stap_get_arg.
(stap_compile_to_ax): Pass agent_expr's gdbarch to stap_get_arg.
(compute_probe_arg): Obtain gdbarch from frame.  Pass frame to
get_probe_argument_count and evaluate_probe_argument.

10 years agoFix a bug in matching notifications.
Yao Qi [Tue, 10 Dec 2013 13:59:20 +0000 (21:59 +0800)]
Fix a bug in matching notifications.

Due to copy-n-paste, the problem caused PR remote/15974 also exists
in gdbserver.  This patch fixes it in the same way.  Patch to fix
remote/15974 can be found:

  https://sourceware.org/ml/gdb-patches/2013-12/msg00014.html

gdb/gdbserver:

2013-12-11  Yao Qi  <yao@codesourcery.com>

* notif.c (handle_notif_ack): Return 0 if no notification
matches.

10 years agoadd missing PR# to previous entry
Doug Evans [Wed, 11 Dec 2013 00:21:41 +0000 (16:21 -0800)]
add missing PR# to previous entry

10 years agoPR 16286
Doug Evans [Wed, 11 Dec 2013 00:20:08 +0000 (16:20 -0800)]
PR 16286

* c-lang.c (c_get_string): Ignore the declared size of the object
if a specific length is requested.

testsuite/
* gdb.python/py-value.c: #include stdlib.h, string.h.
(str): New struct.
(main): New local xstr.
* gdb.python/py-value.exp (test_value_in_inferior): Add test to
fetch a value as a string with a length beyond the declared length
of the array.

10 years agoDelete interp_exec_p.
Doug Evans [Wed, 11 Dec 2013 00:06:53 +0000 (16:06 -0800)]
Delete interp_exec_p.

     * interps.h (interp_exec_p): Delete.
     * interps.c (interp_exec_p): Delete.
     (interp_exec): Update.  Assert interp->procs->exec_proc != NULL.
     * mi/mi-interp.c (mi_cmd_interpreter_exec): Update.

10 years agoUse $(INSTALL_PROGRAM_ENV) consistently.
Roland McGrath [Tue, 10 Dec 2013 22:01:01 +0000 (14:01 -0800)]
Use $(INSTALL_PROGRAM_ENV) consistently.

binutils/
* Makefile.am (install-exec-local): Prefix libtool invocation with
$(INSTALL_PROGRAM_ENV).
* Makefile.in: Regenerate.

gas/
* Makefile.am (install-exec-bindir): Prefix libtool invocation
with $(INSTALL_PROGRAM_ENV).
(install-exec-tooldir): Likewise.
* Makefile.in: Regenerate.

gold/
* Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
with $(INSTALL_PROGRAM_ENV).
* Makefile.in: Regenerate.

ld/
* Makefile.am (install-exec-local): Prefix libtool invocation with
$(INSTALL_PROGRAM_ENV).
* Makefile.in: Regenerate.

10 years agodaily update
Alan Modra [Tue, 10 Dec 2013 23:00:38 +0000 (09:30 +1030)]
daily update

10 years agoAdd call to get_compiler_info to gdb_compile_shlib.
Andrew Burgess [Tue, 10 Dec 2013 17:04:17 +0000 (17:04 +0000)]
Add call to get_compiler_info to gdb_compile_shlib.

    https://sourceware.org/ml/gdb-patches/2013-12/msg00374.html

gdb/testsuite/ChangeLog

* lib/gdb.exp (gdb_compile_shlib): Add call to get_compiler_info,
update comment.

10 years agoUse target_read_code in skip_prologue (amd64)
Yao Qi [Wed, 23 Oct 2013 13:49:32 +0000 (21:49 +0800)]
Use target_read_code in skip_prologue (amd64)

gdb:

2013-12-10  Yao Qi  <yao@codesourcery.com>

* amd64-tdep.c (amd64_analyze_stack_align): Call
target_read_code instead of target_read_memory.
(amd64_analyze_prologue): Call read_code_unsigned_integer
instead of read_memory_unsigned_integer.  Call read_code
instead of read_memory.
(amd64_skip_xmm_prologue): Likewise.

10 years agoUse target_read_code in skip_prologue (i386)
Yao Qi [Fri, 18 Oct 2013 09:36:11 +0000 (17:36 +0800)]
Use target_read_code in skip_prologue (i386)

GDB is able to cache memory accesses requested in target_read_code,
so target_read_code is more efficient than general target_read_memory.

This patch uses target_read_code and its variants to read target
memory in the functions related to i386_skip_prologue.  It improves
the performance when doing 'b foo' (foo is a function) in remote
debugging.

Nowadays, when we set a breakpoint on function f1, GDB will fetch the
code in f1 to determine the start of the function body (say skip the
prologue), it requests read from target many times.  With this patch
applied, the number of RSP 'm' packets are reduced.

gdb:

2013-12-10  Yao Qi  <yao@codesourcery.com>

* corefile.c (read_code): New function.
(read_code_integer): New function.
(read_code_unsigned_integer): New function.
* gdbcore.h (read_code): Declare.
(read_code_integer): Declare.
(read_code_unsigned_integer): Declare.
* i386-tdep.c (i386_follow_jump): Call target_read_code instead
of target_read_memory.  Call read_code_unsigned_integer instead
of read_memory_unsigned_integer.
(i386_analyze_struct_return): Likewise.
(i386_skip_probe): Likewise.
(i386_analyze_stack_align): Likewise.
(i386_match_pattern): Likewise.
(i386_skip_noop): Likewise.
(i386_analyze_frame_setup): Likewise.
(i386_analyze_register_saves): Likewise.
(i386_skip_prologue): Likewise.
(i386_skip_main_prologue): Likewise.
(i386_frame_cache_1): Likewise.

10 years agoInvalidate target cache before starting to handle event.
Yao Qi [Wed, 4 Dec 2013 01:28:44 +0000 (09:28 +0800)]
Invalidate target cache before starting to handle event.

gdb:

2013-12-10  Yao Qi  <yao@codesourcery.com>

* infrun.c: Include "target-dcache.h".
(prepare_for_detach): Call target_dcache_invalidate.
(wait_for_inferior): Likewise.
(fetch_inferior_event): Likewise.
(infrun_thread_stop_requested_callback): Likewise.  Set
overlay_cache_invalid to 1.

10 years agoSet language for Ada minimal symbols.
Joel Brobecker [Thu, 7 Nov 2013 04:35:35 +0000 (08:35 +0400)]
Set language for Ada minimal symbols.

This helps with the following issue: Given an Ada program defining
a global variable:

    package Pck is
       Watch : Integer := 1974;
    end Pck;

When printing the address of this variable, GDB also tries to print
the associated symbol name:

    (gdb) p watch'address
    $1 = (access integer) 0x6139d8 <pck__watch>
                                       ^^
                                       ||

The problem is that GDB prints the variable's linkage name, instead
of its natural name. This is because the language of the associated
minimal symbol never really gets set.

This patch adds handling for Ada symbols in symbol_find_demangled_name.
After this patch, we now get:

    (gdb) p watch'address
    $1 = (access integer) 0x6139d8 <pck.watch>
                                       ^
                                       |

gdb/ChangeLog:

        * symtab.c (symbol_find_demangled_name): Add handling of
        Ada symbols.

gdb/testsuite/ChangeLog:

        * gdb.ada/int_deref.exp: Add test verifying that we print
        the decoded symbol name when printing the address of Ada
        symbols.

10 years agoGDB/MI: Document support for -exec-run --start in -list-features
Joel Brobecker [Tue, 3 Dec 2013 06:04:32 +0000 (10:04 +0400)]
GDB/MI: Document support for -exec-run --start in -list-features

This adds "exec-run-start-option" in the output of the -list-features
commands, allowing front-ends to easily determine whether -exec-run
supports the --start option.

gdb/ChangeLog:

        * mi/mi-main.c (mi_cmd_list_features): add "exec-run-start-option".
        * NEWS: Expand the entry documenting the new -exec-run --start
        option to mention the corresponding new entry in the output of
        "-list-features".

gdb/doc/ChangeLog:

* gdb.texinfo (GDB/MI Miscellaneous Commands): Document the new
"exec-run-start-option" entry in the output of the "-list-features"
command.

gdb/testsuite/ChangeLog:

        * gdb.mi/mi-start.exp: Add test verifying that -list-features
        contains "exec-run-start-option".

10 years agonameless LOAD_DLL_DEBUG_EVENT causes ntdll.dll to be missing
Joel Brobecker [Wed, 20 Nov 2013 17:43:20 +0000 (12:43 -0500)]
nameless LOAD_DLL_DEBUG_EVENT causes ntdll.dll to be missing

We observed on Windows 2012 that we were unable to unwind past
exception handlers. For instance, with any Ada program raising
an exception that does not get handled:

    % gnatmake -g a -bargs -shared
    % gdb a
    (gdb) start
    (gdb) catch exception unhandled
    Catchpoint 2: unhandled Ada exceptions
    (gdb) c
    Catchpoint 2, unhandled CONSTRAINT_ERROR at <__gnat_unhandled_exception> (
        e=0x645ff820 <constraint_error>) at s-excdeb.adb:53
    53      s-excdeb.adb: No such file or directory.

At this point, we can already see that something went wrong, since
the frame selected by the debugger corresponds to a runtime function
rather than the function in the user code that caused the exception
to be raised (in our case procedure A).

This is further confirmed by the fact that we are unable to unwind
all the way to procedure A:

    (gdb) bt
    #0  <__gnat_unhandled_exception> (e=0x645ff820 <constraint_error>)
        at s-excdeb.adb:53
    #1  0x000000006444e9a3 in <__gnat_notify_unhandled_exception> (excep=0x284d2
+0)
        at a-exextr.adb:144
    #2  0x00000000645f106a in __gnat_personality_imp ()
       from C:\[...]\libgnat-7.3.dll
    #3  0x000000006144d1b7 in _GCC_specific_handler (ms_exc=0x242fab0,
        this_frame=0x242fe60, ms_orig_context=0x242f5c0, ms_disp=0x242ef70,
        gcc_per=0x645f0960 <__gnat_personality_imp>)
        at ../../../src/libgcc/unwind-seh.c:289
    #4  0x00000000645f1211 in __gnat_personality_seh0 ()
       from C:\[...]\libgnat-7.3.dll
    #5  0x000007fad3879f4d in ?? ()
    Backtrace stopped: previous frame inner to this frame (corrupt stack?)

It turns out that the unwinder has been doing its job flawlessly
up until frame #5. The address in frame #5 is correct, but GDB
is not able to associate it with any symbol or unwind record.

And this is because this address is inside ntdll.dll, and when
we received the LOAD_DLL_DEBUG_EVENT for that DLL, the system
was not able to tell us the name of the library, thus causing us
to silently ignoring the event. Because GDB does not know about
ntdll.dll, it is unable to access the unwind information from it.
And because the function at that address does not use a frame
pointer, the unwinding becomes impossible.

This patch helps recovering ntdll.dll at the end of the "run/attach"
phase, simply by trying to locate that specific DLL again.

In terms of our medium to long term planning, it seems to me that
we should be able to simplify the code by ignoring LOAD_DLL_DEBUG_EVENT
during the startup phase, and modify windows_ensure_ntdll_loaded
to then detect and report all shared libraries after we've finished
inferior creation.  But for a change just before 7.7 branch creation,
I thought it was safest to just handle ntdll.dll specifically. This
is less intrusive, and ntdll is the only DLL affected by the problem
I know so far.

gdb/ChangeLog:

* windows-nat.c (handle_load_dll): Add comments.
        (windows_ensure_ntdll_loaded): New function.
(do_initial_windows_stuff): Use windows_ensure_ntdll_loaded.
        Add FIXME comment.

10 years agodaily update
Alan Modra [Mon, 9 Dec 2013 23:00:46 +0000 (09:30 +1030)]
daily update

10 years agodaily update
Alan Modra [Sun, 8 Dec 2013 23:00:52 +0000 (09:30 +1030)]
daily update

10 years agoFix gdb/ChangeLog date in last entry.
Joel Brobecker [Sun, 8 Dec 2013 08:28:10 +0000 (12:28 +0400)]
Fix gdb/ChangeLog date in last entry.

10 years agoUse gdb_produce_source
Yao Qi [Tue, 24 Sep 2013 09:52:27 +0000 (17:52 +0800)]
Use gdb_produce_source

We added a new proc gdb_produce_source recently, and it can be used
more widely in lib/gdb.exp to generate source file.

gdb/testsuite:

2013-12-08  Yao Qi  <yao@codesourcery.com>

* lib/gdb.exp (support_complex_tests): Use gdb_produce_source.
(is_elf_target, is_ilp32_target, is_ilp64_target): Likewise.
(is_64_target, is_amd64_regs_target): Likewise.
(skip_altivec_tests, skip_vsx_tests, skip_btrace_tests): Likewise.

10 years agocorrect file reference
Alan Modra [Sun, 8 Dec 2013 05:10:43 +0000 (15:40 +1030)]
correct file reference

10 years agoFix --as-needed undefined symbol references from dynamic libraries.
Alan Modra [Sun, 8 Dec 2013 04:56:12 +0000 (15:26 +1030)]
Fix --as-needed undefined symbol references from dynamic libraries.

libx.so refers to some_sym, liby.so provides some_sym@some_version
wasn't seen as satisfying the reference.

* elf64-ppc.c (_bfd_elf_add_default_symbol): Set dynamic_def
and ref_dynamic_nonweak when chaining together indirect
symbols.

10 years agoDocument the GDB 7.6.2 release in gdb/ChangeLog
Joel Brobecker [Sun, 8 Dec 2013 04:40:37 +0000 (08:40 +0400)]
Document the GDB 7.6.2 release in gdb/ChangeLog

gdb/ChangeLog:

GDB 7.6.2 released.

10 years agoAvoid "may be used uninitialized" warning
Yao Qi [Sun, 8 Dec 2013 02:34:34 +0000 (10:34 +0800)]
Avoid "may be used uninitialized" warning

Hi,
I see such warning below on one compiler I am using.

cc1: warnings being treated as errors
../../workspace/gdb/stack.c: In function 'frame_info':
../../workspace/gdb/stack.c:1519:20: error: 'caller_pc' may be used uninitialized in this function

Go through the gdb-patches archives and find the "canonical" way to
fix this warning is to initialize the variable.

gdb:

2013-12-08  Yao Qi  <yao@codesourcery.com>

* stack.c (frame_info): Initialize variable caller_pc.

10 years agodaily update
Alan Modra [Sat, 7 Dec 2013 23:00:56 +0000 (09:30 +1030)]
daily update

10 years agosim: bfin: tests: make run-tests.sh executable
Mike Frysinger [Wed, 3 Jul 2013 15:27:46 +0000 (11:27 -0400)]
sim: bfin: tests: make run-tests.sh executable

I meant for this script to be +x, but missed when doing the initial CVS
commit.  It wasn't possible to fix w/CVS, but it is w/git, so do it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-12-03  Mike Frysinger  <vapier@gentoo.org>

* run-tests.sh: Add +x file mode.

10 years agostrip off +x bits on non-executable/script files
Mike Frysinger [Wed, 4 Dec 2013 00:40:24 +0000 (19:40 -0500)]
strip off +x bits on non-executable/script files

These files are source files and have no business being +x.  We couldn't
easily fix it in CVS (you need login+write access to the raw rcs files),
but we can fix this w/git.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
10 years agogdb: testsuite: fix ksh shebang to use sh
Mike Frysinger [Wed, 4 Dec 2013 00:32:17 +0000 (19:32 -0500)]
gdb: testsuite: fix ksh shebang to use sh

These scripts use /bin/ksh, but they're dirt simple and can be used with
/bin/sh, so just change the shebang.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
10 years agodaily update
Alan Modra [Fri, 6 Dec 2013 23:46:29 +0000 (10:16 +1030)]
daily update

10 years agoFix "info frame" in the outermost frame.
Pedro Alves [Fri, 6 Dec 2013 19:48:00 +0000 (19:48 +0000)]
Fix "info frame" in the outermost frame.

Doing "info frame" in the outermost frame, when that was indicated by
the next frame saying the unwound PC is undefined/not saved, results
in error and incomplete output:

 (gdb) bt
 #0  thread_function0 (arg=0x0) at threads.c:63
 #1  0x00000034cf407d14 in start_thread (arg=0x7ffff7fcb700) at pthread_create.c:309
 #2  0x000000323d4f168d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

 (gdb) frame 2
 #2  0x000000323d4f168d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115
 115             call    *%rax

 (gdb) info frame
 Stack level 2, frame at 0x0:
  rip = 0x323d4f168d in clone (../sysdeps/unix/sysv/linux/x86_64/clone.S:115); saved rip Register 16 was not saved
 (gdb)

Not saved register values are treated as optimized out values
internally throughout.  stack.c:frame_info is handing unvailable
values, but not optimized out ones.  The patch deletes the
frame_unwind_caller_pc_if_available wrapper function and instead lets
errors propagate to frame_info (it's only user).

As frame_unwind_pc now needs to be able to handle and cache two
different error scenarios, the prev_pc.p variable is replaced with an
enumeration.

(FWIW, I looked into making gdbarch_unwind_pc or a variant return
struct value's instead, but it results in lots of boxing and unboxing
for no real gain -- e.g., the mips and arm implementations need to do
computation on the unboxed PC value.  Might as well throw an error on
first attempt to get at invalid contents.)

After the patch, we get:

 (gdb) info frame
 Stack level 2, frame at 0x0:
  rip = 0x323d4f168d in clone (../sysdeps/unix/sysv/linux/x86_64/clone.S:115); saved rip = <not saved>
  Outermost frame: outermost
  caller of frame at 0x7ffff7fcafc0
  source language asm.
  Arglist at 0x7ffff7fcafb8, args:
  Locals at 0x7ffff7fcafb8, Previous frame's sp is 0x7ffff7fcafc8
 (gdb)

A new test is added.  It's based off dw2-reg-undefined.exp, and tweaked to
mark the return address (rip) of "stop_frame" as undefined.

Tested on x86_64 Fedora 17.

gdb/
2013-12-06  Pedro Alves  <palves@redhat.com>

* frame.c (enum cached_copy_status): New enum.
(struct frame_info) <prev_pc.p>: Change type to enum
cached_copy_status.
(fprint_frame): Handle not saved and unavailable prev_pc values.
(frame_unwind_pc_if_available): Delete and merge contents into ...
(frame_unwind_pc): ... here.  Handle OPTIMIZED_OUT_ERROR.  Adjust
to use enum cached_copy_status.
(frame_unwind_caller_pc_if_available): Delete.
(create_new_frame): Adjust.
* frame.h (frame_unwind_caller_pc_if_available): Delete
declaration.
* stack.c (frame_info): Use frame_unwind_caller_pc instead of
frame_unwind_caller_pc_if_available, and handle
NOT_AVAILABLE_ERROR and OPTIMIZED_OUT_ERROR errors.
* valprint.c (val_print_optimized_out): Use val_print_not_saved.
(val_print_not_saved): New function.
* valprint.h (val_print_not_saved): Declare.

gdb/testsuite/
2013-12-06  Pedro Alves  <palves@redhat.com>

* gdb.dwarf2/dw2-undefined-ret-addr.S: New file.
* gdb.dwarf2/dw2-undefined-ret-addr.c: New file.
* gdb.dwarf2/dw2-undefined-ret-addr.exp: New file.

10 years agoNew OPTIMIZED_OUT_ERROR error code.
Pedro Alves [Fri, 6 Dec 2013 19:48:54 +0000 (19:48 +0000)]
New OPTIMIZED_OUT_ERROR error code.

In order to catch <optimized out> errors like we catch <unavailable>
errors, this adds a new OPTIMIZED_OUT_ERROR error code, and throws it
in various places.

gdb/ChangeLog
2013-12-06  Andrew Burgess  <aburgess@broadcom.com>
    Pedro Alves  <palves@redhat.com>

* exceptions.h (errors): Add OPTIMIZED_OUT_ERROR.
* dwarf2loc.c (write_pieced_value): Throw OPTIMIZED_OUT_ERROR.
* frame.c (frame_unwind_register): Throw OPTIMIZED_OUT_ERROR.
* spu-tdep.c (spu_software_single_step): Throw
OPTIMIZED_OUT_ERROR.
* valops.c (value_assign): Throw OPTIMIZED_OUT_ERROR.

10 years agoupdate free_objfile comment
Tom Tromey [Tue, 26 Nov 2013 21:39:08 +0000 (14:39 -0700)]
update free_objfile comment

The introductory comment to free_objfile is obsolete.
This patch fixes it by removing all the obsolete bits.

2013-12-06  Tom Tromey  <tromey@redhat.com>

* objfiles.c (free_objfile): Update comment.

10 years agoremove objfile_to_front
Tom Tromey [Mon, 25 Nov 2013 16:53:06 +0000 (09:53 -0700)]
remove objfile_to_front

I happened to notice that nothing uses objfile_to_front.
This patch removes it.

2013-12-06  Tom Tromey  <tromey@redhat.com>

* objfiles.h (objfile_to_front): Remove.
* objfiles.c (objfile_to_front): Remove.

10 years agoremove unnecessary declaration
Tom Tromey [Mon, 25 Nov 2013 16:51:25 +0000 (09:51 -0700)]
remove unnecessary declaration

This removes an unnecessary declaration from minsyms.c.

2013-12-06  Tom Tromey  <tromey@redhat.com>

* minsyms.c (get_symbol_leading_char): Remove unnecessary
declaration.

10 years agopack partial_symtab for space
Tom Tromey [Mon, 25 Nov 2013 16:34:49 +0000 (09:34 -0700)]
pack partial_symtab for space

This improves the packing of struct partial_symtab.  I noticed with
pahole that were were a couple of holes.  This consolidates the holes
without, I think, affecting readability -- it just moves the "user"
field a bit earlier in the struct.  This change saves a small amount
of memory.

2013-12-06  Tom Tromey  <tromey@redhat.com>

* psympriv.h (struct partial_symtab) <user>: Move earlier.

10 years agofix a couple of FIXMEs
Tom Tromey [Mon, 25 Nov 2013 15:47:51 +0000 (08:47 -0700)]
fix a couple of FIXMEs

This fixes a couple of old "32x64" FIXME comments by using paddress
with current_gdbarch rather than hex_string and a cast to long.

2013-12-06  Tom Tromey  <tromey@redhat.com>

* cli/cli-cmds.c (edit_command): Use paddress, not hex_string.
(list_command): Likewise.

10 years agoput the psymtab filename in the filename bcache
Tom Tromey [Mon, 25 Nov 2013 14:55:23 +0000 (07:55 -0700)]
put the psymtab filename in the filename bcache

This puts the psymtab filename in the filename bcache.
This saves a small amount of memory.

2013-12-06  Tom Tromey  <tromey@redhat.com>

* psymtab.c (allocate_psymtab): Put the filename in the filename
bcache.

10 years agomake symtab::dirname const
Tom Tromey [Mon, 25 Nov 2013 14:40:05 +0000 (07:40 -0700)]
make symtab::dirname const

This makes symtab::dirname const and updates one spot to avoid an
intermediate constless result.

2013-12-06  Tom Tromey  <tromey@redhat.com>

* buildsym.c (end_symtab_from_static_block): Use obstack_copy0.
* symtab.h (struct symtab) <dirname>: Now const.

10 years agomake symtab::filename const
Tom Tromey [Mon, 25 Nov 2013 14:32:35 +0000 (07:32 -0700)]
make symtab::filename const

This makes symtab::filename const and removes a newly unnecessary
cast.

2013-12-06  Tom Tromey  <tromey@redhat.com>

* symfile.c (allocate_symtab): Remove cast.
* symtab.h (struct symtab) <filename>: Now const.

10 years ago * gdb.base/break.exp: Fix setting of $baz.
Doug Evans [Fri, 6 Dec 2013 18:19:01 +0000 (10:19 -0800)]
* gdb.base/break.exp: Fix setting of $baz.

10 years agoremove some sym_probe_fns methods
Tom Tromey [Mon, 2 Dec 2013 19:13:29 +0000 (12:13 -0700)]
remove some sym_probe_fns methods

While looking into the probe API, it seemed to me that there were a
number of methods in sym_probe_fns that were not needed.  This patch
removes them.

Specifically, it seems to me that sym_probe_fns ought to be concerned
with the API for constructing the probes.  Any method relating to some
aspect of an individual probe can be handled via the probe's own
vtable.  That is, the double indirection here doesn't seem useful --
it certainly isn't in fact used, but also I couldn't think of a
potential use.

2013-12-06  Tom Tromey  <tromey@redhat.com>

* break-catch-throw.c (fetch_probe_arguments): Use
get_probe_argument_count and evaluate_probe_argument.
* elfread.c (elf_get_probe_argument_count)
(elf_can_evaluate_probe_arguments, elf_evaluate_probe_argument)
(elf_compile_to_ax): Remove.
(elf_probe_fns): Update.
* probe.c (get_probe_argument_count, can_evaluate_probe_arguments)
(evaluate_probe_argument): Call method on probe, not via sym
functions.
* stap-probe.c (compute_probe_arg): Use get_probe_argument_count,
evaluate_probe_argument.
(compile_probe_arg): Use get_probe_argument_count.  Call method on
probe, not via sym functions.
* symfile-debug.c (debug_sym_get_probe_argument_count)
(debug_can_evaluate_probe_arguments)
(debug_sym_evaluate_probe_argument, debug_sym_compile_to_ax):
Remove.
(debug_sym_probe_fns): Remove.
* symfile.h (struct sym_probe_fns) <sym_get_probe_argument_count,
can_evaluate_probe_arguments, sym_evaluate_probe_argument,
sym_compile_to_ax>: Remove fields.

10 years agoAdd support for DW_OP_bit_piece and DW_OP_plus_uconst to DWARF assembler.
Andrew Burgess [Fri, 6 Dec 2013 13:27:24 +0000 (13:27 +0000)]
Add support for DW_OP_bit_piece and DW_OP_plus_uconst to DWARF assembler.

  https://sourceware.org/ml/gdb-patches/2013-12/msg00143.html

gdb/testsuite/ChangeLog

* lib/dwarf.exp: (Dwarf::_location): Handle DW_OP_bit_piece and
DW_OP_plus_uconst.

10 years agoAdd epilog unwind for x86_64 pe/coff
Tristan Gingold [Wed, 4 Dec 2013 13:53:12 +0000 (14:53 +0100)]
Add epilog unwind for x86_64 pe/coff

include/coff/
2013-12-06  Tristan Gingold  <gingold@adacore.com>

* pe.h (UWOP_EPILOG, UWOP_PARE): Define.

bfd/
2013-12-06  Tristan Gingold  <gingold@adacore.com>

* pei-x86_64.c (pex64_xdata_print_uwd_codes): Add argument rf.
Display epilog opcode.
(pex64_dump_xdata): Add argument rf; make addr a local variable.
Adjust call to pex64_xdata_print_uwd_codes.
(pex64_bfd_print_pdata): Display code range, adjust call to
pex64_dump_xdata.

10 years agotestsuite: introduce index in varobj child eval.
Keven Boell [Thu, 21 Nov 2013 09:54:47 +0000 (10:54 +0100)]
testsuite: introduce index in varobj child eval.

In some languages, e.g. fortran, arrays start with index 1
instead 0. This patch changes the MI library to support testing
varobj children of fortran arrays.

2013-11-21  Keven Boell  <keven.boell@intel.com>

testsuite/

* lib/mi-support.exp (mi_list_varobj_children_range): Add
call to mi_list_array_varobj_children_with_index.
(mi_list_array_varobj_children_with_index): New function.
Add parameter to specify array start.

10 years ago Fix completion for pascal language.
Pierre Muller [Sun, 17 Nov 2013 19:42:16 +0000 (20:42 +0100)]
   Fix completion for pascal language.
       * p-exp.y (exp : field_exp name): Do not call mark_struct_expression.
       (exp : field_exp name COMPLETE): New rule.
       (exp : SIZEOF): Set correct current_type.
       (last_was_structop): Remove static variable.
       (yylex): Remove saw_structop local variable.
       Adapt code to removal of variables above.

10 years agoUninitialized variable "this_id" in frame.c:get_prev_frame_1.
Joel Brobecker [Thu, 5 Dec 2013 12:17:40 +0000 (13:17 +0100)]
Uninitialized variable "this_id" in frame.c:get_prev_frame_1.

With a simple Ada program where I have 3 functions, one just calling
the next, the backtrace is currently broken when GDB is compiled
at -O2:

   #0  hello.first () at hello.adb:5
   #1  0x0000000100001475 in hello.second () at hello.adb:10
   Backtrace stopped: previous frame inner to this frame (corrupt stack?)

It turns out that a recent patch deleted the assignment of variable
this_id, making it an unitialized variable:

        * frame-unwind.c (default_frame_unwind_stop_reason): Return
        UNWIND_OUTERMOST if the frame's ID is outer_frame_id.
        * frame.c (get_prev_frame_1): Remove outer_frame_id check.

The hunk in question starts with:

-  /* Check that this frame is not the outermost.  If it is, don't try
-     to unwind to the prev frame.  */
-  this_id = get_frame_id (this_frame);
-  if (frame_id_eq (this_id, outer_frame_id))

(the code was removed as redundant - but removing the assignment
was in fact not intentional).

There is no other code in this function that sets the variable.
Instead of re-adding the statement in the lone section where it is
actually used, I inlined it, and then got rid of the variable
altogether.  This way, and until we start needing this frame ID
in another location within that function, we dont' have to worry
about the variable's validity/lifetime.

gdb/ChangeLog:

        * frame.c (get_prev_frame_1): Delete variable "this_id".
        Replace its use by a call to get_frame_id.

10 years agodaily update
Alan Modra [Thu, 5 Dec 2013 23:00:02 +0000 (09:30 +1030)]
daily update

10 years agoAdd software single step support to moxie port
Anthony Green [Thu, 5 Dec 2013 15:25:03 +0000 (10:25 -0500)]
Add software single step support to moxie port

10 years agoinclude/ * longlong.h: New file.
rsandifo [Wed, 4 Dec 2013 10:49:14 +0000 (10:49 +0000)]
include/ * longlong.h: New file.

libgcc/
* longlong.h: Delete (moved to include/).

libquadmath/
* Makefile.am (AM_CPPFLAGS): Define.
* Makefile.in: Regenerate.
* printf/gmp-impl.h: Remove path from longlong.h include.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205659 138bc75d-0d04-0410-961f-82ee72b054a4