external/binutils.git
11 years agoHardware watchpoints turned off, inferior not yet started.
Andrew Burgess [Fri, 18 Oct 2013 16:25:14 +0000 (16:25 +0000)]
Hardware watchpoints turned off, inferior not yet started.

  https://sourceware.org/ml/gdb-patches/2013-10/msg00477.html

gdb/ChangeLog

* breakpoint.c (update_watchpoint): If hardware watchpoints are
forced off, downgrade them to software watchpoints if possible,
and error out if not possible.
(watch_command_1): Move watchpoint type selection closer to
watchpoint creation, and extend the comments.

gdb/testsuite/ChangeLog

* gdb.base/watchpoints.exp: Add test for setting software
watchpoints of different types before starting the inferior.

11 years ago[gdb/16062] stepi sometimes doesn't make progress
Pedro Alves [Fri, 18 Oct 2013 14:28:34 +0000 (14:28 +0000)]
[gdb/16062] stepi sometimes doesn't make progress

I noticed something odd while doing "stepi" over a fork syscall:

 ...
 (gdb) set disassemble-next-line on
 ...
 (gdb) si
 0x000000323d4ba7c2      131       pid = ARCH_FORK ();
    0x000000323d4ba7a4 <__libc_fork+132>:        64 4c 8b 04 25 10 00 00 00      mov    %fs:0x10,%r8
    0x000000323d4ba7ad <__libc_fork+141>:        31 d2   xor    %edx,%edx
    0x000000323d4ba7af <__libc_fork+143>:        4d 8d 90 d0 02 00 00    lea    0x2d0(%r8),%r10
    0x000000323d4ba7b6 <__libc_fork+150>:        31 f6   xor    %esi,%esi
    0x000000323d4ba7b8 <__libc_fork+152>:        bf 11 00 20 01  mov    $0x1200011,%edi
    0x000000323d4ba7bd <__libc_fork+157>:        b8 38 00 00 00  mov    $0x38,%eax
 => 0x000000323d4ba7c2 <__libc_fork+162>:        0f 05   syscall
    0x000000323d4ba7c4 <__libc_fork+164>:        48 3d 00 f0 ff ff       cmp    $0xfffffffffffff000,%rax
    0x000000323d4ba7ca <__libc_fork+170>:        0f 87 2b 01 00 00       ja     0x323d4ba8fb <__libc_fork+475>
 (gdb) si
 0x000000323d4ba7c4      131       pid = ARCH_FORK ();
    0x000000323d4ba7a4 <__libc_fork+132>:        64 4c 8b 04 25 10 00 00 00      mov    %fs:0x10,%r8
    0x000000323d4ba7ad <__libc_fork+141>:        31 d2   xor    %edx,%edx
    0x000000323d4ba7af <__libc_fork+143>:        4d 8d 90 d0 02 00 00    lea    0x2d0(%r8),%r10
    0x000000323d4ba7b6 <__libc_fork+150>:        31 f6   xor    %esi,%esi
    0x000000323d4ba7b8 <__libc_fork+152>:        bf 11 00 20 01  mov    $0x1200011,%edi
    0x000000323d4ba7bd <__libc_fork+157>:        b8 38 00 00 00  mov    $0x38,%eax
    0x000000323d4ba7c2 <__libc_fork+162>:        0f 05   syscall
 => 0x000000323d4ba7c4 <__libc_fork+164>:        48 3d 00 f0 ff ff       cmp    $0xfffffffffffff000,%rax
    0x000000323d4ba7ca <__libc_fork+170>:        0f 87 2b 01 00 00       ja     0x323d4ba8fb <__libc_fork+475>
 (gdb) si
 0x000000323d4ba7c4      131       pid = ARCH_FORK ();
    0x000000323d4ba7a4 <__libc_fork+132>:        64 4c 8b 04 25 10 00 00 00      mov    %fs:0x10,%r8
    0x000000323d4ba7ad <__libc_fork+141>:        31 d2   xor    %edx,%edx
    0x000000323d4ba7af <__libc_fork+143>:        4d 8d 90 d0 02 00 00    lea    0x2d0(%r8),%r10
    0x000000323d4ba7b6 <__libc_fork+150>:        31 f6   xor    %esi,%esi
    0x000000323d4ba7b8 <__libc_fork+152>:        bf 11 00 20 01  mov    $0x1200011,%edi
    0x000000323d4ba7bd <__libc_fork+157>:        b8 38 00 00 00  mov    $0x38,%eax
    0x000000323d4ba7c2 <__libc_fork+162>:        0f 05   syscall
 => 0x000000323d4ba7c4 <__libc_fork+164>:        48 3d 00 f0 ff ff       cmp    $0xfffffffffffff000,%rax
    0x000000323d4ba7ca <__libc_fork+170>:        0f 87 2b 01 00 00       ja     0x323d4ba8fb <__libc_fork+475>
 (gdb) si
 0x000000323d4ba7ca      131       pid = ARCH_FORK ();
    0x000000323d4ba7a4 <__libc_fork+132>:        64 4c 8b 04 25 10 00 00 00      mov    %fs:0x10,%r8
    0x000000323d4ba7ad <__libc_fork+141>:        31 d2   xor    %edx,%edx
    0x000000323d4ba7af <__libc_fork+143>:        4d 8d 90 d0 02 00 00    lea    0x2d0(%r8),%r10
    0x000000323d4ba7b6 <__libc_fork+150>:        31 f6   xor    %esi,%esi
    0x000000323d4ba7b8 <__libc_fork+152>:        bf 11 00 20 01  mov    $0x1200011,%edi
    0x000000323d4ba7bd <__libc_fork+157>:        b8 38 00 00 00  mov    $0x38,%eax
    0x000000323d4ba7c2 <__libc_fork+162>:        0f 05   syscall
    0x000000323d4ba7c4 <__libc_fork+164>:        48 3d 00 f0 ff ff       cmp    $0xfffffffffffff000,%rax
 => 0x000000323d4ba7ca <__libc_fork+170>:        0f 87 2b 01 00 00       ja     0x323d4ba8fb <__libc_fork+475>

Notice how the third "si" didn't actually make progress.

Turning on infrun and lin-lwp debug, we see:

 (gdb)
 infrun: clear_proceed_status_thread (process 5252)
 infrun: proceed (addr=0xffffffffffffffff, signal=144, step=1)
 infrun: resume (step=1, signal=0), trap_expected=0, current thread [process 5252] at 0x323d4ba7c4
 LLR: Preparing to step process 5252, 0, inferior_ptid process 5252
 RC: Not resuming sibling process 5252 (not stopped)
 LLR: PTRACE_SINGLESTEP process 5252, 0 (resume event thread)
 sigchld
 infrun: wait_for_inferior ()
 linux_nat_wait: [process -1], []
 LLW: enter
 LNW: waitpid(-1, ...) returned 5252, No child processes
 LLW: waitpid 5252 received Child exited (stopped)
 LLW: Candidate event Child exited (stopped) in process 5252.
 SEL: Select single-step process 5252
 LLW: exit
 infrun: target_wait (-1, status) =
 infrun:   5252 [process 5252],
 infrun:   status->kind = stopped, signal = SIGCHLD
 infrun: infwait_normal_state
 infrun: TARGET_WAITKIND_STOPPED
 infrun: stop_pc = 0x323d4ba7c4
 infrun: random signal 20
 infrun: stepi/nexti
 infrun: stop_stepping

So the inferior got a SIGCHLD (because the fork child exited while
we're doing 'si'), and since that signal is set to "nostop noprint
pass" (by default), it's considered a random signal, so it should not
cause a stop.  But, it resulted in an immediate a stop_stepping call
anyway.  So the single-step never really finished.

This is a regression caused by:

 [[PATCH] Do not respawn signals, take 2.]
 https://sourceware.org/ml/gdb-patches/2012-06/msg00702.html

Specifically, caused by this change (as mentioned in the "the lost
step issue first" part of that mail):

 diff --git a/gdb/infrun.c b/gdb/infrun.c
 index 53db335..3e8dbc8 100644
 --- a/gdb/infrun.c
 +++ b/gdb/infrun.c
 @@ -4363,10 +4363,8 @@ process_event_stop_test:
    (leaving the inferior at the step-resume-breakpoint without
    actually executing it).  Either way continue until the
    breakpoint is really hit.  */
 -      keep_going (ecs);
 -      return;
      }
 -
 +  else
    /* Handle cases caused by hitting a breakpoint.  */
    {

That made GDB fall through to the

>   /* In all-stop mode, if we're currently stepping but have stopped in
>   some other thread, we need to switch back to the stepped thread.  */
>  if (!non_stop)

part.  However, if we don't have a stepped thread to get back to,
we'll now also fall through to all the "stepping" tests.  For line
stepping, that'll turn out okay, as we'll just end up realizing the
thread is still in the stepping range, and needs to be re-stepped.
However, for stepi/nexti, we'll reach:

  if (ecs->event_thread->control.step_range_end == 1)
    {
      /* It is stepi or nexti.  We always want to stop stepping after
         one instruction.  */
      if (debug_infrun)
 fprintf_unfiltered (gdb_stdlog, "infrun: stepi/nexti\n");
      ecs->event_thread->control.stop_step = 1;
      print_end_stepping_range_reason ();
      stop_stepping (ecs);
      return;
    }

and stop, even though the thread actually made no progress.  The fix
is to restore the keep_going call, but put it after the "switch back
to the stepped thread" code, and before the stepping tests.

Tested on x86_64 Fedora 17, native and gdbserver.  New test included.

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

PR gdb/16062
* infrun.c (handle_inferior_event): Keep going if we got a random
signal we should not stop for, instead of falling through to the
step tests.

gdb/testsuite/
2013-10-18  Pedro Alves  <palves@redhat.com>

PR gdb/16062
* gdb.threads/stepi-random-signal.c: New file.
* gdb.threads/stepi-random-signal.exp: New file.

11 years ago * config/tc-tic6x.c (tic6x_parse_operand): Revert previous delta.
Nick Clifton [Fri, 18 Oct 2013 14:08:00 +0000 (14:08 +0000)]
* config/tc-tic6x.c (tic6x_parse_operand): Revert previous delta.

11 years ago * ld-cris/asneed1.d: New test.
Hans-Peter Nilsson [Fri, 18 Oct 2013 02:38:35 +0000 (02:38 +0000)]
* ld-cris/asneed1.d: New test.

11 years ago * elf32-cris.c (cris_elf_check_relocs): Don't assume
Hans-Peter Nilsson [Fri, 18 Oct 2013 02:37:51 +0000 (02:37 +0000)]
* elf32-cris.c (cris_elf_check_relocs): Don't assume
a registered dynobj means that a .got has been created.

11 years agogdb/
Yao Qi [Fri, 18 Oct 2013 02:09:57 +0000 (02:09 +0000)]
gdb/

* c-varobj.c (cplus_number_of_children): Fix indentation.

11 years agodaily update
Alan Modra [Thu, 17 Oct 2013 23:00:04 +0000 (23:00 +0000)]
daily update

11 years ago * gdb.mi/mi-breakpoint-changed.exp (test_insert_delete_modify):
Maciej W. Rozycki [Thu, 17 Oct 2013 22:02:29 +0000 (22:02 +0000)]
* gdb.mi/mi-breakpoint-changed.exp (test_insert_delete_modify):
Fix comment typo.
* lib/gdb.exp (gdb_init): Likewise.

11 years agofix for PR gdb/15995
Tom Tromey [Thu, 17 Oct 2013 18:29:28 +0000 (18:29 +0000)]
fix for PR gdb/15995

This patch fixes PR gdb/15995.

The bug here is that gdb's printf command does not flush the output
stream.  This makes a printf that is not newline-terminated interleave
incorrectly with other forms of output, such as that generated via a
call to an external program using "shell".

I note that the "output" command already does this flushing.

The fix is to call gdb_flush in printf_command.

Built and regtested on x86-64 Fedora 18.
New test case included.

PR gdb/15995:
* printcmd.c (printcmd): Call gdb_flush.

* gdb.base/printcmds.exp (test_printf): Test printf flushing.

11 years agoremove unused field from struct elfinfo
Tom Tromey [Thu, 17 Oct 2013 15:41:46 +0000 (15:41 +0000)]
remove unused field from struct elfinfo

I noticed that one field in elfread.c:struct elfinfo is unused.
This patch removes it.

* elfread.c (struct elfinfo) <stabindexsect>: Remove.
(elf_locate_sections): Update.

11 years agoRemove ada-varobj.h.
Yao Qi [Thu, 17 Oct 2013 13:31:33 +0000 (13:31 +0000)]
Remove ada-varobj.h.

As a result of previous patch, extern functions in ada-varobj.c can be
made static, and ada-varobj.h can be removed too.

gdb:

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

* Makefile.in (HFILES_NO_SRCDIR): Remove ada-varobj.h.
* ada-varobj.c: Remove the include of ada-varobj.h.
(ada_varobj_get_number_of_children): Declare.
(ada_varobj_get_name_of_child): Make it static.
(ada_varobj_get_path_expr_of_child): Likewise.
(ada_varobj_get_value_of_child): Likewise.
(ada_varobj_get_type_of_child): Likewise.
(ada_varobj_get_value_of_array_variable): Likewise.
* ada-varobj.h: Remove.

11 years agogdb/
Yao Qi [Thu, 17 Oct 2013 13:28:37 +0000 (13:28 +0000)]
gdb/

* Makefile.in (SFILES): Add c-varobj.c and jv-varobj.c.
(COMMON_OBS): Add c-varobj.o and jv-varobj.o.
* ada-varobj.c: Include "varobj.h".
(ada_number_of_children): New.  Moved from varobj.c.
(ada_name_of_variable, ada_name_of_child): Likewise.
(ada_path_expr_of_child, ada_value_of_child): Likewise.
(ada_type_of_child, ada_value_of_variable): Likewise.
(ada_value_is_changeable_p, ada_value_has_mutated): Likewise.
(ada_varobj_ops): New.
* c-varobj.c, jv-varobj.c: New file.  Moved from varobj.c.
* gdbtypes.c (get_target_type): New.  Moved from varobj.c.
* gdbtypes.h (get_target_type): Declare.
* varobj.c: Remove the inclusion of "ada-varobj.h" and
"ada-lang.h".
(ANONYMOUS_STRUCT_NAME): Move it to c-varobj.c.
(ANONYMOUS_UNION_NAME): Likewise.
(get_type, get_value_type, get_target_type): Remove declarations.
(value_get_print_value, varobj_value_get_print_value): Likewise.
(c_number_of_children, c_name_of_variable): Likewise.
(c_name_of_child, c_path_expr_of_child): Likewise.
(c_value_of_child, c_type_of_child): Likewise.
(c_value_of_variable, cplus_number_of_children): Likewise.
(cplus_class_num_children, cplus_name_of_variable): Likewise.
(cplus_name_of_child, cplus_path_expr_of_child): Likewise.
(cplus_value_of_child, cplus_type_of_child): Likewise.
(cplus_value_of_variable, java_number_of_children): Likewise.
(java_name_of_variable, java_name_of_child): Likewise.
(java_path_expr_of_child, java_value_of_child): Likewise.
(java_type_of_child, java_value_of_variable): Likewise.
(ada_number_of_children, ada_name_of_variable): Likewise.
(ada_name_of_child, ada_path_expr_of_child): Likewise.
(ada_value_of_child, ada_type_of_child): Likewise.
(ada_value_of_variable, ada_value_is_changeable_p): Likewise.
(ada_value_has_mutated): Likewise.
(struct language_specific): Move it to varobj.h.
(CPLUS_FAKE_CHILD): Move it to varobj.h.
(restrict_range): Rename it varobj_restrict_range.  Make it extern.
Callers update.
(get_path_expr_parent): Rename it to varobj_get_path_expr_parent.
Make it extern.
(is_anonymous_child): Move it to c-varobj.c and rename to
varobj_is_anonymous_child.  Caller update.
(get_type): Move it to c-varobj.c.
(get_value_type): Rename it varobj_get_value_type.  Make it
extern.
(get_target_type): Move it gdbtypes.c.
(varobj_formatted_print_options): New function.
(value_get_print_value): Rename it to
varobj_value_get_print_value and make it extern.
(varobj_value_is_changeable_p): Make it extern.
(adjust_value_for_child_access): Move it to c-varobj.c.
(default_value_is_changeable_p): Rename it to
varobj_default_value_is_changeable_p.  Make it extern.
(c_number_of_children, c_name_of_variable): Move it to c-varobj.c
(c_name_of_child, c_path_expr_of_child): Likewise.
(c_value_of_child, c_type_of_child): Likewise.
(c_value_of_variable, cplus_number_of_children): Likewise.
(cplus_class_num_children, cplus_name_of_variable): Likewise.
(cplus_name_of_child, cplus_path_expr_of_child): Likewise.
(cplus_value_of_child, cplus_type_of_child): Likewise.
(cplus_value_of_variable): Likewise.
(java_number_of_children, java_name_of_variable): Move it to jv-varobj.c.
(java_name_of_child, java_path_expr_of_child): Likewise.
(java_value_of_child, java_type_of_child): Likewise.
(java_value_of_variable): Likewise.
(ada_number_of_children, ada_name_of_variable): Move it to ada-varobj.c.
(ada_name_of_child, ada_path_expr_of_child): Likewise.
(ada_value_of_child, ada_type_of_child): Likewise.
(ada_value_of_variable, ada_value_is_changeable_p): Likewise.
(ada_value_has_mutated): Likewise.
* varobj.h (CPLUS_FAKE_CHILD): New macro, moved from varobj.c.
(struct lang_varobj_ops): New.  Renamed by 'struct language_specific'.
(c_varobj_ops, cplus_varobj_ops): Declare.
(java_varobj_ops, ada_varobj_ops): Declare.
(varobj_default_value_is_changeable_p): Declare.
(varobj_value_is_changeable_p): Declare.
(varobj_get_value_type, varobj_is_anonymous_child): Declare.
(varobj_get_path_expr_parent): Declare.
(varobj_value_get_print_value): Declare.
(varobj_formatted_print_options): Declare.
(varobj_restrict_range): Declare.

11 years ago * target/waitstatus.h (target_waitkind): Remove spurious
Luis Machado [Thu, 17 Oct 2013 10:21:37 +0000 (10:21 +0000)]
* target/waitstatus.h (target_waitkind): Remove spurious
character from the comments.

11 years ago PR 16056
Alan Modra [Thu, 17 Oct 2013 10:05:38 +0000 (10:05 +0000)]
PR 16056
* elf.c (copy_elf_program_header): Only consider SEC_ALLOC sections
when finding lowest_section.

11 years agoDocument the get_longjmp_target gdbarch method.
Joel Brobecker [Thu, 17 Oct 2013 06:11:22 +0000 (06:11 +0000)]
Document the get_longjmp_target gdbarch method.

gdb/ChangeLog:

        * gdbarch.sh (get_longjmp_target): Add method documentation.
        * gdbarch.h: Regenerate.

11 years agodaily update
Alan Modra [Wed, 16 Oct 2013 23:00:05 +0000 (23:00 +0000)]
daily update

11 years ago2013-10-16 Jan-Benedict Glaw <jbglaw@lug-owl.de>
Jan-Benedict Glaw [Wed, 16 Oct 2013 20:45:20 +0000 (20:45 +0000)]
2013-10-16  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

* ChangeLog: Sync from GCC.
* mh-darwin: Ditto.
* bootstrap-ubsan.mk: Ditto.

11 years ago2013-10-16 Jan-Benedict Glaw <jbglaw@lug-owl.de>
Jan-Benedict Glaw [Wed, 16 Oct 2013 20:36:39 +0000 (20:36 +0000)]
2013-10-16  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

* configure.ac: Update from GCC.
* configure: Regenerate.

11 years ago * dbxread.c (read_dbx_symtab) <bss_ext_symbol>: Remove unused
Tom Tromey [Wed, 16 Oct 2013 16:00:23 +0000 (16:00 +0000)]
* dbxread.c (read_dbx_symtab) <bss_ext_symbol>: Remove unused
label.

11 years ago * gcore.in: Call GDB using the full path to the gcore script.
Luis Machado [Wed, 16 Oct 2013 15:08:11 +0000 (15:08 +0000)]
* gcore.in: Call GDB using the full path to the gcore script.
Error out if the GDB binary is not found.

11 years agoThere were two functions who were calling "sizeof" twice.
Sergio Durigan Junior [Wed, 16 Oct 2013 02:55:27 +0000 (02:55 +0000)]
There were two functions who were calling "sizeof" twice.

The first one, dw2_get_real_path from gdb/dwarf2read.c, was actually
making use of OBSTACK_CALLOC which already calls "sizeof" for its third
argument.

The second, download_tracepoint_1 from gdb/gdbserver/tracepoint.c, was
explicitly calling "sizeof" inside another "sizeof".

This patch fixed both functions.

gdb/ChangeLog
2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>

PR gdb/16014
* dwarf2read.c (dw2_get_real_path): Remove unnecessary call to
sizeof.

gdb/gdbserver/ChangeLog
2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>

PR gdb/16014
* tracepoint.c (download_tracepoint_1): Remove unnecessary double
call to sizeof.

11 years agoThis is a simple bug. target_disable_btrace and target_teardown_btrace,
Sergio Durigan Junior [Wed, 16 Oct 2013 02:41:42 +0000 (02:41 +0000)]
This is a simple bug.  target_disable_btrace and target_teardown_btrace,
both from gdb/target.c, do a "return" calling another function.  But both
are marked as void.  Despite the fact that the functions being called are
void as well, this is wrong.  This patch fixes this by calling the functions
and then returning in the next line.

2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>

PR gdb/16042
* target.c (target_disable_btrace): Fix invalid return value for
void function.
(target_teardown_btrace): Likewise.

11 years agomerge from gcc
DJ Delorie [Wed, 16 Oct 2013 00:29:48 +0000 (00:29 +0000)]
merge from gcc

11 years agodaily update
Alan Modra [Tue, 15 Oct 2013 23:00:05 +0000 (23:00 +0000)]
daily update

11 years ago * src-release (do-proto-toplevel): Support subdir-path-prefixed
Hans-Peter Nilsson [Tue, 15 Oct 2013 20:45:52 +0000 (20:45 +0000)]
* src-release (do-proto-toplevel): Support subdir-path-prefixed
files in SUPPORT_FILES.
(SIM_SUPPORT_DIRS): New variable.
(sim.tar.bz2): New rule.

11 years ago * Makefile.in (srcsim): New variable.
Hans-Peter Nilsson [Tue, 15 Oct 2013 20:42:07 +0000 (20:42 +0000)]
* Makefile.in (srcsim): New variable.
(version.c): Adjust call to $(srccom)/create-version.sh as per change.

11 years ago * create-version.sh: Align parameters to match those of
Hans-Peter Nilsson [Tue, 15 Oct 2013 20:40:22 +0000 (20:40 +0000)]
* create-version.sh: Align parameters to match those of
../../gdb/common/create-version.sh.
* Make-common.in (srcsim): New variable.
(version.c): Adjust call to create-version.sh as per above.

11 years agoFix neon vshll disassembly.
Ramana Radhakrishnan [Tue, 15 Oct 2013 13:30:40 +0000 (13:30 +0000)]
Fix neon vshll disassembly.

opcodes/
2013-10-15  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

* arm-dis.c (neon_opcodes): Adjust print string for vshll.

gas/testsuite/
2013-10-15  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

* gas/arm/neon-cov.d: Adjust output.

11 years agorevert previous delta.
Nick Clifton [Tue, 15 Oct 2013 08:32:36 +0000 (08:32 +0000)]
revert previous delta.

11 years ago2013-10-14 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
Chao-ying Fu [Mon, 14 Oct 2013 19:06:20 +0000 (19:06 +0000)]
2013-10-14  Chao-ying Fu  <Chao-ying.Fu@imgtec.com>

* gas/mips/micromips@msa-relax.d, gas/mips/micromips@msa.d,
gas/mips/micromips@msa64.d, gas/mips/msa-relax.d,
gas/mips/msa-relax.l, gas/mips/msa-relax.s,
gas/mips/msa.d, gas/mips/msa.s, gas/mips/msa64.d,
gas/mips/msa64.s: New.
* gas/mips/mips.exp: Run new tests.

11 years ago2013-10-14 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
Chao-ying Fu [Mon, 14 Oct 2013 19:02:00 +0000 (19:02 +0000)]
2013-10-14  Chao-ying Fu  <Chao-ying.Fu@imgtec.com>

* ld-mips-elf/attr-gnu-8-0.s, ld-mips-elf/attr-gnu-8-1.s,
ld-mips-elf/attr-gnu-8-2.s,
ld-mips-elf/attr-gnu-8-00.d, ld-mips-elf/attr-gnu-8-01.d,
ld-mips-elf/attr-gnu-8-02.d, ld-mips-elf/attr-gnu-8-10.d,
ld-mips-elf/attr-gnu-8-11.d, ld-mips-elf/attr-gnu-8-12.d,
ld-mips-elf/attr-gnu-8-20.d, ld-mips-elf/attr-gnu-8-21.d,
ld-mips-elf/attr-gnu-8-22.d: New.
* ld-mips-elf/mips-elf.exp: Run new tests.

11 years ago2013-10-14 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
Chao-ying Fu [Mon, 14 Oct 2013 18:58:15 +0000 (18:58 +0000)]
2013-10-14  Chao-ying Fu  <Chao-ying.Fu@imgtec.com>

* micromips-opc.c (decode_micromips_operand): Add +T, +U, +V, +W,
+d, +e, +h, +k, +l, +n, +o, +u, +v, +w, +x,
+~, +!, +@, +#, +$, +%, +^, +&, +*, +|.
(MSA): New define.
(MSA64): New define.
(micromips_opcodes): Add MSA instructions.
* mips-dis.c (msa_control_names): New array.
(mips_abi_choice): Add ASE_MSA to mips32r2.
Remove ASE_MDMX from mips64r2.
Add ASE_MSA and ASE_MSA64 to mips64r2.
(parse_mips_dis_option): Handle -Mmsa.
(print_reg): Handle cases for OP_REG_MSA and OP_REG_MSA_CTRL.
(print_insn_arg): Handle cases for OP_IMM_INDEX and OP_REG_INDEX.
(print_mips_disassembler_options): Print -Mmsa.
* mips-opc.c (decode_mips_operand): Add +T, +U, +V, +W, +d, +e, +h, +k,
+l, +n, +o, +u, +v, +w, +~, +!, +@, +#, +$, +%, +^, +&, +*, +|.
(MSA): New define.
(MSA64): New define.
(mips_builtin_op): Add MSA instructions.

11 years ago2013-10-14 Richard Sandiford <rdsandiford@googlemail.com>
Chao-ying Fu [Mon, 14 Oct 2013 18:50:54 +0000 (18:50 +0000)]
2013-10-14  Richard Sandiford  <rdsandiford@googlemail.com>
    Chao-ying Fu  <Chao-ying.Fu@imgtec.com>

* config/tc-mips.c (options): Add OPTION_MSA and OPTION_NO_MSA.
(md_longopts): Add mmsa and mno-msa.
(mips_ases): Add msa.
(RTYPE_MASK): Update.
(RTYPE_MSA): New define.
(OT_REG_ELEMENT): Replace with...
(OT_INTEGER_INDEX, OT_REG_INDEX): ...these new operand types.
(mips_operand_token): Replace reg_element with index.
(mips_parse_argument_token): Treat vector indices as separate tokens.
Handle register indices.
(md_begin): Add MSA register names.
(operand_reg_mask): Handle cases for OP_IMM_INDEX and OP_REG_INDEX.
(convert_reg_type): Handle cases for OP_REG_MSA and OP_REG_MSA_CTRL.
(match_mdmx_imm_reg_operand): Update accordingly.
(match_imm_index_operand): New function.
(match_reg_index_operand): New function.
(match_operand): Handle cases for OP_IMM_INDEX and OP_REG_INDEX.
(md_convert_frag): Convert bz.b/h/w/d, bnz.b/h/w/d, bz.v bnz.v.
(md_show_usage): Print -mmsa and -mno-msa.
* doc/as.texinfo: Document -mmsa and -mno-msa.
* doc/c-mips.texi: Document -mmsa and -mno-msa.
Document .set msa and .set nomsa.

11 years ago2013-10-14 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
Chao-ying Fu [Mon, 14 Oct 2013 18:45:46 +0000 (18:45 +0000)]
2013-10-14  Chao-ying Fu  <Chao-ying.Fu@imgtec.com>

* readelf.c (display_mips_gnu_attribute): Support Tag_GNU_MIPS_ABI_MSA.
* doc/binutils.texi: Document -Mmsa disassembler option.

11 years ago2013-10-14 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
Chao-ying Fu [Mon, 14 Oct 2013 18:43:39 +0000 (18:43 +0000)]
2013-10-14  Chao-ying Fu  <Chao-ying.Fu@imgtec.com>

* elfxx-mips.c (mips_elf_obj_tdata): Add abi_msa_bfd.
(mips_elf_merge_obj_attributes): Set abi_msa_bfd to the first object
file that has a Tag_GNU_MIPS_ABI_MSA attribute.
Merge Tag_GNU_MIPS_ABI_MSA attributes.

11 years ago2013-10-14 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
Chao-ying Fu [Mon, 14 Oct 2013 18:41:17 +0000 (18:41 +0000)]
2013-10-14  Chao-ying Fu  <Chao-ying.Fu@imgtec.com>

* mips.h (mips_operand_type): Add OP_IMM_INDEX and OP_REG_INDEX.
(mips_reg_operand_type): Add OP_REG_MSA and OP_REG_MSA_CTRL.
For MIPS, add comments for +d, +e, +h, +k, +l, +n, +o, +u, +v, +w,
+T, +U, +V, +W, +~, +!, +@, +#, +$, +%, +^, +&, +*, +|.
For MIPS, update extension character sequences after +.
(ASE_MSA): New define.
(ASE_MSA64): New define.
For microMIPS, add comments for +d, +e, +h, +k, +l, +n, +o, +u, +v, +w,
+x, +T, +U, +V, +W, +~, +!, +@, +#, +$, +%, +^, +&, +*, +|.
For microMIPS, update extension character sequences after +.

11 years ago2013-10-14 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
Chao-ying Fu [Mon, 14 Oct 2013 18:37:05 +0000 (18:37 +0000)]
2013-10-14  Chao-ying Fu  <Chao-ying.Fu@imgtec.com>

* mips.h (enum): Add Tag_GNU_MIPS_ABI_MSA.
(enum): Add Val_GNU_MIPS_ABI_MSA_ANY and Val_GNU_MIPS_ABI_MSA_128.

11 years ago * gdb.dwarf2/dwzbuildid.exp (write_dwarf_file): Pass explicit test
Tom Tromey [Mon, 14 Oct 2013 16:20:13 +0000 (16:20 +0000)]
* gdb.dwarf2/dwzbuildid.exp (write_dwarf_file): Pass explicit test
name to gdb_test_no_output.

11 years ago2013-10-14 Jan-Benedict Glaw <jbglaw@lug-owl.de>
Jan-Benedict Glaw [Mon, 14 Oct 2013 12:53:40 +0000 (12:53 +0000)]
2013-10-14  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

* readelf.c (decode_arm_unwind): Don't initialize `addr'.

11 years ago * gen-aout.c (main): Fix formatting. Close file.
Nick Clifton [Mon, 14 Oct 2013 09:15:09 +0000 (09:15 +0000)]
* gen-aout.c (main): Fix formatting.  Close file.

* emultempl/aix.em (_read_file): Close file at end of function.

* gas/all/itbl-test.c (main): Close fas.

* read.c (add_include_dir): Use xrealloc.
* config/tc-score.c (do_macro_bcmp): Initialise inst_main.
* config/tc-tic6x.c (tic6x_parse_operand): Initialise second_reg.

* readelf.c (decode_arm_unwind): Initialise addr structure.
(process_symbol_table): Free lengths.
* srcconv.c (wr_sc): Free info.

* chew.c (perform): Free next.

11 years agogdb/
Yao Qi [Mon, 14 Oct 2013 08:16:45 +0000 (08:16 +0000)]
gdb/

* varobj.c (struct varobj): Move most of the fields to
varobj.h.
(struct varobj_dynamic): New struct.
(varobj_get_display_hint) [HAVE_PYTHON]: Adjust.
(varobj_has_more): Likewise.
(dynamic_varobj_has_child_method): Likewise.
(update_dynamic_varobj_children): Likewise.
(varobj_get_num_children): Likewise.
(varobj_list_children, varobj_pretty_printed_p): Likewise.
(install_new_value_visualizer): Likewise.
(install_new_value_visualizer, install_new_value): Likewise.
(varobj_update, new_variable, free_variable): Likewise.
(my_value_of_variable, value_get_print_value): Likewise.
(install_visualizer): Change the type of parameter 'var' to
'struct varobjd_dynamic *'.  Callers update.
* varobj.h (struct varobj): Moved from varobj.c.
(struct varobj) <dynamic>: New field.

11 years ago * output.h (Output_data_got::add_constant): Tidy.
Alan Modra [Mon, 14 Oct 2013 02:53:01 +0000 (02:53 +0000)]
* output.h (Output_data_got::add_constant): Tidy.
(Output_data_got::add_constant_pair): New function.
* powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
methods used so as to first call reserve_ent().

11 years ago2013-10-13 Sandra Loosemore <sandra@codesourcery.com>
Sandra Loosemore [Mon, 14 Oct 2013 01:02:39 +0000 (01:02 +0000)]
2013-10-13  Sandra Loosemore  <sandra@codesourcery.com>

gdb/
* nios2-tdep.c (nios2_reg_names): Use "sstatus" rather than "ba"
as the preferred name of r30.
* nios2-linux-tdep.c (reg_offsets): Likewise.
* features/nios2-cpu.xml: Likewise.
* features/nios2-linux.c: Regenerated.
* features/nios2.c: Regenerated.
* regformats/nios2-linux.dat: Regenerated.

11 years ago2013-10-13 Sandra Loosemore <sandra@codesourcery.com>
Sandra Loosemore [Mon, 14 Oct 2013 00:42:28 +0000 (00:42 +0000)]
2013-10-13  Sandra Loosemore  <sandra@codesourcery.com>

opcodes/
* nios2-opc.c (nios2_builtin_reg): Use "sstatus" rather than "ba"
as the primary name of r30.

gas/
* config/tc-nios2.c (nios2_consume_arg): Make the "ba" warning
also test/refer to "sstatus".  Reformat the warning message.

gas/testsuite/
* gas/nios2/warn_nobreak.l: Update text of warning messages.
* gas/nios2/registers.s: Use "sstatus" rather than "ba"
as the primary name of r30.
* gas/nios2/registers.d: Likewise.

11 years agodaily update
Alan Modra [Sun, 13 Oct 2013 23:00:05 +0000 (23:00 +0000)]
daily update

11 years agoImprove Executable displayed path (PR 15415 regression kind #2)
Jan Kratochvil [Sun, 13 Oct 2013 16:11:08 +0000 (16:11 +0000)]
Improve Executable displayed path (PR 15415 regression kind #2)

gdb/
2013-10-13  Jan Kratochvil  <jan.kratochvil@redhat.com>

Canonicalize directories for EXEC_FILENAME.
* exec.c (exec_file_attach): Use gdb_realpath_keepfile for
exec_filename.
* utils.c (gdb_realpath_keepfile): New function.
* utils.h (gdb_realpath_keepfile): New declaration.

gdb/testsuite/
2013-10-13  Jan Kratochvil  <jan.kratochvil@redhat.com>

Canonicalize directories for EXEC_FILENAME.
* gdb.base/argv0-symlink.exp
(kept file symbolic link name for info inferiors): New.
(kept directory symbolic link name): Setup kfail.
(kept directory symbolic link name for info inferiors): New.

11 years agold/testsuite/
Richard Sandiford [Sun, 13 Oct 2013 10:17:20 +0000 (10:17 +0000)]
ld/testsuite/
* lib/ld-lib.exp (default_ld_compile): Add a -I option for the source
directory.
* ld-mips-elf/compressed-plt-1.ld, ld-mips-elf/compressed-plt-1.s,
ld-mips-elf/compressed-plt-1-dyn.s, ld-mips-elf/compressed-plt-1a.s,
ld-mips-elf/compressed-plt-1b.s, ld-mips-elf/compressed-plt-1c.s,
ld-mips-elf/compressed-plt-1d.s, ld-mips-elf/compressed-plt-1e.s,
ld-mips-elf/compressed-plt-1-o32-se.rd,
ld-mips-elf/compressed-plt-1-o32-se.od,
ld-mips-elf/compressed-plt-1-o32-mips16-only.rd,
ld-mips-elf/compressed-plt-1-o32-mips16-only.od,
ld-mips-elf/compressed-plt-1-o32-umips-only.rd,
ld-mips-elf/compressed-plt-1-o32-umips-only.od,
ld-mips-elf/compressed-plt-1-o32-mips16.rd,
ld-mips-elf/compressed-plt-1-o32-mips16.od,
ld-mips-elf/compressed-plt-1-o32-mips16-got.rd,
ld-mips-elf/compressed-plt-1-o32-mips16-got.od,
ld-mips-elf/compressed-plt-1-o32-mips16-word.rd,
ld-mips-elf/compressed-plt-1-o32-mips16-word.od,
ld-mips-elf/compressed-plt-1-o32-umips.rd,
ld-mips-elf/compressed-plt-1-o32-umips.od,
ld-mips-elf/compressed-plt-1-o32-umips-got.rd,
ld-mips-elf/compressed-plt-1-o32-umips-got.od,
ld-mips-elf/compressed-plt-1-o32-umips-word.rd,
ld-mips-elf/compressed-plt-1-o32-umips-word.od,
ld-mips-elf/compressed-plt-1-n32-mips16.rd,
ld-mips-elf/compressed-plt-1-n32-mips16.od,
ld-mips-elf/compressed-plt-1-n32-umips.rd,
ld-mips-elf/compressed-plt-1-n32-umips.od: New tests.
* ld-mips-elf/mips-elf.exp: Run them.

11 years agobfd/
Richard Sandiford [Sun, 13 Oct 2013 10:03:22 +0000 (10:03 +0000)]
bfd/
* elfxx-mips.c (mips_use_local_got_p): New function.
(mips_elf_count_got_symbols, mips_elf_calculate_relocation): Use it.
(_bfd_mips_elf_check_relocs): Set pointer_equality_needed for
GOT and absolute references.

ld/testsuite/
* ld-mips-elf/pic-and-nonpic-6-n32.ad,
ld-mips-elf/pic-and-nonpic-6-n32.dd,
ld-mips-elf/pic-and-nonpic-6-n32.gd,
ld-mips-elf/pic-and-nonpic-6-n32.nd,
ld-mips-elf/pic-and-nonpic-6-n32.rd,
ld-mips-elf/pic-and-nonpic-6-n64.ad,
ld-mips-elf/pic-and-nonpic-6-n64.dd,
ld-mips-elf/pic-and-nonpic-6-n64.gd,
ld-mips-elf/pic-and-nonpic-6-n64.nd,
ld-mips-elf/pic-and-nonpic-6-n64.rd,
ld-mips-elf/pic-and-nonpic-6-o32.ad,
ld-mips-elf/pic-and-nonpic-6-o32.dd,
ld-mips-elf/pic-and-nonpic-6-o32.gd,
ld-mips-elf/pic-and-nonpic-6-o32.nd,
ld-mips-elf/pic-and-nonpic-6-o32.rd: Fix symbol value of extf4.
No longer expect extf3, extf4 and extd2 to be in the global GOT.

11 years agodaily update
Alan Modra [Sat, 12 Oct 2013 23:00:05 +0000 (23:00 +0000)]
daily update

11 years agoOnly allow 32-bit/64-bit registers for bndcl/bndcu/bndcn
H.J. Lu [Sat, 12 Oct 2013 15:57:07 +0000 (15:57 +0000)]
Only allow 32-bit/64-bit registers for bndcl/bndcu/bndcn

gas/testsuite/

* gas/i386/mpx.s: Remove bndcl/bndcu/bndcn tests with AX.
* gas/i386/x86-64-mpx.s: Likwise.

* gas/i386/mpx.d: Updated.
* gas/i386/x86-64-mpx.d: Likewise.

opcodes/

* i386-dis.c (intel_operand_size): Move v_bnd_mode alongside the
default case.
(OP_E_register): Move v_bnd_mode alongside m_mode.
* i386-opc.tbl (bndcl, bndcu, bndcn): Split 32- and 64-bit variants.
Drop Reg16 and Disp16. Add NoRex64.
(bndmk, bndmov, bndldx, bndstx): Drop Disp16.
* i386-tbl.h: Re-generate.

11 years agogold/
Roland McGrath [Fri, 11 Oct 2013 23:06:08 +0000 (23:06 +0000)]
gold/
* powerpc.cc (Output_data_got_powerpc): Remove unused methods
add_got_entry and add_got_entry_pair.

11 years agodaily update
Alan Modra [Fri, 11 Oct 2013 23:00:04 +0000 (23:00 +0000)]
daily update

11 years agoRevert inappropriate portions of last change.
Roland McGrath [Fri, 11 Oct 2013 22:16:34 +0000 (22:16 +0000)]
Revert inappropriate portions of last change.

11 years agogold/
Roland McGrath [Fri, 11 Oct 2013 22:07:40 +0000 (22:07 +0000)]
gold/
* configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
(HAVE_PUBNAMES): Likewise.
* configure: Regenerate.

11 years agogold/
Roland McGrath [Fri, 11 Oct 2013 22:05:16 +0000 (22:05 +0000)]
gold/
* testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
* testsuite/Makefile.in: Regenerate.

11 years agogold/
Roland McGrath [Fri, 11 Oct 2013 22:02:21 +0000 (22:02 +0000)]
gold/
* target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
Remove const from declaration.
* target.cc (Sized_target::do_adjust_elf_header): Update definition.
* sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
* output.h (Output_file_header): Remove const from member target_
and corresponding constructor argument.
* output.cc (Output_file_header::Output_file_header): Update prototype.
(Output_file_header::do_sized_write): Use this->target_ in place
of parameters()->target().

11 years agogold/
Roland McGrath [Fri, 11 Oct 2013 21:59:46 +0000 (21:59 +0000)]
gold/
* testsuite/undef_symbol.cc (Foo::get_a): New method.

11 years agogold/
Roland McGrath [Fri, 11 Oct 2013 21:56:16 +0000 (21:56 +0000)]
gold/
* configure.ac (MERGE_CONSTANTS_FLAG): New check.
* configure: Regenerate.
* Makefile.in: Regenerate.
* testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
* testsuite/merge_string_literals_2.c: Likewise.
* testsuite/Makefile.am
(merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
(AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
literal -fmerge-constants.
* testsuite/Makefile.in: Regenerate.

11 years agogold/
Roland McGrath [Fri, 11 Oct 2013 21:11:49 +0000 (21:11 +0000)]
gold/
* i386.cc (Target_i386): Remove unused member dynbss_.
* arm.cc (Target_arm): Likewise.
* powerpc.cc (Target_powerpc): Likewise.
* sparc.cc (Target_sparc): Likewise.
* tilegx.cc (Target_tilegx): Likewise.
* x86_64.cc (Target_x86_64): Likewise.
* dwarf_reader.h (Dwarf_info_reader): Remove unused members
type_signature_, type_offset_.
* plugin.h (Plugin_hook): Remove unused member layout_.
* readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
mapfile_.
(Read_member): Remove unused members input_objects_, symtab_,
mapfile_, layout_.
(Check_library): Remove unused member symtab_.
* archive.h (Lib_group): Remove unused member lib_.
* archive.cc (Lib_group::Lib_group): Update initializer.
* incremental.h (Incremental_binary): Remove unused member target_.
(Incremental_script_entry): Removed unused member script_.
* layout.h (Write_symbols_task): Remove unused member input_objects_.
* icf.h (Icf): Remove unused member num_tracked_relocs.

11 years agogold/
Roland McGrath [Fri, 11 Oct 2013 21:02:43 +0000 (21:02 +0000)]
gold/
* gold-threads.h (Once): Conditionalize member was_run_lock_ on
[ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
its only use.
* gold-threads.cc (Once::Once): Likewise conditionalize initializer.

11 years agotestsuite/ChangeLog:
Ulrich Weigand [Fri, 11 Oct 2013 18:50:56 +0000 (18:50 +0000)]
testsuite/ChangeLog:

2013-10-11  Andreas Arnez  <arnez@linux.vnet.ibm.com>

* gdb.arch/s390-multiarch.exp: New file.
* gdb.arch/s390-multiarch.c: New file.

11 years agogold/
Roland McGrath [Fri, 11 Oct 2013 17:38:32 +0000 (17:38 +0000)]
gold/
* archive.h: Use struct rather than class for forward declaration
of Read_symbols_data.

11 years ago * Makefile.in (GDBFLAGS): New variable.
Doug Evans [Fri, 11 Oct 2013 17:32:30 +0000 (17:32 +0000)]
* Makefile.in (GDBFLAGS): New variable.
(run): New rule.

11 years agobinutils/
Roland McGrath [Fri, 11 Oct 2013 17:24:26 +0000 (17:24 +0000)]
binutils/
* winduni.c (languages): Use \345 (octal syntax) rather than
literal non-ASCII/non-UTF8 character in string literal.

11 years agobinutils/
Roland McGrath [Fri, 11 Oct 2013 17:10:58 +0000 (17:10 +0000)]
binutils/
* readelf.c (print_dynamic_symbol): Use array subscript syntax
rather than addition syntax with string literal.

11 years agoChangeLog entries for the previous commit.
Joel Brobecker [Fri, 11 Oct 2013 14:06:40 +0000 (14:06 +0000)]
ChangeLog entries for the previous commit.

git-related mistake (added the files to the index, but forgot to
commit --amend them before pushing the commit)

11 years agoDocument the -catch-assert and -catch-exception new GDB/MI commands.
Joel Brobecker [Fri, 11 Oct 2013 13:51:27 +0000 (13:51 +0000)]
Document the -catch-assert and -catch-exception new GDB/MI commands.

This patch adds documentation for the new GDB/MI commands "-catch-assert"
and "-catch-exception", meant to provide the same functionality as
the "catch assert", "catch exception" and "catch exception unhandled"
CLI commands.

In the GDB Manual, there was already a section for catchpoint comments,
so that seemed like a natural place to document the new commands. But
commands related to a given concept seem to have traditionally been
organized alphabetically, and I didn't want future commands to break
down logical pairing of various commands. For instance, "-catch-load"
and "-catch-unload" are quite "distant" from each other, and it is easy
to imagine a new comment which would alphabetically fall in between,
causing them to be separated. So I introduced subsections to prevent
that from happening.

gdb/ChangeLog:

        * NEWS: Add entry documenting the new "-catch-assert" and
        "-catch-exception" GDB/MI commands.

gdb/doc/ChangeLog:

        * gdb.texinfo (Shared Library GDB/MI Catchpoint Commands):
        New subsection inside which the "-catch-load" and "-catch-unload"
        commands documentation is now placed.
        (Ada Exception GDB/MI Catchpoint Commands): New subsection
        documenting the "-catch-assert" and "-catch-exception" new
        GDB/MI commands.

11 years agoAdjust gdb.ada/mi_catch_ex.exp to use GDB/MI catch commands...
Joel Brobecker [Fri, 11 Oct 2013 13:49:36 +0000 (13:49 +0000)]
Adjust gdb.ada/mi_catch_ex.exp to use GDB/MI catch commands...

... in place of the CLI "catch ..." commands.  The latter were used
because the GDB/MI equivalents were not available at the time.

gdb/testsuite/ChangeLog:

        * gdb.ada/mi_catch_ex.exp: Adjusts all "catch ..." tests to
        use the appropriate GDB/MI command instead, and verify
        the test output.

11 years agoNew GDB/MI commands to catch Ada exceptions
Joel Brobecker [Fri, 11 Oct 2013 13:48:19 +0000 (13:48 +0000)]
New GDB/MI commands to catch Ada exceptions

This patch introduces two new GDB/MI commands implementing the equivalent
of the "catch exception" and  "catch assert" GDB/CLI commands.

gdb/ChangeLog:

        * breakpoint.h (init_ada_exception_breakpoint): Add parameter
        "enabled".
        * breakpoint.c (init_ada_exception_breakpoint): Add parameter
        "enabled".  Set B->ENABLE_STATE accordingly.
        * ada-lang.h (ada_exception_catchpoint_kind): Move here from
        ada-lang.c.
        (create_ada_exception_catchpoint): Add declaration.
        * ada-lang.c (ada_exception_catchpoint_kind): Move to ada-lang.h.
        (create_ada_exception_catchpoint): Make non-static. Add new
        parameter "disabled". Use it in call to
        init_ada_exception_breakpoint.
        (catch_ada_exception_command): Add parameter "enabled" in call
        to create_ada_exception_catchpoint.
        (catch_assert_command): Likewise.

        * mi/mi-cmds.h (mi_cmd_catch_assert, mi_cmd_catch_exception):
        Add declarations.
        * mi/mi-cmds.c (mi_cmds): Add the "catch-assert" and
        "catch-exception" commands.
        * mi/mi-cmd-catch.c: Add #include "ada-lang.h".
        (mi_cmd_catch_assert, mi_cmd_catch_exception): New functions.

11 years agoAdd "ada_" prefix to enum ada_exception_catchpoint_kind
Joel Brobecker [Fri, 11 Oct 2013 13:45:27 +0000 (13:45 +0000)]
Add "ada_" prefix to enum ada_exception_catchpoint_kind

This is in preparation for making that type public, in order to be
able to use make create_ada_exception_catchpoint public as well,
making it usable from the GDB/MI implementation.

gdb/ChangeLog:

        * ada-lang.c (enum ada_exception_catchpoint_kind): Renames
        "enum exception_catchpoint_kind".  Replace the "ex_" prefix
        of all its enumerates with "ada_".  Update the rest of this
        file throughout.

11 years agoRework a bit Ada exception catchpoint support (in prep for GDB/MI)
Joel Brobecker [Fri, 11 Oct 2013 13:44:11 +0000 (13:44 +0000)]
Rework a bit Ada exception catchpoint support (in prep for GDB/MI)

This patch reworks a bit how the different steps required to insert
an Ada exception catchpoints are organized. They used to be:

  1. Call a "decode" function which does:
        1.a.  Parse the command and its arguments
        1.b.  Create a SAL & OPS from some of those arguments

  2. Call create_ada_exception_catchpoint using SAL as well
     as some of the arguments extracted above.

The bulk of the change consists in integrating step (1.b) into
step (2) in order to turn create_ada_exception_catchpoint into
a function whose arguments are all user-level concepts. This
paves the way from a straightforward implementation of the equivalent
commands in the GDB/MI interpreter.

gdb/ChangeLog:

        * ada-lang.c (ada_decode_exception_location): Delete.
        (create_ada_exception_catchpoint): Remove arguments "sal",
        "addr_string" and "ops".  Add argument "ex_kind" instead.
        Adjust implementation accordingly, calling ada_exception_sal
        to get the entities it no longer gets passed as arguments.
        Document the function's arguments.
        (catch_ada_exception_command): Use catch_ada_exception_command_split
        instead of ada_decode_exception_location, and update call to
        create_ada_exception_catchpoint.
        (catch_ada_assert_command_split): Renames
        ada_decode_assert_location.  Remove parameters "addr_string" and
        "ops", and now returns void.  Adjust implementation accordingly.
        Update the function documentation.
        (catch_assert_command): Use catch_ada_assert_command_split
        instead of ada_decode_assert_location.  Update call to
        create_ada_exception_catchpoint.

11 years agoFix dates (wrong month) in the last 2 ChangeLog entries.
Joel Brobecker [Fri, 11 Oct 2013 13:42:06 +0000 (13:42 +0000)]
Fix dates (wrong month) in the last 2 ChangeLog entries.

11 years agowarn if "source" fails to open the file when from_tty == 0
Joel Brobecker [Fri, 11 Oct 2013 08:23:11 +0000 (08:23 +0000)]
warn if "source" fails to open the file when from_tty == 0

Consider the following example:

    % gdb -q -batch -ex 'source nonexistant-file'
    [nothing]

One would have at least expected the debugger to warn about
not finding the file, similar to the error shown when using
a more interactive mode. Eg:

    (gdb) source nonexistant-file
    nonexistant-file: No such file or directory.

Not raising an error appears to be intentional, presumably in order
to prevent this situation from stoping the execution of a GDB script.
But the lack of at least a warning makes it harder for a user to
diagnose any issue, if the file was expected to be there and readable.

This patch adds a warning in that case:

    % gdb -q -batch -ex 'source nonexistant-file'
    warning: nonexistant-file: No such file or directory.

gdb/ChangeLog:

        * utils.h (perror_warning_with_name): Add declaration.
        * utils.c (perror_warning_with_name): New function.
        * cli/cli-cmds.c (source_script_with_search): Add call to
        perror_warning_with_name if from_tty is nul.

gdb/testsuite/ChangeLog:

        * gdb.base/source-nofile.gdb: New file.
        * gdb.base/source.exp: Add two tests verifying the behavior when
        the "source" command is given a non-existant filename.

11 years agonew function perror_string extracted out of throw_perror_with_name.
Joel Brobecker [Fri, 11 Oct 2013 08:20:10 +0000 (08:20 +0000)]
new function perror_string extracted out of throw_perror_with_name.

The main purpose of this patch is to extract the part of
throw_perror_with_name that computes a string providing the system
error message combined with a prefix string.  This will become useful
later on to provide a routine which prints a warning using that
perror_string, rather than throwing an error.

gdb/ChangeLog:

        * utils.c (perror_string): New function, extracted out of
        throw_perror_with_name.
        (throw_perror_with_name): Rework to use perror_string.

11 years agogdb/testsuite/
Yao Qi [Fri, 11 Oct 2013 07:27:46 +0000 (07:27 +0000)]
gdb/testsuite/

* gdb.mi/mi-catch-load.c: Remove the include of "dlfcn.h".
 [__WIN32__]: Include "windows.h" and define macro 'dlopen'
 and 'dlclose'.
[!__WIN32__]: Include "dlfcn.h".
* gdb.mi/mi-catch-load.exp: Set up kfail.

11 years ago * Removed short_hand field from opcode table and
Sean Keys [Fri, 11 Oct 2013 04:55:42 +0000 (04:55 +0000)]
 * Removed short_hand field from opcode table and
     refactored assembler/disassember accordingly.
     Testsuite checkout OK.

11 years agoAdjust gdb/doc/ChangeLog re "set/show remotebaud" renaming...
Joel Brobecker [Fri, 11 Oct 2013 04:50:26 +0000 (04:50 +0000)]
Adjust gdb/doc/ChangeLog re "set/show remotebaud" renaming...

... adding the node names, to be more explicit about which nodes
were affected by this change.

11 years agogdb/
Yao Qi [Fri, 11 Oct 2013 03:01:09 +0000 (03:01 +0000)]
gdb/

Typo fix in my previous commit.

11 years agogdb/
Yao Qi [Fri, 11 Oct 2013 02:54:44 +0000 (02:54 +0000)]
gdb/

* remote.c (discard_pending_stop_replies_in_queue): Update
declaration.
(struct stop_reply) <rs>: New field.
(remove_stop_reply_of_remote_state): New function.
(discard_pending_stop_replies_in_queue): Add parameter 'rs'.
Callers update.  Pass remove_stop_reply_of_remote_state to
QUEUE_iterate.
(remote_parse_stop_reply): Initialize field 'rs'.

11 years ago * gas/xgate/all_insns.d: Add com macro insn test.
Sean Keys [Fri, 11 Oct 2013 01:41:49 +0000 (01:41 +0000)]
* gas/xgate/all_insns.d: Add com macro insn test.
* gas/xgate/all_insns.s: Add com macro insn test.

11 years agoopcodes/
Roland McGrath [Fri, 11 Oct 2013 00:58:29 +0000 (00:58 +0000)]
opcodes/
* i386-dis.c (oappend_maybe_intel): New function.
(OP_ST, OP_STi, append_seg, OP_I, OP_I64, OP_sI, OP_ESreg): Use it.
(OP_C, OP_T, CMP_Fixup, OP_EX_VexImmW): Likewise.
(VCMP_Fixup, VPCMP_Fixup, PCLMUL_Fixup): Likewise.

11 years agodaily update
Alan Modra [Thu, 10 Oct 2013 23:00:05 +0000 (23:00 +0000)]
daily update

11 years agold/
Roland McGrath [Thu, 10 Oct 2013 22:50:40 +0000 (22:50 +0000)]
ld/
* ldmisc.c (vfinfo): Use Boolean ? "" : ":" in place of ":" + Boolean.
It silences some compilers' warnings and is much less bizarre to read.

11 years agoopcodes/
Roland McGrath [Thu, 10 Oct 2013 17:43:37 +0000 (17:43 +0000)]
opcodes/
* cr16-opc.c (REG): Cast NAME to 'reg' enum type to suppress
possible compiler warnings when the union's initializer is
actually meant for the 'preg' enum typed member.
* crx-opc.c (REG): Likewise.

11 years agoopcodes/
Roland McGrath [Thu, 10 Oct 2013 17:19:49 +0000 (17:19 +0000)]
opcodes/
* v850-dis.c (v850_cacheop_codes, v850_prefop_codes):
Remove duplicate const qualifier.

11 years agogas/
Jan Beulich [Thu, 10 Oct 2013 12:22:41 +0000 (12:22 +0000)]
gas/
2013-10-10  Jan Beulich <jbeulich@suse.com>

* tc-i386-intel.c (i386_intel_simplify_register): Suppress base/index
swapping for bndmk, bndldx, and bndstx.

11 years agogdb/aarch64-linux-tdep.c: Call linux_init_abi.
Will Newton [Thu, 10 Oct 2013 10:40:42 +0000 (10:40 +0000)]
gdb/aarch64-linux-tdep.c: Call linux_init_abi.

If we are running on a Linux platform we should call linux_init_abi
in order to get all the useful hooks it enables.

gdb/ChangeLog:

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

* aarch64-linux-tdep.c (aarch64_linux_init_abi): Call
linux_init_abi.

11 years ago2013-10-10 Andreas Arnez <arnez@linux.vnet.ibm.com>
Andreas Krebbel [Thu, 10 Oct 2013 09:54:13 +0000 (09:54 +0000)]
2013-10-10  Andreas Arnez  <arnez@linux.vnet.ibm.com>

* lib/gdb.exp (gdb_core_cmd): Replace fixed string "re-load
generated corefile" by argument "$test".

11 years agoRemove unnecessary @w{} in gdb.texinfo
Joel Brobecker [Thu, 10 Oct 2013 06:00:41 +0000 (06:00 +0000)]
Remove unnecessary @w{} in gdb.texinfo

gdb/doc/ChangeLog:

        * gdb.texinfo (Connecting): Remove unnecessary @w{}.

11 years agoRename "set/show remotebaud" command into "set/show serial baud"
Joel Brobecker [Thu, 10 Oct 2013 05:50:20 +0000 (05:50 +0000)]
Rename "set/show remotebaud" command into "set/show serial baud"

This patch renames the "set/show remotebaud" commands into
"set/show serial baud", and moves its implementation into serial.c.
It also moves the "baud_rate" global from top.c to serial.c, where
the new code is being added (the alternative was to add an include
of target.h).

And to facilitate the transition to the new setting name, this
patch also preserves the old commands, and marks them as deprecated
to alert the users of the change.

gdb/ChangeLog:

        * cli/cli-cmds.c (show_baud_rate): Moved to serial.c as
        serial_baud_show_cmd.
        (_initialize_cli_cmds): Delete the code creating the
        "set/show remotebaud" commands.
        * serial.c (baud_rate): Move here from top.c.
        (serial_baud_show_cmd): Move here from cli/cli-cmds.c.
        (_initialize_serial): Create "set/show serial baud" commands.
        Add "set/show remotebaud" command aliases.
        * top.c (baud_rate): Moved to serial.c.
        * NEWS: Document the new "set/show serial baud" commands,
        replacing "set/show remotebaud".

gdb/doc/ChangeLog:

        * gdb.texinfo: Replace "set remotebaud" and "show remotebaud"
        by "set serial baud" and "show serial baud" (resp) throughout.

11 years agodaily update
Alan Modra [Wed, 9 Oct 2013 23:00:04 +0000 (23:00 +0000)]
daily update

11 years agosim/erc32/ChangeLog:
Sergio Durigan Junior [Wed, 9 Oct 2013 21:42:11 +0000 (21:42 +0000)]
sim/erc32/ChangeLog:
2013-10-09  Sergio Durigan Junior  <sergiodj@redhat.com>

PR sim/16018:
* float.c (set_fsr): Add missing "break" statements.  Reindent
code.

11 years agobfd/
Roland McGrath [Wed, 9 Oct 2013 19:40:04 +0000 (19:40 +0000)]
bfd/
* elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Cast switch
expression to int to silence over-eager compiler warnings.

11 years agold/
Roland McGrath [Wed, 9 Oct 2013 18:16:18 +0000 (18:16 +0000)]
ld/
* emultempl/elf32.em (id_note_section_size): Use ATTRIBUTE_UNUSED
rather than a dummy assignment for unused parameter.
* plugin.c (get_input_file, release_input_file): Likewise.

11 years agobfd/
Roland McGrath [Wed, 9 Oct 2013 18:02:48 +0000 (18:02 +0000)]
bfd/
* xcofflink.c (_bfd_xcoff_bfd_final_link): Don't touch EREL in
loop that doesn't use (or initialize) it.

11 years agobfd/
Roland McGrath [Wed, 9 Oct 2013 17:54:32 +0000 (17:54 +0000)]
bfd/
* elfxx-tilegx.c (tilegx32_plt_tail_entry, tilegx32_plt_tail_entry):
Move second const qualifier so it applies to the pointer.

11 years agoStop using errno values around target_xfer interfaces and memory errors.
Pedro Alves [Wed, 9 Oct 2013 17:00:00 +0000 (17:00 +0000)]
Stop using errno values around target_xfer interfaces and memory errors.

target_read_memory & friends build on top of target_read (thus on top
of the target_xfer machinery), but turn all errors to EIO, an errno
value.  I think we'd better convert all these to return a
target_xfer_error too, like target_xfer_partial in a previous patch.
The patch starts by doing that.

(The patch does not add a enum target_xfer_error value for '0'/no
error, and likewise does not change the return type of several of
these functions to enum target_xfer_error, because different functions
return '0' with different semantics.)

I audited the tree for memory_error calls, EIO checks, places where
GDB hardcodes 'errno = EIO', and also for strerror calls.  What I
found is that nowadays there's really no need to handle random errno
values, other than the EIOs gdb itself hardcodes.  No doubt errno
values would appear in common code back in the day when
target_xfer_memory was the main interface to access memory, but
nowadays, any errno value that deprecated interface could return is
just absorved by default_xfer_partial:

      else if (xfered == 0 && errno == 0)
/* "deprecated_xfer_memory" uses 0, cross checked against
           ERRNO as one indication of an error.  */
return 0;
      else
return -1;

There are two places in the code that check for EIO and print "out of
bounds", and defer to strerror for other errors.  That's
c-lang.c:c_get_string, and valprint.c.:val_print_string.  AFAICT, the
strerror branch can never be reached nowadays, as the only error
possible to get at those points is EIO, given that it's GDB itself
that set that errno value (in target_read_memory, etc.).

breakpoint.c:insert_bp_location always prints the error val as if an
errno, returned by target_insert_breakpoint, with strerr.  Now the
error here is either always EIO for mem-break.c targets (again
hardcoded by the target_read_memory/target_write_memory functions), so
this always prints "Input/output error" or similar (depending on
host), or, for remote targets (and probably others), this gem:

  Error accessing memory address 0x80200400: Unknown error -1.

This patch makes these 3 places print the exact same error
memory_error prints.  This changes output, but I think this is better,
for making memory error output consistent with other commands, and, it
means we have a central place to tweak for memory errors.

E.g., this changes:

 Cannot insert breakpoint 1.
 Error accessing memory address 0x5fc660: Input/output error.

to:

 Cannot insert breakpoint 1.
 Cannot access memory at address 0x5fc660

Which I find pretty much acceptable.

Surprisingly, only py-prettyprint.exp had a regression, for needing an
adjustment.  I also grepped the testsuite for the old errors, and
found no other hits.

Now that errno values aren't used anywhere in any of these memory
access related routines, I made memory_error itself take a
target_xfer_error instead of an errno.  The new
target_xfer_memory_error function added recently is no longer
necessary, and is thus removed.

Tested on x86_64 Fedora 17, native and gdbserver.

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

* breakpoint.c (insert_bp_location): Use memory_error_message to
build the memory error string.
* c-lang.c: Include "gdbcore.h".
(c_get_string): Use memory_error to throw error.
(target_xfer_memory_error): Delete.
(memory_error_message): New, factored out from
target_xfer_memory_error.
(memory_error): Change parameter type to target_xfer_error.
Rewrite.
(read_memory): Use memory_error instead of
target_xfer_memory_error.
* gdbcore.h: Include "target.h".
(memory_error): Change parameter type to target_xfer_error.
(memory_error_message): Declare function.
* target.c (target_read_memory, target_read_stack)
(target_write_memory, target_write_raw_memory): Return
TARGET_XFER_E_IO on error.  Adjust comments.
(get_target_memory): Pass TARGET_XFER_E_IO to memory_error,
instead of EIO.
* target.h (target_read, target_insert_breakpoint)
(target_remove_breakpoint): Adjust comments.
* valprint.c (partial_memory_read): Rename parameter, and adjust
comment.
(val_print_string): Use memory_error_message to build the memory
error string.

gdb/testsuite/
2013-10-09  Pedro Alves  <palves@redhat.com>

* gdb.python/py-prettyprint.exp (run_lang_tests): Adjust expected
output.

11 years agoFix typo in previous delta.
Nick Clifton [Wed, 9 Oct 2013 16:37:44 +0000 (16:37 +0000)]
Fix typo in previous delta.

11 years ago PR gprof/16027
Nick Clifton [Wed, 9 Oct 2013 16:34:30 +0000 (16:34 +0000)]
PR gprof/16027
* source.c (annotate_source): Close ifp.
* corefile.c (read_function_mappings): Close file.

11 years ago PR ld/16028
Nick Clifton [Wed, 9 Oct 2013 16:30:02 +0000 (16:30 +0000)]
PR ld/16028
* ldmain.c (add_keepsyms_file): Close file at end of function.