Commit Graph

86877 Commits

Author SHA1 Message Date
Catalin Udma e7ea3ec7c6 python: Use console format for output of gdb.execute command
When gdb is started in MI mode, the output of gdb.execute
command is in MI-format in case when it is executed from python stop
handler while for all other cases the output is in console-format.

To assure consistent output format, this is fixed by using the console
format for all python gdb command executions.

PR python/19743

gdb/ChangeLog:
2016-03-31  Catalin Udma  <catalin.udma@freescale.com>

	PR python/19743
	* python/python.c (execute_gdb_command): Use console uiout
	when executing gdb command.
	* utils.c (restore_ui_out_closure): New structure.
	(do_restore_ui_out): New function.
	(make_cleanup_restore_ui_out): Likewise.
	* utils.h (make_cleanup_restore_ui_out): Declare.

gdb/testsuite/ChangeLog:
2016-03-31  Catalin Udma  <catalin.udma@freescale.com>

	PR python/19743
	* gdb.python/py-mi-events-gdb.py: New file.
	* gdb.python/py-mi-events.c: New file.
	* gdb.python/py-mi-events.exp: New file.

Signed-off-by: Catalin Udma <catalin.udma@freescale.com>
2016-03-31 15:32:38 +03:00
Pedro Alves f7c382926d Remove support for "target m32rsdi" and "target mips/pmon/ddb/rockhopper/lsi"
This removes support for:

 | target            | source                |
 |-------------------+-----------------------|
 | target m32rsdi    | gdb/remote-m32r-sdi.c |
 | target mips       | gdb/remote-mips.c     |
 | target pmon       | gdb/remote-mips.c     |
 | target ddb        | gdb/remote-mips.c     |
 | target rockhopper | gdb/remote-mips.c     |
 | target lsi        | gdb/remote-mips.c     |

That is:

 - Remote M32R debugging over SDI.

 - Debugging boards using the MIPS remote debugging protocol
   over a serial line, PMON, and a few variants.

These are the last non-"target remote" remote targets in the tree, if
you don't count "target sim".

Refs:

 https://sourceware.org/ml/gdb/2016-03/msg00004.html
 https://sourceware.org/ml/gdb-patches/2016-03/msg00580.html

gdb/ChangeLog:
2016-03-31  Pedro Alves  <palves@redhat.com>

	* NEWS: Mention that support for "target m32rsdi", "target mips",
	"target pmon", "target ddb", "target rockhopper", and "target lsi"
	was removed.
	* Makefile.in (ALL_TARGET_OBS): Remove remote-m32r-sdi.o and
	remote-mips.o.
	(ALLDEPFILES): Remove remote-m32r-sdi.c and remote-mips.c.
	* configure.tgt: Remove all references to remote-m32r-sdi.o and
	remote-mips.o.
	* mips-tdep.c (deprecated_mips_set_processor_regs_hack): Delete
	function.
	* mips-tdep.h (deprecated_mips_set_processor_regs_hack): Delete
	declaration.
	* remote-m32r-sdi.c, remote-mips.c: Delete files.
	* symfile.c (generic_load, generic_load): Remove comments.

gdb/doc/ChangeLog:
2016-03-31  Pedro Alves  <palves@redhat.com>

	* gdb.texinfo (M32R/SDI): Delete node.
	(MIPS Embedded): Remove references to the MIPS remote debugging
	protocol, PMON and variants, and the associated commands.
2016-03-31 13:24:34 +01:00
Trevor Saunders 6757cf5769 enable -Wwrite-strings for gas
We add a new AC_SUBST to warning.m4 so that the test if the warning is
supported is centralized, but the warning can be enabled per directory.

binutils/ChangeLog:

2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* configure: Regenerate.

gprof/ChangeLog:

2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* configure: Regenerate.

ld/ChangeLog:

2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* configure: Regenerate.

opcodes/ChangeLog:

2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* configure: Regenerate.

bfd/ChangeLog:

2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* configure: Regenerate.
	* warning.m4: Add WARN_WRITE_STRINGS AC_SUBST.

gold/ChangeLog:

2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* configure: Regenerate.

gas/ChangeLog:

2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* Makefile.am: Add WARN_WRITE_STRINGS to WARN_CFLAGS.
	* Makefile.in: Regenerate.
	* configure: Likewise.
2016-03-31 07:30:56 -04:00
Trevor Saunders e4a0c70877 make xtensa_section_rename () take const char *
Xtensa uses it in several macros passing it a literal string, so its convenient
for the argument type to be const char *.  However some of the code in
symbols.c seems to assume tc_canonicalize_symbol_name () will return a non
const pointer, and some other target's implementations even modify the
argument, so it seems best to return a char * which means casting away const on
the argument when we return it instead of another string.

gas/ChangeLog:

2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-xtensa.c (struct rename_section_struct): Make old_name
	const.
	(xtensa_section_rename): Make argument type const char *.
	* config/tc-xtensa.h (xtensa_section_rename): Adjust.
2016-03-31 07:30:41 -04:00
Trevor Saunders e2c7dcae81 tc-i960.c: add some casts when assigning literals to args[i]
parse_ldconst () takes a char ** as a in / out argument, and sometimes points
args[0] to a constant string.  Then in some cases after parse_ldconst ()
     returns md_assemble () twiddles the contents of arg[0].  So it seems like
     it would take some work to avoid these casts, and its not really clear
     that work is worth it.

gas/ChangeLog:

2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-i960.c (parse_ldconst): Cast to char * when assigning to
	args[0].
2016-03-31 07:29:51 -04:00
Trevor Saunders f854977c23 cast the arg to md_assemble () to char *
For these targets its not clear how md_assemble can usefully be split up so
that part can take const char *.  There is also a fair number of targets that
need md_assemble () to take a char *, so we can't easily make the argument
const.  So since there isn't many callers it seems easiest to just add a couple
of casts.

gas/ChangeLog:

2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-m32c.c (m32c_md_end): cast the argument to md_assemble to
	char *.
	(m32c_indirect_operand): Likewise.
	* config/tc-nds32.c (do_pseudo_b): Likewise.
	(do_pseudo_bal): Likewise.
	(do_pseudo_ls_bhw): Likewise.
2016-03-31 07:29:00 -04:00
Trevor Saunders 97830986a1 cast to char * when assigning to optarg
gas/ChangeLog:

2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* as.c (parse_args): Cast literal to char * when assigning to optarg.
2016-03-31 07:28:08 -04:00
Trevor Saunders e87de5136e work around get_symbol_name () in sparc and ia64
get_symbol_name () returns a char * in a out arg, which means we need to cast
to assign a literal to the variable passed to get_symbol_name ().  It seems
like better APIs than get_symbol_name () could be provided, but that seems like
a fair amount of work so just casting seems to be the betterthing to do for
now.

gas/ChangeLog:

2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-ia64.c (md_assemble): Add temporary variable to pass to
	get_symbol_name ().
	* config/tc-sparc.c (s_register): Cast a literal to char * in
	assignment.
2016-03-31 07:27:36 -04:00
Trevor Saunders 47990a6ab5 cast literal to char * when assigning to input_line_ptr
various places either directly or indirectly set input_line_pointer to point at
a literal.  Currently lots of places modify the string input_line_pointer
points at, so making it const isn't easy.  Since most if not all of these
places assign to input_line_pointer to parse an expression it would probably be
best to add ways to generate and deal with expressions that doesn't involve
parsing strings, but for now adding some casts seems easiest.

gas/ChangeLog:

2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-i960.c (parse_expr): Cast to char * when assigning to
	input_line_pointer.
	* config/tc-m32r.c (expand_debug_syms): Likewise.
	* config/tc-msp430.c (msp430_dstoperand): Likewise.
	* config/tc-z80.c (md_begin): Likewise.
	* stabs.c (stabs_generate_asm_func): Likewise.
2016-03-31 07:23:31 -04:00
Alan Modra fc90c28021 More cases of missing TO_ADDR in ldlang.c
and one extraneous occurrence.

	* ldlang.c (TO_ADDR, TO_SIZE, opb_shift): Move earlier in file.
	(lang_insert_orphan): Use TO_ADDR in __stop sym calculation.
	(print_input_section): Don't use TO_ADDR when printing section
	size.
	(lang_size_sections_1): Use TO_ADDR in overlay lma calculation.
	(lang_size_sections): Use TO_ADDR in relro end calculation.
2016-03-31 19:35:33 +10:30
Trevor Saunders e046cf801d get rid of K&R style args
gas/ChangeLog:

2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* cgen.c: Modernize the way functions declare arguments.
	* config/tc-bfin.c: Likewise.
	* config/tc-pdp11.c: Likewise.
	* literal.c: Likewise.
	* read.c: Likewise.
	* stabs.c: Likewise.
2016-03-31 01:04:00 -04:00
Trevor Saunders d923501116 make some variables unsigned
these places define char arrays containing values greater than 0x80 which
doesn't fit in an 8 bit signed char, but does fit in an unsigned one.

gas/ChangeLog:

2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-aarch64.c (aarch64_handle_align): Make the type of some
	variables unsigned char[].
	* config/tc-alpha.c (alpha_handle_align): Likewise.
	* config/tc-arm.c (arm_handle_align): Likewise.
	* config/tc-z80.c: Likewise.
2016-03-31 00:57:11 -04:00
Cary Coutant b60ecbc6dd Don't override definition a shared object by one in a later shared object.
In PR 16979, a reference to malloc is being resolved to an unversioned
reference in libmalloc.so. When linked with --as-needed, however, the
dynamic table does not list libmalloc.so as a DT_NEEDED library.

If we have a reference to an unversioned symbol in a shared object,
and we later see a versioned definition in another shared object, we
were overriding the first definition with the second in the process of
defining the default version. As a result, we no longer think that the
first shared object was actually needed to resolve any symbols, and we
don't list it as a DT_NEEDED library.

This patch fixes the problem by treating the two definitions as separate
symbols, so the second definition does not override the first.

2016-03-30  Cary Coutant  <ccoutant@gmail.com>

gold/
	PR gold/16979
	* symtab.cc (Symbol_table::define_default_version): Check for case
	where symbols are both in different shared objects.
2016-03-30 19:15:09 -07:00
GDB Administrator 69b51e106d Automatic date update in version.in 2016-03-31 00:00:09 +00:00
Marcin Kościelnicki 1cda151268 gdbserver/IPA: Export some functions via global function pointers.
On powerpc64, qSymbol for a function returns the function code address,
and not the descriptor address.  Since we emit code calling gdb_collect
and some other functions, we need the descriptor (no way to know the
proper TOC address without it).  To get the descriptor address, make
global function pointer variables in the IPA pointing to the relevant
functions and read them instead of asking for them directly via qSymbol.

gdb/gdbserver/ChangeLog:

	* linux-aarch64-ipa.c: Rename gdb_agent_get_raw_reg to get_raw_reg.
	* linux-amd64-ipa.c: Likewise.
	* linux-i386-ipa.c: Likewise.
	* linux-s390-ipa.c: Likewise.
	* tracepoint.c: IPA-export gdb_collect_ptr instead of gdb_collect,
	ditto for get_raw_reg_ptr, get_trace_state_variable_value_ptr,
	set_trace_state_variable_value_ptr.
	(struct ipa_sym_addresses): Likewise.
	(symbol_list): Likewise.
	(install_fast_tracepoint): Dereference gdb_collect_ptr instead of
	accessing gdb_collect directly.
	(gdb_collect_ptr_type): New typedef.
	(get_raw_reg_ptr_type): New typedef.
	(get_trace_state_variable_value_ptr_type): New typedef.
	(set_trace_state_variable_value_ptr_type): New typedef.
	(gdb_collect_ptr): New global.
	(get_raw_reg_ptr): New global.
	(get_trace_state_variable_value_ptr): New global.
	(set_trace_state_variable_value_ptr): New global.
	(get_raw_reg_func_addr): Dereference get_raw_reg_ptr instead of
	accessing get_raw_reg directly.
	(get_get_tsv_func_addr): Likewise for
	get_trace_state_variable_value_ptr.
	(get_set_tsv_func_addr): Likewise for
	set_trace_state_variable_value_ptr.
	* tracepoint.h: Rename gdb_agent_get_raw_reg to get_raw_reg.
2016-03-30 23:48:47 +02:00
Andrew Burgess 0a106562e3 opcodes/arc: Comment and whitespace fixes in opcode table
Add a new comment, and clean up some whitespace issues in the
instruction table.

opcode/ChangeLog:

	* arc-nps400-tbl.h: Add a header comment, and fix some whitespace
	issues.  No functional changes.
2016-03-30 18:13:31 +01:00
Andrew Burgess 62bdf2d66e ld/testing: Fix error and warning checks in run_dump_test
The options warning_output and error_output to the run_dump_test
function were incorrectly checking the return value from the regexp_diff
function, and so, as a result failing tests were showing as a pass.
Fixed in this commit.

ld/ChangeLog:

	* testsuite/lib/ld-lib.exp (run_dump_test): Fix check of return
	value from regexp_diff.
	* testsuite/ld-elf/orphan-5.l: Fix expected output.
	* testsuite/ld-elf/orphan-6.l: Likewise.
2016-03-30 17:58:05 +01:00
Yao Qi fb3f3d25c3 Check func against 0 rather than NULL
Variable 'func''s type is CORE_ADDR, so it should be compared with 0
rather than NULL.  This causes a build error.

This patch fixes this.

gdb:

2016-03-30  Yao Qi  <yao.qi@linaro.org>

	* arm-tdep.c (arm_epilogue_frame_this_id): Check 'func' against
	0 rather than NULL.
2016-03-30 17:03:29 +01:00
Yao Qi 779aa56f2c Add arm epilogue unwinder
Nowadays, GDB can't unwind successfully from epilogue on arm,

 (gdb) bt
 #0  0x76ff65a2 in shr1 () from /home/yao/Source/gnu/build/gdb/testsuite/gdb.reverse/shr1.sl
 #1  0x0000869e in main () at /home/yao/Source/gnu/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.reverse/solib-reverse.c:34
 Backtrace stopped: previous frame inner to this frame (corrupt stack?)

(gdb) disassemble shr1
Dump of assembler code for function shr1:
   ....
   0x76ff659a <+10>:	adds	r7, #12
   0x76ff659c <+12>:	mov	sp, r7
   0x76ff659e <+14>:	ldr.w	r7, [sp], #4
   0x76ff65a2 <+18>:	bx	lr
End of assembler dump.

in this case, prologue unwinder is used.  It analyzes the prologue and
get the offsets of saved registers to SP.  However, in epilogue, the
SP has been restored, prologue unwinder gets the registers from the
wrong address, and even the frame id is wrong.

In reverse debugging, this case (program stops at the last instruction
of function) happens quite frequently due to the reverse execution.
There are many test fails due to missing epilogue unwinder.

This adds epilogue unwinder, but the frame cache is still get by
prologue unwinder except that SP is fixed up separately, because SP
is restored in epilogue.

This patch fixes many fails in solib-precsave.exp, and solib-reverse.exp.

gdb:

2016-03-30  Yao Qi  <yao.qi@linaro.org>

	* arm-tdep.c: (arm_make_epilogue_frame_cache): New function.
	(arm_epilogue_frame_this_id): New function.
	(arm_epilogue_frame_prev_register): New function.
	(arm_epilogue_frame_sniffer): New function.
	(arm_epilogue_frame_unwind): New.
	(arm_gdbarch_init): Append unwinder arm_epilogue_frame_unwind.
2016-03-30 16:44:24 +01:00
Yao Qi c58b006a7e Refactor arm_stack_frame_destroyed_p
This patch is to refactor arm_stack_frame_destroyed_p, so that the code
can be used in both arm_stack_frame_destroyed_p and arm epilogue
unwinder I am going to add in the next patch.  In fact, the code
is the same in two places, but checking whether it is thumb mode
is slightly different.  arm_stack_frame_destroyed_p uses
arm_pc_is_thumb, and epilogue unwinder should use arm_frame_is_thumb.

gdb:

2016-03-30  Yao Qi  <yao.qi@linaro.org>

	* arm-tdep.c (arm_stack_frame_destroyed_p): Rename it ...
	(arm_stack_frame_destroyed_p_1): ... here.  Don't call
	arm_pc_is_thumb.
	(arm_stack_frame_destroyed_p): Call
	thumb_stack_frame_destroyed_p and
	arm_stack_frame_destroyed_p_1.
2016-03-30 16:44:24 +01:00
Yao Qi e6359af3fd Simplify gdb.reverse/until-reverse.c
Nowadays, functions fprintf, printf and malloc are executed in
gdb.reverse/until-reverse.c, so that it takes much time to record
instructions inside them.  This may cause timeout, and we had several
fixes to bump the timeout,

 https://sourceware.org/ml/gdb-patches/2012-02/msg00038.html
 https://sourceware.org/ml/gdb-patches/2015-08/msg00186.html

also I still see this on arm-linux,

 continue
 Continuing.
 Do you want to auto delete previous execution log entries when record/replay buffer becomes full (record full stop-at-limit)?([y] or n) n
 Process record: stopped by user.

 Program stopped.
 0xf77021e6 in __linkin_atfork (newp=0xf7751748 <atfork_mem>) at ../nptl/sysdeps/unix/sysv/linux/register-atfork.c:117
 117     ../nptl/sysdeps/unix/sysv/linux/register-atfork.c: No such file or directory.
 (gdb) FAIL: gdb.reverse/until-precsave.exp: run to end of main (got interactive prompt)

however, I can't figure out how these functions (fprintf, printf and
malloc) are related to the test itself.  marker1 is a function from
shared library too so we don't need these complicated libc functions
at all.  IMO, recording the instructions in these libc functions has
nothing to do with the test itself except slow down the test.  This
patch is to remove the usage of fprintf and printf, and also move
malloc to a dead code path.

gdb/testsuite:

2016-03-30  Yao Qi  <yao.qi@linaro.org>

	* gdb.reverse/until-precsave.exp: Match function name only.
	* gdb.reverse/until-reverse.c (main): Don't call fprintf nor printf.
	Move malloc to a condition block.
	* gdb.reverse/until-reverse.exp: Match function name only.
2016-03-30 16:36:51 +01:00
Nick Clifton c6025a80cc Fix compile time warning about comparison between signed and unsigned values.
PR target/19880
	* config/tc-arm.c (do_t_push_pop): Cast bitmask to unsigned before
	shifting.
2016-03-30 16:18:04 +01:00
Simon Marchi 72fb548884 gdbserver/tracepoint.c: Remove whitespace
gdb/gdbserver/ChangeLog:

	* tracepoint.c (cmd_qtenable_disable): Remove whitespace.
2016-03-30 10:54:28 -04:00
Claudiu Zissulescu f89a23cfc9 [ARC] Allow equ redefintion tests for ARC.
gas/
2016-03-30  Claudiu Zissulescu  <claziss@synopsys.com>

        * testsuite/gas/all/gas.exp: Don't xfail on ARC.
        * testsuite/gas/elf/elf.exp: Likewise.
        * testsuite/gas/all/redef3.d: Allow execution for ARC.
2016-03-30 16:21:25 +02:00
Claudiu Zissulescu f621ad3c4b [ARC] Fix warn.exp test error.
gas/
2016-03-30  Claudiu Zissulescu  <claziss@synopsys.com>

        * testsuite/gas/arc/warn.exp: Fix matching pattern.
2016-03-30 16:09:56 +02:00
Claudiu Zissulescu bd05ac5f5e [ARC] Cleanup AUX register names.
opcodes/
2016-03-30  Claudiu Zissulescu  <claziss@synopsys.com>

        * arc-regs.h (IC_RAM_ADDRESS, IC_TAG, IC_WP, IC_DATA, CONTROL0)
        (AX2, AY2, MX2, MY2, AY0, AY1, DC_RAM_ADDR, DC_TAG, CONTROL1)
        (RTT): Remove duplicate.
        (LCDINSTR, LCDDATA, LCDSTAT, CC_*, PCT_COUNT*, PCT_SNAP*)
        (PCT_CONFIG*): Remove.
        (D1L, D1H, D2H, D2L): Define.
2016-03-30 16:06:54 +02:00
Senthil Kumar Selvaraj 024ea11b48 Fix a seg-fault in the AVR linker.
* elf32-avr.c (avr_elf32_load_records_from_section): Free
	internal_relocs only if they aren't cached.
2016-03-30 14:52:26 +01:00
Nick Clifton 7517e550ce Fix more bugs in AArch64 simulator.
* cpustate.c (aarch64_set_reg_s32): New function.
	(aarch64_set_reg_u32): New function.
	(aarch64_get_FP_half): Place half precision value into the correct
	slot of the union.
	(aarch64_set_FP_half): Likewise.
	* cpustate.h: Add prototypes for aarch64_set_reg_s32 and
	aarch64_set_reg_u32.
	* memory.c (FETCH_FUNC): Cast the read value to the access type
	before converting it to the return type.  Rename to FETCH_FUNC64.
	(FETCH_FUNC32): New macro.  Duplicates FETCH_FUNC64 but for 32-bit
	accesses.  Use for 32-bit memory access functions.
	* simulator.c (ldrsb_wb): Use sign extension not zero extension.
	(ldrb_scale_ext, ldrsh32_abs, ldrsh32_wb): Likewise.
	(ldrsh32_scale_ext, ldrsh_abs, ldrsh64_wb): Likewise.
	(ldrsh_scale_ext, ldrsw_abs): Likewise.
	(ldrh32_abs): Store 32 bit value not 64-bits.
	(ldrh32_wb, ldrh32_scale_ext): Likewise.
	(do_vec_MOV_immediate): Fix computation of val.
	(do_vec_MVNI): Likewise.
	(DO_VEC_WIDENING_MUL): New macro.
	(do_vec_mull): Use new macro.
	(do_vec_mul): Use new macro.
	(do_vec_MLA): Read values before writing.
	(do_vec_xtl): Likewise.
	(do_vec_SSHL): Select correct shift value.
	(do_vec_USHL): Likewise.
	(do_scalar_UCVTF): New function.
	(do_scalar_vec): Call new function.
	(store_pair_u64): Treat reads of SP as reads of XZR.
2016-03-30 10:29:04 +01:00
Yao Qi 1e6697eab9 Move CL entries from gdb/ChangeLog to gdb/testsuite/ChangeLog
Two ChangeLog entries in gdb/ChangeLog should be placed in
gdb/testsuite/ChangeLog.  This patch moves them to the right
place.
2016-03-30 09:32:59 +01:00
Alan Modra a87dd97a20 PR18452, ld allows overlapping sections
PR 18452
	* ldlang.c (maybe_overlays): New static var.
	(lang_size_sections_1): Set it here.
	(struct check_sec): New.
	(sort_sections_by_lma): Adjust for array of structs.
	(sort_sections_by_vma): New function.
	(lang_check_section_addresses): Check both LMA and VMA for overlap.
	* testsuite/ld-scripts/rgn-over7.d: Adjust.
2016-03-30 17:50:03 +10:30
Alan Modra ca62bc4a86 Missing TO_ADDR
* ldlang.c (lang_size_sections_1): Correct code detecting a
	backward non-overlapping move.
2016-03-30 17:50:03 +10:30
Alan Modra 2e4a7aea70 Use consistent test for .tbss sections in ldlang.c
Some places tested SEC_LOAD, others SEC_HAS_CONTENTS.

	* ldlang.c (IS_TBSS): New macro, extracted from..
	(IGNORE_SECTION): ..here.
	(lang_size_sections_1): Use IS_TBSS and IGNORE_SECTION.
	(lang_size_sections, lang_do_assignments_1): Use IS_TBSS.
2016-03-30 17:50:03 +10:30
Doug Evans 4ae6cc1962 python/py-utils.c (host_string_to_python_string): New function.
gdb/ChangeLog:

	* python/py-utils.c (host_string_to_python_string): New function.
	* python/python-internal.h (host_string_to_python_string): Declare it.
	* python/py-*.c (*): Update all calls to
	PyString_Decode (str, strlen (str), host_charset (), NULL);
	to use host_string_to_python_string instead.
2016-03-29 23:48:35 -07:00
Trevor Saunders 4ec9d7d564 use xstrdup and friends more
gas/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-hppa.c (pa_space): Use xstrdup where appropriate.
	(pa_subspace): Likewise.
	(create_new_space): Likewise.
	(create_new_subspace): Likewise.
	* config/tc-mips.c (mips_lookup_insn): Likewise.
	* config/tc-tic4x.c (tic4x_asg): Likewise.
	* config/tc-tic54x.c (tic54x_eval): Likewise.
	(stag_add_field): Likewise.
	(tic54x_usect): Likewise.
	(tic54x_clink): Likewise.
	(tic54x_set_default_include): Likewise.
	(tic54x_include): Likewise.
	(tic54x_message): Likewise.
	(tic54x_sblock): Likewise.
	(tic54x_var): Likewise.
	(subsym_ismember): Likewise.
	(subsym_substitute): Likewise.
	* config/tc-xtensa.c (xg_replace_opname): Likewise.
	(xg_translate_sysreg_op): Likewise.
	(xg_translate_idioms): Likewise.
	(md_assemble): Likewise.
	(cache_literal_section): Likewise.
2016-03-29 21:48:26 -04:00
GDB Administrator 49efcf2ab9 Automatic date update in version.in 2016-03-30 00:00:21 +00:00
Marcin Kościelnicki 28170b88cc gdbserver: Handle 'v' packet while processing qSymbol.
On powerpc64, qSymbol query may require gdb to read a function
descriptor, sending a vFile packet to gdbserver.  Thus, we need
to handle 'v' packet in look_up_one_symbol.

vFile replies may be quite long, and require reallocating own_buf.
Since handle_v_requests assumes the buffer is the static global own_buf
from server.c and reallocates it, we need to make own_buf global and
use it from look_up_one_symbol instead of using our own auto variable.
I've also done the same change in relocate_instruction, just in case.

On gdb side, in remote_check_symbols, rs->buf may be clobbered by vFile
handling, yet we need its contents for the reply (the symbol name is
stored there).  Allocate a new buffer instead.

This broke fast tracepoints on powerpc64, due to errors in reading IPA
symbols.

gdb/ChangeLog:

	* remote.c (remote_check_symbols): Allocate own buffer for reply.

gdbserver/ChangeLog:

	* remote-utils.c (look_up_one_symbol): Remove own_buf, handle 'v'
	packets.
	(relocate_instruction): Remove own_buf.
	* server.c (own_buf): Make global.
	(handle_v_requests): Make global.
	* server.h (own_buf): New declaration.
	(handle_v_requests): New prototype.
2016-03-30 01:51:06 +02:00
Max Filippov a08b52b5c4 gdb: xtensa: fix frame initialization when PC is invalid
When gdb is used on core dump and PC is not pointing to a readable
memory read_memory_integer call in the xtensa_frame_cache throws an
error, making register inspection/backtracing impossible in that thread.

Use safe_read_memory_integer instead.

2016-03-29  Max Filippov  <jcmvbkbc@gmail.com>
gdb/
	* xtensa-tdep.c (xtensa_frame_cache): Change op1 type to LONGEST.
	Use safe_read_memory_integer instead of read_memory_integer.
2016-03-30 02:17:24 +03:00
Marcin Kościelnicki c37c0ba69b gdb/NEWS: Add mention of s390*-linux tracepoints.
gdb/ChangeLog:

	* NEWS: Mention support for tracepoints on s390*-linux.
2016-03-29 23:39:52 +02:00
Marcin Kościelnicki f39e874354 gdbserver/s390: Add support for compiled agent expressions.
These sequences assume a z900+ CPU, like the rest of fast tracepoint
support.

gdb/gdbserver/ChangeLog:

	PR 18377
	* linux-s390-low.c (add_insns): New function.
	(s390_emit_prologue): New function.
	(s390_emit_epilogue): New function.
	(s390_emit_add): New function.
	(s390_emit_sub): New function.
	(s390_emit_mul): New function.
	(s390_emit_lsh): New function.
	(s390_emit_rsh_signed): New function.
	(s390_emit_rsh_unsigned): New function.
	(s390_emit_ext): New function.
	(s390_emit_log_not): New function.
	(s390_emit_bit_and): New function.
	(s390_emit_bit_or): New function.
	(s390_emit_bit_xor): New function.
	(s390_emit_bit_not): New function.
	(s390_emit_equal): New function.
	(s390_emit_less_signed): New function.
	(s390_emit_less_unsigned): New function.
	(s390_emit_ref): New function.
	(s390_emit_if_goto): New function.
	(s390_emit_goto): New function.
	(s390_write_goto_address): New function.
	(s390_emit_litpool): New function.
	(s390_emit_const): New function.
	(s390_emit_call): New function.
	(s390_emit_reg): New function.
	(s390_emit_pop): New function.
	(s390_emit_stack_flush): New function.
	(s390_emit_zero_ext): New function.
	(s390_emit_swap): New function.
	(s390_emit_stack_adjust): New function.
	(s390_emit_set_r2): New function.
	(s390_emit_int_call_1): New function.
	(s390_emit_void_call_2): New function.
	(s390_emit_eq_goto): New function.
	(s390_emit_ne_goto): New function.
	(s390_emit_lt_goto): New function.
	(s390_emit_le_goto): New function.
	(s390_emit_gt_goto): New function.
	(s390_emit_ge_goto): New function.
	(s390x_emit_prologue): New function.
	(s390x_emit_epilogue): New function.
	(s390x_emit_add): New function.
	(s390x_emit_sub): New function.
	(s390x_emit_mul): New function.
	(s390x_emit_lsh): New function.
	(s390x_emit_rsh_signed): New function.
	(s390x_emit_rsh_unsigned): New function.
	(s390x_emit_ext): New function.
	(s390x_emit_log_not): New function.
	(s390x_emit_bit_and): New function.
	(s390x_emit_bit_or): New function.
	(s390x_emit_bit_xor): New function.
	(s390x_emit_bit_not): New function.
	(s390x_emit_equal): New function.
	(s390x_emit_less_signed): New function.
	(s390x_emit_less_unsigned): New function.
	(s390x_emit_ref): New function.
	(s390x_emit_if_goto): New function.
	(s390x_emit_const): New function.
	(s390x_emit_call): New function.
	(s390x_emit_reg): New function.
	(s390x_emit_pop): New function.
	(s390x_emit_stack_flush): New function.
	(s390x_emit_zero_ext): New function.
	(s390x_emit_swap): New function.
	(s390x_emit_stack_adjust): New function.
	(s390x_emit_int_call_1): New function.
	(s390x_emit_void_call_2): New function.
	(s390x_emit_eq_goto): New function.
	(s390x_emit_ne_goto): New function.
	(s390x_emit_lt_goto): New function.
	(s390x_emit_le_goto): New function.
	(s390x_emit_gt_goto): New function.
	(s390x_emit_ge_goto): New function.
	(s390_emit_ops): New function.
	(struct linux_target_ops): Fill in emit_ops hook.
2016-03-29 23:39:46 +02:00
Marcin Kościelnicki abd9baf9c6 gdbserver/s390: Add fast tracepoint support.
Fast tracepoints will only work on 6-byte intructions, and assume at least
a z900 CPU.  s390 also has 4-byte jump instructions, which also work on
pre-z900, but their range is limitted to +-64kiB, which is not very useful
(and wouldn't work at all with current jump pad allocation).

There's a little problem with s390_relocate_instruction function: it
converts BRAS/BRASL instructions to LARL of the return address + JG
to the target address.  On 31-bit, this sets the high bit of the target
register to 0, while BRAS/BRASL would set it to 1.  While this is not
a problem when the result is only used to address memory, it could
possibly break something that expects to compare such addresses for
equality without first masking the bit off.  In particular, I'm not sure
whether leaving the return address high bit unset is ABI-compliant
(could confuse some unwinder?).  If that's a problem, it could be fixed
by handling it in the jump pad (since at that point we can just modify
the GPRs in the save area without having to worry about preserving
CCs and only having that one GPR to work with - I'm not sure if it's
even possible to set the high bit with such constraints).

gdb/gdbserver/ChangeLog:

	PR 18377
	* Makefile.in: Add s390 IPA files.
	* configure.srv: Build IPA for s390.
	* linux-s390-ipa.c: New file.
	* linux-s390-low.c: New includes - inttypes.h and linux-s390-tdesc.h.
	(init_registers_s390_linux32): Move declaration to linux-s390-tdesc.h.
	(tdesc_s390_linux32): Likewise.
	(init_registers_s390_linux32v1): Likewise.
	(tdesc_s390_linux32v1): Likewise.
	(init_registers_s390_linux32v2): Likewise.
	(tdesc_s390_linux32v2): Likewise.
	(init_registers_s390_linux64): Likewise.
	(tdesc_s390_linux64): Likewise.
	(init_registers_s390_linux64v1): Likewise.
	(tdesc_s390_linux64v1): Likewise.
	(init_registers_s390_linux64v2): Likewise.
	(tdesc_s390_linux64v2): Likewise.
	(init_registers_s390_te_linux64): Likewise.
	(tdesc_s390_te_linux64): Likewise.
	(init_registers_s390_vx_linux64): Likewise.
	(tdesc_s390_vx_linux64): Likewise.
	(init_registers_s390_tevx_linux64): Likewise.
	(tdesc_s390_tevx_linux64): Likewise.
	(init_registers_s390x_linux64): Likewise.
	(tdesc_s390x_linux64): Likewise.
	(init_registers_s390x_linux64v1): Likewise.
	(tdesc_s390x_linux64v1): Likewise.
	(init_registers_s390x_linux64v2): Likewise.
	(tdesc_s390x_linux64v2): Likewise.
	(init_registers_s390x_te_linux64): Likewise.
	(tdesc_s390x_te_linux64): Likewise.
	(init_registers_s390x_vx_linux64): Likewise.
	(tdesc_s390x_vx_linux64): Likewise.
	(init_registers_s390x_tevx_linux64): Likewise.
	(tdesc_s390x_tevx_linux64): Likewise.
	(have_hwcap_s390_vx): New static variable.
	(s390_arch_setup): Fill have_hwcap_s390_vx.
	(s390_get_thread_area): New function.
	(s390_ft_entry_gpr_esa): New const.
	(s390_ft_entry_gpr_zarch): New const.
	(s390_ft_entry_misc): New const.
	(s390_ft_entry_fr): New const.
	(s390_ft_entry_vr): New const.
	(s390_ft_main_31): New const.
	(s390_ft_main_64): New const.
	(s390_ft_exit_fr): New const.
	(s390_ft_exit_vr): New const.
	(s390_ft_exit_misc): New const.
	(s390_ft_exit_gpr_esa): New const.
	(s390_ft_exit_gpr_zarch): New const.
	(append_insns): New function.
	(s390_relocate_instruction): New function.
	(s390_install_fast_tracepoint_jump_pad): New function.
	(s390_get_min_fast_tracepoint_insn_len): New function.
	(s390_get_ipa_tdesc_idx): New function.
	(struct linux_target_ops): Wire in the above functions.
	(initialize_low_arch) [!__s390x__]: Don't initialize s390x tdescs.
	* linux-s390-tdesc.h: New file.
2016-03-29 23:39:00 +02:00
Marcin Kościelnicki a4105d04e1 gdbserver/s390: Switch on tracepoint support.
Also adds s390 support to gdb.trace testsuite.

gdb/gdbserver/ChangeLog:

	* linux-s390-low.c (s390_supports_tracepoints): New function.
	(struct linux_target_ops): Fill supports_tracepoints hook.

gdb/testsuite/ChangeLog:

	* gdb.trace/ftrace.exp: Set arg0exp for s390.
	* gdb.trace/mi-trace-frame-collected.exp: Expect 4 registers on s390.
	* gdb.trace/mi-trace-unavailable.exp: Set pcnum for s390, add gpr0num
	variable for GPR 0 instead of assuming it is register 0.
	* gdb.trace/trace-common.h: Add s390 fast tracepoint placeholder.
	* lib/trace-support.exp: Add s390 registers.
2016-03-29 23:08:05 +02:00
Don Breazeal 444bca650a 2016-03-29 Don Breazeal <donb@codesourcery.com>
* gdb/value.c (value_actual_type): Fix formatting issue.
2016-03-29 10:36:07 -07:00
Claudiu Zissulescu 9885948fc9 [ARC] Fix typo in extension instruction name.
opcodes/
2016-03-29  Claudiu Zissulescu  <claziss@synopsys.com>

        * arc-ext-tbl.h (dsp_fp_i2flt): Fix typo.
2016-03-29 19:05:31 +02:00
Yao Qi bfa6adb959 Compile gdb.arch/arm-neon.exp with debug info
Pass "debug" to prepare_for_testing otherwise, some tests fail.

gdb/testsuite:

2016-03-29  Yao Qi  <yao.qi@linaro.org>

	* gdb.arch/arm-neon.exp: Pass debug to prepare_for_testing.
2016-03-29 14:53:25 +01:00
Claudiu Zissulescu f2dd88387a [ARC] Add support for Quarkse opcodes.
gas/
2016-03-29  Claudiu Zissulescu  <claziss@synopsys.com>

        * testsuite/gas/arc/ext2op.d: New file.
        * testsuite/gas/arc/ext2op.s: Likewise.
        * testsuite/gas/arc/ext3op.d: Likewise.
        * testsuite/gas/arc/ext3op.s: Likewise.

opcodes/
2016-03-29  Claudiu Zissulescu  <claziss@synopsys.com>

        * arc-tbl.h (invld07): Remove.
        * arc-ext-tbl.h: New file.
        * arc-dis.c (FIELDA, FIELDB, FIELDC): Remove.
        * arc-opc.c (arc_opcodes): Add ext-tbl include.

include/
2016-03-29  Claudiu Zissulescu  <claziss@synopsys.com>

        * opcode/arc.h (insn_subclass_t): Add QUARKSE subclass.
        (FIELDA, FIELDB, FIELDC, FIELDF, FIELDQ, INSN3OP, INSN2OP)
        (INSN2OP, INSN3OP_ABC, INSN3OP_ALC, INSN3OP_ABL, INSN3OP_ALL)
        (INSN3OP_0BC, INSN3OP_0LC, INSN3OP_0BL, INSN3OP_0LL, INSN3OP_ABU)
        (INSN3OP_ALU, INSN3OP_0BU, INSN3OP_0LU, INSN3OP_BBS, INSN3OP_0LS)
        (INSN3OP_CBBC, INSN3OP_CBBL, INSN3OP_C0LC, INSN3OP_C0LL)
        (INSN3OP_CBBU, INSN3OP_C0LU, MINSN3OP_ABC, MINSN3OP_ALC)
        (MINSN3OP_ABL, MINSN3OP_ALL, MINSN3OP_0BC, MINSN3OP_0LC)
        (MINSN3OP_0BL, MINSN3OP_0LL, MINSN3OP_ABU, MINSN3OP_ALU)
        (MINSN3OP_0BU, MINSN3OP_0LU, MINSN3OP_BBS, MINSN3OP_0LS)
        (MINSN3OP_CBBC, MINSN3OP_CBBL, MINSN3OP_C0LC, MINSN3OP_C0LL)
        (MINSN3OP_CBBU, MINSN3OP_C0LU, INSN2OP_BC, INSN2OP_BL, INSN2OP_0C)
        (INSN2OP_0L INSN2OP_BU, INSN2OP_0U, MINSN2OP_BC, MINSN2OP_BL)
        (MINSN2OP_0C, MINSN2OP_0L, MINSN2OP_BU, MINSN2OP_0U): Define.
2016-03-29 14:49:22 +02:00
Trevor Saunders 17b9d67d4e make md_parse_option () take a const char *
This is mostly just adding const in many places, however there are a couple
interesting things.  We need to add casts in tc-s390.c and tc-cris.c because
they have functions that assign to input_line_pointer an argument that
sometimes comes from md_parse_option.  Presumably this is safe because those
targets never pass literals to md_parse_option (), but this code should
probably be improved in the future.  Also xtensa passes the argument to strtoll
which is a rather odd function, it takes a const char * as argument and returns
a pointer into that string as a char * through an out argument, but we can work
around that by adding more variables.

gas/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-aarch64.c (struct aarch64_long_option_table): Ad const
	qualifier.
	* config/tc-alpha.c (md_parse_option): Likewise.
	* config/tc-arc.c (md_parse_option): Likewise.
	* config/tc-arm.c (struct arm_long_option_table): Likewise.
	(md_parse_option): Likewise.
	* config/tc-avr.c (md_parse_option): Likewise.
	* config/tc-bfin.c (md_parse_option): Likewise.
	* config/tc-cr16.c (md_parse_option): Likewise.
	* config/tc-cris.c (s_cris_arch): Likewise.
	(md_parse_option): Likewise.
	* config/tc-crx.c (md_parse_option): Likewise.
	* config/tc-d10v.c (md_parse_option): Likewise.
	* config/tc-d30v.c (md_parse_option): Likewise.
	* config/tc-dlx.c (md_parse_option): Likewise.
	* config/tc-epiphany.c (md_parse_option): Likewise.
	* config/tc-fr30.c (md_parse_option): Likewise.
	* config/tc-frv.c (md_parse_option): Likewise.
	* config/tc-ft32.c (md_parse_option): Likewise.
	* config/tc-h8300.c (md_parse_option): Likewise.
	* config/tc-hppa.c (md_parse_option): Likewise.
	* config/tc-i370.c (md_parse_option): Likewise.
	* config/tc-i386.c (md_parse_option): Likewise.
	* config/tc-i860.c (md_parse_option): Likewise.
	* config/tc-i960.c (md_parse_option): Likewise.
	* config/tc-ia64.c (md_parse_option): Likewise.
	* config/tc-ip2k.c (md_parse_option): Likewise.
	* config/tc-iq2000.c (md_parse_option): Likewise.
	* config/tc-lm32.c (md_parse_option): Likewise.
	* config/tc-m32c.c (md_parse_option): Likewise.
	* config/tc-m32r.c (md_parse_option): Likewise.
	* config/tc-m68hc11.c (md_parse_option): Likewise.
	* config/tc-m68k.c (md_parse_option): Likewise.
	* config/tc-mcore.c (md_parse_option): Likewise.
	* config/tc-mep.c (md_parse_option): Likewise.
	* config/tc-metag.c (struct metag_long_option): Likewise.
	(md_parse_option): Likewise.
	* config/tc-microblaze.c (md_parse_option): Likewise.
	* config/tc-microblaze.h (md_parse_option): Remove prototype.
	* config/tc-mips.c (md_parse_option): Adjust.
	* config/tc-mmix.c (md_parse_option): Likewise.
	* config/tc-mn10200.c (md_parse_option): Likewise.
	* config/tc-mn10300.c (md_parse_option): Likewise.
	* config/tc-moxie.c (md_parse_option): Likewise.
	* config/tc-msp430.c (md_parse_option): Likewise.
	* config/tc-mt.c (md_parse_option): Likewise.
		* config/tc-nds32.c (md_parse_option): Likewise.
		* config/tc-nds32.h (nds32_parse_option): Likewise.
	* config/tc-nios2.c (md_parse_option): Likewise.
	* config/tc-ns32k.c (md_parse_option): Likewise.
	* config/tc-or1k.c (md_parse_option): Likewise.
	* config/tc-pdp11.c (md_parse_option): Likewise.
	* config/tc-pj.c (md_parse_option): Likewise.
	* config/tc-ppc.c (md_parse_option): Likewise.
	* config/tc-rl78.c (md_parse_option): Likewise.
	* config/tc-rx.c (md_parse_option): Likewise.
	* config/tc-s390.c (s390_parse_cpu): Likewise.
	* config/tc-score.c (md_parse_option): Likewise.
	* config/tc-sh.c (md_parse_option): Likewise.
	* config/tc-sparc.c (md_parse_option): Likewise.
	* config/tc-spu.c (md_parse_option): Likewise.
	* config/tc-tic30.c (md_parse_option): Likewise.
	* config/tc-tic4x.c (md_parse_option): Likewise.
	* config/tc-tic54x.c (md_parse_option): Likewise.
	* config/tc-tic6x.c (md_parse_option): Likewise.
	* config/tc-tilegx.c (md_parse_option): Likewise.
	* config/tc-tilepro.c (md_parse_option): Likewise.
	* config/tc-v850.c (md_parse_option): Likewise.
	* config/tc-vax.c (md_parse_option): Likewise.
	* config/tc-visium.c (struct visium_long_option_table): Likewise.
	* config/tc-xc16x.c (md_parse_option): Likewise.
	* config/tc-xgate.c (md_parse_option): Likewise.
	* config/tc-xstormy16.c (md_parse_option): Likewise.
	* config/tc-xtensa.c (md_parse_option): Likewise.
	* config/tc-z80.c (md_parse_option): Likewise.
	* config/tc-z8k.c (md_parse_option): Likewise.
	* tc.h (md_parse_option): Likewise.
2016-03-29 07:43:25 -04:00
Trevor Saunders 30bd735cb0 apply ChangeLog for previous commit 2016-03-29 07:40:22 -04:00
Trevor Saunders aff7ae12a6 replace some obstack_alloc () calls with the XOBNEW wrapper
gas/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-bfin.c (gencode): Use XOBNEW obstack_alloc () wrapper.
	* config/tc-hppa.c (fix_new_hppa): Likewise.
	(pa_vtable_entry): Likewise.
	(pa_vtable_inherit): Likewise.
	* config/tc-m68k.c (md_begin): Likewise.
2016-03-29 07:33:25 -04:00
Nick Clifton ef0d8ffc45 Tidy up AArch64 simulator code.
* cpustate.c: Remove space after asterisk in function parameters.
	* decode.h (greg): Delete unused function.
	(vreg, shift, extension, scaling, writeback, condcode): Likewise.
	* simulator.c: Use INSTR macro in more places.
	(HALT_NYI): Use sim_io_eprintf in place of fprintf.
	Remove extraneous whitespace.
2016-03-29 11:34:22 +01:00
Nick Clifton ed3056ebdb Relax assertion in BFIN linker to allow for discard GOT relocs.
PR 17334
	* elf32-bfin.c (elf32_bfinfdpic_finish_dynamic_sections): Relax
	assertion on the size of the got section to allow it to be bigger
	than the number of relocs.
2016-03-29 10:24:16 +01:00