Commit Graph

84461 Commits

Author SHA1 Message Date
Simon Marchi 4ab31498e4 Add missing spaces in previous patch
gdb/ChangeLog:

	* progspace.c (delete_program_space): Add missing spaces.
2015-07-08 15:48:02 -04:00
Simon Marchi 7a41607e01 Delete program spaces directly when removing inferiors
When deleting an inferior, delete the associated program space as well
if it becomes unused. This replaces the "pruning" approach, with which
you could forget to call prune_program_spaces (as seen, with the
-remove-inferior command, see [1]).

This allows to remove the prune_program_spaces function. At the same
time, I was able to clean up the delete_inferior* family:

 - delete_inferior is unused
 - delete_inferior_silent is only used in monitor_close, but is replaced
   with discard_all_inferiors [2], so it becomes unused
 - All remaining calls to delete_inferior_1 are with silent=1, so the
   parameter is removed
 - delete_inferior_1 is renamed to delete_inferior

I renamed pspace_empty_p to program_space_empty_p. I prefer if the
"exported" functions have a more explicit and standard name.

Tested on Ubuntu 14.10.

[1] https://sourceware.org/ml/gdb-patches/2014-09/msg00717.html
[2] See https://sourceware.org/ml/gdb-patches/2015-07/msg00228.html and
    follow-ups for details.

gdb/Changelog:

	* inferior.c (delete_inferior_1): Rename to ...
	(delete_inferior): ..., remove 'silent' parameter, delete
	program space when unused and remove call to prune_program_spaces.
	Remove the old, unused, delete_inferior.
	(delete_inferior_silent): Remove.
	(prune_inferiors): Change call from delete_inferior_1 to
	delete_inferior and remove 'silent' parameter. Remove call to
	prune_program_spaces.
	(remove_inferior_command): Idem.
	* inferior.h (delete_inferior_1): Rename to...
	(delete_inferior): ..., remove 'silent' parameter and remove the
	original delete_inferior.
	(delete_inferior_silent): Remove.
	* mi/mi-main.c (mi_cmd_remove_inferior): Change call from
	delete_inferior_1 to delete_inferior and remove 'silent'
	parameter.
	* progspace.c (prune_program_spaces): Remove.
	(pspace_empty_p): Rename to...
	(program_space_empty_p): ... and make non-static.
	(delete_program_space): New.
	* progspace.h (prune_program_spaces): Remove declaration.
	(program_space_empty_p): New declaration.
	(delete_program_space): New declaration.
	* monitor.c (monitor_close): Replace call to
	delete_thread_silent and delete_inferior_silent with
	discard_all_inferiors.
2015-07-08 15:41:01 -04:00
Richard Sandiford 7e30235281 Clarify case requirements for gas pseudo-ops
gas/
2015-07-08  Ciro Santilli  <ciro.santilli@gmail.com>

	* doc/as.texinfo: Clarify case requirements for pseudo ops.
2015-07-08 20:11:06 +01:00
Patrick Palka a9bd710f87 tui: replace deprecated_register_changed_hook with observer
This is a straightforward replacement of the TUI's use of the
aforementioned hook with the register_changed observer.  Since this was
the only user of the hook, this patch also removes the hook.

gdb/ChangeLog:

	* defs.h (deprecated_register_changed_hook): Remove prototype.
	* interps.c (clear_iterpreter_hooks): Remove reference to
	deprecated_register_changed_hook.
	* top.c (deprecated_register_changed_hook): Remove prototype.
	* valops.c (value_assign): Remove reference to
	deprecated_register_changed_hook.
	* tui/tui-hooks.c (tui_register_changed): Add parameter "frame".
	Add comment documenting the function.
	(tui_register_changed_observer): Define.
	(tui_install_hooks): Remove reference to
	deprecated_register_changed_hook.  Set
	tui_register_changed_observer.
	(tui_remove_hooks): Remove reference to
	deprecated_register_changed_hook.  Unset
	tui_register_changed_observer.
2015-07-08 14:44:30 -04:00
Denis Chertykov 328e7bfdde Define DIFF_EXPR_OK for avr target to allow PC relative difference relocation.
When generating relocation (tc_gen_reloc) 32 bit relocation fixup
is changed to new 32 bit PC relative relocation if the fixup has pc-relative
flag set.

bfd/ChangeLog

2015-07-06  Pitchumani Sivanupandi <pitchumani.s@atmel.com>

    * elf32-avr.c: Add 32 bit PC relative relocation for AVR target.

gas/ChangeLog

2015-07-06  Pitchumani Sivanupandi <pitchumani.s@atmel.com>

    * config/tc-avr.c (tc_gen_reloc): Change 32 bit relocation to
    32 bit PC relative and update offset if the fixup is pc-relative.
    * config/tc-avr.h (DIFF_EXPR_OK): Define to enable PC relative diff
    relocs.

gas/testsuite/ChangeLog

2015-07-06  Pitchumani Sivanupandi <pitchumani.s@atmel.com>

    * gas/avr/pc-relative-reloc.d: New test for 32 bit pc relative reloc.
    * gas/avr/per-function-debugline.s: New test source.

include/ChangeLog

2015-07-06  Pitchumani Sivanupandi <pitchumani.s@atmel.com>

    * elf/avr.h: Add new 32 bit PC relative relocation.

ld/testsuite/ChangeLog

2015-07-06  Pitchumani Sivanupandi <pitchumani.s@atmel.com>

    * ld-avr/gc-section-debugline.d: New test.
    * ld-avr/per-function-debugline.s: Source for new test.
2015-07-08 21:41:52 +03:00
Andrew Burgess 7c7f93f6e5 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.
2015-07-08 17:39:35 +01:00
Simon Marchi ef3f321b39 Revert "Delete program spaces directly when removing inferiors"
Reverted, since it causes a build failure.  It turns out that
delete_inferior_silent wasn't actually unused.

This reverts commit 0560c645c0.
2015-07-08 11:40:35 -04:00
Simon Marchi 0560c645c0 Delete program spaces directly when removing inferiors
When deleting an inferior, delete the associated program space as well
if it becomes unused. This replaces the "pruning" approach, with which
you could forget to call prune_program_spaces (as seen, with the
-remove-inferior command, see [1]).

This allows to remove the prune_program_spaces function. At the same
time, I was able to clean up the delete_inferior* family.
delete_inferior_silent and delete_inferior were unused, which allowed
renaming delete_inferior_1 to delete_inferior. Also, since all calls to
it were with silent=1, I removed that parameter completely.

I renamed pspace_empty_p to program_space_empty_p. I prefer if the
"exported" functions have a more explicit and standard name.

Tested on Ubuntu 14.10.

This obsoletes my previous patch "Add call to prune_program_spaces in
mi_cmd_remove_inferior" [1].

[1] https://sourceware.org/ml/gdb-patches/2014-09/msg00717.html

gdb/Changelog:

	* inferior.c (delete_inferior_1): Rename to ...
	(delete_inferior): ..., remove 'silent' parameter, delete
	program space when unused and remove call to prune_program_spaces.
	Remove the old, unused, delete_inferior.
	(delete_inferior_silent): Remove.
	(prune_inferiors): Change call from delete_inferior_1 to
	delete_inferior and remove 'silent' parameter. Remove call to
	prune_program_spaces.
	(remove_inferior_command): Idem.
	* inferior.h (delete_inferior_1): Rename to...
	(delete_inferior): ..., remove 'silent' parameter and remove the
	original delete_inferior.
	(delete_inferior_silent): Remove.
	* mi/mi-main.c (mi_cmd_remove_inferior): Change call from
	delete_inferior_1 to delete_inferior and remove 'silent'
	parameter.
	* progspace.c (prune_program_spaces): Remove.
	(pspace_empty_p): Rename to...
	(program_space_empty_p): ... and make non-static.
	(delete_program_space): New.
	* progspace.h (prune_program_spaces): Remove declaration.
	(program_space_empty_p): New declaration.
	(delete_program_space): New declaration.
2015-07-08 11:26:32 -04:00
Jan Kratochvil 084641963d 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.
2015-07-08 14:42:19 +02:00
Robert O'Callahan bcf5c1d96b 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.
2015-07-08 10:53:36 +01:00
Markus Metzger e8643a4533 add myself to write-after-approval list
gdb/
	* MAINTAINERS (Write After Approval): Add Markus T. Metzger.
2015-07-08 09:59:07 +02:00
Markus Metzger 76fb6829cd ari: fix strerror() use
Do not use strerror(), instead use safe_strerror().

gdb/
	* nat/linux-btrace.c (kernel_supports_bts, kernel_supports_pt):
	Use safe_strerror() instead of strerror().
2015-07-08 09:57:55 +02:00
GDB Administrator 501f83eb18 Automatic date update in version.in 2015-07-08 00:00:07 +00:00
Han Shen b91deca94e Make gold aarch64 accept long form of mapping symbols.
2015-07-07  Han Shen  <shenhan@google.com>

gold/ChangeLog:
	2015-07-06 Han Shen  <shenhan@google.com>
	* aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
	of mapping symbols.
2015-07-07 16:40:13 -07:00
Yao Qi 4931af25b8 New proc is_aarch64_target
Some tests expect the the target is aarch64, but checking target
triplet is not accurate, because target triplet can be aarch64 but
the program is in arm (or aarch32) state.

This patch addes a new proc is_aarch64_target which returns true
if the target is on aarch64 state.

gdb/testsuite:

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

	* gdb.arch/aarch64-atomic-inst.exp: Check is_aarch64_target
	instead of istarget "aarch64*-*-*".
	* gdb.arch/aarch64-fp.exp: Likewise.
	* gdb.base/float.exp: Likewise.
	* gdb.reverse/aarch64.exp: Likewise.
	* lib/gdb.exp (is_aarch64_target): New proc.
2015-07-07 16:58:20 +01:00
Yao Qi 9fcf688e80 New proc is_aarch32_target
GDB tests running on arm target should be also run on aarch32
(32-bit mode on aarch64).  There should be no difference.  It is not
precise to check target triplet to decide which tests should be run,
because if I compiler all the test binary in 32-bit (arm program),
but target triplet is still aarch64, so that these arm specific tests
are skipped.

This patch is to add a new proc is_aarch32_target which return true
if target triplet is arm or the test binary is compiled for arm.

gdb/testsuite:

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

	* lib/gdb.exp (is_aarch32_target): New proc.
	* gdb.arch/arm-bl-branch-dest.exp: Check is_aarch32_target
	instead of "istarget "arm*-*-*"".
	* gdb.arch/arm-disp-step.exp: Likewise.
	* gdb.arch/thumb-bx-pc.exp: Likewise.
	* gdb.arch/thumb-prologue.exp: Likewise.
	* gdb.arch/thumb-singlestep.exp: Likewise.
	* gdb.base/disp-step-syscall.exp: Likewise.
	* gdb.base/float.exp: Likewise.
2015-07-07 16:58:19 +01:00
Yao Qi fbd8d50de2 Enable multi-arch test in catch-syscall.exp on aarch64
This patch is to enable test_catch_syscall_multi_arch on aarch64.

gdb/testsuite:

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

	* gdb.base/catch-syscall.exp (test_catch_syscall_multi_arch):
	Set arch1, arch2, syscall1_name, syscall2_name and syscall_number.
2015-07-07 16:58:19 +01:00
Yao Qi 71be1fdc36 Adjust gdb.multi tests for aarch64
Multi-arch related tests under gdb.multi are to compile programs with
the same compiler but different compiler options (-m64 vs -m32).  However,
different compilers are needed to compile both aarch64 program and
arm (aarch32) program.  This patch is to adjust these test cases to
compile programs in different modes with different compiler.

When we use gcc for arm-linux target, its file name can be different,
arm-linux-gnueabihf-gcc, arm-linux-gnueabi-gcc, or arm-none-linux-gnueabi-gcc,
so I add a variable ARM_CC_FOR_TARGET, so that user can set the name
of gcc for arm-linux target on aarch64, like:

 $ make check RUNTESTFLAGS='ARM_CC_FOR_TARGET=arm-linux-gnueabihf-gcc multi-arch.exp'

gdb/testsuite:

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

	* gdb.multi/multi-arch-exec.exp: Set march1 and march2 to "" if target
	is aarch64.  If target is aarch64, set compiler=${ARM_CC_FOR_TARGET}
	if it exists.
	* gdb.multi/multi-arch.exp: Likewise.
2015-07-07 16:58:19 +01:00
Yao Qi 82c40d4b1d Set architecture to arm in arm-*.xml files
This patch is to add the following line to various arm target description
xml files,

<architecture>arm</architecture>

in order to fix problems I've seen on aarch64 multi-arch debugging,

 detach^M
 Detaching from program: build-gdb/gdb/testsuite/gdb.base/attach, process 17145^M
 (gdb) PASS: gdb.base/attach.exp: attach1 detach file^M
 No executable file now.^M
 Architecture of file not recognized.^M
 (gdb) FAIL: gdb.base/attach.exp: attach1, purging symbols after detach

Without this patch, struct target_desc *tdesc_* are not initialised
properly, that is, fields arch and osabi in 'struct target_desc' are
not set properly.  This doesn't cause any problems on single arch
debugging, because arch-utils.c:gdbarch_info_fill will guess correctly.
However, in multi-arch debugging, gdbarch_info_fill gets the aarch64
arch, but the target description is for arm (because the current
inferior is 32-bit arm).

It is a surprise to me we didn't set architecture to "arm" before in *.xml
files, and I didn't find out why didn't do so.  AFAICS,
gdb/features/arm-with-iwmmxt.xml was added firstly (in patch
https://sourceware.org/ml/gdb-patches/2007-01/msg00593.html)
which had <architecture>iwmmxt</architecture>, however, afterwards,
architecture isn't set anymore in features/arm-*.xml files (in patches
https://sourceware.org/ml/gdb-patches/2009-07/msg00689.html and
https://sourceware.org/ml/gdb-patches/2010-08/msg00225.html).

gdb:

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

	* features/arm-with-m-fpa-layout.xml: Set architecture to arm.
	* features/arm-with-m-fpa-layout.c: Regenerated.
	* features/arm-with-m-vfp-d16.xml: Likewise.
	* features/arm-with-m-vfp-d16.c: Regenerated.
	* features/arm-with-m.xml: Likewise.
	* features/arm-with-m.c: Regenerated.
	* features/arm-with-neon.xml: Likewise.
	* features/arm-with-neon.c: Regenerated.
	* features/arm-with-vfpv2.xml: Likewise.
	* features/arm-with-vfpv2.c: Regenerated.
	* features/arm-with-vfpv3.xml: Likewise.
	* features/arm-with-vfpv3.c: Regenerated.
2015-07-07 16:58:19 +01:00
Yao Qi 607685ecee Native debug arm program by aarch64 GDB
This patch is to let aarch64 GDB debug 32-bit arm program natively.  In
each function for fetching and storing registers, GDB will check
gdbarch_bfd_arch_info (gdbarch)->bits_per_word, if it is 32, call
the corresponding aarch32 functions in aarch32-linux-nat.c, otherwise
fall back to aarch64 code to fetch and store registers.

aarch64_linux_read_description has to return the right target description,
but we don't have gdbarch available there, so GDB fetches auxv and gets
AT_PHENT, in order to determine whether the target is 32-bit or 64-bit.
I learned this trick from solib-svr4.c.

gdb:

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

	* aarch32-linux-nat.h (VFP_REGS_SIZE): New macro, moved from
	arm-linux-nat.c.
	* aarch64-linux-nat.c: Include aarch32-linux-nat.h and
	elf/external.h.
	(fetch_gregs_from_thread): Call aarch32_gp_regcache_supply
	if target is 32-bit.
	(store_gregs_to_thread): Call aarch32_gp_regcache_collect
	if target is 32-bit.
	(fetch_fpregs_from_thread): Call aarch32_vfp_regcache_supply
	if target is 32-bit.
	(store_fpregs_to_thread): Call aarch32_vfp_regcache_collect
	if target is 32-bit.
	(tdesc_arm_with_vfpv3, tdesc_arm_with_neon): Declare.
	(aarch64_linux_read_description): Return the right target
	description.
	* arm-linux-nat.c (VFP_REGS_SIZE): Moved to aarch32-linux-nat.h.
	* config/aarch64/linux.mh (NATDEPFILES): Add aarch32-linux-nat.o.
	* configure.tgt (aarch64*-*-linux*): Add arm-tdep.o and
	arm-linux-tdep.o
2015-07-07 16:58:19 +01:00
Yao Qi f1b6788884 New aarch32-linux-nat.c
This patch is to move all the code about transferring
regcache <-> byte buffer for arm (aarch32) to a separate file
aarch32-linux-nat.c.  Then, in the following patch, aarch64 code
can use it to do multi-arch debugging.  This is a refactory patch.

gdb:

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

	* aarch32-linux-nat.c: New file.
	* aarch32-linux-nat.h: New file.
	* arm-linux-nat.c: Include aarch32-linux-nat.h.
	(fetch_regs): Move code to aarch32-linux-nat.c.  Call
	aarch32_gp_regcache_supply.
	(store_regs): Move code to aarch32-linux-nat.c.  Call
	aarch32_gp_regcache_collect.
	(fetch_vfp_regs): Move code to aarch32-linux-nat.c.  Call
	aarch32_vfp_regcache_supply.
	(store_vfp_regs): Move code to aarch32-linux-nat.c.  Call
	aarch32_vfp_regcache_collect.
	* config/arm/linux.mh (NATDEPFILES): Add aarch32-linux-nat.o.
2015-07-07 16:58:19 +01:00
Yao Qi 179bfe826b Remove {fetch,store}_fpregister and {fetch,store}_register
This patch is to remove fetch_fpregister, fech_register,
store_fpregister and store_register, and use fetch_fpregs,
fetch_regs, store_regs, and store_fpregs instead.

gdb:

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

	* arm-linux-nat.c (store_fpregister): Remove.
	(store_register): Likewise.
	(fetch_fpregister): Likewise.
	(fetch_register): Likewise.
	(arm_linux_store_inferior_registers): Call store_regs and
	store_fpregs instead.
	(arm_linux_fetch_inferior_registers): Call fetch_fpregs and
	fetch_regs instead.
2015-07-07 16:58:19 +01:00
Simon Marchi 3e221d361f Fix test for Python 3
gdb/testsuite/ChangeLog:

	* gdb.python/py-lazy-string.exp: Add missing parentheses to
	print.
2015-07-07 11:39:06 -04:00
Yao Qi d441430b75 [arm] Fix regression by Do not skip prologue for asm (.S) files
Patch "Do not skip prologue for asm (.S) files" [1] changes GDB's
behaviour on which test gdb.arch/thumb-singlestep.exp depends, so
it causes the fail below:

 (gdb) si^M
 37              blx     foo^M
 (gdb) FAIL: gdb.arch/thumb-singlestep.exp: step into foo

the test assumes the program will stop at the instruction after "push"
but it doesn't.  The fix to this fail is to do one more single step.

[1] https://sourceware.org/ml/gdb-patches/2015-06/msg00561.html

gdb/testsuite:

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

	* gdb.arch/thumb-singlestep.exp: Do one more single step.
2015-07-07 10:40:30 +01:00
GDB Administrator fa446e20d9 Automatic date update in version.in 2015-07-07 00:00:08 +00:00
Doug Kwan 15162befa3 Align text section ends so that stub tables appears at expected addresses. 2015-07-06 15:02:40 -07:00
Andrew Burgess 6008fc5fcd gdb: Rewrite documentation for layout and focus commands.
Changes the documentation for the layout and focus commands.

Instead of documenting each layout (or focus) sub-command as a separate
command, document a single layout (and focus) command which takes a
parameter, then list the possible parameters in a table nested under
each command.

The documentation for the layout command has been extended little to
make it clearer which windows are shown in each layout.

gdb/ChangeLog:

	* doc/gdb.texinfo (TUI): Restructure documentation on TUI layout
	and focus commands.
2015-07-06 22:39:21 +01:00
Joel Brobecker 7c79d316af Update NEWS post GDB 7.10 branch creation.
gdb/ChangeLog:

	* NEWS: Create a new section for the next release branch.
	Rename the section of the current branch, now that it has
	been cut.
2015-07-06 13:02:47 -07:00
Joel Brobecker f2232bea32 Bump version to 7.10.50.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 (66c4b3e8a6):
	* version.in: Bump version to 7.10.50.DATE-cvs.
2015-07-06 12:58:29 -07:00
Luis Machado 66c4b3e8a6 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:

  6ae8866180 is the first bad commit
  commit 6ae8866180
  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.
2015-07-06 16:09:21 -03:00
H.J. Lu 1a617dc351 Remove the merge conflict introduced by
commit 2f0c68f23b
Author: Catherine Moore <clm@codesourcery.com>
Date:   Thu May 28 14:50:36 2015 -0700

    Compact EH Support
2015-07-06 12:03:01 -07:00
Andrew Burgess bcd8537ce1 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.
2015-07-06 19:18:15 +01:00
Andrew Burgess 10e9aaa3b8 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.
2015-07-06 19:13:02 +01:00
Simon Marchi 8a13d42d99 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.
2015-07-06 13:10:56 -04:00
Simon Marchi a844296a98 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.
2015-07-06 13:04:11 -04:00
Andrew Burgess f41cbf58f4 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.
2015-07-06 15:54:21 +01:00
Patrick Palka 118ca22445 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.
2015-07-06 08:07:32 -04:00
GDB Administrator 0d3a523baa Automatic date update in version.in 2015-07-06 00:00:07 +00:00
Richard Sandiford 92a9c616e4 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.
2015-07-05 19:57:07 +01:00
GDB Administrator 533edc14b8 Automatic date update in version.in 2015-07-05 00:00:07 +00:00
GDB Administrator e7ba597a2e Automatic date update in version.in 2015-07-04 00:00:08 +00:00
Kai Tietz 0f088b2a94 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.
2015-07-03 15:50:29 +01:00
Alan Modra b6b3dd8f31 Correct ld Makefile dependendcy for or1k
* Makefile.am (eelf32or1k.c, eelf32or1k_linux.c): Depend on ELF_DEPS.
	* Makefile.in: Regenerate.
2015-07-03 10:58:22 +09:30
Alan Modra ef5a96d564 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.
2015-07-03 10:57:14 +09:30
Kevin Buettner 1b485e6778 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.
2015-07-02 17:21:18 -07:00
GDB Administrator 69ae7f4d16 Automatic date update in version.in 2015-07-03 00:00:08 +00:00
Kevin Buettner 0561fea48c 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.
2015-07-02 15:26:51 -07:00
Jan Kratochvil decf8d9a5f 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.
2015-07-02 22:39:57 +02:00
Yao Qi 2fd0f80d57 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.
2015-07-02 17:02:05 +01:00
Nick Clifton db49d3d041 Fix snafu with latest addition to the ARM sim.
* Makefile.in (SIM_EXTRA_CFLAGS): Revert previous delta.
	(SIM_EXTRA_LIBS): Add -lm.
2015-07-02 16:19:09 +01:00