Commit Graph

80134 Commits

Author SHA1 Message Date
Nick Clifton bcf83b2a66 An off-by-one error in the code to catch bogus vn_next fields meant that
linker testsuite failures were showing up for the cris target.  Fixed by
this patch.

	* readelf.c (process_version_sections): Fix off-by-one error in
	previous delta.
2014-03-20 13:15:12 +00:00
Will Newton 97323ad113 bfd/elf32-arm.c: Set st_value to zero for undefined symbols
Unless pointer_equality_needed is set then set st_value to be zero
for undefined symbols.

bfd/ChangeLog:

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

	PR ld/16715
	* elf32-arm.c (elf32_arm_check_relocs): Set
	pointer_equality_needed for absolute references within
	executable links.
	(elf32_arm_finish_dynamic_symbol): Set st_value to zero
	unless pointer_equality_needed is set.

ld/testsuite/ChangeLog:

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

	* ld-arm/ifunc-14.rd: Update symbol values.
2014-03-20 11:43:33 +00:00
Alan Modra e1f8f1b3af daily update 2014-03-20 09:32:15 +10:30
Nick Clifton c24cf8b6e8 This is a fix for PR binutils/16723, where a corrupt .gnu.version_r section could
send readelf into an infinite loop.

	* readelf.c (process_version_sections): Prevent an infinite loop
	when the vn_next field is zero but there are still entries to be
	processed.
2014-03-19 16:48:02 +00:00
Jose E. Marchesi ec92c392f7 This patch adds support for the hyperprivileged registers %hstick_offset
and %hstick_enable to the Sparc assembler.

	* config/tc-sparc.c (hpriv_reg_table): Added entries for
	%hstick_offset and %hstick_enable.
	* doc/c-sparc.texi (Sparc-Regs): Document the %hstick_offset and
	%hstick_enable hyperprivileged registers.

	* sparc-dis.c (v9_hpriv_reg_names): Names for %hstick_offset and
	%hstick_enable added.

	* gas/sparc/rdhpr.s: Test rd %hstick_offset and %hstick_enable.
	* gas/sparc/rdhpr.d: Likewise.

	* gas/sparc/wrhpr.s: Test wr %hstick_offset and %hstick_enable.
	* gas/sparc/wrhpr.d: Likewise.
2014-03-19 16:43:41 +00:00
Jose E. Marchesi 999bf65c4b Fix Sparc test which was failing in the presence of new v9 opcodes.
* gas/sparc/ldd_std.d: Fix objdump invocation in order to get
	the old opcodes for the ldtw, ldtwa, stw and stwa instructions.
2014-03-19 16:22:31 +00:00
Pedro Alves 05adc73e82 gdb.base/async.exp: Enable it.
There's no reason not to enable this test anymore.

Even if the current output isn't ideal (we mess up the prompt), it's what
we have today.  We can adjust the test if the output improves.

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

	* gdb.base/async.exp: Remove early return.
2014-03-19 15:55:06 +00:00
Pedro Alves 6048b9501d gdb.base/async.exp: Make test messages unique.
$ cat gdb.sum| grep PASS| sort | uniq -c |sort -n
       1 PASS: gdb.base/async.exp: finish&
       1 PASS: gdb.base/async.exp: jump&
       1 PASS: gdb.base/async.exp: next&
       1 PASS: gdb.base/async.exp: nexti&
       1 PASS: gdb.base/async.exp: set exec-done-display off
       1 PASS: gdb.base/async.exp: set exec-done-display on
       1 PASS: gdb.base/async.exp: set target-async on
       1 PASS: gdb.base/async.exp: stepi&
       1 PASS: gdb.base/async.exp: until&
       2 PASS: gdb.base/async.exp: step&

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

	* gdb.base/async.exp (step& tests): Pass explicit test messages.
2014-03-19 15:54:31 +00:00
Pedro Alves 8bcfb00a77 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.
2014-03-19 15:53:00 +00:00
Pedro Alves 884e37dceb 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.
2014-03-19 15:51:54 +00:00
Pedro Alves 148e57e232 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.
2014-03-19 15:51:29 +00:00
Pedro Alves f48088c7de 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.
2014-03-19 15:50:53 +00:00
Pedro Alves e2f6c96628 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.
2014-03-19 15:48:47 +00:00
Pedro Alves c30568d4d1 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.
2014-03-19 15:22:44 +00:00
Nick Clifton 6caf711179 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.
2014-03-19 14:46:15 +00:00
Nick Clifton 288c6b306e Remove spurious character. 2014-03-19 14:43:00 +00:00
Daniel Gutson 2e6976a881 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.
2014-03-19 14:31:25 +00:00
Nick Clifton e57190430e 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.
2014-03-19 12:21:39 +00:00
Nick Clifton b41c812c96 Fix typo in changelog entry. 2014-03-19 09:40:21 +00:00
Nick Clifton b8985e5c0e 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.
2014-03-19 09:38:25 +00:00
Nick Clifton 1d63324c56 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.
2014-03-19 08:51:20 +00:00
Doug Evans 0172b6a7de * gdb.base/async.exp: Whitespace fixes. Turn on target-async.
Fix spelling of exec-done-display.
2014-03-18 19:19:51 -04:00
Alan Modra 1d09f4731b daily update 2014-03-19 09:30:42 +10:30
Jan Kratochvil 06c868a8dc 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>
2014-03-18 22:48:06 +01:00
Maciej W. Rozycki dea80df099 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.
2014-03-18 19:48:14 +00:00
Pedro Alves 0c7e1a4602 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.
2014-03-18 17:50:28 +00:00
Yufeng Zhang a52e6fd34a 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.
2014-03-18 17:41:43 +00:00
Nick Clifton d68d7e6b82 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.
2014-03-18 14:16:54 +00:00
Alan Modra c24ff48c75 daily update 2014-03-18 09:30:50 +10:30
Tom Tromey 9c1fcd01cf fix latent bugs in ui-out.c
The destructor code in ui-out.c has a latent bug, which is hidden by
the fact that nothing uses this right now.  This patch fixes the
problem.  The bug is that we don't always clear a pointer in the
ui-out object, leading to a bad free.

2014-03-17  Tom Tromey  <tromey@redhat.com>

	* ui-out.c (clear_table, ui_out_new): Clear uiout->table.id.
2014-03-17 19:02:13 +00:00
Chris Faylor c712f1e3f7 2014-03-17 Christopher Faylor <me.cygwin2014@cgf.cx>
* Makefile.am: Use host version of windres.
	* Makefile.in: Regenerate.
2014-03-17 13:19:49 -04:00
Nick Clifton 1f5afe1cc0 Add support for parsing VFP register names in .cfi_offset directives.
PR gas/16694
	* config/tc-arm.c (tc_arm_regname_to_dw2regnum): Parse VFP
	registers as well.

	* gas/cfi/cfi-arm-1.s: Add checks of VFP registers.
	* gas/cfi/cfi-arm-1.d: Update expected output.
2014-03-17 16:30:30 +00:00
Joel Brobecker f7c77d9323 [testsuite/Ada] New testcase for packed array renaming.
gdb/testsuite/ChangeLog:

        * gdb.ada/pckd_arr_ren: New testcase.
2014-03-17 08:45:55 -07:00
Pierre-Marie de Rodat 11aa919a07 [Ada] Crash with references to GNAT packed arrays handling
Consider the following declarations:

  type Packed_Array is array (Natural range <>) of Boolean;
  pragma Pack (Packed_Array);

  function Make (H, L : Natural) return Packed_Array is
  begin
     return (H .. L => False);
  end Make;

  A1 : Packed_Array := Make (1, 2);
  A2 : Packed_Array renames A1;

One possible DWARF translation for A2 is:

  <3><1e4>: Abbrev Number: 21 (DW_TAG_variable)
     <1e5>   DW_AT_name                 : a2
     <1ea>   DW_AT_type                 : <0x1d9>

  <3><1d9>: Abbrev Number: 22 (DW_TAG_const_type)
     <1da>   DW_AT_type                 : <0x1de>
  <3><1de>: Abbrev Number: 23 (DW_TAG_reference_type)
     <1e0>   DW_AT_type                 : <0x1a3>
  <3><1a3>: Abbrev Number: 17 (DW_TAG_array_type)
     <1a4>   DW_AT_name                 : foo__Ta1S___XP1
     <1a8>   DW_AT_GNAT_descriptive_type: <0x16b>

  <3><16b>: Abbrev Number: 6 (DW_TAG_typedef)
     <16c>   DW_AT_name                 : foo__Ta1S
     <172>   DW_AT_type                 : <0x176>
  <3><176>: Abbrev Number: 17 (DW_TAG_array_type)
     <177>   DW_AT_name                 : foo__Ta1S
     <17b>   DW_AT_GNAT_descriptive_type: <0x223>

Here, foo__Ta1S___XP1 is the type used for the code generation while
foo__Ta1S is the source-level type. Both form a valid GNAT encoding for
a packed array type.

Trying to print A2 (1) can make GDB crash. This is because A2 is defined
as a reference to a GNAT encoding for a packed array. When decoding
constrained packed arrays, the ada_coerce_ref subprogram follows
references and returns a fixed type from the target type, peeling
the GNAT encoding for packed arrays. The remaining code assumes that
the resulting type is still such an encoding while we only have
a standard GDB array type, hence the crash:

  arr = ada_coerce_ref (arr);
  [...]
  type = decode_constrained_packed_array_type (value_type (arr));

decode_constrained_packed_array_type assumes that its argument is
such an encoding. From its front comment:

  /* The array type encoded by TYPE, where
     ada_is_constrained_packed_array_type (TYPE).  */

This patch simply replaces the call to ada_coerce_ref with a call
to coerce_ref in order to avoid prematurely transforming
the packed array type as a side-effect. This way, the remaining code
will always work with a GNAT encoding.

gdb/ChangeLog:

	* ada-lang.c (decode_constrained_packed_array): Perform a
	minimal coercion for reference with coerce_ref instead of
	ada_coerce_ref.
2014-03-17 08:44:43 -07:00
Tristan Gingold d4ccb5e05c darwin: handle recent version of dyld
gdb/
	* solib-darwin.c (DYLD_VERSION_MAX): Increase value.
	(darwin_solib_create_inferior_hook): Emit a warning if version
	is unhandled.
2014-03-17 14:10:06 +01:00
Nick Clifton a2a0d05662 readelf -s test: Skip extra symbols produced by MSP430 assembler.
* binutils-all/readelf.ss: Add skip of MSP430 defined symbols.
2014-03-17 11:00:32 +00:00
Tristan Gingold 167e1c1f1f od-macho: dump compact unwind info.
binutils/
	* od-macho.c (dump_section_header): Renames of dump_section.
	(dump_segment): Adjust after renaming.
	(OPT_COMPACT_UNWIND): Define.
	(options): Add compact unwind.
	(mach_o_help): Document compact_unwind.
	(unwind_x86_64_regs, unwind_x86_regs): New arrays.
	(dump_unwind_encoding_x86, dump_unwind_encoding)
	(dump_obj_compact_unwind, dump_exe_compact_unwind)
	(dump_section_content): New functions.
	(mach_o_dump): Handle compact unwind.

include/mach-o/
	* unwind.h: New file.
2014-03-17 10:29:07 +01:00
Tristan Gingold fbe383b9ee mach-o: handle lasz load dylib command.
bfd/
	* mach-o.c (bfd_mach_o_read_dylib): Handle lazy load dylib.
	(bfd_mach_o_read_command): Ditto.

binutils/
	* od-macho.c (dump_load_command): Handle lazy load dylib.
2014-03-17 10:14:23 +01:00
Alan Modra 49f2e27ce4 daily update 2014-03-17 09:30:41 +10:30
Ulrich Weigand 49840f2a66 Fix Python 2.4 build break
This fixes a build failure against Python 2.4 by casting away "const"
on the second argument to PyObject_GetAttrString.  Similar casts to
support Python 2.4 were already present in a number of other places.

gdb/
2014-03-16  Ulrich Weigand  <uweigand@de.ibm.com>

	* python/py-value.c (get_field_flag): Cast flag_name argument to
	PyObject_GetAttrString to support Python 2.4.
2014-03-16 15:04:38 +01:00
Alan Modra c296d686ed daily update 2014-03-16 09:30:42 +10:30
Alan Modra 2b8118237a daily update 2014-03-15 09:30:57 +10:30
Jan Kratochvil ed4123e58e Step down from being global maintainer.
gdb/
2014-03-14  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* MAINTAINERS (The Official FSF-appointed GDB Maintainers)
	(Global Maintainers): Remove Jan Kratochvil.
2014-03-14 19:54:08 +01:00
Anthony Green 182a105a38 Check fwrite return code 2014-03-14 12:56:12 -04:00
Nick Clifton 8d05292667 Add support for instruction level tracing to the ARM simulator.
* wrapper.c (op_print): New function.
	(sim_dis_read): New function.
	(print_insn): New function - disassembles the given instruction.
	(sim_trace): Note that tracing is now allowed.
	(sim_create_inferior): Default to emulating v6.
	Initialise the disassembler machinery.
	(sim_target_parse_command_line): Add support for -t -d and -z
	options.
	(sim_target_display_usage): Note existence of -d and -z options.
	(sim_open): Parse -t -d and -z options.
	* armemu.h: Add exports of trace, disas and trace_funcs.
	Add prototype for print_insn.
	* armemu.c (ARMul_Emulate26): Add tracing code.
	Delete unused variables.
	* thumbemu (handle_v6_thumb_insn): Delete unused variable Rd.
	Move Rm variable into switch cases.
	Add tracing code.

	* armcopro.c (XScale_cp15_init): Add a return value.
	(XScale_cp13_init): Likewise.
	(XScale_cp14_init): Likewise.
	(XScale_cp15_LDC): Delete unused function.
	(XScale_cp15_STC): Likewise.
	* maverick.c: Delete comment inside comment.
	(DSPInit): Delete unused function.
	(DSPMCR4): Fix compile time warning about missing parenthesis.
	(DSPMCR5): Likewise.
	(DSPCDP6): Delete unused variable opcode2.
2014-03-14 15:21:23 +00:00
David McQuillan b9366cf395 Prevent writes to R15 via LDR or LDM from changing the ARM/Thumb state in pre-v5 architectures.
PR sim/8388
	* armemu.c (WriteR15Load): New function.  Determines if the state
	can be changed upon a write to R15.
	(LoadMult): Use WriteR15Load.
	* armemu.h (WRITEDESTB): Use WriteR15Load.
2014-03-14 14:03:29 +00:00
Alan Modra e5b98723a5 Correct ld-powerpc/vle-reloc-2 test
* ld-powerpc/vle-reloc-3.d: Remove addresses.
2014-03-15 00:12:56 +10:30
Nick Clifton 5a026fc9a2 Fix build time problem with MingGW hosts, which do not have a strnlen() function.
2014-03-13  Meador Inge  <meadori@codesourcery.com>

	 * configure.in: Add strnlen to AC_CHECK_DECLS.
	 * config.in: Regenerate.
         * configure: Regenerate.
	 * sysdep.h (strnlen): Add prototype.

         * dwarf.c (strnlen): Move prototype ...
	 * sysdep.h (strnlen): ... to here.
2014-03-14 11:21:00 +00:00
Joel Brobecker dc6ae99692 Fix guit.texi CL entry. 2014-03-14 08:55:26 +01:00
Alan Modra c3301df1da Fix overflow handling of VLE_SDA21
bfd/
	* elf32-ppc.c (ppc_elf_relocate_section): Correct overflow
	handling for VLE_SDA21 relocs.
ld/testsuite/
	* ld-powerpc/vle.ld: Place .PPC.EMB.sdata0 within 32k of 0.
	* ld-powerpc/vle-reloc-3.d: Update.
2014-03-14 15:01:53 +10:30