Commit Graph

80551 Commits

Author SHA1 Message Date
Pedro Alves 932539e3ab [GDBserver] Move Z packet defines and type convertion routines to shared code.
The Aarch64, MIPS and x86 Linux backends all have Z packet number
defines and corresponding protocol number to internal type convertion
routines.  Factor them all out to gdbserver's core code, so we only
have one shared copy.

Tested on x86_64 Fedora 20, and also cross built for aarch64-linux-gnu
and mips-linux-gnu.

gdb/gdbserver/
2014-05-20  Pedro Alves  <palves@redhat.com>

	* mem-break.h: Include break-common.h.
	(Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
	(Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): New defines.
	(Z_packet_to_target_hw_bp_type): New declaration.
	* mem-break.c (Z_packet_to_target_hw_bp_type): New function.
	* i386-low.c (Z_PACKET_HW_BP, Z_PACKET_WRITE_WP, Z_PACKET_READ_WP)
	(Z_PACKET_ACCESS_WP): Delete macros.
	(Z_packet_to_hw_type): Delete function.
	* i386-low.h: Don't include break-common.h here.
	(Z_packet_to_hw_type): Delete declaration.
	* linux-x86-low.c (x86_insert_point, x86_insert_point): Call
	Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
	* win32-i386-low.c (i386_insert_point, i386_remove_point): Call
	Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
	* linux-aarch64-low.c: Don't include break-common.h here.
	(Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
	(Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): Delete macros.
	(Z_packet_to_target_hw_bp_type): Delete function.
	* linux-mips-low.c (rsp_bp_type_to_target_hw_bp_type): Delete
	function.
	(mips_insert_point, mips_remove_point): Use
	Z_packet_to_target_hw_bp_type.
2014-05-20 18:41:41 +01:00
Pedro Alves 4ff0d3d82d [GDBserver][AArch64] Make watchpoint support use target_hw_bp_type.
This makes linux-aarch64-low.c use target_hw_bp_type, like gdb's
aarch64-linux-nat.c.  The original motivation is decoupling
insert_point/remove_point from Z packet numbers, but I think making
the files a little bit more similar is a good thing on its own right.
Ideally we'd merge these files even...  The
aarch64_point_encode_ctrl_reg change is taken straight from GDB's
copy.

I confirmed with a cross compiler that this builds, but it's otherwise
untested.

gdb/gdbserver/
2014-05-20  Pedro Alves  <palves@redhat.com>

	* linux-aarch64-low.c: Include break-common.h.
	(enum target_point_type): Delete.
	(Z_packet_to_point_type): Rename to ...
	(Z_packet_to_target_hw_bp_type): ... this, and return a
	target_hw_bp_type instead.
	(aarch64_show_debug_reg_state): Take an enum target_hw_bp_type
	instead of an enum target_point_type.
	(aarch64_point_encode_ctrl_reg): Likewise.  Compute type mask from
	breakpoint type.
	(aarch64_dr_state_insert_one_point)
	(aarch64_dr_state_remove_one_point, aarch64_handle_breakpoint)
	(aarch64_handle_aligned_watchpoint)
	(aarch64_handle_unaligned_watchpoint, aarch64_handle_watchpoint):
	Take an enum target_hw_bp_type instead of an enum
	target_point_type.
	(aarch64_supports_z_point_type): New function.
	(aarch64_insert_point, aarch64_remove_point): Use it.  Adjust to
	use Z_packet_to_target_hw_bp_type.
2014-05-20 18:24:27 +01:00
Joel Brobecker 786dc51990 Do not build gdbserver with -Werror by default if development=false
On GDB release branches, we change $development in gdb/development.sh
to false, in order to build the GDB release without -Werror by default,
thus avoiding harmless compiler warnings from breaking the build of
someone who's only interested in building GDB rather than working
on it.

This patch implements the same strategy for gdbserver, using the exact
same method.

gdb/gdbserver/ChangeLog:

        * configure.ac: Only use -Werror by default when DEVELOPMENT
        is true.
        * configure: Regenerate.

Tested on x86_64-linux, by rebuilding GDBserver first with development
set to true, and then doing it again with development set to false.
Werror was used in the first case, but not in the second.
2014-05-20 06:25:10 -07:00
Markus Metzger e59fa00fa0 btrace: no replay without history
When using a reverse execution command without execution history, GDB
might end up in a state where replaying has been started but remains
at the current instruction.  This state is illegal.

Do not step if there is no execution history to avoid this.

2014-05-20  Markus Metzger  <markus.t.metzger@intel.com>

	* record-btrace.c (record_btrace_step_thread): Check for empty history.

testsuite/
	* gdb.btrace/nohist.exp: New.
2014-05-20 14:18:10 +02:00
Nick Clifton 00b32ff21f Fix MSP430 assembler to support #hi(<symbol>).
* config/tc-msp430.c (CHECK_RELOC_MSP430): Add OP parameter.
	Generate BFD_RELOC_MSP430_ABS_HI16 if vshift is 1.
	(msp430_srcoperand): Store vshift value in operand.

	* msp430.h (struct msp430_operand_s): Add vshift field.

	* gas/elf/struct.d: Expect extra output from some toolchains.
	* gas/symver/symver0.d: Likewise.
	* gas/symver/symver1.d: Likewise.
2014-05-20 10:28:42 +01:00
Will Newton 273dc27930 ld/aarch64: xfail non-PIC shared object tests on aarch64
aarch64 does not support building non-PIC shared objects, so mark
tests for these as xfail.

ld/testsuite/ChangeLog:

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

	* ld-shared/shared.exp: Mark non-PIC shared object tests
	as xfail on aarch64.
2014-05-20 09:47:29 +01:00
Yao Qi 8b696e3155 Set timeout for gdb.reverse/*.exp test cases
Hi,
This patch is to add a new board setting gdb_reverse_timeout, which is
used to set timeout for all gdb.reverse test cases, which are usually
very slow and cause some TIMEOUT failures, for example, on some arm
boards.  We have some alternatives to this approach, but I am not
satisfied with them:

 - Increase the timeout value.  This is the global change, and it may
   cause some delay where actual failures happen.
 - Set timeout by gdb_reverse_timeout in every gdb.reverse/*.exp.
   Then, we have to touch every file under gdb.reverse.

In this patch, we choose a central place to set timeout for all tests
in gdb.reverse, which is convenient.

gdb/testsuite:

2014-05-20  Yao Qi  <yao@codesourcery.com>

	* lib/gdb.exp (gdb_init): Set timeout if test file is under
	gdb.reverse directory and gdb_reverse_timeout exists in board
	setting.
	* README: Document gdb_reverse_timeout.
2014-05-20 14:02:02 +08:00
Yao Qi 73c9764f95 gdb_init argument ARGS is a string rather than a list
The argument ARGS of gdb_init is passed from dejagnu is a string, the
test file name.  In dejagnu/runtest.exp:

proc runtest { test_file_name } {
....
....
        if [info exists tool] {
            if { [info procs "${tool}_init"] != "" } {
                ${tool}_init $test_file_name;
            }
        }
....
}

but inn default_gdb_init (callee of gdb_init), we have

    set gdb_test_file_name [file rootname [file tail [lindex $args 0]]]

In tcl, all actual arguments are combined to a list and assigned to
args.  This code here isn't wrong, but unnecessary, because its caller
(proc runtest) only passes one string to it, and IMO, we don't need
such tricky tcl "args".

I doubt that "[lindex $args 0]" is to be backward compatible with old
dejagnu, but dejagnu-1.4 release started to pass $test_file_name to
${too}_init, as I showed above.  dejagnu-1.4 was released in 2001, and
it should be old enough.  I also tried to check whether gdb testusite
works with dejagnu-1.3 or not, but failed to build dejagnu-1.3 on my
machine.  Supposing GDB testsuite requires at least dejagnu-1.4, this
change should be safe.

This patch is update default_gdb_init to treat ARGS as a string instead
of a list.  Then, 'args' sounds like a list, and this patch also renames
it by 'test_file_name', to align with dejagnu.

gdb/testsuite:

2014-05-20  Yao Qi  <yao@codesourcery.com>

	* lib/gdb.exp (default_gdb_init): Rename argument 'args' by
	'test_file_name'.  Treat args as a string instead of a list.
	(gdb_init): Rename argument 'args' by 'test_file_name'.
2014-05-20 14:01:51 +08:00
Hui Zhu f2205de008 Fix issue #15778: GDB Aarch64 signal frame unwinder issue
The root cause of this issue is unwinder of "#3  <signal handler called>"
doesn't supply right values of registers.
When GDB want to get the previous frame of "#3  <signal handler called>",
it will call cache init function of unwinder "aarch64_linux_sigframe_init".
The address or the value of the registers is get from this function.
So the bug is inside thie function.

I check the asm code of "#3  <signal handler called>":
(gdb) frame 3
(gdb) p $pc
$1 = (void (*)()) 0x7f931fa4d0
(gdb) disassemble $pc, +10
Dump of assembler code from 0x7f931fa4d0 to 0x7f931fa4da:
=> 0x0000007f931fa4d0:	mov	x8, #0x8b                  	// #139
   0x0000007f931fa4d4:	svc	#0x0
   0x0000007f931fa4d8:	nop

This is the syscall sys_rt_sigreturn, Linux kernel function "restore_sigframe"
will set the frame:
	for (i = 0; i < 31; i++)
		__get_user_error(regs->regs[i], &sf->uc.uc_mcontext.regs[i],
				 err);
	__get_user_error(regs->sp, &sf->uc.uc_mcontext.sp, err);
	__get_user_error(regs->pc, &sf->uc.uc_mcontext.pc, err);
The struct of uc_mcontext is:
struct sigcontext {
	__u64 fault_address;
	/* AArch64 registers */
	__u64 regs[31];
	__u64 sp;
	__u64 pc;
	__u64 pstate;
	/* 4K reserved for FP/SIMD state and future expansion */
	__u8 __reserved[4096] __attribute__((__aligned__(16)));
};

But in GDB function "aarch64_linux_sigframe_init", the code the get address
of registers is:
  for (i = 0; i < 31; i++)
    {
      trad_frame_set_reg_addr (this_cache,
			       AARCH64_X0_REGNUM + i,
			       sigcontext_addr + AARCH64_SIGCONTEXT_XO_OFFSET
			       + i * AARCH64_SIGCONTEXT_REG_SIZE);
    }

  trad_frame_set_reg_addr (this_cache, AARCH64_FP_REGNUM, fp);
  trad_frame_set_reg_addr (this_cache, AARCH64_LR_REGNUM, fp + 8);
  trad_frame_set_reg_addr (this_cache, AARCH64_PC_REGNUM, fp + 8);

The code that get pc and sp is not right, so I change the code according
to Linux kernel code:
  trad_frame_set_reg_addr (this_cache, AARCH64_SP_REGNUM,
			   sigcontext_addr + AARCH64_SIGCONTEXT_XO_OFFSET
			     + 31 * AARCH64_SIGCONTEXT_REG_SIZE);
  trad_frame_set_reg_addr (this_cache, AARCH64_PC_REGNUM,
			   sigcontext_addr + AARCH64_SIGCONTEXT_XO_OFFSET
			     + 32 * AARCH64_SIGCONTEXT_REG_SIZE);

The issue was fixed by this change, and I did the regression test.  It
also fixed a lot of other XFAIL and FAIL.

2014-05-20  Hui Zhu  <hui@codesourcery.com>
	    Yao Qi  <yao@codesourcery.com>

	PR backtrace/16558
	* aarch64-linux-tdep.c (aarch64_linux_sigframe_init): Update comments
	and change address of sp and pc.
2014-05-20 13:19:06 +08:00
Alan Modra cdf2a8b762 Remove unnecessary header from m68k-dis.c
* m68k-dis.c: Don't include setjmp.h.
2014-05-20 13:15:18 +09:30
Alan Modra 93d1b056cb Rewrite ppc32 backend .sdata and .sdata2 handling
1) _SDA_BASE_ and _SDA2_BASE_ and defined automatically, in a similar
   manner to the way _GLOBAL_OFFSET_TABLE_ is handled.  It's a little
   more complicated to remove the symbols because _SDA_BASE_ needs to
   be there if either .sdata or .sbss is present, and similarly for
   _SDA2_BASE.
2) The linker created .sdata and .sdata2 sections used for
   R_PPC_EMB_SDAI16 and R_PPC_EMB_SDA2I16 pointers are created early.
   Nowadays we strip unneeded sections from the output, so it isn't
   necessary to delay creating the sections.
3) The output section for targets of various SDA relocs is now checked
   as per the ABI(s).  We previously allowed .sdata.foo and similar,
   most likely because at some stage we were checking input sections.

Also, the patch fixes a long-standing bug in size_input_sections
that affects the values of symbols defined in stripped input
sections.

	PR 16952
bfd/
	* elf32-ppc.c (ppc_elf_create_linker_section): Move earlier.
	Remove redundant setting of htab->elf.dynobj.  Don't align.
	Define .sdata symbols using _bfd_elf_define_linkage_sym.
	(ppc_elf_create_glink): Call ppc_elf_create_linker_section.
	(create_sdata_sym): Delete.
	(elf_allocate_pointer_linker_section): Rename from
	elf_create_pointer_linker_section.  Align section.
	(ppc_elf_check_relocs): Don't call ppc_elf_creat_linker_section
	directly here, or create_sdata_sym.  Set ref_regular on _SDA_BASE_
	and _SDA2_BASE_.
	(ppc_elf_size_dynamic_sections): Remove ATTRIBUTE_UNUSED on param.
	Remove unnecessary tests on _SDA_BASE_ sym.
	(maybe_strip_sdasym, ppc_elf_maybe_strip_sdata_syms): New functions.
	(ppc_elf_relocate_section): Tighten SDA reloc symbol section checks.
	* elf32-ppc.h (ppc_elf_set_sdata_syms): Delete.
	(ppc_elf_maybe_strip_sdata_syms): Declare.
ld/
	* emulparams/elf32ppccommon.sh (_SDA_BASE_, _SDA2_BASE_): Delete.
	* emultempl/ppc32elf.em (ppc_before_allocation): Call
	ppc_elf_maybe_strip_sdata_syms.
	* ldlang.c (size_input_section): Correct output_offset value
	for excluded input sections.
2014-05-20 13:13:23 +09:30
Alan Modra ab2f2ff937 daily update 2014-05-20 09:30:38 +09:30
Doug Evans 7305118224 build_type_unit_groups and moved closer to only caller and renamed
* dwarf2read.c (build_type_psymtabs_1): Renamed from
	build_type_unit_groups and moved closer to only caller.  Remove
	arguments.  All references updated.  Remove outdated .gdb_index
	comment.
	(struct tu_abbrev_offset, sort_tu_by_abbrev_offset): Move with
	build_type_psymtabs_1.
2014-05-19 16:06:59 -07:00
Tom Tromey c4e54771f8 fix two latent type errors
I'm checking this in as obvious.

I was looking at instances of "alloc.*sizeof" and noticed a couple
where the types in question are incorrect.

In gdbtypes, the code allocates sizeof(int) to represent a struct rank.
In mi-cmds, the code uses "struct mi_cmd **" -- one "*" too many.

In both cases the problems are latent because in practice the sizes
are the same as the sizes of the correct types.  Still, it's better to
be correct.

I think gdb would be improved by a wholesale change from explicit
sizeofs to using the libiberty.h allocation macros.  In most cases
they are both shorter and have better type safety.  However, the
resulting patch is rather large.

Built and regtested on x86-64 Fedora 20.

2014-05-19  Tom Tromey  <tromey@redhat.com>

	* gdbtypes.c (rank_function): Use XNEWVEC.
	* mi/mi-cmds.c (build_table): Use XCNEWVEC.
2014-05-19 14:17:16 -06:00
Doug Evans 8832e7e38e Remove all_type_unit_groups, unused.
* dwarf2read.c (struct dwarf2_per_objfile): Delete unused members
	n_type_unit_groups, all_type_unit_groups.  All uses removed.
	(get_type_unit_group, build_type_unit_groups): Delete forward decls.
	(dw2_get_cutu): Renamed from dw2_get_cu.  All callers updated.
	(dw2_get_cu): Renamed from dw2_get_primary_cu.  All callers updated.
	(add_type_unit_group_to_table): Delete.
2014-05-19 12:52:08 -07:00
Jan Kratochvil 9e0aa64f55 Fix gdbserver qGetTLSAddr for x86_64 -m32
gdbserver makes libthread_db to access uninitialized memory.  Surprisingly it
does not harm normally, even -fsanitize=address works with current gdbserver.
I have found just valgrind detects it as a very first warning for gdbserver:

Syscall param ptrace(addr) contains uninitialised byte(s)
   at 0x3721EECEBE: ptrace (ptrace.c:45)
   by 0x436EE5: ps_get_thread_area (linux-x86-low.c:252)
   by 0x5559D02: __td_ta_lookup_th_unique (td_ta_map_lwp2thr.c:157)
   by 0x5559EC3: td_ta_map_lwp2thr (td_ta_map_lwp2thr.c:207)
   by 0x43F87D: find_one_thread (thread-db.c:281)
   by 0x440038: thread_db_get_tls_address (thread-db.c:505)
   by 0x40F6D0: handle_query (server.c:2004)
   by 0x4124CF: process_serial_event (server.c:3445)
   by 0x4136B6: handle_serial_event (server.c:3889)
   by 0x419571: handle_file_event (event-loop.c:434)
   by 0x418D38: process_event (event-loop.c:189)
   by 0x419AB7: start_event_loop (event-loop.c:552)

Reproducible with:
cd gdb/testsuite
g++ -o gdb.threads/tls gdb.threads/tls{,2}.c -m32 -pthread
../gdbserver/gdbserver :1234 gdb.threads/tls
../gdb -batch gdb.threads/tls -ex 'target remote :1234' -ex 'b spin' -ex c -ex 'p a_thread_local'

It is more easily reproducible even without valgrind using s/0x00/0xff/ in the
attached patch.  It will then turn the output of reproducer above:
$1 = 0
->
Cannot find thread-local storage for Thread 29044, executable file .../gdb/testsuite/gdb.threads/tls:
Remote target failed to process qGetTLSAddr request

gdb/gdbserver/
2014-05-19  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix gdbserver qGetTLSAddr for x86_64 -m32.
	* linux-x86-low.c (X86_64_USER_REGS): New.
	(x86_fill_gregset): Call memset for BUF first in x86_64 -m32 case.

Message-ID: <20140410114901.GA16411@host2.jankratochvil.net>
2014-05-19 20:20:27 +02:00
Doug Evans cd8ae15e25 * eval.c (evaluate_subexp_standard): Add some comments. 2014-05-19 10:51:08 -07:00
Jan Kratochvil f1f4348a6e [testsuite patch] Test power{5,6,7} disassembly
Power5, Power6 and Power7 disassembly testing.

gdb/testsuite/
2014-05-19  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.arch/powerpc-power.exp: New file.
	* gdb.arch/powerpc-power.s: New file.

Message-ID: <20140514205425.GA15398@host2.jankratochvil.net>
2014-05-19 15:39:24 +02:00
Nick Clifton 296a868924 Extend the fix already created for PR 16858 so that it works with x86 PE targets as well.
PR gas/16858
	* config/tc-i386.c (md_apply_fix): Improve the detection of code
	symbols for 32-bit PE targets.
2014-05-19 14:29:31 +01:00
Andreas Tobler fb2c6e43b8 Don't link FreeBSD tests with -ldl.
* ld-elf/shared.exp: Introduce the extralibs variable to control
    the libraries to be linked. Don't link -ldl on *-*-freebsd*.

    * ld-bootstrap/bootstrap.exp: Do not add -ldl to the extralibs on
    *-*-freebsd*.
2014-05-19 08:49:55 +02:00
Alan Modra f0d7b6ded5 daily update 2014-05-19 09:30:38 +09:30
Richard Sandiford fd5c94abf6 gas/
* config/tc-mips.c (md_obj_begin): Delete.
	(md_obj_end): Fold into...
	(md_mips_end): ...here.  Move to end of file.
2014-05-18 20:28:04 +01:00
Alan Modra d7e4851a0c daily update 2014-05-18 09:30:41 +09:30
Doug Evans 08f4850b5d * progspace.c (remove_program_space): Delete, unused.
* progspace.h (remove_program_space): Ditto.
2014-05-17 12:18:26 -07:00
Doug Evans bed8455c71 * inferior.c (prune_inferiors): Fix comment.
(remove_inferior_command): Call prune_program_spaces.
2014-05-17 11:59:34 -07:00
Nick Clifton 77f730a2f5 Prevent the V850 assembler from generating an internal error if it is asked to
handle a ctoff() pseudo-op when running in RH850 ABI mode.

	PR gas/16946
	* config/tc-v850.c (handle_ctoff): Generate an error if called
	when using the RH850 ABI.
2014-05-17 17:48:44 +01:00
Ryan Mansfield a7c7b2ba6c * config.bfd: Move QNX target_cflags from arm-*-netbsd* to arm-*-nto*. 2014-05-17 17:48:44 +01:00
Doug Evans b3ce5e5f18 Copy over changes from guile.texi.
* python.texi (Basic Python) <gdb.execute>: Add text.
	(Basic Python) <gdb.post_event>: Remove "main" from "main GDB thread".
	(Values From Inferior) <Python string>: Add text.
	(Values From Inferior) <Value.string>: Clarify string length handling.
	(Pretty Printing API): Add cindex.
	(Types In Python) <TYPE_CODE_*>: Use vtable instead of table.
	Remove unnecessary index of gdb.TYPE_CODE_*.  Replace @findex with
	@vindex.
	(Commands In Python) <COMPLETE_*>: Similarly.
	(Symbols In Python) <SYMBOL_*>: Similarly.
	(Breakpoints In Python) <WP_*>: Similarly.
	(Breakpoints In Python) <BP_*>: Similarly.
2014-05-17 09:13:00 -07:00
David Taylor 8dfcab11cd Improve docs of qfThreadInfo packet.
gdb/doc/gdb.texinfo (General Query Packets): Add a note about thread IDs
mentioned in the qfThreadInfo reply.
2014-05-17 10:29:57 +03:00
Alan Modra ff46be9062 daily update 2014-05-17 09:30:39 +09:30
Doug Evans d7761c2cba * gdb.base/completion.exp: Check that all expected files exist
before doing file completion.
2014-05-16 12:46:24 -07:00
Doug Evans 0dbe70ceba * gdb.base/Makefile.in (EXECUTABLES): Add completion. 2014-05-16 12:34:05 -07:00
Doug Evans 8d551b0239 New command line option -D.
* NEWS: Mention it.
	* main.c (set_gdb_data_directory): New function.
	(captured_main): Recognize -D.  Flag error for --data-directory "".
	Call set_gdb_data_directory.
	(print_gdb_help): Print --data-directory, -D.
	* main.h (set_gdb_data_directory): Declare.
	* top.c (staged_gdb_datadir): New static global.
	(set_gdb_datadir): Call set_gdb_data_directory
	(show_gdb_datadir): New function.
	(init_main): Update init of data-directory parameter.

	testsuite/
	* gdb.base/catch-syscall.exp (test_catch_syscall_fail_nodatadir):
	Update.
	(do_syscall_tests_without_xml): Update.

	doc/
	* gdb.texinfo (Mode Options): Add -D.
2014-05-16 12:15:10 -07:00
Gregory Fong 18848e288c Import the "dirfd" gnulib module.
2014-05-16  Gregory Fong  <gregory.0xf0@gmail.com>

	Import the "dirfd" gnulib module.
	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add dirfd.
	* gnulib/aclocal.m4: Update.
	* gnulib/config.in: Update.
	* gnulib/configure: Update.
	* gnulib/import/Makefile.am: Update.
	* gnulib/import/Makefile.in: Update.
	* gnulib/import/dirfd.c: New.
	* gnulib/import/m4/dirfd.m4: New.
	* gnulib/import/m4/gnulib-cache.m4: Update.
	* gnulib/import/m4/gnulib-comp.m4: Update.
2014-05-16 12:26:33 -06:00
John Marino 5febff9be8 * configure.tgt: Add /lib to dragonfly NATIVE_LIB_DIRS. 2014-05-16 15:39:47 +01:00
Jon Turney 6e6e7cfc78 This fixes a few issues with pe/coff build-ids that were discovered since the
original patches were posted:

  pe/coff: Display GUID build-id in the conventional way
  pe/coff: Don't interpret debug directory in section with no contents
  pe/coff: Keep .build-id with --only-keep-debug
  pe/coff: Don't break .build-id with objcopy/strip

	* peXXigen.c (pe_print_debugdata): Don't interpret debug directory
	in a section with no contents.
	(is_vma_in_section, find_section_by_vma): New functions.
	(_bfd_XX_bfd_copy_private_bfd_data_common): Recalculate file
	offsets in the debug directory.
	(_bfd_XXi_slurp_codeview_record, _bfd_XXi_write_codeview_record):
	Byte-swap GUID from little-endian to big-endian order for
	consistent and conventional display.

	* objcopy.c (is_nondebug_keep_contents_section): New function.
	(setup_section): Use it.
2014-05-16 15:34:13 +01:00
Kaushik Phata 856ea05ccf This adds support for marking RL78 binaries as either supporting 32-bit
or 64-bit doubles.  It also makes the linker complain if the user attempts
to link together binaries with different sized doubles.

	* elf32-rl78.c (rl78_elf_merge_private_bfd_data): Complain if
	64-bit doubles objects mix with 32-bit doubles objects.
	(rl78_elf_print_private_bfd_data): Describe 64-bit doubles flag.

	* readelf.c (get_machine_flags): Handle RL78 64-bit doubles flag.

	* config/tc-rl78.c (enum options): Add OPTION_32BIT_DOUBLES
	and OPTION_64BIT_DOUBLES.
	(md_longopts): Add -m32bit-doubles and -m64bit-doubles.
	(md_parse_option): Parse -m32bit-doubles and -m64bit-doubles.
	(md_show_usage): Show all of the RL78 options.
	(rl78_float_cons): New static functions.
	(md_pseudo_table): Update handler for "double".
2014-05-16 14:57:10 +01:00
Pedro Alves 73eb770959 mi-support.exp: Fix some pastos.
gdb/testsuite/
2014-05-16  Pedro Alves  <palves@redhat.com>

	* lib/mi-support.exp (mi_expect_stop): On timeout, say "timeout"
	instead of "unknown output after running".
2014-05-16 14:43:47 +01:00
Yao Qi 3fae92fc2a Copy file1.txt to remote host in dw2-filename.exp and dw2-anonymous-func.exp
Some gdb.dwarf2/*.exp tests copy file1.txt to host via gdb_remote_download
but dw2-filename.exp and dw2-anonymous-func.exp don't do that.  Looks like
an oversight in this patch
https://sourceware.org/ml/gdb-patches/2013-08/msg00365.html

There are some fails in remote host testing.
FAIL: gdb.dwarf2/dw2-anonymous-func.exp: list file1.txt
FAIL: gdb.dwarf2/dw2-filename.exp: interpreter-exec mi -file-list-exec-source-files
FAIL: gdb.dwarf2/dw2-filename.exp: info sources

This patch is to invoke gdb_remote_download to copy file1.txt to host
and remote it at the end.  This patch fixes these fails above.

gdb/testsuite:

2014-05-16  Yao Qi  <yao@codesourcery.com>

	* gdb.dwarf2/dw2-filename.exp: Copy file1.txt to host.  Remove
	file1.txt from host at the end.
	* gdb.dwarf2/dw2-anonymous-func.exp: Likewise.
2014-05-16 20:24:50 +08:00
Yao Qi 95c64f92be Fix display of tabulation character for mingw hosts.
Pierre proposed this patch
https://sourceware.org/ml/gdb-patches/2013-10/msg00011.html and
Tom gave a suggestion that it's better to do check \t in print_wchar
<https://sourceware.org/ml/gdb-patches/2013-11/msg00148.html>
However, I don't see the follow-up to this discussion.

We encounter two fails in printcmds.exp on mingw host, and Pierre's
patch fixes them.  I pick it up, update a little per Tom's
comments, and post it here for review.  This patch fixes these fails
below on mingw32 host.

FAIL: gdb.base/charset.exp: print string in ASCII
FAIL: gdb.base/charset.exp: try printing '\t' in ASCII
FAIL: gdb.base/charset.exp: print string in ISO-8859-1
FAIL: gdb.base/charset.exp: try printing '\t' in ISO-8859-1
FAIL: gdb.base/charset.exp: print string in UTF-32
FAIL: gdb.base/charset.exp: try printing '\t' in UTF-32
FAIL: gdb.base/printcmds.exp: p ctable1[9]
FAIL: gdb.base/printcmds.exp: p &ctable1[1*8]

Also regression tested on x86_64-linux.  Is it OK?

gdb:

2014-05-16  Pierre Muller  <muller@sourceware.org>
	    Yao Qi  <yao@codesourcery.com>

	* valprint.c (print_wchar): Move the code on checking whether
	W is a printable wide char to the default branch of switch
	statement below.  Call wchar_printable instead of gdb_iswprint.
2014-05-16 20:19:00 +08:00
Yao Qi 19679ecafc Fix changelong entry.
Each changelog entry should be tab-prefixed.
2014-05-16 20:11:21 +08:00
Taimoor Mirza cac395eae4 Fix prologue analysis for ldr.w and ldrd instruction
Prologue analysis for ldr.w and ldrd instruction obtains offset from
first two bytes that contains opcode of instruction. It should obtain
offset from next two bytes that actually contain operands.

       * arm-tdep.c (thumb_analyze_prologue): Fix offset calculation for
	ldr.w and ldrd instructions.

Signed-off-by: Taimoor Mirza <tmirza@codesourcery.com>
2014-05-16 11:39:05 +05:00
Alan Modra 791849751d daily update 2014-05-16 09:30:36 +09:30
Doug Evans c2b2ccc5ed Make more robust when run in parallel mode.
Since we're not compiling with gcc, we don't know where the
DWO file will ultimately be built.  It could be built in
testsuite/gdb.dwarf2/foo (non-parallel mode) or
testsuite/outputs/gdb.dwarf2/foo (parallel mode).

	* gdb.dwarf2/fission-reread.S: Remove directory from .dwo file path.
	* gdb.dwarf2/fission-reread.exp: Set debug-file-directory before
	loading file.  Add test for TU lookup.
2014-05-15 15:50:34 -07:00
Doug Evans 83655187cb * dwarf2read.c (read_structure_type): Delete outdated comments. 2014-05-15 15:45:05 -07:00
Simon Marchi 8c217a4b68 Fix argument passing in mi_run_cmd_full
Passing arguments did not work when use_mi_command was set.

gdb/testsuite/ChangeLog:
2014-05-13  Simon Marchi  <simon.marchi@ericsson.com>

	* lib/mi-support.exp (mi_run_cmd_full): Set arguments by calling
	"-exec-arguments" or "set args" before running the inferior.
2014-05-15 15:45:51 -04:00
Simon Marchi 3deb39c62d Fix mi_expect_stop for non-zero exit codes
The message displayed by gdb is different when the inferior exits with
zero and non-zero values, this fix takes that into account.

gdb/testsuite/ChangeLog:
2014-05-13  Simon Marchi  <simon.marchi@ericsson.com>

	* lib/mi-support.exp (mi_expect_stop): Expect message for
	inferiors that exit with non-zero exit code.
2014-05-15 15:41:36 -04:00
Alan Modra 5fe7ffdc98 Fix "overflow in PLT unwind data" warning
When linking statically, it's possible to hit this warning with IFUNC
or very large executables, due to .glink being unused.

	* powerpc.cc (do_plt_fde_location): Handle zero length .glink.
	Compare FDE contents with DW_CFA_nop rather than 0.
2014-05-15 18:37:43 +09:30
Alan Modra 57b287416b daily update 2014-05-15 09:30:45 +09:30
Sandra Loosemore d9e042ac0b Sync nios2 configure changes from GCC mainline.
2014-05-14  Sandra Loosemore  <sandra@codesourcery.com>

	* configure.ac (target_makefile_frag): Set for nios2-*-elf*.
	* configure: Regenerated.

	config/
	* mt-nios2-elf: New file.
2014-05-14 16:27:14 -07:00