external/binutils.git
8 years agoFix gdbserver --debug issues caught by Valgrind
Pedro Alves [Thu, 6 Aug 2015 12:38:56 +0000 (13:38 +0100)]
Fix gdbserver --debug issues caught by Valgrind

Running gdbserver --debug under Valgrind shows:

 ==4803== Invalid read of size 4
 ==4803==    at 0x432B62: linux_write_memory (linux-low.c:5320)
 ==4803==    by 0x4143F7: write_inferior_memory (target.c:83)
 ==4803==    by 0x415895: remove_memory_breakpoint (mem-break.c:362)
 ==4803==    by 0x432EF5: linux_remove_point (linux-low.c:5460)
 ==4803==    by 0x416319: delete_raw_breakpoint (mem-break.c:802)
 ==4803==    by 0x4163F3: release_breakpoint (mem-break.c:842)
 ==4803==    by 0x416477: delete_breakpoint_1 (mem-break.c:869)
 ==4803==    by 0x4164EF: delete_breakpoint (mem-break.c:891)
 ==4803==    by 0x416843: delete_gdb_breakpoint_1 (mem-break.c:1069)
 ==4803==    by 0x4168D8: delete_gdb_breakpoint (mem-break.c:1098)
 ==4803==    by 0x4134E3: process_serial_event (server.c:4051)
 ==4803==    by 0x4138E4: handle_serial_event (server.c:4196)
 ==4803==  Address 0x4c6b930 is 0 bytes inside a block of size 1 alloc'd
 ==4803==    at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
 ==4803==    by 0x4240C6: xmalloc (common-utils.c:43)
 ==4803==    by 0x41439C: write_inferior_memory (target.c:80)
 ==4803==    by 0x415895: remove_memory_breakpoint (mem-break.c:362)
 ==4803==    by 0x432EF5: linux_remove_point (linux-low.c:5460)
 ==4803==    by 0x416319: delete_raw_breakpoint (mem-break.c:802)
 ==4803==    by 0x4163F3: release_breakpoint (mem-break.c:842)
 ==4803==    by 0x416477: delete_breakpoint_1 (mem-break.c:869)
 ==4803==    by 0x4164EF: delete_breakpoint (mem-break.c:891)
 ==4803==    by 0x416843: delete_gdb_breakpoint_1 (mem-break.c:1069)
 ==4803==    by 0x4168D8: delete_gdb_breakpoint (mem-break.c:1098)
 ==4803==    by 0x4134E3: process_serial_event (server.c:4051)
 ==4803==

And:

 ==7272== Conditional jump or move depends on uninitialised value(s)
 ==7272==    at 0x3615E48361: vfprintf (vfprintf.c:1634)
 ==7272==    by 0x414E89: debug_vprintf (debug.c:60)
 ==7272==    by 0x42800A: debug_printf (common-debug.c:35)
 ==7272==    by 0x43937B: my_waitpid (linux-waitpid.c:149)
 ==7272==    by 0x42D740: linux_wait_for_event_filtered (linux-low.c:2441)
 ==7272==    by 0x42DADA: linux_wait_for_event (linux-low.c:2552)
 ==7272==    by 0x42E165: linux_wait_1 (linux-low.c:2860)
 ==7272==    by 0x42F5D8: linux_wait (linux-low.c:3453)
 ==7272==    by 0x4144A4: mywait (target.c:107)
 ==7272==    by 0x413969: handle_target_event (server.c:4214)
 ==7272==    by 0x41A1A6: handle_file_event (event-loop.c:429)
 ==7272==    by 0x41996D: process_event (event-loop.c:184)

gdb/ChangeLog:
2015-08-06  Pedro Alves  <palves@redhat.com>

* nat/linux-waitpid.c (my_waitpid): Only print *status if waitpid
returned > 0.

gdb/gdbserver/ChangeLog:
2015-08-06  Pedro Alves  <palves@redhat.com>

* linux-low.c (linux_write_memory): Rewrite debug output to avoid
reading beyond the passed in buffer length.

8 years agogdbserver: Fix non-stop / fork / step-over issues
Pedro Alves [Thu, 6 Aug 2015 11:07:10 +0000 (12:07 +0100)]
gdbserver: Fix non-stop / fork / step-over issues

Ref: https://sourceware.org/ml/gdb-patches/2015-07/msg00868.html

This adds a test that has a multithreaded program have several threads
continuously fork, while another thread continuously steps over a
breakpoint.

This exposes several intertwined issues, which this patch addresses:

 - When we're stopping and suspending threads, some thread may fork,
   and we missed setting its suspend count to 1, like we do when a new
   clone/thread is detected.  When we next unsuspend threads, the fork
   child's suspend count goes below 0, which is bogus and fails an
   assertion.

 - If a step-over is cancelled because a signal arrives, but then gdb
   is not interested in the signal, we pass the signal straight back
   to the inferior.  However, we miss that we need to re-increment the
   suspend counts of all other threads that had been paused for the
   step-over.  As a result, other threads indefinitely end up stuck
   stopped.

 - If a detach request comes in just while gdbserver is handling a
   step-over (in the test at hand, this is GDB detaching the fork
   child), gdbserver internal errors in stabilize_thread's helpers,
   which assert that all thread's suspend counts are 0 (otherwise we
   wouldn't be able to move threads out of the jump pads).  The
   suspend counts aren't 0 while a step-over is in progress, because
   all threads but the one stepping past the breakpoint must remain
   paused until the step-over finishes and the breakpoint can be
   reinserted.

 - Occasionally, we see "BAD - reinserting but not stepping." being
   output (from within linux_resume_one_lwp_throw).  That was because
   GDB pokes memory while gdbserver is busy with a step-over, and that
   suspends threads, and then re-resumes them with proceed_one_lwp,
   which missed another reason to tell linux_resume_one_lwp that the
   thread should be set back to stepping.

 - In a couple places, we were resuming threads that are meant to be
   suspended.  E.g., when a vCont;c/s request for thread B comes in
   just while gdbserver is stepping thread A past a breakpoint.  The
   resume for thread B must be deferred until the step-over finishes.

 - The test runs with both "set detach-on-fork" on and off.  When off,
   it exercises the case of GDB detaching the fork child explicitly.
   When on, it exercises the case of gdb resuming the child
   explicitly.  In the "off" case, gdb seems to exponentially become
   slower as new inferiors are created.  This is _very_ noticeable as
   with only 100 inferiors gdb is crawling already, which makes the
   test take quite a bit to run.  For that reason, I've disabled the
   "off" variant for now.

gdb/ChangeLog:
2015-08-06  Pedro Alves  <palves@redhat.com>

* target/waitstatus.h (enum target_stop_reason)
<TARGET_STOPPED_BY_SINGLE_STEP>: New value.

gdb/gdbserver/ChangeLog:
2015-08-06  Pedro Alves  <palves@redhat.com>

* linux-low.c (handle_extended_wait): Set the fork child's suspend
count if stopping and suspending threads.
(check_stopped_by_breakpoint): If stopped by trace, set the LWP's
stop reason to TARGET_STOPPED_BY_SINGLE_STEP.
(linux_detach): Complete an ongoing step-over.
(lwp_suspended_inc, lwp_suspended_decr): New functions.  Use
throughout.
(resume_stopped_resumed_lwps): Don't resume a suspended thread.
(linux_wait_1): If passing a signal to the inferior after
finishing a step-over, unsuspend and re-resume all lwps.  If we
see a single-step event but the thread should be continuing, don't
pass the trap to gdb.
(stuck_in_jump_pad_callback, move_out_of_jump_pad_callback): Use
internal_error instead of gdb_assert.
(enqueue_pending_signal): New function.
(check_ptrace_stopped_lwp_gone): Add debug output.
(start_step_over): Use internal_error instead of gdb_assert.
(complete_ongoing_step_over): New function.
(linux_resume_one_thread): Don't resume a suspended thread.
(proceed_one_lwp): If the LWP is stepping over a breakpoint, reset
it stepping.

gdb/testsuite/ChangeLog:
2015-08-06  Pedro Alves  <palves@redhat.com>

* gdb.threads/forking-threads-plus-breakpoint.exp: New file.
* gdb.threads/forking-threads-plus-breakpoint.c: New file.

8 years agoLinux gdbserver confused when event randomization picks process exit event
Pedro Alves [Thu, 6 Aug 2015 11:07:09 +0000 (12:07 +0100)]
Linux gdbserver confused when event randomization picks process exit event

The tail end of linux_wait_1 isn't expecting that the select_event_lwp
machinery can pick a whole-process exit event to report to GDB.  When
that happens, both gdb and gdbserver end up quite confused:

 ...
 (gdb)
 [Thread 24971.24971] #1 stopped.
 0x0000003615a011f0 in ?? ()
 c&
 Continuing.
 (gdb) [New Thread 24971.24981]
 [New Thread 24983.24983]
 [New Thread 24971.24982]

 [Thread 24983.24983] #3 stopped.
 0x0000003615ebc7cc in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/fork.c:130
 130       pid = ARCH_FORK ();
 [New Thread 24984.24984]
 Error in re-setting breakpoint -16: PC register is not available
 Error in re-setting breakpoint -17: PC register is not available
 Error in re-setting breakpoint -18: PC register is not available
 Error in re-setting breakpoint -19: PC register is not available
 Error in re-setting breakpoint -24: PC register is not available
 Error in re-setting breakpoint -25: PC register is not available
 Error in re-setting breakpoint -26: PC register is not available
 Error in re-setting breakpoint -27: PC register is not available
 Error in re-setting breakpoint -28: PC register is not available
 Error in re-setting breakpoint -29: PC register is not available
 Error in re-setting breakpoint -30: PC register is not available
 PC register is not available
 (gdb)

gdb/gdbserver/ChangeLog:
2015-08-06  Pedro Alves  <palves@redhat.com>

* linux-low.c (add_lwp): Set waitstatus to TARGET_WAITKIND_IGNORE.
(linux_thread_alive): Use lwp_is_marked_dead.
(extended_event_reported): Delete.
(linux_wait_1): Check if waitstatus is TARGET_WAITKIND_IGNORE
instead of extended_event_reported.
(mark_lwp_dead): Don't set the 'dead' flag.  Store the waitstatus
as well.
(lwp_is_marked_dead): New function.
(lwp_running): Use lwp_is_marked_dead.
* linux-low.h: Delete 'dead' field, and update 'waitstatus's
comment.

8 years agoLinux gdbserver fork event debug output
Pedro Alves [Thu, 6 Aug 2015 11:07:09 +0000 (12:07 +0100)]
Linux gdbserver fork event debug output

The "extended event with waitstatus" debug output is unreachable, as
it is guarded by "if (!report_to_gdb)".  If extended_event_reported is
true, then so is report_to_gdb.  Move it to where we print why we're
reporting an event to GDB.

Also, the debug output currently tries to print the wrong struct
target_waitstatus.

gdb/gdbserver/ChangeLog:
2015-08-06  Pedro Alves  <palves@redhat.com>

* linux-low.c (linux_wait_1): Move fork event output out of the
!report_to_gdb check.  Pass event_child->waitstatus to
target_waitstatus_to_string instead of ourstatus.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 6 Aug 2015 00:00:27 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agostepping is disturbed by setjmp/longjmp | try/catch in other threads
Pedro Alves [Wed, 5 Aug 2015 19:09:28 +0000 (20:09 +0100)]
stepping is disturbed by setjmp/longjmp | try/catch in other threads

At https://sourceware.org/ml/gdb-patches/2015-08/msg00097.html, Joel
observed that trying to next/step a program on GNU/Linux sometimes
results in the following failed assertion:

% gdb -q .obj/gprof/main
    (gdb) start
    (gdb) n
    (gdb) step
    [...]/infrun.c:2391: internal-error:
    resume: Assertion `sig != GDB_SIGNAL_0' failed.

What happened is that, during the "next" operation, GDB hit a
longjmp/exception/step-resume breakpoint but failed to see that this
breakpoint was set for a different thread than the one being stepped.

Joel's detailed analysis follows:

More precisely, at the end of the "start" command, we are stopped at
the start of function Main in main.adb; there are 4 threads in total,
and we are in the main thread (which is thread 1):

    (gdb) info thread
      Id   Target Id         Frame
      4    Thread 0xb7a56ba0 (LWP 28379) 0xffffe410 in __kernel_vsyscall ()
      3    Thread 0xb7c5aba0 (LWP 28378) 0xffffe410 in __kernel_vsyscall ()
      2    Thread 0xb7e5eba0 (LWP 28377) 0xffffe410 in __kernel_vsyscall ()
    * 1    Thread 0xb7ea18c0 (LWP 28370) main () at /[...]/main.adb:57

All the logs below reference Thread ID/LWP, but it'll be easier to
talk about the threads by GDB thread number.  For instance, thread 1
is LWP 28370 while thread 3 is LWP 28378.  So, the explanations below
translate the LWPs into thread numbers.

Back to what happens while we are trying to "next' our program:
    (gdb) n
    infrun: clear_proceed_status_thread (Thread 0xb7a56ba0 (LWP 28379))
    infrun: clear_proceed_status_thread (Thread 0xb7c5aba0 (LWP 28378))
    infrun: clear_proceed_status_thread (Thread 0xb7e5eba0 (LWP 28377))
    infrun: clear_proceed_status_thread (Thread 0xb7ea18c0 (LWP 28370))
    infrun: proceed (addr=0xffffffff, signal=GDB_SIGNAL_DEFAULT)
    infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0xb7ea18c0 (LWP 28370)] at 0x805451e
    infrun: target_wait (-1.0.0, status) =
    infrun:   28370.28370.0 [Thread 0xb7ea18c0 (LWP 28370)],
    infrun:   status->kind = stopped, signal = GDB_SIGNAL_TRAP
    infrun: TARGET_WAITKIND_STOPPED
    infrun: stop_pc = 0x8054523

We've resumed thread 1 (LWP 28370), and received in return a signal
that the same thread stopped slightly further.  It's still in the
range of instructions for the line of source we started the "next"
from, as evidenced by the following trace...

    infrun: stepping inside range [0x805451e-0x8054531]

... and thus, we decide to continue stepping the same thread:

    infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0xb7ea18c0 (LWP 28370)] at 0x8054523
    infrun: prepare_to_wait

That's when we get an event from a different thread (thread 3)...

    infrun: target_wait (-1.0.0, status) =
    infrun:   28370.28378.0 [Thread 0xb7c5aba0 (LWP 28378)],
    infrun:   status->kind = stopped, signal = GDB_SIGNAL_TRAP
    infrun: TARGET_WAITKIND_STOPPED
    infrun: stop_pc = 0x80782d0
    infrun: context switch
    infrun: Switching context from Thread 0xb7ea18c0 (LWP 28370) to Thread 0xb7c5aba0 (LWP 28378)

... which we find to be at the address where we set a breakpoint on
"the unwinder debug hook" (namely "_Unwind_DebugHook").  But GDB fails
to notice that the breakpoint was inserted for thread 1 only, and so
decides to handle it as...

    infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME

... and inserts a breakpoint at the corresponding resume address, as
evidenced by this the next log:

    infrun: exception resume at 80542a2

That breakpoint seems innocent right now, but will play a role fairly
quickly.  But for now, GDB has inserted the exception-resume
breakpoint, and needs to single-step thread 3 past the breakpoint it
just hit.  Thus, it temporarily disables the exception breakpoint, and
requests a step of that thread:

    infrun: skipping breakpoint: stepping past insn at: 0x80782d0
    infrun: skipping breakpoint: stepping past insn at: 0x80782d0
    infrun: skipping breakpoint: stepping past insn at: 0x80782d0
    infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current thread [Thread 0xb7c5aba0 (LWP 28378)] at 0x80782d0
    infrun: prepare_to_wait

We then get a notification, still from thread 3, that it's now past
that breakpoint...

    infrun: prepare_to_wait
    infrun: target_wait (-1.0.0, status) =
    infrun:   28370.28378.0 [Thread 0xb7c5aba0 (LWP 28378)],
    infrun:   status->kind = stopped, signal = GDB_SIGNAL_TRAP
    infrun: TARGET_WAITKIND_STOPPED
    infrun: stop_pc = 0x8078424

... so we can resume what we were doing before, which is single-stepping
thread 1 until we get to a new line of code:

    infrun: switching back to stepped thread
    infrun: Switching context from Thread 0xb7c5aba0 (LWP 28378) to Thread 0xb7ea18c0 (LWP 28370)
    infrun: expected thread still hasn't advanced
    infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0xb7ea18c0 (LWP 28370)] at 0x8054523

The "resume" log above shows that we're resuming thread 1 from where
we left off (0x8054523).  We get one more stop at 0x8054529, which is
still inside our stepping range so we go again.  That's when we get
the following event, from thread 3:

    infrun: prepare_to_wait
    infrun: target_wait (-1.0.0, status) =
    infrun:   28370.28378.0 [Thread 0xb7c5aba0 (LWP 28378)],
    infrun:   status->kind = stopped, signal = GDB_SIGNAL_TRAP
    infrun: TARGET_WAITKIND_STOPPED
    infrun: stop_pc = 0x80542a2

Now the stop_pc address is interesting, because it's the address of
"exception resume" breakpoint...

    infrun: context switch
    infrun: Switching context from Thread 0xb7ea18c0 (LWP 28370) to Thread 0xb7c5aba0 (LWP 28378)
    infrun: BPSTAT_WHAT_CLEAR_LONGJMP_RESUME

... and since that location is at a different line of code, this is
where it decides the "next" operation should stop:

    infrun: stop_waiting
    [Switching to Thread 0xb7c5aba0 (LWP 28378)]
    0x080542a2 in inte_tache_rt.ttache_rt (
        <_task>=0x80968ec <inte_tache_rt_inst.tache2>)
        at /[...]/inte_tache_rt.adb:54
    54            end loop;

However, what GDB should have noticed earlier that the exception
breakpoint we hit was for a different thread, thus should have
single-stepped that thread out of the breakpoint _without_ inserting
the exception-return breakpoint, and then resumed the single-stepping
of the initial thread (thread 1) until that thread stepped out of its
stepping range.

This is what this patch does, and after applying it, GDB now correctly
stops on the next line of code.

The patch adds a C++ test that exercises this, both for setjmp/longjmp
and exception breakpoints.  With an unpatched GDB it shows:

 (gdb) next
 [Switching to Thread 22445.22455]
 thread_try_catch (arg=0x0) at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.threads/next-other-thr-longjmp.c:59
 59            catch (...)
 (gdb) FAIL: gdb.threads/next-other-thr-longjmp.exp: next to line 1
 next
 /home/pedro/gdb/mygit/build/../src/gdb/infrun.c:4865: internal-error: process_event_stop_test: Assertion `ecs->event_thread->control.exception_resume_breakpoint != NULL' fa
 iled.
 A problem internal to GDB has been detected,
 further debugging may prove unreliable.
 Quit this debugging session? (y or n) FAIL: gdb.threads/next-other-thr-longjmp.exp: next to line 2 (GDB internal error)
 Resyncing due to internal error.
 n

Tested on x86_64-linux, no regressions.

gdb/ChangeLog:
2015-08-05  Pedro Alves  <palves@redhat.com>
    Joel Brobecker  <brobecker@adacore.com>

        * breakpoint.c (bpstat_what) <bp_longjmp, bp_longjmp_call_dummy>
<bp_exception, bp_longjmp_resume, bp_exception_resume>: Handle the
case where BS->STOP is not set.

gdb/testsuite/ChangeLog:
2015-08-05  Pedro Alves  <palves@redhat.com>

* gdb.threads/next-while-other-thread-longjmps.c: New file.
* gdb.threads/next-while-other-thread-longjmps.exp: New file.

8 years agoCheck for asprintf and vasprintf during configure stage.
Iain Buclaw [Tue, 28 Jul 2015 07:57:32 +0000 (09:57 +0200)]
Check for asprintf and vasprintf during configure stage.

This should fix some build errors seen on AIX, MinGW, and possibly other
non-GNU systems too due to missing asprintf().

bfd/

* configure.in: Add asprintf and vasprintf to AC_CHECK_DECLS.
* config.in, configure: Regenerate.

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 5 Aug 2015 00:00:28 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 4 Aug 2015 00:00:24 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 3 Aug 2015 00:00:27 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 2 Aug 2015 00:00:29 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 1 Aug 2015 00:00:24 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 31 Jul 2015 00:00:29 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoremote follow fork and spurious child stops in non-stop mode
Pedro Alves [Thu, 30 Jul 2015 17:55:37 +0000 (18:55 +0100)]
remote follow fork and spurious child stops in non-stop mode

Running gdb.threads/fork-plus-threads.exp against gdbserver in
extended-remote mode, even though the test passes, we still see broken
behavior:

 (gdb) PASS: gdb.threads/fork-plus-threads.exp: set detach-on-fork off
 continue &
 Continuing.
 (gdb) PASS: gdb.threads/fork-plus-threads.exp: continue &
 [New Thread 28092.28092]

 [Thread 28092.28092] #2 stopped.
 [New Thread 28094.28094]
 [Inferior 2 (process 28092) exited normally]
 [New Thread 28094.28105]
 [New Thread 28094.28109]

...

[Thread 28174.28174] #18 stopped.
 [New Thread 28185.28185]
 [Inferior 10 (process 28174) exited normally]
 [New Thread 28185.28196]

 [Thread 28185.28185] #20 stopped.
 Cannot remove breakpoints because program is no longer writable.
 Further execution is probably impossible.
 [Inferior 11 (process 28185) exited normally]
 [Inferior 1 (process 28091) exited normally]
 PASS: gdb.threads/fork-plus-threads.exp: reached breakpoint
 info threads
 No threads.
 (gdb) PASS: gdb.threads/fork-plus-threads.exp: no threads left
 info inferiors
   Num  Description       Executable
 * 1    <null>            /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.threads/fork-plus-threads
 (gdb) PASS: gdb.threads/fork-plus-threads.exp: only inferior 1 left

All the "[Thread FOO] #NN stopped." above are bogus, as well as the
"Cannot remove breakpoints because program is no longer writable.",
which is a consequence.

The problem is that when we intercept a fork event, we should report
the event for the parent, only, and leave the child stopped, but not
report its stop event.  GDB later decides whether to follow the parent
or the child.  But because handle_extended_wait does not set the
child's last_status.kind to TARGET_WAITKIND_STOPPED, a
stop_all_threads/unstop_all_lwps sequence (e.g., from trying to access
memory) by mistake ends up queueing a SIGSTOP on the child, resuming
it, and then when that SIGSTOP is intercepted, because the LWP has
last_resume_kind set to resume_stop, gdbserver reports the stop to
GDB, as GDB_SIGNAL_0:

...
 >>>> entering unstop_all_lwps
 unstopping all lwps
 proceed_one_lwp: lwp 1600
    client wants LWP to remain 1600 stopped
 proceed_one_lwp: lwp 1828
 Client wants LWP 1828 to stop. Making sure it has a SIGSTOP pending
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 Sending sigstop to lwp 1828
 pc is 0x3615ebc7cc
 Resuming lwp 1828 (continue, signal 0, stop expected)
   continue from pc 0x3615ebc7cc
 unstop_all_lwps done
 sigchld_handler
 <<<< exiting unstop_all_lwps
 handling possible target event
 >>>> entering linux_wait_1
 linux_wait_1: [<all threads>]
 my_waitpid (-1, 0x40000001)
 my_waitpid (-1, 0x1): status(137f), 1828
 LWFE: waitpid(-1, ...) returned 1828, ERRNO-OK
 LLW: waitpid 1828 received Stopped (signal) (stopped)
 pc is 0x3615ebc7cc
 Expected stop.
 LLW: resume_stop SIGSTOP caught for LWP 1828.1828.
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
 linux_wait_1 ret = LWP 1828.1828, 1, 0
 <<<< exiting linux_wait_1
 Writing resume reply for LWP 1828.1828:1
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Tested on x86_64 Fedora 20, extended-remote.

gdb/gdbserver/ChangeLog:
2015-07-30  Pedro Alves  <palves@redhat.com>

* linux-low.c (handle_extended_wait): Set the child's last
reported status to TARGET_WAITKIND_STOPPED.

8 years agoPR threads/18600: Inferiors left around after fork+thread spawn
Pedro Alves [Thu, 30 Jul 2015 17:55:36 +0000 (18:55 +0100)]
PR threads/18600: Inferiors left around after fork+thread spawn

The new gdb.threads/fork-plus-threads.exp test exposes one more
problem.  When one types "info inferiors" after running the program,
one see's a couple inferior left still, while there should only be
inferior #1 left.  E.g.:

 (gdb) info inferiors
   Num  Description       Executable
   4    process 8393      /home/pedro/bugs/src/test
   2    process 8388      /home/pedro/bugs/src/test
 * 1    <null>            /home/pedro/bugs/src/test
 (gdb) info threads

Calling prune_inferiors() manually at this point (from a top gdb) does
not remove them, because they still have inf->pid != 0 (while they
shouldn't).  This suggests that we never mourned those inferiors.

Enabling logs (master + previous patch) we see:

 ...
 WL: waitpid Thread 0x7ffff7fc2740 (LWP 9513) received Trace/breakpoint trap (stopped)
 WL: Handling extended status 0x03057f
 LHEW: Got clone event from LWP 9513, new child is LWP 9579
 [New Thread 0x7ffff37b8700 (LWP 9579)]
 WL: waitpid Thread 0x7ffff7fc2740 (LWP 9508) received 0 (exited)
 WL: Thread 0x7ffff7fc2740 (LWP 9508) exited.
    ^^^^^^^^
 [Thread 0x7ffff7fc2740 (LWP 9508) exited]
 WL: waitpid Thread 0x7ffff7fc2740 (LWP 9499) received 0 (exited)
 WL: Thread 0x7ffff7fc2740 (LWP 9499) exited.
 [Thread 0x7ffff7fc2740 (LWP 9499) exited]
 RSRL: resuming stopped-resumed LWP Thread 0x7ffff37b8700 (LWP 9579) at 0x3615ef4ce1: step=0
 ...
 (gdb) info inferiors
   Num  Description       Executable
   5    process 9508      /home/pedro/bugs/src/test
^^^^
   4    process 9503      /home/pedro/bugs/src/test
   3    process 9500      /home/pedro/bugs/src/test
   2    process 9499      /home/pedro/bugs/src/test
 * 1    <null>            /home/pedro/bugs/src/test
 (gdb)
 ...

Note the "Thread 0x7ffff7fc2740 (LWP 9508) exited." line.
That's this in wait_lwp:

      /* Check if the thread has exited.  */
      if (WIFEXITED (status) || WIFSIGNALED (status))
{
  thread_dead = 1;
  if (debug_linux_nat)
    fprintf_unfiltered (gdb_stdlog, "WL: %s exited.\n",
target_pid_to_str (lp->ptid));
}
    }

That was the leader thread reporting an exit, meaning the whole
process is gone.  So the problem is that this code doesn't understand
that an WIFEXITED status of the leader LWP should be reported to
infrun as process exit.

gdb/ChangeLog:
2015-07-30  Pedro Alves  <palves@redhat.com>

PR threads/18600
* linux-nat.c (wait_lwp): Report to the core when thread group
leader exits.

gdb/testsuite/ChangeLog:
2015-07-30  Pedro Alves  <palves@redhat.com>

PR threads/18600
* gdb.threads/fork-plus-threads.exp: Test that "info inferiors"
only shows inferior 1.

8 years agoPR threads/18600: Threads left stopped after fork+thread spawn
Pedro Alves [Thu, 30 Jul 2015 17:55:36 +0000 (18:55 +0100)]
PR threads/18600: Threads left stopped after fork+thread spawn

When a program forks and another process start threads while gdb is
handling the fork event, newly created threads are left stuck stopped
by gdb, even though gdb presents them as "running", to the user.

This can be seen with the test added by this patch.  The test has the
inferior fork a certain number of times and waits for all children to
exit.  Each fork child spawns a number of threads that do nothing and
joins them immediately.  Normally, the program should run unimpeded
(from the point of view of the user) and exit very quickly.  Without
this fix, it doesn't because of some threads left stopped by gdb, so
inferior 1 never exits.

The program triggers when a new clone thread is found while inside the
linux_stop_and_wait_all_lwps call in linux-thread-db.c:

      linux_stop_and_wait_all_lwps ();

      ALL_LWPS (lp)
if (ptid_get_pid (lp->ptid) == pid)
  thread_from_lwp (lp->ptid);

      linux_unstop_all_lwps ();

Within linux_stop_and_wait_all_lwps, we reach
linux_handle_extended_wait with the "stopping" parameter set to 1, and
because of that we don't mark the new lwp as resumed.  As consequence,
the subsequent resume_stopped_resumed_lwps, called from
linux_unstop_all_lwps, never resumes the new LWP.

There's lots of cruft in linux_handle_extended_wait that no longer
makes sense.  On systems with CLONE events support, we don't rely on
libthread_db for thread listing anymore, so the code that preserves
stop_requested and the handling of last_resume_kind is all dead.

So the fix is to remove all that, and simply always mark the new LWP
as resumed, so that resume_stopped_resumed_lwps re-resumes it.

gdb/ChangeLog:
2015-07-30  Pedro Alves  <palves@redhat.com>
    Simon Marchi  <simon.marchi@ericsson.com>

PR threads/18600
* linux-nat.c (linux_handle_extended_wait): On CLONE event, always
mark the new thread as resumed.  Remove STOPPING parameter.
(wait_lwp): Adjust call to linux_handle_extended_wait.
(linux_nat_filter_event): Adjust call to
linux_handle_extended_wait.
(resume_stopped_resumed_lwps): Add debug output.

gdb/testsuite/ChangeLog:
2015-07-30  Simon Marchi  <simon.marchi@ericsson.com>
    Pedro Alves  <palves@redhat.com>

PR threads/18600
* gdb.threads/fork-plus-threads.c: New file.
* gdb.threads/fork-plus-threads.exp: New file.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 30 Jul 2015 00:00:25 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 29 Jul 2015 00:00:28 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 28 Jul 2015 00:00:25 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 27 Jul 2015 00:00:30 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 26 Jul 2015 00:00:27 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 25 Jul 2015 00:00:24 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 24 Jul 2015 00:00:30 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 23 Jul 2015 00:00:31 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 22 Jul 2015 00:00:26 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 21 Jul 2015 00:00:24 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoMakefile.in (STABS_DOC_BUILD_INCLUDES): Add gdb-cfg.texi, GDBvn.texi.
Doug Evans [Mon, 20 Jul 2015 16:23:58 +0000 (09:23 -0700)]
Makefile.in (STABS_DOC_BUILD_INCLUDES): Add gdb-cfg.texi, GDBvn.texi.

gdb/doc/ChangeLog:

* Makefile.in (STABS_DOC_BUILD_INCLUDES): Add gdb-cfg.texi, GDBvn.texi.

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 20 Jul 2015 00:00:30 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 19 Jul 2015 00:00:25 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 18 Jul 2015 00:00:24 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 17 Jul 2015 00:00:25 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agostabs.texinfo: @include gdb-cfg.texi.
Doug Evans [Thu, 16 Jul 2015 18:15:04 +0000 (11:15 -0700)]
stabs.texinfo: @include gdb-cfg.texi.

gdb/doc/ChangeLog:

* stabs.texinfo: @include gdb-cfg.texi.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 16 Jul 2015 00:00:24 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 15 Jul 2015 00:00:24 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agogdbserver/Linux: internal error when killing a process that is already gone
Pedro Alves [Tue, 14 Jul 2015 09:48:05 +0000 (10:48 +0100)]
gdbserver/Linux: internal error when killing a process that is already gone

If the process disappears (e.g., killed with "kill -9" from the shell)
while it was stopped under GDBserver's control, and the GDBserver
tries to kill it, GDBserver asserts:

 (gdb) shell kill -9 23084
 (gdb) kill
 ...
 Killing process(es): 23084
 /home/pedro/gdb/mygit/src/gdb/gdbserver/linux-low.c:972: A problem internal to GDBserver has been detected.
 kill_wait_lwp: Assertion `res > 0' failed.
 ...

gdb/gdbserver/ChangeLog:
2015-07-14  Pedro Alves  <palves@redhat.com>

* linux-low.c (kill_wait_lwp): Don't assert if waitpid fails.
Instead, ignore ECHILD, and throw an error for other errnos.

8 years agorecord: set stop_pc in "record goto" command
Markus Metzger [Mon, 6 Jul 2015 14:36:45 +0000 (16:36 +0200)]
record: set stop_pc in "record goto" command

When navigating in the recorded execution trace via "record goto", we do not
set stop_pc.  This may trigger an internal error in infrun.c when stepping
from that location.  Set it.

(gdb) rec full
(gdb) c
Continuing.

Breakpoint 1, foo (void) at foo.c:42
42             x = y
(gdb) rn
foo (void)
    at foo.c:41
41             y = x
(gdb) rec go end
Go forward to insn number 98724
    at foo.c:42
42             x = y
(gdb) n
infrun.c:2382: internal-error: resume: Assertion `sig != GDB_SIGNAL_0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

This happens because there's a breakpoint at PC when the "next"
is issued, so that breapoint should be immediately stepped over.
That should have been detected/done by proceed, here:

  if (addr == (CORE_ADDR) -1)
    {
      if (pc == stop_pc
  && breakpoint_here_p (aspace, pc) == ordinary_breakpoint_here
  && execution_direction != EXEC_REVERSE)
/* There is a breakpoint at the address we will resume at,
   step one instruction before inserting breakpoints so that
   we do not stop right away (and report a second hit at this
   breakpoint).

   Note, we don't do this in reverse, because we won't
   actually be executing the breakpoint insn anyway.
   We'll be (un-)executing the previous instruction.  */
tp->stepping_over_breakpoint = 1;

But since stop_pc was stale, the pc == stop_pc check failed, and left the
breakpont at PC inserted.

gdb/
* record-btrace.c (record_btrace_goto_begin, record_btrace_goto_end)
record_btrace_goto): Move call to print_stack_frame ...
(record_btrace_set_replay): ... here.  Set stop_pc.
* record-full.c (record_full_goto_entry): Set stop_pc.

testsuite/
* gdb.btrace/record_goto-step.exp: New.

8 years agobtrace: fix build fail with 32-bit BFD
Markus Metzger [Tue, 7 Jul 2015 11:54:34 +0000 (13:54 +0200)]
btrace: fix build fail with 32-bit BFD

When compiling GDB with 32-bit BFD, the build fails with:

In file included from btrace.h:33:0,
                 from btrace.c:23:
/usr/include/intel-pt.h:1643:51: note: expected 'int (*)(uint8_t *, size_t,
 const struct pt_asid *, uint64_t, void *)' but argument is of type 'int
 (*)(gdb_byte *, size_t, const struct pt_asid *, CORE_ADDR, void *)' extern
 pt_export int pt_image_set_callback(struct pt_image *image, ^

gdb/
* btrace.c (btrace_pt_readmem_callback): Change type of PC argument.

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 14 Jul 2015 00:00:27 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 13 Jul 2015 00:00:24 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 12 Jul 2015 00:00:29 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 11 Jul 2015 00:00:27 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoFix testsuite regression by: Do not skip prologue for asm (.S) files
Jan Kratochvil [Fri, 10 Jul 2015 13:04:51 +0000 (15:04 +0200)]
Fix testsuite regression by: Do not skip prologue for asm (.S) files

I have somehow missed gdb.asm/asm-source.exp PASS->FAIL even on x86_64.

It has no longer valid assumption that "break" breaks after the prologue even
in assembler.  So I have changed this assumption of the testfile.

gdb/testsuite/ChangeLog
2015-07-10  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.asm/asm-source.exp (f at main): Stop at gdbasm_enter.
(n at main): New.
* gdb.asm/asmsrc1.s: Add comment "mark: main enter".

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 10 Jul 2015 00:00:32 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 9 Jul 2015 00:00:23 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agogdb/doc: Update 'frame' command documentation.
Andrew Burgess [Wed, 8 Jul 2015 14:02:32 +0000 (15:02 +0100)]
gdb/doc: Update 'frame' command documentation.

The documentation for the 'frame' command has gotten a little out of
date, it still mentions architecturally specific details that are no
longer relevant.

This commit removes the old details that no longer apply, and tries to
expand the existing text a little to make the usage clearer for some
cases.

gdb/doc/ChangeLog:

* gdb.texinfo (Selection): Update documentation for 'frame'
command.

8 years agocompile: Warn for old GCC on cv-qualified self-reference
Jan Kratochvil [Wed, 8 Jul 2015 12:42:19 +0000 (14:42 +0200)]
compile: Warn for old GCC on cv-qualified self-reference

GDB could:

compile code struct_object.selffield = &struct_object
./compile/compile-c-types.c:83: internal-error: insert_type: Assertion `add == NULL || add->gcc_type == gcc_type' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) FAIL: gdb.compile/compile.exp: compile code struct_object.selffield = &struct_object (GDB internal
error)

The bug was not in GDB but in the GCC part interfacing with GDB.

Alexandre Oliva has fixed it the right way:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;a=commitdiff;h=072dfdba0ea62abb65514cb3a90cdf3868efe286
git://gcc.gnu.org/git/gcc.git
aoliva/libcp1

Attaching this GDB testsuite update + info to user s/he should upgrade GCC.
After Alex upstreams the fix I can update the message to contain the specific
GCC release.

gdb/ChangeLog
2015-07-08  Jan Kratochvil  <jan.kratochvil@redhat.com>

PR compile/18484
* compile/compile-c-types.c (insert_type): Change gdb_assert to error.

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

PR compile/18484
* gdb.compile/compile.c (struct struct_type): Add volatile to
selffield's type.
* gdb.compile/compile.exp
(compile code struct_object.selffield = &struct_object): Skip further
struct_object tests if this one xfails.

8 years agoPR18617 - Incorrect expression bytecode generated for narrowing conversions
Robert O'Callahan [Wed, 8 Jul 2015 10:11:22 +0000 (11:11 +0100)]
PR18617 - Incorrect expression bytecode generated for narrowing conversions

The existing code preserves 'from' bits, which is incorrect.  E.g.

 (gdb) maint agent-eval (char)255L
 Scope: 0x4008d6
 Reg mask: 00
   0  const16 255
   3  ext 64
   5  end

'ext 64' should be 'ext 8'; this bytecode evaluates to 255 instead of
the correct result of -1.  The fix is simple.  I ran the entire test
suite on x86-64 and there were no new test failures.

gdb/ChangeLog:
2015-07-08  Robert O'Callahan  <robert@ocallahan.org>

PR exp/18617
* ax-gdb.c (gen_conversion): Extend to 'to' bits, not 'from'.

gdb/testsuite/ChangeLog:
2015-07-08  Robert O'Callahan  <robert@ocallahan.org>

PR exp/18617
* gdb.trace/ax.exp: Add test.

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 8 Jul 2015 00:00:27 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 7 Jul 2015 00:00:28 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoBump GDB version number to 7.9.90.DATE-cvs.
Joel Brobecker [Mon, 6 Jul 2015 20:21:58 +0000 (13:21 -0700)]
Bump GDB version number to 7.9.90.DATE-cvs.

gdb/ChangeLog:

* version.in: Set GDB version number to 7.9.90.DATE-cvs.

8 years agoDocument the GDB 7.9.90 release in gdb/ChangeLog
Joel Brobecker [Mon, 6 Jul 2015 20:21:44 +0000 (13:21 -0700)]
Document the GDB 7.9.90 release in gdb/ChangeLog

gdb/ChangeLog:

GDB 7.9.90 released.

8 years agoSet GDB version number to 7.9.90.
Joel Brobecker [Mon, 6 Jul 2015 20:11:06 +0000 (13:11 -0700)]
Set GDB version number to 7.9.90.

gdb/ChangeLog:

* version.in: Set GDB version number to 7.9.90.

8 years agoSet development mode to "off" by default.
Joel Brobecker [Mon, 6 Jul 2015 19:58:42 +0000 (12:58 -0700)]
Set development mode to "off" by default.

bfd/ChangeLog:

* development.sh (development): Set to false.

8 years agoBump version to 7.9.90.DATE-cvs.
Joel Brobecker [Mon, 6 Jul 2015 19:58:10 +0000 (12:58 -0700)]
Bump version to 7.9.90.DATE-cvs.

Now that the GDB 7.10 branch has been created, we can
bump the version number.

gdb/ChangeLog:

GDB 7.10 branch created (66c4b3e8a628a207bc6aafef6af0c4128195f56e):
* version.in: Bump version to 7.9.90.DATE-cvs.

8 years agoFix problems with finishing a dummy function call on simulators.
Luis Machado [Mon, 6 Jul 2015 19:09:21 +0000 (16:09 -0300)]
Fix problems with finishing a dummy function call on simulators.

This fixes regressions introduced with the original change to not
consider permanent breakpoints always inserted:

  6ae8866180bf90e9ec76c2dd34c07fd826d11a83 is the first bad commit
  commit 6ae8866180bf90e9ec76c2dd34c07fd826d11a83
  Author: Luis Machado <lgustavo@codesourcery.com>
  Date:   Wed Jun 17 16:50:57 2015 -0300

      Fix problems with finishing a dummy function call on simulators.

Some checks were mistakenly left out of the original patch, which
caused the following failures:

-PASS: gdb.base/shlib-call.exp: print mainshr1(1)
-PASS: gdb.base/shlib-call.exp: step into mainshr1
+FAIL: gdb.base/shlib-call.exp: print mainshr1(1)
+FAIL: gdb.base/shlib-call.exp: step into mainshr1

-PASS: gdb.cp/chained-calls.exp: q(p())
+FAIL: gdb.cp/chained-calls.exp: q(p())

-PASS: gdb.cp/chained-calls.exp: q(p() + r())
+FAIL: gdb.cp/chained-calls.exp: q(p() + r())

-PASS: gdb.cp/chained-calls.exp: g(f(g(f() + f())) + f())
+FAIL: gdb.cp/chained-calls.exp: g(f(g(f() + f())) + f())

-PASS: gdb.cp/chained-calls.exp: *c
-PASS: gdb.cp/chained-calls.exp: *c + *c
-PASS: gdb.cp/chained-calls.exp: q(*c + *c)
+FAIL: gdb.cp/chained-calls.exp: *c
+FAIL: gdb.cp/chained-calls.exp: *c + *c
+FAIL: gdb.cp/chained-calls.exp: q(*c + *c)

-PASS: gdb.cp/classes.exp: calling method for small class
+FAIL: gdb.cp/classes.exp: calling method for small class

The above is likely caused by GDB not removing the permanent
breakpoints from the target, leading to the inferior executing
the breakpoint instruction and tripping on a SIGSEGV.

gdb/ChangeLog:
2015-07-06  Luis Machado  <lgustavo@codesourcery.com>

* breakpoint.c (remove_breakpoint_1): Don't handle permanent
breakpoints in a special way.
(remove_breakpoint): Likewise.
(mark_breakpoints_out): Likewise.

8 years agoRemove the merge conflict introduced by
H.J. Lu [Mon, 6 Jul 2015 19:00:45 +0000 (12:00 -0700)]
Remove the merge conflict introduced by

commit 2f0c68f23bb3132cd5ac466ca8775c0d9e4960cd
Author: Catherine Moore <clm@codesourcery.com>
Date:   Thu May 28 14:50:36 2015 -0700

    Compact EH Support

8 years agogdb/doc: Fix incorrect use of @xref.
Andrew Burgess [Mon, 6 Jul 2015 10:37:24 +0000 (11:37 +0100)]
gdb/doc: Fix incorrect use of @xref.

All uses of @xref must be followed by either '.' or ','.  In commit
a4ea0946c an incorrect use of @xref was introduced.  This commit
adds a comma after the use of @xref.

gdb/ChangeLog:

* doc/gdb.texinfo (TUI): Add comma after @xref.

8 years agogdb/tui: Don't cast between window types.
Andrew Burgess [Mon, 6 Jul 2015 15:56:42 +0000 (16:56 +0100)]
gdb/tui: Don't cast between window types.

Instead of casting between structure types to get the 'tui_gen_win_info'
info from a 'tui_win_info' access the generic member variable.  This is
inline with what is done throughout the rest of the tui code.

gdb/ChangeLog:

* tui/tui-win.c (tui_set_focus): Use structure member 'generic'
instead of casting the structure type.

8 years agosearch_struct_field: remove OFFSET parameter
Simon Marchi [Mon, 6 Jul 2015 17:10:56 +0000 (13:10 -0400)]
search_struct_field: remove OFFSET parameter

I was trying to understand what the OFFSET parameter was for, and
realized it was set to 0 in every call to search_struct_field.  I
assume that it was used at some point, but some subsequent changes
made it useless.

gdb/ChangeLog:

* valops.c (search_struct_field): Remove OFFSET parameter.
(value_cast_structs): Adjust calls to search_struct_field.
(value_struct_elt): Same.
(find_overload_match): Same.

8 years agoCleanup value_fetch_lazy's comment and return value
Simon Marchi [Mon, 6 Jul 2015 17:04:11 +0000 (13:04 -0400)]
Cleanup value_fetch_lazy's comment and return value

The comment for value_fetch_lazy seems outdated. It says that it's only
called from the value_contents and value_contents_all (macros!), which
is not true.  Also, the return value seems useless now, despite what the
comment says.

gdb/ChangeLog:

* value.c (value_fetch_lazy): Update comment, change return
value to void.
* value.h (value_fetch_lazy): Change return value to void.

8 years agogdb: tui_win_name: Make parameter and result const.
Andrew Burgess [Mon, 6 Jul 2015 14:32:11 +0000 (15:32 +0100)]
gdb: tui_win_name: Make parameter and result const.

This commit makes the parameter and the result for 'tui_win_name'
constant.  There's one place in the code that is then updated as a
result of this change.

gdb/ChangeLog:

* tui/tui-data.c (tui_partial_win_by_name): Window name is const.
(tui_win_name): Make parameter and result const.
* tui/tui-data.h (tui_win_name): Make parameter and result const.

8 years agoDon't throw an error in "show mpx bound" implementation
Patrick Palka [Thu, 2 Jul 2015 15:55:01 +0000 (11:55 -0400)]
Don't throw an error in "show mpx bound" implementation

"show" functions should not throw an exception in part because it causes
the output of the commands "info set" and "show" to get truncated.

This fixes the following fails:

    FAIL: gdb.base/default.exp: info set
    FAIL: gdb.base/default.exp: show

gdb/ChangeLog:

* i386-tdep.c (i386_mpx_info_bounds): Don't call error, instead
use printf_unfiltered.
(set_mpx_cmd): Add missing trailing space to command string
literal.
(_initialize_i386_tdep): Give the "mpx" prefix command its
correct name.

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 6 Jul 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoFix an opd->append index in elf64-ppc.c
Richard Sandiford [Sun, 5 Jul 2015 18:56:59 +0000 (19:56 +0100)]
Fix an opd->append index in elf64-ppc.c

bfd/
* elf64-ppc.c (toc_adjusting_stub_needed): Use the symbol value
plus addend rather than the original st_value when looking up
entries in opd->adjust.

ld/testsuite/
* ld-powerpc/tocopt6-inc.s, ld-powerpc/tocopt6a.s,
ld-powerpc/tocopt6b.s, ld-powerpc/tocopt6c.s,
ld-powerpc/tocopt6.d: New test.
* ld-powerpc/powerpc.exp (ppc64elftests): Add it.

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 5 Jul 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 4 Jul 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAdd experimental support for --gc-sections with COFF and PE based targets.
Kai Tietz [Fri, 3 Jul 2015 14:50:29 +0000 (15:50 +0100)]
Add experimental support for --gc-sections with COFF and PE based targets.

PR ld/11539
bfd * coffcode.h (coff_bfd_gc_sections): Define default
to bfd_coff_gc_sections function.
* cofflink.c (init_reloc_cookie): Copy and adjust coff
related code about gc-sections from elflink.c to here.
(fini_reloc_cookie): Likewise.
(init_reloc_cookie_rels): Likewise.
(fini_reloc_cookie_rels): Likewise.
(init_reloc_cookie_for_section): Likewise.
(fini_reloc_cookie_for_section): Likewise.
(_bfd_coff_gc_mark_hook): Likewise.
(_bfd_coff_gc_mark_rsec): Likewise.
(_bfd_coff_gc_mark_reloc): Likewise.
(_bfd_coff_gc_mark): Likewise.
(_bfd_coff_gc_mark_extra_sections): Likewise.
(coff_gc_sweep_symbol_info): Likewise.
(coff_gc_sweep_symbol): Likewise.
(gc_sweep_hook_fn): Likewise.
(coff_gc_sweep): Likewise.
(bfd_coff_gc_sections): Likewise.
(_bfd_coff_gc_keep): Likewise.
* libcoff.h (coff_reloc_cookie): New struct.
(bfd_coff_gc_sections): New prototype.
(coff_gc_mark_hook_fn): New type.

ld * scripttempl/pep.sc: Mark .idata*, .CRT*, .tls*,
.rsrc*, .init, .ctor*, .dtor*, .fini, .jcr,
.eh_frame, .pdata. .xdata, and .gcc_except_table sections
as KEEP.
* scripttempl/pe.sc: Likewise.

8 years agoCorrect ld Makefile dependendcy for or1k
Alan Modra [Fri, 3 Jul 2015 01:28:22 +0000 (10:58 +0930)]
Correct ld Makefile dependendcy for or1k

* Makefile.am (eelf32or1k.c, eelf32or1k_linux.c): Depend on ELF_DEPS.
* Makefile.in: Regenerate.

8 years agoRemove ppc860, ppc750cl, ppc7450 insns from common ppc.
Alan Modra [Fri, 3 Jul 2015 01:26:26 +0000 (10:56 +0930)]
Remove ppc860, ppc750cl, ppc7450 insns from common ppc.

Back in the day support for these processors was added, we probably
didn't want to waste PPC_OPCODE bits on minor variations.  I've had a
complaint that disassembly of mfspr/mtspr was wrong for power8.  This
patch fixes that problem.

Note that since -m860/-m850/-m821 are new gas options enabling the
mpc8xx specific mfspr/mtspr variants it is possible that this change
will break some mpc8xx assembly code.  ie. you might need to modify
makefiles to pass -m860 to gas.

include/opcode/
* ppc.h (PPC_OPCODE_750, PPC_OPCODE_7450, PPC_OPCODE_860): Define.
opcodes/
* ppc-opc.c (PPC750, PPC7450, PPC860): Define using PPC_OPCODE_*.
* ppc-dis.c (ppc_opts): Add 821, 850 and 860 entries.  Add
PPC_OPCODE_7450 to 7450 entry.  Add PPC_OPCODE_750 to 750cl entry.
gas/
* config/tc-ppc.c (md_show_usage): Add -m821, -m850, -m860.
* doc/c-ppc.texi (PowerPC-Opts): Likewise.
gas/testsuite/
* gas/ppc/titan.d: Correct mfmcsrr0 disassembly.

8 years agoAdd support for backtracing through Renesas RX exception frames.
Kevin Buettner [Thu, 2 Jul 2015 23:46:31 +0000 (16:46 -0700)]
Add support for backtracing through Renesas RX exception frames.

This change adds support for backtracing through Renesas RX exception
frames.

Determination about the type of frame is made by scanning the
remainder of the function for a return instruction and then looking at
which, if any, return instruction is found.  A normal RTS instruction
indicates that the frame is a normal frame.  An RTFI instruction
indicates that it's a fast interrupt, and an RTE instruction indicates
that the frame is a (normal) exception frame.  If no return instruction
is found within the scanned region - which can happen when the end of
the function cannot be found - it is assumed to be a normal frame.

I was able to test that normal prologue scanning still works by
disabling the dwarf2 sniffer.  I've tested this code for normal
interrupts.  The fast interrupt case has not been tested.

gdb/ChangeLog:

* rx-tdep.c (RX_USP_REGNUM, RX_BPC_REGNUM): New constants.
(enum rx_frame_type): New.
(struct rx_prologue): Add new field `frame_type'.
(rx_analyze_prologue): Add `frame_type' parameter. Cache this
parameter in the prologue struct.  Add code for recording
locations of PC and PSW for fast interrupt and exception frames.
(rx_skip_prologue): Adjust call to rx_analyze_prologue.
(rx_analyze_frame_prologue): Add `frame_type' parameter.
(rx_frame_type): New function.
(rx_frame_base): Fetch frame type and pass it to rx_analyze_prologue.
(rx_frame_this_id): Rename parameter `this_prologue_cache' to
`this_cache'.
(rx_frame_prev_register): Rename parameter `this_prologue_cache' to
`this_cache'.  Add cases for RX_FRAME_TYPE_EXCEPTION and
RX_FRAME_TYPE_FAST_INTERRUPT.
(normal_frame_p, exception_frame_p, rx_frame_sniffer_common)
(rx_frame_sniffer, rx_exception_sniffer): New functions.
(rx_frame_unwind): Use rx_frame_sniffer instead of
default_frame_sniffer.
(rx_frame_unwind): New unwinder.
(rx_gdbarch_init): Register new unwinder.

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 3 Jul 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agorx: Create and use flags types for psw, bpsw, and fpsw registers.
Kevin Buettner [Thu, 2 Jul 2015 22:02:56 +0000 (15:02 -0700)]
rx: Create and use flags types for psw, bpsw, and fpsw registers.

This change adds two flags types for the (Renesas RX) psw, bpsw, and
fpsw registers.  As a result, symbolic flags are displayed for these
registers in the output of GDB's "info registers" command as well as
in output from other commands, such as "print".

gdb/ChangeLog:

* rx-tdep.c (RX_BPSW_REGNUM, RX_FPSW_REGNUM): New constants.
(struct gdbarch_tdep): Add fields rx_psw_type and rx_fpsw_type.
(rx_register_type): Add cases for RX_PSW_REGNUM, RX_BPSW_REGNUM,
and RX_FPSW_REGNUM.
(rx_gdbarch_init): Initialize PSW, BPSW, and FPSW flags types.

8 years agoFix GCC false warning
Jan Kratochvil [Thu, 2 Jul 2015 20:39:57 +0000 (22:39 +0200)]
Fix GCC false warning

At least on
gcc-4.4.7-11.el6.i686
./configure --enable-64-bit-bfd --enable-targets=all
GDB does not build due to:
cc1: warnings being treated as errors
s390-linux-tdep.c: In function â€˜s390_handle_arg’:
s390-linux-tdep.c:2575: error: â€˜val’ may be used uninitialized in this function

gdb/ChangeLog
2015-07-02  Jan Kratochvil  <jan.kratochvil@redhat.com>

Fix GCC false warning.
* s390-linux-tdep.c (s390_handle_arg): Initialize VAL.

8 years agoFix typo in aarch64_linux_insert_hw_breakpoint
Yao Qi [Thu, 2 Jul 2015 13:03:54 +0000 (14:03 +0100)]
Fix typo in aarch64_linux_insert_hw_breakpoint

It should be "insert_hw_breakpoint" rather than "insert_hw_watchpoint".

gdb:

2015-07-02  Yao Qi  <yao.qi@linaro.org>

* aarch64-linux-nat.c (aarch64_linux_insert_hw_breakpoint): Fix
typo in the debugging message.

8 years agoFix snafu with latest addition to the ARM sim.
Nick Clifton [Thu, 2 Jul 2015 15:19:09 +0000 (16:19 +0100)]
Fix snafu with latest addition to the ARM sim.

* Makefile.in (SIM_EXTRA_CFLAGS): Revert previous delta.
(SIM_EXTRA_LIBS): Add -lm.

8 years agobtrace: maintenance commands
Markus Metzger [Mon, 3 Feb 2014 13:35:28 +0000 (14:35 +0100)]
btrace: maintenance commands

Add maintenance commands that help debugging the btrace record target.
The following new commands are added:

maint info btrace
  Print information about branch tracing internals.

maint btrace packet-history
  Print the raw branch tracing data.

maint btrace clear-packet-history
  Discard the stored raw branch tracing data.

maint btrace clear
  Discard all branch tracing data.  It will be fetched and processed
  anew by the next "record" command.

maint set|show btrace pt skip-pad
  Set and show whether PAD packets are skipped when computing the
  packet history.

gdb/
* btrace.c: Include gdbcmd.h, cli/cli-utils.h, and ctype.h.
(maint_btrace_cmdlist, maint_btrace_set_cmdlist)
(maint_btrace_show_cmdlist, maint_btrace_pt_set_cmdlist)
(maint_btrace_pt_show_cmdlist, maint_btrace_pt_skip_pad)
(btrace_maint_clear): New.
(btrace_fetch, btrace_clear): Call btrace_maint_clear.
(pt_print_packet, btrace_maint_decode_pt)
(btrace_maint_update_pt_packets, btrace_maint_update_packets)
(btrace_maint_print_packets, get_uint, get_context_size, no_chunk)
(maint_btrace_packet_history_cmd)
(maint_btrace_clear_packet_history_cmd, maint_btrace_clear_cmd)
(maint_btrace_cmd, maint_btrace_set_cmd, maint_btrace_show_cmd)
(maint_btrace_pt_set_cmd, maint_btrace_pt_show_cmd)
(maint_info_btrace_cmd, _initialize_btrace): New.
* btrace.h (btrace_pt_packet, btrace_pt_packet_s)
(btrace_maint_packet_history, btrace_maint_info): New.
(btrace_thread_info) <maint>: New.
* NEWS: Announce it.

doc/
* gdb.texinfo (Maintenance Commands): Document "maint btrace"
commands.

8 years agobtrace: store raw btrace data
Markus Metzger [Mon, 3 Feb 2014 10:40:50 +0000 (11:40 +0100)]
btrace: store raw btrace data

Store the raw branch trace data that has been read from the target.

This data can be used for maintenance commands as well as for generating
a core file for the "record save" command.

gdb/
* btrace.c (btrace_fetch): Append the new trace data.
(btrace_clear): Clear the stored trace data.
* btrace.h (btrace_thread_info) <data>: New.
* common/btrace-common.h (btrace_data_clear)
(btrace_data_append): New.
* common/btrace-common.c (btrace_data_clear)
(btrace_data_append): New.

8 years agobtrace, linux: use data_size and data_offset
Markus Metzger [Mon, 17 Nov 2014 10:18:05 +0000 (11:18 +0100)]
btrace, linux: use data_size and data_offset

In struct perf_event_mmap_page there are new fields data_size and data_offset
that give the location of the perf_event data buffer relative to the mmap
page.  Use them if they are present.

gdb/
* nat/linux-btrace.c (linux_enable_bts): Check for
PERF_ATTR_SIZE_VER5.
Check for data_offset and data_size fields.  Use them.

8 years agobtrace: support Intel(R) Processor Trace
Markus Metzger [Fri, 24 Jan 2014 12:45:47 +0000 (13:45 +0100)]
btrace: support Intel(R) Processor Trace

Adds a new command "record btrace pt" to configure the kernel to use
Intel(R) Processor Trace instead of Branch Trace Strore.

The "record btrace" command chooses the tracing format automatically.

Intel(R) Processor Trace support requires Linux 4.1 and libipt.

gdb/
* NEWS: Announce new commands "record btrace pt" and "record pt".
Announce new options "set|show record btrace pt buffer-size".
* btrace.c: Include "rsp-low.h".
Include "inttypes.h".
(btrace_add_pc): Add forward declaration.
(pt_reclassify_insn, ftrace_add_pt, btrace_pt_readmem_callback)
(pt_translate_cpu_vendor, btrace_finalize_ftrace_pt)
(btrace_compute_ftrace_pt): New.
(btrace_compute_ftrace): Support BTRACE_FORMAT_PT.
(check_xml_btrace_version): Update version check.
(parse_xml_raw, parse_xml_btrace_pt_config_cpu)
(parse_xml_btrace_pt_raw, parse_xml_btrace_pt)
(btrace_pt_config_cpu_attributes, btrace_pt_config_children)
(btrace_pt_children): New.
(btrace_children): Add support for "pt".
(parse_xml_btrace_conf_pt, btrace_conf_pt_attributes): New.
(btrace_conf_children): Add support for "pt".
* btrace.h: Include "intel-pt.h".
(btrace_pt_error): New.
* common/btrace-common.c (btrace_format_string, btrace_data_fini)
(btrace_data_empty): Support BTRACE_FORMAT_PT.
* common/btrace-common.h (btrace_format): Add BTRACE_FORMAT_PT.
(struct btrace_config_pt): New.
(struct btrace_config)<pt>: New.
(struct btrace_data_pt_config, struct btrace_data_pt): New.
(struct btrace_data)<pt>: New.
* features/btrace-conf.dtd (btrace-conf)<pt>: New.
(pt): New.
* features/btrace.dtd (btrace)<pt>: New.
(pt, pt-config, cpu): New.
* nat/linux-btrace.c (perf_event_read, perf_event_read_all)
(perf_event_pt_event_type, kernel_supports_pt)
(linux_supports_pt): New.
(linux_supports_btrace): Support BTRACE_FORMAT_PT.
(linux_enable_bts): Free tinfo on error.
(linux_enable_pt): New.
(linux_enable_btrace): Support BTRACE_FORMAT_PT.
(linux_disable_pt): New.
(linux_disable_btrace): Support BTRACE_FORMAT_PT.
(linux_fill_btrace_pt_config, linux_read_pt): New.
(linux_read_btrace): Support BTRACE_FORMAT_PT.
* nat/linux-btrace.h (struct btrace_tinfo_pt): New.
(struct btrace_target_info)<pt>: New.
* record-btrace.c (set_record_btrace_pt_cmdlist)
(show_record_btrace_pt_cmdlist): New.
(record_btrace_print_pt_conf): New.
(record_btrace_print_conf): Support BTRACE_FORMAT_PT.
(btrace_ui_out_decode_error): Support BTRACE_FORMAT_PT.
(cmd_record_btrace_pt_start): New.
(cmd_record_btrace_start): Support BTRACE_FORMAT_PT.
(cmd_set_record_btrace_pt, cmd_show_record_btrace_pt): New.
(_initialize_record_btrace): Add new commands.
* remote.c (PACKET_Qbtrace_pt, PACKET_Qbtrace_conf_pt_size): New.
(remote_protocol_features): Add "Qbtrace:pt".
Add "Qbtrace-conf:pt:size".
(remote_supports_btrace): Support BTRACE_FORMAT_PT.
(btrace_sync_conf): Support PACKET_Qbtrace_conf_pt_size.
(remote_enable_btrace): Support BTRACE_FORMAT_PT.
(_initialize_remote): Add new commands.

gdbserver/
* linux-low.c: Include "rsp-low.h"
(linux_low_encode_pt_config, linux_low_encode_raw): New.
(linux_low_read_btrace): Support BTRACE_FORMAT_PT.
(linux_low_btrace_conf): Support BTRACE_FORMAT_PT.
(handle_btrace_enable_pt): New.
(handle_btrace_general_set): Support "pt".
(handle_btrace_conf_general_set): Support "pt:size".

doc/
* gdb.texinfo (Process Record and Replay): Spell out that variables
and registers are not available during btrace replay.
Describe the new "record btrace pt" command.
Describe the new "set|show record btrace pt buffer-size" options.
(General Query Packets): Describe the new Qbtrace:pt and
Qbtrace-conf:pt:size packets.
Expand "bts" to "Branch Trace Store".
Update the branch trace DTD.

8 years agoconfigure: check for libipt
Markus Metzger [Tue, 12 Nov 2013 15:58:45 +0000 (16:58 +0100)]
configure: check for libipt

Check for libipt, an Intel(R) Processor Trace decoder library.  The sources
can be found on github at:

    https://github.com/01org/processor-trace

gdb/
* configure.ac: Check for libipt
* configure: Regenerate.
* config.in: Regenerate.
* Makefile.in (LIBIPT): New.
(CLIBS): Add $LIBIPT.
* NEWS: document new configure options

8 years agodebug compile: Replace confusing debug message
Jan Kratochvil [Thu, 2 Jul 2015 06:01:35 +0000 (08:01 +0200)]
debug compile: Replace confusing debug message

It was found that from

(gdb) set debug compile 1
(gdb) compile code 1
[...]
allocated 0x7f bytes at 0x7ffff7ff9000 prot 5
allocated 0x38 bytes at 0x7ffff7ff8000 prot 1
lookup undefined ELF symbol "_GLOBAL_OFFSET_TABLE_"
allocated 0x10 bytes at 0x7ffff7ff7000 for registers
(gdb) _

the message 'lookup undefined ELF symbol' looks as an error to people,
including to myself once.

Change it to:

allocated 0x7f bytes at 0x7ffff7ff9000 prot 5
allocated 0x38 bytes at 0x7ffff7ff8000 prot 1
ELF symbol "_GLOBAL_OFFSET_TABLE_" relocated to zero
allocated 0x10 bytes at 0x7ffff7ff7000 for registers
(gdb) _

gdb/ChangeLog
2015-07-02  Jan Kratochvil  <jan.kratochvil@redhat.com>

* compile/compile-object-load.c (compile_object_load): Replace debug
message "lookup undefined ELF symbol" by 3 more specific messages.

8 years agoTabify my ChangeLog entry for 2015-06-29.
Kevin Buettner [Thu, 2 Jul 2015 00:46:23 +0000 (17:46 -0700)]
Tabify my ChangeLog entry for 2015-06-29.

8 years agorl78: Create a flags type for the psw register.
Kevin Buettner [Wed, 1 Jul 2015 23:18:35 +0000 (16:18 -0700)]
rl78: Create a flags type for the psw register.

For the Renesas rl78 architecture, associate a flags type with the PSW
register. This will cause symbolic flags to be printed when using
the "info registers" command.

gdb/ChangeLog:

* rl78-tdep.c (struct gdbarch_tdep): Add new field, rl78_psw_type.
(rl78_register_type): Add case for RL78_PSW_REGNUM.
(rl78_gdbarch_init): Initialize rl78_psw_type.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 2 Jul 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAssembler tests for Nios II R2
Sandra Loosemore [Wed, 1 Jul 2015 23:11:47 +0000 (16:11 -0700)]
Assembler tests for Nios II R2

2015-07-01  Sandra Loosemore  <sandra@codesourcery.com>
    Cesar Philippidis  <cesar@codesourcery.com>

gas/testsuite/
* gas/nios2/add-r2.d: New.
* gas/nios2/align_fill-r2.d: New.
* gas/nios2/align_text-r2.d: New.
* gas/nios2/aligned_text-r2.d: New.
* gas/nios2/and-r2.d: New.
* gas/nios2/andc.d: New.
* gas/nios2/andc.s: New.
* gas/nios2/bmx.d: New.
* gas/nios2/bmx.s: New.
* gas/nios2/branch-r2.d: New.
* gas/nios2/break-r2.d: New.
* gas/nios2/bret-r2.d: New.
* gas/nios2/cache-r2.d: New.
* gas/nios2/cache-r2.s: New.
* gas/nios2/call-r2.d: New.
* gas/nios2/call26-r2.d: New.
* gas/nios2/call26_noat-r2.d: New.
* gas/nios2/call_noat-r2.d: New.
* gas/nios2/cdx_add.d: New.
* gas/nios2/cdx_add.s: New.
* gas/nios2/cdx_and.d: New.
* gas/nios2/cdx_and.s: New.
* gas/nios2/cdx_break.d: New.
* gas/nios2/cdx_break.s: New.
* gas/nios2/cdx_callr.d: New.
* gas/nios2/cdx_callr.s: New.
* gas/nios2/cdx_jmpr.d: New.
* gas/nios2/cdx_jmpr.s: New.
* gas/nios2/cdx_ldbu.d: New.
* gas/nios2/cdx_ldbu.s: New.
* gas/nios2/cdx_ldhu.d: New.
* gas/nios2/cdx_ldhu.s: New.
* gas/nios2/cdx_ldw.d: New.
* gas/nios2/cdx_ldw.s: New.
* gas/nios2/cdx_ldwsp.d: New.
* gas/nios2/cdx_ldwsp.s: New.
* gas/nios2/cdx_mov.d: New.
* gas/nios2/cdx_mov.s: New.
* gas/nios2/cdx_neg.d: New.
* gas/nios2/cdx_neg.s: New.
* gas/nios2/cdx_not.d: New.
* gas/nios2/cdx_not.s: New.
* gas/nios2/cdx_or.d: New.
* gas/nios2/cdx_or.s: New.
* gas/nios2/cdx_pop.d: New.
* gas/nios2/cdx_pop.s: New.
* gas/nios2/cdx_push.d: New.
* gas/nios2/cdx_push.s: New.
* gas/nios2/cdx_relax.d: New.
* gas/nios2/cdx_relax.s: New.
* gas/nios2/cdx_ret.d: New.
* gas/nios2/cdx_ret.s: New.
* gas/nios2/cdx_sll.d: New.
* gas/nios2/cdx_sll.s: New.
* gas/nios2/cdx_spaddi.d: New.
* gas/nios2/cdx_spaddi.s: New.
* gas/nios2/cdx_spdeci.d: New.
* gas/nios2/cdx_spdeci.s: New.
* gas/nios2/cdx_srl.d: New.
* gas/nios2/cdx_srl.s: New.
* gas/nios2/cdx_stb.d: New.
* gas/nios2/cdx_stb.s: New.
* gas/nios2/cdx_sth.d: New.
* gas/nios2/cdx_sth.s: New.
* gas/nios2/cdx_stw.d: New.
* gas/nios2/cdx_stw.s: New.
* gas/nios2/cdx_stwsp.d: New.
* gas/nios2/cdx_stwsp.s: New.
* gas/nios2/cdx_sub.d: New.
* gas/nios2/cdx_sub.s: New.
* gas/nios2/cdx_trap.d: New.
* gas/nios2/cdx_trap.s: New.
* gas/nios2/cdx_xor.d: New.
* gas/nios2/cdx_xor.s: New.
* gas/nios2/cmp-r2.d: New.
* gas/nios2/comments-r2.d: New.
* gas/nios2/complex-r2.d: New.
* gas/nios2/ctl-r2.d: New.
* gas/nios2/custom-r2.d: New.
* gas/nios2/eni.d: New.
* gas/nios2/eni.s: New.
* gas/nios2/etbt-r2.d: New.
* gas/nios2/flushda-r2.d: New.
* gas/nios2/jmp-r2.d: New.
* gas/nios2/ldb-r2.d: New.
* gas/nios2/ldb-r2.s: New.
* gas/nios2/ldh-r2.d: New.
* gas/nios2/ldh-r2.s: New.
* gas/nios2/ldw-r2.d: New.
* gas/nios2/ldw-r2.s: New.
* gas/nios2/ldwm.d: New.
* gas/nios2/ldwm.s: New.
* gas/nios2/lineseparator-r2.d: New.
* gas/nios2/movia-r2.d: New.
* gas/nios2/mpx.d: New.
* gas/nios2/mpx.s: New.
* gas/nios2/mul-r2.d: New.
* gas/nios2/nop-r2.d: New.
* gas/nios2/nop-r2.s: New.
* gas/nios2/nor-r2.d: New.
* gas/nios2/or-r2.d: New.
* gas/nios2/rdprs-r2.d: New.
* gas/nios2/rdprs-r2.s: New.
* gas/nios2/registers-r2.d: New.
* gas/nios2/ret-r2.d: New.
* gas/nios2/rotate-r2.d: New.
* gas/nios2/stb-r2.d: New.
* gas/nios2/stb-r2.s: New.
* gas/nios2/sth-r2.d: New.
* gas/nios2/sth-r2.s: New.
* gas/nios2/stw-r2.d: New.
* gas/nios2/stw-r2.s: New.
* gas/nios2/stwm.d: New.
* gas/nios2/stwm.s: New.
* gas/nios2/sub-r2.d: New.
* gas/nios2/sync-r2.d: New.
* gas/nios2/trap-r2.d: New.
* gas/nios2/tret-r2.d: New.
* gas/nios2/wrpie.d: New.
* gas/nios2/wrpie.s: New.
* gas/nios2/wrprs-r2.d: New.
* gas/nios2/xor-r2.d: New.

8 years agoOpcodes and assembler support for Nios II R2
Sandra Loosemore [Wed, 1 Jul 2015 23:08:03 +0000 (16:08 -0700)]
Opcodes and assembler support for Nios II R2

2015-07-01  Sandra Loosemore  <sandra@codesourcery.com>
    Cesar Philippidis  <cesar@codesourcery.com>

gas/
* config/tc-nios2.c (nios2_min_align): New.
(nop): Replace with....
(nop_r1, nop_r2, nop_r2_cdx, nop32, nop16): New.
(nios2_align): Handle alignment on 2-byte boundaries when CDX
instructions may be present.
(s_nios2_align): Adjust reference to nop.
(CDXBRANCH, IS_CDXBRANCH): New.
(CDX_UBRANCH_SUBTYPE, CDX_CBRANCH_SUBTYPE): New.
(nios2_relax_subtype_size): Handle 2-byte CDX branches.
(nios2_relax_frag): Likewise.
(md_convert_frag): Handle R2 encodings.
(nios2_check_overflow): Check that low-order bits are zero
before applying rightshift from howto.
(nios2_check_overflow): Correct negative overflow calculation.
(nios2_diagnose_overflow): Handle signed_immed12_overflow.  Issue
generic overflow messages for miscellaneous instruction formats.
(md_apply_fix): Recognize new R2 relocations.  For pc_relative
relocations, store fixup in *valP.
(nios2_reglist_mask, nios2_reglist_dir): New.
(nios2_parse_reglist): New.
(nios2_parse_base_register): New.
(nios2_assemble_expression): Handle constant expressions designated
by BFD_RELOC_NONE.
(nios2_assemble_reg3): New.
(nios2_assemble_arg_c): Handle R2 instruction formats.
(nios2_assemble_arg_d): Likewise.
(nios2_assemble_arg_s): Likewise.
(nios2_assemble_arg_t): Likewise.
(nios2_assemble_arg_D): New.
(nios2_assemble_arg_S): New.
(nios2_assemble_arg_T): New.
(nios2_assemble_arg_i): Handle R2 instruction formats.
(nios2_assemble_arg_I): New.
(nios2_assemble_arg_u): Handle R2 instruction formats.
(nios2_assemble_arg_U): New.
(nios2_assemble_arg_V): New.
(nios2_assemble_arg_W): New.
(nios2_assemble_arg_X): New.
(nios2_assemble_arg_Y): New.
(nios2_assemble_arg_o): Handle R2 instruction formats.
(nios2_assemble_arg_O): New.
(nios2_assemble_arg_P): New.
(nios2_assemble_arg_j): Handle R2 instruction formats.
(nios2_assemble_arg_k): New.
(nios2_assemble_arg_l): Handle R2 instruction formats.
(nios2_assemble_arg_m): Likewise.
(nios2_assemble_arg_M): New.
(nios2_assemble_arg_N): New.
(nios2_assemble_arg_e): New.
(nios2_assemble_arg_f): New.
(nios2_assemble_arg_g): New.
(nios2_assemble_arg_h): New.
(nios2_assemble_arg_R): New.
(nios2_assemble_arg_B): New.
(nios2_assemble_args): Handle new argument letters.
(nios2_consume_arg): Likewise.
(nios2_translate_pseudo_insn): Avoid dereferencing null pointer
in error message.
(nios2_ps_insn_info_structs): Add nop.n.
(output_ubranch): Handle CDX branches.
(output_cbranch): Likewise.
(output_call): Handle R2 encodings.
(output_movia): Likewise.
(md_begin): Initialize nios2_min_align.
(md_assemble): Align to nios2_min_align.  Adjust nios2_min_align
if a 16-bit instruction is seen.
(nios2_cons_align): Use appropriate nop pattern.

include/opcode/
* nios2.h (enum iw_format_type): Add R2 formats.
(enum overflow_type): Add signed_immed12_overflow and
enumeration_overflow for R2.
(struct nios2_opcode): Document new argument letters for R2.
(REG_3BIT, REG_LDWM, REG_POP): Define.
(includes): Include nios2r2.h.
(nios2_r2_opcodes, nios2_num_r2_opcodes): Declare.
(nios2_r2_asi_n_mappings, nios2_num_r2_asi_n_mappings): Declare.
(nios2_r2_shi_n_mappings, nios2_num_r2_shi_n_mappings): Declare.
(nios2_r2_andi_n_mappings, nios2_num_r2_andi_n_mappings): Declare.
(nios2_r2_reg3_mappings, nios2_num_r2_reg3_mappings): Declare.
(nios2_r2_reg_range_mappings, nios2_num_r2_reg_range_mappings):
Declare.
* nios2r2.h: New file.

opcodes/
* nios2-dis.c (nios2_extract_opcode): New.
(nios2_disassembler_state): New.
(nios2_find_opcode_hash): Use mach parameter to select correct
disassembler state.
(nios2_print_insn_arg): Extend to support new R2 argument letters
and formats.
(print_insn_nios2): Check for 16-bit instruction at end of memory.
* nios2-opc.c (nios2_builtin_regs): Add R2 register attributes.
(NIOS2_NUM_OPCODES): Rename to...
(NIOS2_NUM_R1_OPCODES): This.
(nios2_r2_opcodes): New.
(NIOS2_NUM_R2_OPCODES): New.
(nios2_num_r2_opcodes): New.
(nios2_r2_asi_n_mappings, nios2_num_r2_asi_n_mappings): New.
(nios2_r2_shi_n_mappings, nios2_num_r2_shi_n_mappings): New.
(nios2_r2_andi_n_mappings, nios2_num_r2_andi_n_mappings): New.
(nios2_r2_reg3_mappings, nios2_num_r2_reg3_mappings): New.
(nios2_r2_reg_range_mappings, nios2_num_r2_reg_range_mappings): New.

8 years agoRelocations for Nios II R2
Sandra Loosemore [Wed, 1 Jul 2015 23:02:09 +0000 (16:02 -0700)]
Relocations for Nios II R2

2015-07-01  Sandra Loosemore  <sandra@codesourcery.com>
    Cesar Philippidis  <cesar@codesourcery.com>

bfd/
* bfd-in2.h: Regenerated.
* elf32-nios2.c (elf_nios2_howto_table_rel): Rename to...
(elf_nios2_r1_howto_table_rel): This.
(elf_nios2_r2_howto_table_rel): New.
(BFD_IS_R2): New.
(lookup_howto): Add ABFD parameter.  Adjust to look up in either
the R1 or R2 relocation table, as determined by ABFD.
(nios2_reloc_map): Add R2 relocations.
(nios2_elf32_bfd_reloc_type_lookup): Do lookup using lookup_howto.
Pass it the ABFD parameter.
(nios2_elf32_bfd_reloc_name_lookup): Use ABFD to decide whether to
return an R1 or R2 relocation.
(nios2_elf32_info_to_howto): Do lookup using lookup_howto.
Pass it the ABFD parameter.
(nios2_elf32_do_call26_relocate): Check for alignment on a 4-byte
boundary.
(nios2_elf32_relocate_section): Adjust call to lookup_howto.
* libbfd.h: Regenerated.
* reloc.c (BFD_RELOC_NIOS2_R2_S12): New.
(BFD_RELOC_NIOS2_R2_I10_1_PCREL): New.
(BFD_RELOC_NIOS2_R2_T1I7_1_PCREL): New.
(BFD_RELOC_NIOS2_R2_T1I7_2): New.
(BFD_RELOC_NIOS2_R2_T2I4): New.
(BFD_RELOC_NIOS2_R2_T2I4_1): New.
(BFD_RELOC_NIOS2_R2_T2I4_2): New.
(BFD_RELOC_NIOS2_R2_X1I7_2): New.
(BFD_RELOC_NIOS2_R2_X2L5): New.
(BFD_RELOC_NIOS2_R2_F1I5_2): New.
(BFD_RELOC_NIOS2_R2_L5I4X1): New.
(BFD_RELOC_NIOS2_R2_T1X1I6): New.
(BFD_RELOC_NIOS2_R2_T1X1I6_2): New.

include/elf/
* nios2.h (R_NIOS2_R2_S12): New.
(R_NIOS2_R2_I10_1_PCREL): New.
(R_NIOS2_R2_T1I7_1_PCREL): New.
(R_NIOS2_R2_T1I7_2): New.
(R_NIOS2_R2_T2I4): New.
(R_NIOS2_R2_T2I4_1): New.
(R_NIOS2_R2_T2I4_2): New.
(R_NIOS2_R2_X1I7_2): New.
(R_NIOS2_R2_X2L5): New.
(R_NIOS2_R2_F1I5_2): New.
(R_NIOS2_R2_L5I4X1): New.
(R_NIOS2_R2_T1X1I6): New.
(R_NIOS2_R2_T1X1I6_2): New.
(R_NIOS2_ILLEGAL): Renumber.

8 years agoAdd Nios II arch flags and compatibility tests
Sandra Loosemore [Wed, 1 Jul 2015 22:55:28 +0000 (15:55 -0700)]
Add Nios II arch flags and compatibility tests

2015-07-01  Sandra Loosemore  <sandra@codesourcery.com>
    Cesar Philippidis  <cesar@codesourcery.com>

bfd/
* archures.c (bfd_mach_nios2r1, bfd_mach_nios2r2): New.
* bfd-in2.h: Regenerated.
* cpu-nios2.c (nios2_compatible): New.
(N): Use nios2_compatible instead of bfd_default_compatible.
(NIOS2R1_NEXT, NIOS2R2_NEXT): Define.
(arch_info_struct): New.
(bfd_nios2_arch): Chain to NIOS2R1_NEXT.
* elf32-nios2.c (is_nios2_elf): New.
(nios2_elf32_merge_private_bfd_data): New.
(nios2_elf32_object_p): New.
(bfd_elf32_bfd_merge_private_bfd_data): Define.
(elf_backend_object_p): Define.

gas/
* config/tc-nios2.c: Adjust includes.
(OPTION_MARCH): Define.
(md_longopts): Add -march option.
(nios2_architecture): New.
(nios2_use_arch): New.
(md_parse_option): Handle OPTION_MARCH.
(md_show_usage): Document -march.
(md_begin): Set arch in BFD.
(nios2_elf_final_processing): New.
* config/tc-nios2.h (elf_tc_final_processing): Define.
(nios2_elf_final_processing): New.
* doc/c-nios2.texi (-march): Add documentation.

include/elf/
* nios2.h (EF_NIOS2_ARCH_R1, EF_NIOS2_ARCH_R2): Define.

ld/testsuite/
* ld-nios2/mixed1a.d: New.
* ld-nios2/mixed1a.s: New.
* ld-nios2/mixed1b.d: New.
* ld-nios2/mixed1b.s: New.
* ld-nios2/nios2.exp: Build the new compatibility tests.

8 years agoRefactor elf_x86_64_convert_mov_to_lea
H.J. Lu [Wed, 1 Jul 2015 16:32:47 +0000 (09:32 -0700)]
Refactor elf_x86_64_convert_mov_to_lea

* elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Refactor.

8 years agoTUI: Make sure to update registers if frame information has changed
Patrick Palka [Wed, 1 Jul 2015 12:02:09 +0000 (08:02 -0400)]
TUI: Make sure to update registers if frame information has changed

When I replaced TUI's frame_changed hook to fix PR tui/13378 I assumed
that there's no reason to refresh register information following a call
to "up", "down" or "frame".  This assumption was made to fix the problem
of refreshing frame information twice following a sync-execution normal
stop (once in tui_normal_stop and then in tui_before_prompt) -- the
second refresh removing any highlights made by the first.

I was wrong about that -- GDB's snapshot of register information is
per-frame, and when the frame changes, registers do too (most
prominently the %rip and %rsp registers).  So e.g. GDB 7.8 would
highlight such register changes after invoking "up", "down" or "frame",
and current GDB does not.

To fix this regression, this patch adds another (sufficient) condition
for refreshing register information: in
tui_refresh_frame_and_register_information, always refresh register
information if frame information has changed.  This makes register
information get refreshed following a call to "up", "down" or "frame"
while still avoiding the "double refresh" issue following a normal stop.

This condition may seem to obsolete the existing registers_too_p
parameter, but it does not: following a normal stop, it is possible that
registers may have changed while frame information had not.  We could be
on the exact same PC with different register values.  The new condition
would not catch such a case, but the registers_too_p condition will.  So
both conditions seem necessary (and either one is sufficient).

gdb/ChangeLog:

* tui/tui-hooks.c (tui_refresh_frame_and_register_information):
Update commentary.  Always refresh the registers when frame
information has changed.
* tui/tui-stack.c (tui_show_frame_info): Update commentary.
Change return type to int.  Return 1 if frame information has
changed, 1 otherwise.
(tui_before_prompt): Update commentary.
* tui/tui-stack.h (tui_show_frame_info): Change return type to
int.

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 1 Jul 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoRemove the unneeded escaping of '[' and ']' characters in test_class_help
Martin Galvan [Tue, 30 Jun 2015 21:20:47 +0000 (18:20 -0300)]
Remove the unneeded escaping of '[' and ']' characters in test_class_help

As these characters don't need to be escaped for strings
wrapped inside {} braces, we can remove the unneeded backslashes.

gdb/testsuite/ChangeLog:

* lib/gdb.exp (test_class_help): Remove the unneeded escaping of
'[' and ']' characters.

8 years agoSync dlang demangling tests from upstream libiberty testsuite
Iain Buclaw [Tue, 30 Jun 2015 18:09:16 +0000 (20:09 +0200)]
Sync dlang demangling tests from upstream libiberty testsuite

gdb/testsuite/ChangeLog:

* gdb.dlang/demangle.exp: Sync tests from libiberty testsuite.

8 years agoReplace TUI's select_frame hook (PR tui/13378)
Patrick Palka [Tue, 30 Jun 2015 17:56:49 +0000 (13:56 -0400)]
Replace TUI's select_frame hook (PR tui/13378)

The select_frame hook is used by TUI to update TUI's frame and register
information following changes to the selected frame.  The problem with
this hook is that it gets called after every single frame change, even
if the frame change is only temporary or internal.  This is the primary
cause of flickering and slowdown when running the inferior under TUI
with conditional breakpoints set.  Internal GDB events are the source of
many calls to select_frame and these internal events are triggered
frequently, especially when a few conditional breakpoints are set.

This patch removes the select_frame hook altogether and instead makes
the frame and register information get updated in two key places (using
observers): after an inferior stops, and right before displaying a
prompt.  The latter hook covers the case when frame information must be
updated following a call to "up", "down" or "frame", and the former
covers the case when frame and register information must be updated
after a call to "continue", "step", etc. or after the inferior stops in
async execution mode.  Together these hooks should cover all the cases
when frame information ought to be refreshed (and when the relevant
windows ought to be subsequently updated).

The print_frame_info_listing hook is also effectively obsolete now, but
it still must be set while the TUI is active because its caller
print_frame_info will otherwise assume that the CLI is active, and will
print the frame informaion accordingly.  So this patch also sets the
print_frame_info_listing hook to a dummy callback, in lieu of outright
removing it yet.

Effectively, with this patch, frame/PC changes that do not immediately
precede an inferior-stop event or a prompt display event no longer cause
TUI's frame and register information to be updated.

And as a result of this change and of the previous change to
tui_show_frame_info, the TUI is much more disciplined about updating the
screen, and so the flicker as described in the PR is totally gone.

gdb/ChangeLog:

PR tui/13378
* frame.c (select_frame): Remove reference to
deprecated_selected_frame_level_changed_hook.
* frame.h (deprecated_selected_frame_level_changed_hook): Remove
declaration.
* stack.c (deprecated_selected_frame_level_changed_hook):
Likewise.
* tui/tui-hooks.c (tui_selected_frame_level_changed_hook):
Rename to ...
(tui_refresh_frame_and_register_information): ... this.  Bail
out if there is no stack.  Don't update register information
unless registers_too_p is true.
(tui_print_frame_info_listing_hook): Rename to ...
(tui_dummy_print_frame_info_listing_hook): ... this.
(tui_before_prompt): New function.
(tui_normal_stop): New function.
(tui_before_prompt_observer): New observer.
(tui_normal_stop_observer): New observer.
(tui_install_hooks): Set
deprecated_print_frame_info_listing_hook to
tui_dummy_print_frame_info_listing_hook.  Register
tui_before_prompt_observer to call tui_before_prompt and
tui_normal_stop_observer to call tui_normal_stop.  Remove
reference to deprecated_selected_frame_level_changed_hook.
(tui_remove_hooks): Detach and unset tui_before_prompt_observer
and tui_normal_stop_observer.  Remove reference to
deprecated_selected_frame_level_changed_hook.

8 years agoBe lazy about refreshing the windows in tui_show_frame_info (PR tui/13378)
Patrick Palka [Sat, 27 Jun 2015 00:38:30 +0000 (20:38 -0400)]
Be lazy about refreshing the windows in tui_show_frame_info (PR tui/13378)

tui_show_frame_info is responsible for updating the visible windows
following a change in frame information (that being the currently
selected frame, PC, line number, etc).  Currently it always redraws and
refreshes each window even if frame information has not changed.  This
behavior is inefficient and helps contribute to the occassional
flickering of the TUI as described in the mentioned PR.

This patch makes tui_show_frame_info refresh the windows only if frame
information has changed.  Determining whether frame information has
changed is done indirectly by determining whether the locator has
changed.  This approach is convenient and yet sensible because the
locator contains all the relevant info we need to check anyway: the
current PC, the line number, the name of the executable and the name of
the current function.  Probably only the PC is really necessary to
check, but it doesn't hurt to check every field.

Effectively, with this patch, consecutive calls to select_frame with the
same frame/PC no longer cause TUI's frame information to be updated
multiple times.

gdb/ChangeLog:

PR tui/13378
* tui/tui-stack.c (tui_set_locator_info): Change prototype to
return an int instead of void.  Return whether the locator
window has changed.
(tui_show_frame_info): If the locator info has not changed, then
bail out early to avoid refreshing the windows.

8 years agoCorrectly initialize the TUI locator window
Patrick Palka [Sat, 27 Jun 2015 00:17:56 +0000 (20:17 -0400)]
Correctly initialize the TUI locator window

The call to tui_alloc_content in tui_set_locator_info passes
locator->type as the type of the window whose content is being
allocated.  This may seem correct but it's actually not because when
this code path actually get executed locator->type has not yet been to
set LOCATOR_WIN so it defaults to 0 i.e. SRC_WIN.  Thus we allocate the
content of the locator window as if it was the source window.  This
oversight turns out not to be a big deal in practice but the patch that
follows depends on the locator's proc_name and full_name arrays to be
initialized to the empty string which is done by tui_alloc_content if
we pass to it LOCATOR_WIN.

This patch fixes this bug by explicitly passing LOCATOR_WIN to
tui_alloc_content.

gdb/ChangeLog:

* tui/tui-stack.c (tui_set_locator_info): Explicitly pass
LOCATOR_WIN to tui_alloc_content.

8 years agoSync libdecnumber with gcc
H.J. Lu [Tue, 30 Jun 2015 17:22:36 +0000 (10:22 -0700)]
Sync libdecnumber with gcc

* configure: Regenerated.

8 years agoSync dfp.m4 with gcc
H.J. Lu [Tue, 30 Jun 2015 17:20:19 +0000 (10:20 -0700)]
Sync dfp.m4 with gcc

* dfp.m4 (enable_decimal_float): Also set to yes for
i?86*-*-elfiamcu target.

8 years agoSync toplevel configure with gcc
H.J. Lu [Tue, 30 Jun 2015 17:15:57 +0000 (10:15 -0700)]
Sync toplevel configure with gcc

* configure.ac (ospace_frag): Enable for i?86*-*-elfiamcu
target.
* configure: Regenerate.

8 years agoThis fixes parsing a file containing ELF attributes with very large tag values.
Nick Clifton [Tue, 30 Jun 2015 16:12:47 +0000 (17:12 +0100)]
This fixes parsing a file containing ELF attributes with very large tag values.

PR binutils/18570
* elf-attrs.c (obj_attr_size): Use an unsigned int type for the tag.
(write_obj_attribute): Likewise.
(elf_new_obj_attr): Likewise.
(bfd_elf_get_obj_attr_int): Likewise.
(bfd_elf_add_obj_attr_int): Likewise.
(bfd_elf_add_obj_attr_string): Likewise.
(bfd_elf_add_obj_attr_int_string): Likewise.
(gnu_obj_attrs_arg_type): Likewise.
(_bfd_elf_obj_attrs_arg_type): Likewise.
(_bfd_elf_parse_attributes): Likewise.
(_bfd_elf_merge_unknown_attribute_list): Likewise.
* elf-bfd.h (struct obj_attribute_list): Likewise.
Update prototypes.