Convert function declarations to ISO C format.  Remove redundant code.

	* wrapper.c: Convert function declarations to ISO C format.
	(sim_open): Delete code for handling t,d and z command line
	options.
Enable verbose error messages by default for AArch64 gas.

gas/

	* config/tc-aarch64.c (aarch64_opts): Add new option
	"mno-verbose-error".
	(verbose_error_p): Initialize to 1.
	* doc/c-aarch64.texi (AArch64 Options): Document -mverbose-error
	and -mno-verbose-error.

gas/testsuite/

	* gas/aarch64/illegal.d: Pass -mno-verbose-error.
	* gas/aarch64/verbose-error.s: Add more verbose message testcases.
	* gas/aarch64/verbose-error.l: Ditto.
PR gdb/13860: make "-exec-foo"'s MI output equal to "foo"'s MI output.

Part of PR gdb/13860 is about the mi-solib.exp test's output being
different in sync vs async modes.

sync:

  >./gdb -nx -q ./testsuite/gdb.mi/solib-main -ex "set stop-on-solib-events 1" -ex "set target-async off" -i=mi
  =thread-group-added,id="i1"
  ~"Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main..."
  ~"done.\n"
  (gdb)
  &"start\n"
  ~"Temporary breakpoint 1 at 0x400608: file ../../../src/gdb/testsuite/gdb.mi/solib-main.c, line 21.\n"
  =breakpoint-created,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x0000000000400608",func="main",file="../../../src/gdb/testsuite/gdb.mi/solib-main.c",fullname="/home/pedro/gdb/mygit/src/gdb/testsuite/gdb.mi/solib-main.c",line="21",times="0",original-location="main"}
  ~"Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main \n"
  =thread-group-started,id="i1",pid="17724"
  =thread-created,id="1",group-id="i1"
  ^running
  *running,thread-id="all"
  (gdb)
  =library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
  ~"Stopped due to shared library event (no libraries added or removed)\n"
  *stopped,reason="solib-event",frame={addr="0x000000379180f990",func="_dl_debug_state",args=[],from="/lib64/ld-linux-x86-64.so.2"},thread-id="1",stopped-threads="all",core="3"
  (gdb)

async:

  >./gdb -nx -q ./testsuite/gdb.mi/solib-main -ex "set stop-on-solib-events 1" -ex "set target-async on" -i=mi
  =thread-group-added,id="i1"
  ~"Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main..."
  ~"done.\n"
  (gdb)
  start
  &"start\n"
  ~"Temporary breakpoint 1 at 0x400608: file ../../../src/gdb/testsuite/gdb.mi/solib-main.c, line 21.\n"
  =breakpoint-created,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x0000000000400608",func="main",file="../../../src/gdb/testsuite/gdb.mi/solib-main.c",fullname="/home/pedro/gdb/mygit/src/gdb/testsuite/gdb.mi/solib-main.c",line="21",times="0",original-location="main"}
  ~"Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main \n"
  =thread-group-started,id="i1",pid="17729"
  =thread-created,id="1",group-id="i1"
  ^running
  *running,thread-id="all"
  =library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
  (gdb)
  *stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="1"

For now, let's focus only on the *stopped event.  We see that the
async output is missing frame info.  And this causes a test failure in
async mode, as "mi_expect_stop solib-event" wants to see the frame
info.

However, if we compare the event output when a real MI execution
command is used, compared to a CLI command (e.g., run vs -exec-run,
next vs -exec-next, etc.), we see:

  >./gdb -nx -q ./testsuite/gdb.mi/solib-main -ex "set stop-on-solib-events 1" -ex "set target-async off" -i=mi
  =thread-group-added,id="i1"
  ~"Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main..."
  ~"done.\n"
  (gdb)
  r
  &"r\n"
  ~"Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main \n"
  =thread-group-started,id="i1",pid="17751"
  =thread-created,id="1",group-id="i1"
  ^running
  *running,thread-id="all"
  (gdb)
  =library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
  ~"Stopped due to shared library event (no libraries added or removed)\n"
  *stopped,reason="solib-event",frame={addr="0x000000379180f990",func="_dl_debug_state",args=[],from="/lib64/ld-linux-x86-64.so.2"},thread-id="1",stopped-threads="all",core="3"
  (gdb)
  -exec-run
  =thread-exited,id="1",group-id="i1"
  =thread-group-exited,id="i1"
  =library-unloaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",thread-group="i1"
  =thread-group-started,id="i1",pid="17754"
  =thread-created,id="1",group-id="i1"
  ^running
  *running,thread-id="all"
  (gdb)
  =library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
  *stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="1"
  =thread-selected,id="1"
  (gdb)

As seen above, with MI commands, the *stopped event _doesn't_ have
frame info.  This is because normal_stop, as commanded by the result
of bpstat_print, skips printing frame info in this case (it's an
"event", not a "breakpoint"), and when the interpreter is MI,
mi_on_normal_stop skips calling print_stack_frame, as the normal_stop
call was already done with the MI uiout.  This explains why the async
output is different even with a CLI command.  Its because in async
mode, the mi_on_normal_stop path is always taken; it is always reached
with the MI uiout, because the stop is handled from the event loop,
instead of from within `proceed -> wait_for_inferior -> normal_stop'
with the interpreter overridden, as in sync mode.

This patch fixes the issue by making all cases output the same
*stopped event, by factoring out the print code from normal_stop, and
using it from mi_on_normal_stop as well.  I chose the *stopped output
without a frame, mainly because that is what you already get if you
use MI execution commands, the commands frontends are supposed to use
(except when implementing a console).  This patch makes it simpler to
tweak the MI output differently if desired, as we only have to change
the centralized print_stop_event (taking into account whether the
uiout is MI-like), and all different modes will change accordingly.

Tested on x86_64 Fedora 17, no regressions.  The mi-solib.exp test no
longer fails in async mode with this patch, so the patch removes the
kfail.

2014-03-18  Pedro Alves  <palves@redhat.com>

	PR gdb/13860
	* inferior.h (print_stop_event): Declare.
	* infrun.c (print_stop_event): New, factored out from ...
	(normal_stop): ... this.
	* mi/mi-interp.c (mi_on_normal_stop): Use print_stop_event instead
	of bpstat_print/print_stack_frame.

2014-03-18  Pedro Alves  <palves@redhat.com>

	PR gdb/13860
	* gdb.mi/mi-solib.exp: Remove gdb/13860 kfail.
	* lib/mi-support.exp (mi_expect_stop): Add special handling for
	solib-event.
Power: Correct little-endian e500v2 GPR frame offsets

This change corrects GPR frame offset calculation for the e500v2
processor.  On this target, featuring the SPE APU, GPRs are 64-bit and
are held in stack frames whole with the use of `evstdd' and `evldd'
instructions.  Their integer 32-bit part occupies the low-order word and
therefore its offset varies between the two endiannesses possible.

	* rs6000-tdep.c (rs6000_frame_cache): Correct little-endian GPR
	offset into SPE pseudo registers.
Fix SIGTERM signal safety (PR gdb/15358).

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

	PR gdb/15358
	* defs.h (sync_quit_force_run): New declaration.
	(QUIT): Check also SYNC_QUIT_FORCE_RUN.
	* event-top.c (async_sigterm_handler): New declaration.
	(async_sigterm_token): New variable.
	(async_init_signals): Create also async_sigterm_token.
	(async_sigterm_handler): New function.
	(sync_quit_force_run): New variable.
	(handle_sigterm): Replace quit_force call by other calls.
	* utils.c (quit): Call quit_force if SYNC_QUIT_FORCE_RUN.

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

	PR gdb/15358
	* gdb.base/gdb-sigterm.c: New file.
	* gdb.base/gdb-sigterm.exp: New file.

Message-ID: <20140316135334.GA30698@host2.jankratochvil.net>
daily update
	* gdb.base/async.exp: Whitespace fixes.  Turn on target-async.
	Fix spelling of exec-done-display.
Improve .rsrc section merging with better handling of the alignment adjustments
made between merged .rsrc sections.

	* peXXigen.c (rsrc_align): New function.  Attempts to cope with
	alignment variances when .rsrc sections are merged.
	(rsrc_process_section): Use rsrc_align.

	* Makefile.am (default-manifest.o): Use WINDRES_FOR_TARGET.
	* Makefile.in: Regenerate.
	* emultempl/default-manifest.rc: Fix typo.
	* scripttempl/pe.sc (R_RSRC): Fix default-manifest exclusion.
	(.rsrc): Add SUBALIGN(4).
	* scripttempl/pep.sc: Likewise.
Fix RX gas testsuite failures by accounting for new variations in the disassembler's output.

	* rx-decode.opc (bwl): Allow for bogus instructions with a size
	field of 3.
	(sbwl, ubwl, SCALE): Likewise.
	* rx-decode.c: Regenerate.

	* gas/rx/mov.d: Update expected disassembly.
Fix typo in changelog entry.
Fix RX linker testsuite failures by making the assembler use conventional section names.

	* config/default.exp (ASFLAGS): For the RX target add:
	-muse-conventional-section-names.
Add support for ARM assembler produced by CodeCompositor Studio.

	* config/tc-arm.c (codecomposer_syntax): New flag that states whether the
	CCS syntax compatibility mode is on or off.
	(asmfunc_states): New enum to represent the asmfunc directive state.
	(asmfunc_state): New variable holding the asmfunc directive state.
	(comment_chars): Rename to arm_comment_chars.
	(line_separator_chars): Rename to arm_line_separator_chars.
	(s_ccs_ref): New function that handles the .ref directive.
	(asmfunc_debug): New function.
	(s_ccs_asmfunc): New function that handles the .asmfunc directive.
	(s_ccs_endasmfunc): New function that handles the .endasmfunc directive.
	(s_ccs_def): New function that handles the .def directive.
	(tc_start_label_without_colon): New function.
	(md_pseudo_table): Added new CCS directives.
	(arm_ccs_mode): New function that handles the -mccs command line option.
	(arm_long_opts): Added new -mccs command line option.
	* config/tc-arm.h (LABELS_WITHOUT_COLONS): New macro.
	(TC_START_LABEL_WITHOUT_COLON): New macro.
	(tc_start_label_without_colon): Added extern function declaration.
	(tc_comment_chars): Define.
	(tc_line_separator_chars): Define.
	* app.c (do_scrub_begin): Use tc_line_separator_chars, if defined.
	* read.c (read_begin): Likewise.
	* doc/as.texinfo: Add documentation for the -mccs command line
	option.
	* doc/c-arm.texi: Likewise.
	* doc/internals.texi: Document tc_line_separator_chars.
	* NEWS: Mention the new feature.

	* gas/arm/ccs.s: New test case.
	* gas/arm/ccs.d: New expected disassembly.
Remove spurious character.
Improve .rsrc section merging again.  This time with an algorithm that
should work for all types of input .rsrc section.

	* peXXigen.c (rsrc_process_section): Add code to scan input
	sections and record their lengths.  Use these lengths to find the
	start of each merged .rsrc section.

	* scripttempl/pe.sc (R_RSRC): Fix default-manifest exclusion.
	(.rsrc): Add SUBALIGN(4).  Remove SORT.
	* scripttempl/pep.sc: Likewise.
gdb.base/async.exp: Leave gdb_protocol alone.

Many eons ago, async was only implemented in the remote target, and
you'd activate it by doing "target async" rather than "target remote".
That's long gone now, replaced by "set target-async on".

gdb/testsuite/
2014-03-19  Pedro Alves  <palves@redhat.com>

	* gdb.base/async.exp: Don't frob gdb_protocol.
gdb.base/async.exp: Don't hardcode line numbers.

gdb/testsuite/
2014-03-19  Pedro Alves  <palves@redhat.com>

	* gdb.base/async.c (main): Add "jump here" and "until here" line
	marker comments.
	* gdb.base/async.exp (jump_here): New global.
	(jump& test): Use it.
	(until_here): New global.
	(until& test): Use it.
gdb.base/async.exp: Fix stepi& test.

Currently the test assumes that "stepi" over:

 13       x = 5;

end up somewhere midline.  But, (at least) on x86, that assignment
ends up compiled as just one movl instruction, so a stepi stops at the
next line already:

 completed.
 PASS: gdb.base/async.exp: step &
 step&
 (gdb) foo () at ../../../src/gdb/testsuite/gdb.base/async.c:13
 13       x = 5;
 completed.
 PASS: gdb.base/async.exp: step &
 stepi&
 (gdb) 14         y = 3;
 completed.
 FAIL: gdb.base/async.exp: (timeout) stepi &
 nexti&
 (gdb) 16         return x + y;
 completed.
 FAIL: gdb.base/async.exp: (timeout) nexti &
 finish&
 Run till exit from #0  foo () at ../../../src/gdb/testsuite/gdb.base/async.c:16

This patch fixes it, by making sure there's more than one instruction
in that line.

gdb/testsuite/
2014-03-19  Pedro Alves  <palves@redhat.com>

	* gdb.base/async.c (foo): Make 'x' volatile.  Write to it twice in
	the same line.
gdb.base/async.exp: Use prepare_for_testing.

gdb/testsuite/
2014-03-19  Pedro Alves  <palves@redhat.com>

	* gdb.base/async.exp: Use prepare_for_testing.
gdb.base/async.exp: Factor out test pattern to a procedure.

All the tests here follow the same pattern (and they all have the same
problem, not fixed here yet).  Add a new procedure, factoring out the
pattern to a simple place.

gdb/testsuite/
2014-03-19  Pedro Alves  <palves@redhat.com>

	* gdb.base/async.exp (test_background): New procedure.
	Use it for all background execution command tests.
gdb.base/async.exp: Fix races.

This test is currently racy:

 PASS: gdb.base/async.exp: step&
 stepi&
 (gdb) 0x0000000000400547        14       x = 5; x = 5;
 completed.
 PASS: gdb.base/async.exp: stepi&
 nexti&
 (gdb) 15         y = 3;
 completed.FAIL: gdb.base/async.exp: nexti&

The problem is here:

 	-re "^$command\r\n${before_prompt}${gdb_prompt}${after_prompt}completed\.\r\n" {
 	    pass "$command"
 	}
	-re "$gdb_prompt.*completed\.$" {
 	    fail "$command"
	}

Note how the fail pattern is a subset of the pass pattern.  If the
expect buffer happens to end up with:

  "^$command\r\n${before_prompt}${gdb_prompt}${after_prompt}completed\."

that is, the final "\r\n" has't reached the expect buffer yet, but
"completed." has, then the fail pattern matches...

gdb/testsuite/
2014-03-19  Pedro Alves  <palves@redhat.com>

	* gdb.base/async.exp (test_background): Expect \r\n after
	"completed." in the fail pattern.