Commit Graph

84461 Commits

Author SHA1 Message Date
GDB Administrator 05e83eb1b6 Automatic date update in version.in 2015-07-14 00:00:08 +00:00
Yao Qi d5131498a5 Fix attach-pie-noexec.exp fail on native-extended-gdbserver
When I examine the buildbot fails, I see this fail on
native-extended-gdbserver,

 Attaching to process 13529^M
 "target:/scratch/yao/gdb/build-git/x86_64/gdb/testsuite/gdb.base/attach-pie-noexec (deleted)": could not open as an executable file: No such file or directory^M
 (gdb) FAIL: gdb.base/attach-pie-noexec.exp: attach

if I run tests with board file unix, it doesn't exist,

 Attaching to process 13869^M
 /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/gdb.base/attach-pie-noexec (deleted): No such file or directory.^M
 (gdb) PASS: gdb.base/attach-pie-noexec.exp: attach

the test expects to see the period at the end of the error message,

  gdb_test "attach $testpid" "Attaching to process $testpid\r\n.*: No such file or directory\\." "attach"

however the period is missing when running with native-extended-gdbserver.

in exec.c:exec_file_attach, GDB has two places may throw errors [1] and [2],

      if (load_via_target)
	{
	  ...
	}
      else
	{
 	  ...
	  if (scratch_chan < 0)
	    perror_with_name (filename);  <--- [1]
	}

	...
      if (!exec_bfd)
	{
	  error (_("\"%s\": could not open as an executable file: %s"), <-- [2]
		 scratch_pathname, bfd_errmsg (bfd_get_error ()));
	}

perror_with_name [1] append a period at the end of error message,
but error [2] doesn't.  This fix is to add a period at the end of the
error message.  Note that this fail is shown up on 7.9 release as well.

gdb:

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

	* exec.c (exec_file_attach): Add period at the end of error
	message.
2015-07-13 17:14:13 +01:00
Andrew Burgess 97605e61a1 gdb/tui: Add command completion to winheight command.
Share the window name completion code from the focus command with the
winheight command, providing window name completion for the winheight
command.

gdb/ChangeLog:

	* tui/tui-win.c (window_name_completer): New function.
	(focus_completer): Call window_name_completer.  All old content
	moved into window_name_completer.
	(winheight_completer): New function.
	(_initialize_tui_win): Rename variable.  Add completer to
	winheight command.  Update doc string on winheight.
2015-07-13 15:47:06 +01:00
GDB Administrator c576455ba7 Automatic date update in version.in 2015-07-13 00:00:08 +00:00
H.J. Lu fb8b9dbc14 Extend --compress-debug-sections in gold
This patch extends --compress-debug-sections= with [zlib-gnu|zlib-gabi]
in gold.

	PR gold/18322
	* compressed_output.cc (zlib_compress): Add argument for
	compression header size.  Set header size to compression header
	size if it isn't 0.  Don't write out the zlib header here.
	(Output_compressed_section::set_final_data_size): Support
	zlib-gnu and zlib-gabi compressions.  Pass compression header
	size to zlib_compress and write out compression header.  Set
	the SHF_COMPRESSED bit for zlib-gabi compression.  Otherwise
	clear the SHF_COMPRESSED bit
	* options.h (compress_debug_sections): Add zlib-gnu and
	zlib-gabi.
	* output.h (Output_section::set_flags): New.
	* testsuite/Makefile.am (check_PROGRAMS): Add
	flagstest_compress_debug_sections_none,
	flagstest_compress_debug_sections_gnu and
	flagstest_compress_debug_sections_gabi.
	(check_DATA): Add flagstest_compress_debug_sections_none.stdout.
	flagstest_compress_debug_sections.stdout,
	flagstest_compress_debug_sections.cmp,
	flagstest_compress_debug_sections.check,
	flagstest_compress_debug_sections_gnu.stdout,
	flagstest_compress_debug_sections_gnu.cmp,
	flagstest_compress_debug_sections_gnu.check,
	flagstest_compress_debug_sections_gabi.stdout,
	flagstest_compress_debug_sections_gabi.cmp and
	flagstest_compress_debug_sections_gabi.check.
	(flagstest_compress_debug_sections_none): New.
	(flagstest_compress_debug_sections_none.stdout): Likewise.
	(flagstest_compress_debug_sections.stdout): Likewise.
	(flagstest_compress_debug_sections.check): Likewise.
	(flagstest_compress_debug_sections.cmp): Likewise.
	(flagstest_compress_debug_sections_gnu): Likewise.
	(flagstest_compress_debug_sections_gnu.stdout): Likewise.
	(flagstest_compress_debug_sections_gnu.check): Likewise.
	(flagstest_compress_debug_sections_gnu.cmp): Likewise.
	(flagstest_compress_debug_sections_gabi): Likewise.
	(flagstest_compress_debug_sections_gabi.stdout): Likewise.
	(flagstest_compress_debug_sections_gnu.check): Likewise.
	(flagstest_compress_debug_sections_gnu.cmp): Likewise.
	* testsuite/Makefile.in: Regenerated.
2015-07-12 10:56:58 -07:00
H.J. Lu 480586639d Add SHF_COMPRESSED section decompression to gold
This patch adds SHF_COMPRESSED section decompression to gold.

	PR gold/18321
	* compressed_output.h (decompress_input_section): Add arguments
	for ELF class, big endian and sh_flags.
	* compressed_output.cc (decompress_input_section): Likewise.
	Support the SHF_COMPRESSED section.
	* dynobj.h (Dynobj): Add elfsize and is_big_endian member
	functions.
	* plugin.h (Pluginobj): Likewise.
	* layout.cc (Layout::get_output_section_flags): Also clear the
	SHF_COMPRESSED bit.
	* object.h (Compressed_section_info): Add flag to store sh_flags.
	(Object): Add pure virtual elfsize and is_big_endian member
	functions.
	* object.cc (need_decompressed_section): Don't skip the ".zdebug"
	prefix here.
	(build_compressed_section_map): Check SHF_COMPRESSED for
	uncompressed size.  Store sh_flags in Compressed_section_info.
	Pass size, big_endian and sh_flags to decompress_input_section.
	Skip the ".debug"/".zdebug" prefix when passing section name to
	need_decompressed_section.
	(Sized_relobj_file<size, big_endian>::do_find_special_section):
	Don't check ".zdebug_*" sections.
	(Object::decompressed_section_contents): Pass ELF class, big
	endian and sh_flags to decompress_input_section.
	* reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
	Likewise.
	* testsuite/Makefile.am (check_DATA): Add
	debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
	(MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
	gdb_index_test_2_gabi.stdout.
	(debug_msg_cdebug_gabi.o): New.
	(odr_violation1_cdebug_gabi.o): Likewise.
	(odr_violation2_cdebug_gabi.o): Likewise.
	(debug_msg_cdebug_gabi.err): Likewise.
	(check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
	(gdb_index_test_cdebug_gabi.o): Likewise.
	(gdb_index_test_2_gabi): Likewise.
	(gdb_index_test_2_gabi.stdout): Likewise.
	* testsuite/gdb_index_test_2_gabi.sh: New file.
	* testsuite/Makefile.in: Regenerated.
2015-07-12 10:50:40 -07:00
Sandra Loosemore 8d6dbeb44c Fix GDB breakage due to addition of new nios2 mach types in BFD.
2015-07-12  Sandra Loosemore  <sandra@codesourcery.com>

	gdb/
	* nios2-linux-tdep.c (_initialize_nios2_linux_tdep): Register
	all nios2 mach variants.
2015-07-12 07:13:12 -07:00
GDB Administrator 9394ff46fb Automatic date update in version.in 2015-07-12 00:00:08 +00:00
GDB Administrator e571fc2b05 Automatic date update in version.in 2015-07-11 00:00:08 +00:00
H.J. Lu 889884731e Properly convert objects between different ELF classes
The output SHF_COMPRESSED section size is different from input if
ELF classes of input and output aren't the same.  We must adjust
the section sizes as well as the compression headers in
SHF_COMPRESSED sections when converting objects between different
ELF classes.

bfd/

	 PR binutils/18656
	 * bfd.c (bfd_convert_section_size): New function.
	 (bfd_convert_section_contents): Likewise.
	 * bfd-in2.h: Regenerated.

binutils/

2015-07-10  H.J. Lu  <hongjiu.lu@intel.com>

	 PR binutils/18656
	 * objcopy.c (setup_section): Call bfd_convert_section_size
	 to get the output section size.
	 (copy_section): Get the section size from the output section
	 and call bfd_get_full_section_contents to convert section
	 contents for output.

binutils/testsuite/

	 PR binutils/18656
	 * binutils-all/compress.exp (convert_test): New proc.
	 Run conversion tests between x86-64 and x32.
2015-07-10 14:27:39 -07:00
Kevin Buettner a0e28e5467 rx-tdep.c: Use target_read_code instead of target_read_memory.
This change causes the prologue scanner and the frame type scanner in
rx-tdep.c to use target_read_code() instead of target_read_memory().
This change allows these instruction scanners to operate much more
quickly due to the fact that target_read_code() can potentially read
from a cache maintained by GDB.

gdb/ChangeLog:

	* rx-tdep.c (rx_get_opcode_byte): Use target_read_code instead
	of target_read_memory.
2015-07-10 13:14:32 -07:00
Pedro Alves 58c1b36c67 gdbserver/event-loop.c: type mismatch
Building with C++ catches a buglet here:

../../../src/gdb/gdbserver/event-loop.c:205:19: warning: invalid conversion from ‘gdb_client_data {aka void*}’ to ‘void**’ [-fpermissive]
   event_ptr->data = data;
                   ^

This works in practice because gdb_client_data is a pointer already
(hence in C we get an implicit conversion), and nothing deferences the
pointer.  It's passed from client at event registration/creation time,
only to pass straight back to client callback.

Well, that and nothing in gdbserver uses the event data anyway.

gdb/gdbserver/ChangeLog:
2015-07-10  Pedro Alves  <palves@redhat.com>

	* event-loop.c (struct callback_event) <data>: Change type to
	gdb_client_data instance instead of gdb_client_data pointer.
	(append_callback_event): Adjust.
2015-07-10 19:47:17 +01:00
H.J. Lu 813dabb9f0 Warn unsupported compress type and corrupted compressed section
* readelf.c (dump_section_as_strings): Warn unsupported compress
	type and corrupted compressed section.
	(dump_section_as_bytes): Likewise.
	(load_specific_debug_section): Likewise.
2015-07-10 10:23:12 -07:00
H.J. Lu 209ce4c2de Updated to accept .debug_* sections
* gas/i386/dw2-compress-1.d: Updated to accept .debug_* sections.
2015-07-10 08:41:10 -07:00
H.J. Lu be0496857f Updated to accept .debug_* sections
* binutils-all/dw2-3.W: Updated to accept .debug_* sections.
2015-07-10 08:14:59 -07:00
Jan Kratochvil 218a5a11a0 Fix testsuite regression by: Do not skip prologue for asm (.S) files
I have somehow missed gdb.asm/asm-source.exp PASS->FAIL even on x86_64.

It has no longer valid assumption that "break" breaks after the prologue even
in assembler.  So I have changed this assumption of the testfile.

gdb/testsuite/ChangeLog
2015-07-10  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.asm/asm-source.exp (f at main): Stop at gdbasm_enter.
	(n at main): New.
	* gdb.asm/asmsrc1.s: Add comment "mark: main enter".
2015-07-10 15:04:51 +02:00
Pierre Langlois 421530db90 [GDBserver][AArch64] Cleanup comments for each linux_target_ops method
This patch cleans up the comments for each linux_target_ops methods.  We
should mention which method each function implements but there is no
need to duplicate information already mentionned in the base target_ops
or linux_target_ops definitions.

gdb/gdbserver/ChangeLog:

	* linux-aarch64-low.c: Add comments for each linux_target_ops
	method.  Remove comments already covered in target_ops and
	linux_target_ops definitions.
	(the_low_target): Add comments for each unimplemented method.
2015-07-10 13:53:49 +01:00
Andrew Burgess c101f28fea gdb/tui: Use cleanups to free string copies.
In parse_scrolling_args it is possible for a string copy to leak if an
error occurs.  Switching to using a cleanup fixes this leak.

In tui_set_win_height the string can't be leaked, but switching to using
a cleanup guards against the possibility that a leak could be introduced
in the future (by adding an error somewhere in the call stack).

gdb/ChangeLog:

	* tui/tui-win.c (tui_set_win_height): Use a cleanup to free the
	string copy.
	(parse_scrolling_args): Likewise.
2015-07-10 12:39:03 +01:00
Andrew Burgess 150375dc7a gdb/tui: Define tui window names once.
Don't duplicate the window names inside the completion function.
Instead make use of the existing defines, and the tui_win_name function
to obtain the window names.

gdb/ChangeLog:

	* tui/tui-win.c (focus_completer): Don't duplicate the tui window
	names in this function.
2015-07-10 12:38:38 +01:00
Andrew Burgess 6dce28e413 gdb: Convert TUI windows names to lower case.
This commit converts the window names for the TUI windows to lower case.
The windows names are already lower case in the documentation, and are
shown as lower case in some of the command completion results.

Given that all the commands that take a window name currently accept
upper or lower case, this commit just changes the window names to lower
case in the remaining places they are displayed by gdb.

gdb/ChangeLog:

	* tui/tui-data.h (SRC_NAME): Convert to lower case.
	(CMD_NAME): Likewise.
	(DATA_NAME): Likewise.
	(DISASSEM_NAME): Likewise.
	* tui/tui-win.c (tui_set_focus): Window names are now lower case.
	(tui_set_win_height): Likewise.
	(parse_scrolling_args): Likewise.
2015-07-10 12:37:57 +01:00
Alan Modra a2c59f280d Make ALIGN(x) behave as ALIGN(.,x)
Inside output sections, ALIGN(.,x) uses a section-relative value for
dot.  The unary ALIGN always used the absolute value of dot.

	* ldexp.c (align_dot_val): New function.
	(fold_unary <ALIGN_K, NEXT>): Use it.
2015-07-10 20:08:55 +09:30
Alan Modra 40f77f827b Add missing changelog entries 2015-07-10 20:08:55 +09:30
Andreas Arnez e03ed3c64a gnu_vector.exp: Skip infcall tests on x86/x86_64
Since the new KFAILs/KPASSs for the infcall tests on x86 and x86_64
targets generated unnecessary noise, this change skips them with
UNSUPPORTED instead.

gdb/testsuite/ChangeLog:

	* gdb.base/gnu_vector.exp: On x86 and x86_64 targets, skip the
	infcall tests instead of setting up for KFAIL.
2015-07-10 10:36:02 +02:00
Markus Metzger 485668e5b3 record: set stop_pc in "record goto" command
When navigating in the recorded execution trace via "record goto", we do not
set stop_pc.  This may trigger an internal error in infrun.c when stepping
from that location.  Set it.

(gdb) rec full
(gdb) c
Continuing.

Breakpoint 1, foo (void) at foo.c:42
42             x = y
(gdb) rn
foo (void)
    at foo.c:41
41             y = x
(gdb) rec go end
Go forward to insn number 98724
    at foo.c:42
42             x = y
(gdb) n
infrun.c:2382: internal-error: resume: Assertion `sig != GDB_SIGNAL_0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

This happens because there's a breakpoint at PC when the "next"
is issued, so that breapoint should be immediately stepped over.
That should have been detected/done by proceed, here:

  if (addr == (CORE_ADDR) -1)
    {
      if (pc == stop_pc
	  && breakpoint_here_p (aspace, pc) == ordinary_breakpoint_here
	  && execution_direction != EXEC_REVERSE)
	/* There is a breakpoint at the address we will resume at,
	   step one instruction before inserting breakpoints so that
	   we do not stop right away (and report a second hit at this
	   breakpoint).

	   Note, we don't do this in reverse, because we won't
	   actually be executing the breakpoint insn anyway.
	   We'll be (un-)executing the previous instruction.  */
	tp->stepping_over_breakpoint = 1;

But since stop_pc was stale, the pc == stop_pc check failed, and left the
breakpont at PC inserted.

gdb/
	* record-btrace.c (record_btrace_goto_begin, record_btrace_goto_end)
	record_btrace_goto): Move call to print_stack_frame ...
	(record_btrace_set_replay): ... here.  Set stop_pc.
	* record-full.c (record_full_goto_entry): Set stop_pc.

testsuite/
	* gdb.btrace/record_goto-step.exp: New.
2015-07-10 09:19:27 +02:00
Han Shen 73854cdd43 Use "gold_info" instead of "gold_warning" for erratum fix.
gold/ChangeLog:

	* aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use 'gold_info'.
	(Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
2015-07-09 17:13:34 -07:00
GDB Administrator f250f5c6dd Automatic date update in version.in 2015-07-10 00:00:08 +00:00
Han Shen 61163dfaae Drop 'missing mapping symbols' warning for arm and aarch64.
The psABI (AAELF) says this about mapping symbols:

    4.6.5.1 Section-relative mapping symbols

    Mapping symbols defined in a section define a sequence of
    half-open address intervals that cover the address range of the
    section. Each interval starts at the address defined by the
    mapping symbol, and continues up to, but not including, the
    address defined by the next (in address order) mapping symbol or
    the end of the section. A section must have a mapping symbol
    defined at the beginning of the section; however, if the section
    contains only data then the mapping symbol may be omitted.

That makes it pretty clear that, in the absence of a mapping symbol,
the entire section can be treated as data.

gold/ChangeLog:
	* aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
	* arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
	symbol warning.
2015-07-09 15:43:15 -07:00
Pierre Langlois 58d2eda55c Add NEWS entry for tracepoints support on aarch64-linux
gdb/ChangeLog:

	* NEWS: Mention support for tracepoints on aarch64-linux.
2015-07-09 16:35:11 +01:00
Pierre Langlois 7671bf47fc [GDBServer][AArch64] Enable support for tracepoints
gdb/gdbserver/ChangeLog:

	* linux-aarch64-low.c (aarch64_supports_tracepoints): New
	function.  Return 1.
	(the_low_target): Install it.
2015-07-09 16:35:11 +01:00
Pierre Langlois 7890fb4566 [testsuite][AArch64] Port gdb.trace
This patch adds support for AArch64 to the gdb.trace testsuite.

Note that it does not add support for testing fast tracepoint as it
isn't supported.  Therefore the test cases with inline assembly are not
ported in this patch, as we do not know what the conditions for
inserting a fast tracepoint on AArch64 would be.

gdb/testsuite/ChangeLog:

	* gdb.trace/backtrace.exp: Set registers for aarch64 target.
	* gdb.trace/collection.exp: Likewise.
	* gdb.trace/mi-trace-frame-collected.exp: Likewise.
	* gdb.trace/mi-trace-unavailable.exp: Likewise.
	* gdb.trace/report.exp: Likewise.
	* gdb.trace/trace-break.exp: Likewise.
	* gdb.trace/unavailable.exp: Likewise.
	* gdb.trace/while-dyn.exp: Likewise.
2015-07-09 16:35:11 +01:00
Pierre Langlois ea873d8ea6 [AArch64] Implement gdbarch_gen_return_address gdbarch method
This patch implements the 'collect $_ret' command to collect the return
address of a function in a tracepoint.  It marks the LR register for
collection.

gdb/ChangeLog:

	* aarch64-tdep.c: Add ax.h and ax-gdb.h includes.
	(aarch64_gen_return_address): New function.
	(aarch64_gdbarch_init): Hook it.
2015-07-09 16:35:11 +01:00
Pierre Langlois 02a2a705aa [AArch64] Teach stub unwinder to terminate gracefully
The stub unwinder is used on AArch64 if the target's memory is not
readable at the current PC.  For example, the user could try to call at
an invalid address such as 0x0, as covered in the gdb.base/signull.exp
test case.  Many GDB ports use a similar unwinder to handle this case
too.

If we purposely kill the inferior before examining the trace then we get
the following issue:

~~~
...
(gdb) trace f
Tracepoint 3 at 0x7fb7fc28c0
(gdb) tstart
(gdb) continue
...
(gdb) tstop
(gdb) tsave /tmp/trace
(gdb) kill
...
(gdb) target tfile /tmp/trace
...
(gdb) tfind
Register 31 is not available.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Found trace frame 0, tracepoint 3
#-1 0x0000007fb7fc28c0 in f () ...
^^^
~~~

This patch teaches the stub unwinder to report to the core frame code
with UNWIND_UNAVAILABLE when either the stack pointer of the return
address are unavailable to read from the target.

gdb/ChangeLog:

	* aarch64-tdep.c (aarch64_make_stub_cache): Set available_p and
	swallow NOT_AVAILABLE_ERROR.
	(aarch64_stub_this_id): Call frame_id_build_unavailable_stack if
	available_p is not set.
	(aarch64_stub_frame_unwind_stop_reason): New function.
	(aarch64_stub_unwind): Install it.
2015-07-09 16:35:11 +01:00
Pierre Langlois 7dfa3edc03 [AArch64] Teach prologue unwinder to terminate gracefully
Without debugging information, we have the following issue when
examining a trace buffer:

~~~
...
(gdb) trace f
Tracepoint 3 at 0x7fb7fc28c0
(gdb) tstart
(gdb) continue
...
(gdb) tstop
(gdb) tfind start
Register 31 is not available.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Found trace frame 0, tracepoint 3
#-1 0x0000007fb7fc28c0 in f () ...
^^^
~~~

The reason for this is that the target's stack pointer is unavailable
when examining the trace buffer.  What we are seeing is due to the
'tfind' command creating a sentinel frame and unwinding it.  If an
exception is thrown, we are left with the sentinel frame being displayed
at level #-1.  The exception is thrown when the prologue unwinder tries
to read the stack pointer to construct an ID for the frame.

This patch fixes this by making the prologue unwinder catch
NOT_AVAILABLE_ERROR exceptions when either registers or memory is
unreadable and report back to the frame core code with
UNWIND_UNAVAILABLE.

gdb/ChangeLog:

	* aarch64-tdep.c (aarch64_prologue_cache) <available_p>: New
	field.
	(aarch64_make_prologue_cache_1): New function, factored out from
	aarch64_make_prologue_cache.  Do not allocate cache.  Set
	available_p.
	(aarch64_make_prologue_cache): Reimplement wrapping
	aarch64_make_prologue_cache_1, and swallowing
	NOT_AVAILABLE_ERROR.
	(aarch64_prologue_frame_unwind_stop_reason): New function.
	Return UNWIND_UNAVAILABLE if available_p is not set.
	(aarch64_prologue_unwind): Install it.
	(aarch64_prologue_this_id): Move prev_pc and prev_sp limit
	checks into aarch64_prologue_frame_unwind_stop_reason.  Call
	frame_id_build_unavailable_stack if available_p is not set.
2015-07-09 16:35:11 +01:00
Pierre Langlois db63414322 [AArch64] Only access inferior registers when creating a frame cache
This patch moves the address of the start of a function (func) and the
address from which it was called (prev_pc) into aarch64_prologue_cache.
The idea is to keep accesses to the inferior's registers into
aarch64_make_prologue_cache and aarch64_make_stub_cache.

gdb/ChangeLog:

	* aarch64-tdep.c (aarch64_prologue_cache) <func, prev_pc>: New
	fields.
	(aarch64_scan_prologue): Set prev_pc.
	(aarch64_make_prologue_cache): Set func.
	(aarch64_make_stub_cache): Set prev_pc.
	(aarch64_prologue_this_id): Remove local variables id, pc and
	func.  Read prev_pc and func from cache.
	(aarch64_stub_this_id): Read prev_pc from cache.
2015-07-09 16:35:11 +01:00
Pierre Langlois 8b61f75db5 [AArch64] Refactor aarch64_make_stub_cache
We would previously have to make sure the frame cache was not already
created before calling aarch64_make_stub_cache.  This patch makes this
function check it so the caller does not need to do so.

gdb/ChangeLog:

	* aarch64-tdep.c (aarch64_make_stub_cache): Update comment.  New
	argument this_cache.  Remove unused local variables reg and
	unwound_fp.  Return early if this_cache is already set.  Set
	this_cache.
	(aarch64_stub_this_id): Update call to aarch64_make_stub_cache.
2015-07-09 16:35:10 +01:00
Pierre Langlois 7c8edfae86 [AArch64] Refactor aarch64_make_prologue_cache
We would previously have to make sure the frame cache was not already
created before calling aarch64_make_prologue_cache.  This patch makes
this function check it so that the caller does not need to do so.

gdb/ChangeLog:

	* aarch64-tdep.c (aarch64_make_prologue_cache): Update comment.
	New argument this_cache.  Return early if this_cache is already
	set.  Set this_cache.
	(aarch64_prologue_this_id): Update call to
	aarch64_make_prologue_cache.
	(aarch64_prologue_prev_register): Likewise.
	(aarch64_normal_frame_base): Likewise.
2015-07-09 16:35:10 +01:00
Catherine Moore 3350cc01de 2015-07-09 Catherine Moore <clm@codesourcery.com>
include/
        * elf/mips/mips.h (Val_GNU_MIPS_ABI_FP_NAN2008): New.

        gas/
        * config/tc-mips.c (check_fpabi):  Handle
        VAL_GNU_MIPS_ABI_FP_NAN2008.

        binutils/
        * readelf.c (print_mips_fp_abi_value): Handle
        Val_GNU_MIPS_ABI_FP_NAN2008.

        ld/testsuite/
        * ld-mips-elf/attr-gnu-4-08.d: Update expected output.
        * ld-mips-elf/attr-gnu-4-09.d: New.
        * ld-mips-elf/attr-gnu-4-19.d: New.
        * ld-mips-elf/attr-gnu-4-29.d: New.
        * ld-mips-elf/attr-gnu-4-39.d: New.
        * ld-mips-elf/attr-gnu-4-49.d: New.
        * ld-mips-elf/attr-gnu-4-59.d: New.
        * ld-mips-elf/attr-gnu-4-69.d: New.
        * ld-mips-elf/attr-gnu-4-79.d: New.
        * ld-mips-elf/attr-gnu-4-89.d: New.
        * ld-mips-elf/attr-gnu-4-9.s: New.
        * ld-mips-elf/mips-elf.exp: Run new tests.
2015-07-09 08:26:10 -07:00
Simon Marchi 938c69a118 Factor out memberptr printing code from c_val_print
gdb/ChangeLog:

	* c-valprint.c (c_val_print): Factor out memberptr printing code
	from c_val_print to ...
	(c_val_print_memberptr): ... this new function.
2015-07-09 11:24:57 -04:00
Simon Marchi 49f7fe2880 Factor out int printing code from c_val_print
gdb/ChangeLog:

	* c-valprint.c (c_val_print): Factor out int printing code to ...
	(c_val_print_int): ... this new function.
2015-07-09 11:24:57 -04:00
Simon Marchi 9e4f353ca9 Factor out struct and union printing code from c_val_print
gdb/ChangeLog:

	* c-valprint.c (c_val_print): Factor out struct and union
	printing code to ...
	(c_val_print_struct): ... this new function ...
	(c_val_print_union): ... and this new function.
2015-07-09 11:24:56 -04:00
Simon Marchi 1c67f03263 Factor out pointer printing code from c_val_print
gdb/ChangeLog:

	* c-valprint.c (c_val_print): Factor out pointer printing code
	to ...
	(c_val_print_ptr): ... this new function.
2015-07-09 11:24:56 -04:00
Simon Marchi 0b6ef777bd Factor out array printing code from c_val_print
gdb/ChangeLog:

	* c-valprint.c (c_valprint): Factor our array printing code from
	c_val_print to ...
	(c_val_print_array): ... this new function.
2015-07-09 11:24:56 -04:00
Simon Marchi 1033c33c36 Factor out print_unpacked_pointer from c_val_print
Turn this code into a function, instead of a goto.

gdb/ChangeLog:

	* c-valprint.c (c_val_print): Factor out pointer printing code
	to ...
	(print_unpacked_pointer): ... this new function.
2015-07-09 11:24:56 -04:00
Simon Marchi f6b93c3463 Remove unneeded variable assignment
The assignment to i in the TYPE_CODE_PTR section is not useful.
Removing it allows to move i in a narrower scope, which will help
things somewhere in the next patches.

gdb/ChangeLog:

	* c-valprint.c (c_val_print): Remove an assignment to i and move
	its declaration.
2015-07-09 11:24:56 -04:00
Catherine Moore de231f2015 2015-07-09 Catherine Moore <clm@codesourcery.com>
* elflink.c (bfd_elf_size_dynamic_sections): Call to
        _bfd_elf_maybe_strip_eh_frame_hdr should be before
        bed->elf_backend_size_dynamic_sections.
2015-07-09 08:07:47 -07:00
Yao Qi 0f4576e358 Pass ptid to aarch64_linux_get_debug_reg_capacity
This patch is to pass ptid to aarch64_linux_get_debug_reg_capacity,
and stop using global variable inferior_ptid.

gdb:

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

	* aarch64-linux-nat.c (aarch64_linux_get_debug_reg_capacity): Add
	argument ptid.  Update comments.  Caller update.
2015-07-09 12:55:45 +01:00
Yao Qi c2d65f389a [gdbserver, aarch64] Set usrregs to NULL in regs_info
Hi,
I happen to read the comments in regs_info below,

struct regs_info
{
  ...
  /* Info used when accessing registers with PTRACE_PEEKUSER /
     PTRACE_POKEUSER.  This can be NULL if all registers are
     transferred with regsets  .*/
  struct usrregs_info *usrregs;

that usrregs can be NULL if all registers are transferred with
regsets, which is exactly what aarch64-linux does.  This patch
is to set usrregs to NULL in regs_info and remove
aarch64_usrregs_info and aarch64_regmap.

gdb/gdbserver:

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

	* linux-aarch64-low.c (aarch64_regmap): Remove.
	(aarch64_usrregs_info): Remove.
	(regs_info): Set field usrregs to NULL.
2015-07-09 12:48:09 +01:00
Markus Metzger 37fdfe4c00 btrace, pt: support new packets
Add support for dumping new Intel(R) Processor Trace packets in the
"maint btrace packet-history" command.

gdb/
	* btrace.c (pt_print_packet): Print stop, vmcs, tma, mtc, cyc, and
	mnt packets.
2015-07-09 08:03:10 +02:00
Markus Metzger 80a2b330f7 btrace: fix build fail with 32-bit BFD
When compiling GDB with 32-bit BFD, the build fails with:

In file included from btrace.h:33:0,
                 from btrace.c:23:
/usr/include/intel-pt.h:1643:51: note: expected 'int (*)(uint8_t *, size_t,
 const struct pt_asid *, uint64_t, void *)' but argument is of type 'int
 (*)(gdb_byte *, size_t, const struct pt_asid *, CORE_ADDR, void *)' extern
 pt_export int pt_image_set_callback(struct pt_image *image, ^

gdb/
	* btrace.c (btrace_pt_readmem_callback): Change type of PC argument.
2015-07-09 08:01:44 +02:00
GDB Administrator de0ef28545 Automatic date update in version.in 2015-07-09 00:00:07 +00:00