H.J. Lu [Tue, 14 Jul 2015 16:17:41 +0000 (09:17 -0700)]
Sync longlong.h with GCC
Sync with GCC
2014-10-28 Richard Henderson <rth@redhat.com>
* longlong.h [__alpha] (umul_ppmm): Disable for c++.
H.J. Lu [Tue, 14 Jul 2015 16:16:33 +0000 (09:16 -0700)]
Sync hashtab.h, splay-tree.h with GCC
Sync with GCC
2014-12-09 Trevor Saunders <tsaunders@mozilla.com>
* hashtab.h, splay-tree.h: Remove GTY markers.
H.J. Lu [Tue, 14 Jul 2015 16:14:50 +0000 (09:14 -0700)]
Remove trailing spaces in demangle.h
H.J. Lu [Tue, 14 Jul 2015 16:10:59 +0000 (09:10 -0700)]
Sync ansidecl.h with GCC
Sync with GCC
2015-03-02 Markus Trippelsdorf <markus@trippelsdorf.de>
PR target/65261
* ansidecl.h (ATTRIBUTE_NO_SANITIZE_UNDEFINED): New macro.
H.J. Lu [Tue, 14 Jul 2015 15:43:24 +0000 (08:43 -0700)]
Sync config files with GCC
Sync with GCC
2015-05-13 Eric Botcazou <ebotcazou@adacore.com>
* sjlj.m4: New file.
2015-05-04 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* bitfields.m4: Change int to long long, and use bitfields of
width 1 instead of 0.
2015-05-01 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* bitfields.m4: New file.
2015-04-14 H.J. Lu <hongjiu.lu@intel.com>
* bootstrap-mpx.mk: New file.
2015-03-25 Uros Bizjak <ubizjak@gmail.com>
PR bootstrap/65537
* bootstrap-lto-noplugin.mk: New build configuration.
2014-11-13 Kirill Yukhin <kirill.yukhin@intel.com>
* target-posix: New file.
2014-10-27 Tom Tromey <tromey@redhat.com>
* gcc-plugin.m4: New file.
Peter Bergner [Tue, 14 Jul 2015 15:46:16 +0000 (10:46 -0500)]
Fix build issue with nat/linux-namespaces.c.
* nat/linux-namespaces.c (setns): Rename from this ...
(do_setns): ... to this. Support calling setns if it exists.
(mnsh_handle_setns): Call do_setns.
H.J. Lu [Tue, 14 Jul 2015 15:39:12 +0000 (08:39 -0700)]
Sync config/warnings.m4 with GCC
config/
Sync with GCC
2015-05-27 Jason Merrill <jason@redhat.com>
PR bootstrap/66304
* warnings.m4 (ACX_PROG_CXX_WARNING_OPTS)
(ACX_PROG_CXX_WARNINGS_ARE_ERRORS)
(ACX_PROG_CXX_WARNING_ALMOST_PEDANTIC): New.
(ACX_PROG_CC_WARNING_OPTS, ACX_PROG_CC_WARNING_ALMOST_PEDANTIC)
(ACX_PROG_CC_WARNINGS_ARE_ERRORS): Push into C language context.
libdecnumber/
* configure: Regenerated.
libiberty/
* configure: Regenerated.
opcodes/
* configure: Regenerated.
H.J. Lu [Tue, 14 Jul 2015 15:17:27 +0000 (08:17 -0700)]
Sync toplevel configure with GCC
Sync with GCC
2015-05-16 James Bowman <james.bowman@ftdichip.com>
* configure.ac: FT32 target added.
* configure: Regenerate.
H.J. Lu [Tue, 14 Jul 2015 14:49:50 +0000 (07:49 -0700)]
Sync toplevel configure.ac with GCC
Sync with GCC
2015-06-02 Jason Merrill <jason@redhat.com>
PR bootstrap/66319
* configure.ac: Use -std=gnu++98.
2015-05-28 Mike Frysinger <vapier@gentoo.org>
* configure.ac (--vtable-verify): Use AS_HELP_STRING for help.
* configure: Regenerate.
2015-05-11 Paulo Matos <paulo@matos-sorge.com>
* configure.ac: Fix typo.
* configure: Regenerate.
2015-05-03 Matthias Klose <doko@ubuntu.com>
* configure.ac: Match $host configured with triplets.
* configure: Regenerate.
2015-04-17 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/62077
* configure.ac (--enable-stage1-checking): Default to
release,misc,gimple,rtlflag,tree,types if --disable-checking
or --enable-checking is not specified and DEV-PHASE is not
experimental.
* configure: Regenerated.
2015-03-27 Uros Bizjak <ubizjak@gmail.com>
Install back PR target/47230 fix (Revert the revert).
config/
Sync with GCC
* mh-alpha-linux: Restored.
Nick Clifton [Tue, 14 Jul 2015 11:06:33 +0000 (12:06 +0100)]
Remove extraneous whitespace from ARM sim sources.
* armcopro.c: Remove extraneous whitespace.
* armdefs.h: Likewise.
* armfpe.h: Likewise.
* arminit.c: Likewise.
* armopts.h: Likewise.
* armos.c: Likewise.
* armos.h: Likewise.
* armrdi.c: Likewise.
* armsupp.c: Likewise.
* armvirt.c: Likewise.
* bag.c: Likewise.
* bag.h: Likewise.
* communicate.c: Likewise.
* communicate.h: Likewise.
* dbg_conf.h: Likewise.
* dbg_cp.h: Likewise.
* dbg_hif.h: Likewise.
* dbg_rdi.h: Likewise.
* gdbhost.c: Likewise.
* gdbhost.h: Likewise.
* iwmmxt.c: Likewise.
* iwmmxt.h: Likewise.
* kid.c: Likewise.
* main.c: Likewise.
* maverick.c: Likewise.
* parent.c: Likewise.
* thumbemu.c: Likewise.
* wrapper.c: Likewise.
Nick Clifton [Tue, 14 Jul 2015 10:31:42 +0000 (11:31 +0100)]
Fix texinfo problem by adding the required period after an @xref.
* ld.texinfo (Options): Add missing period after @xref.
Pedro Alves [Wed, 11 Mar 2015 15:20:31 +0000 (15:20 +0000)]
Add test that exercises the inferior being killed while stopped under GDB
This exercises the case of the inferior disappearing while GDB is
debugging it, such as something doing "kill -9 PID" while the program
is stopped under GDB or GDBserver. This triggered a set of internal
errors, fixed by previous patches.
gdb/testsuite/ChangeLog:
2015-07-14 Pedro Alves <palves@redhat.com>
* gdb.base/killed-outside.exp: New file.
* gdb.base/killed-outside.c: New file.
Pedro Alves [Tue, 14 Jul 2015 09:10:50 +0000 (10:10 +0100)]
gdbserver/Linux: internal error when killing a process that is already gone
If the process disappears (e.g., killed with "kill -9" from the shell)
while it was stopped under GDBserver's control, and the GDBserver
tries to kill it, GDBserver asserts:
(gdb) shell kill -9 23084
(gdb) kill
...
Killing process(es): 23084
/home/pedro/gdb/mygit/src/gdb/gdbserver/linux-low.c:972: A problem internal to GDBserver has been detected.
kill_wait_lwp: Assertion `res > 0' failed.
...
gdb/gdbserver/ChangeLog:
2015-07-14 Pedro Alves <palves@redhat.com>
* linux-low.c (kill_wait_lwp): Don't assert if waitpid fails.
Instead, ignore ECHILD, and throw an error for other errnos.
GDB Administrator [Tue, 14 Jul 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Yao Qi [Mon, 13 Jul 2015 16:14:13 +0000 (17:14 +0100)]
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.
Andrew Burgess [Fri, 10 Jul 2015 13:06:28 +0000 (14:06 +0100)]
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.
GDB Administrator [Mon, 13 Jul 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
H.J. Lu [Sun, 12 Jul 2015 17:56:41 +0000 (10:56 -0700)]
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.
H.J. Lu [Sun, 12 Jul 2015 17:50:25 +0000 (10:50 -0700)]
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.
Sandra Loosemore [Sun, 12 Jul 2015 14:13:12 +0000 (07:13 -0700)]
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.
GDB Administrator [Sun, 12 Jul 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
GDB Administrator [Sat, 11 Jul 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
H.J. Lu [Fri, 10 Jul 2015 21:20:20 +0000 (14:20 -0700)]
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.
Kevin Buettner [Thu, 9 Jul 2015 23:05:31 +0000 (16:05 -0700)]
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.
Pedro Alves [Fri, 10 Jul 2015 18:47:17 +0000 (19:47 +0100)]
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.
H.J. Lu [Fri, 10 Jul 2015 17:23:12 +0000 (10:23 -0700)]
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.
H.J. Lu [Fri, 10 Jul 2015 15:41:10 +0000 (08:41 -0700)]
Updated to accept .debug_* sections
* gas/i386/dw2-compress-1.d: Updated to accept .debug_* sections.
H.J. Lu [Fri, 10 Jul 2015 15:14:59 +0000 (08:14 -0700)]
Updated to accept .debug_* sections
* binutils-all/dw2-3.W: Updated to accept .debug_* sections.
Jan Kratochvil [Fri, 10 Jul 2015 13:04:51 +0000 (15:04 +0200)]
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".
Pierre Langlois [Thu, 2 Jul 2015 11:11:47 +0000 (12:11 +0100)]
[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.
Andrew Burgess [Mon, 6 Jul 2015 17:16:24 +0000 (18:16 +0100)]
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.
Andrew Burgess [Mon, 6 Jul 2015 16:50:28 +0000 (17:50 +0100)]
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.
Andrew Burgess [Mon, 6 Jul 2015 10:09:05 +0000 (11:09 +0100)]
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.
Alan Modra [Wed, 8 Jul 2015 12:48:34 +0000 (22:18 +0930)]
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.
Alan Modra [Fri, 10 Jul 2015 10:36:25 +0000 (20:06 +0930)]
Add missing changelog entries
Andreas Arnez [Fri, 10 Jul 2015 08:36:02 +0000 (10:36 +0200)]
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.
Markus Metzger [Mon, 6 Jul 2015 14:36:45 +0000 (16:36 +0200)]
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.
Han Shen [Thu, 9 Jul 2015 22:55:55 +0000 (15:55 -0700)]
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'.
GDB Administrator [Fri, 10 Jul 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Han Shen [Thu, 9 Jul 2015 22:38:12 +0000 (15:38 -0700)]
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.
Pierre Langlois [Thu, 9 Jul 2015 15:35:11 +0000 (16:35 +0100)]
Add NEWS entry for tracepoints support on aarch64-linux
gdb/ChangeLog:
* NEWS: Mention support for tracepoints on aarch64-linux.
Pierre Langlois [Thu, 9 Jul 2015 15:35:11 +0000 (16:35 +0100)]
[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.
Pierre Langlois [Thu, 9 Jul 2015 15:35:11 +0000 (16:35 +0100)]
[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.
Pierre Langlois [Thu, 9 Jul 2015 15:35:11 +0000 (16:35 +0100)]
[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.
Pierre Langlois [Thu, 9 Jul 2015 15:35:11 +0000 (16:35 +0100)]
[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.
Pierre Langlois [Thu, 9 Jul 2015 15:35:11 +0000 (16:35 +0100)]
[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.
Pierre Langlois [Thu, 9 Jul 2015 15:35:11 +0000 (16:35 +0100)]
[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.
Pierre Langlois [Thu, 9 Jul 2015 15:35:10 +0000 (16:35 +0100)]
[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.
Pierre Langlois [Thu, 9 Jul 2015 15:35:10 +0000 (16:35 +0100)]
[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.
Catherine Moore [Thu, 9 Jul 2015 15:24:54 +0000 (08:24 -0700)]
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.
Simon Marchi [Thu, 9 Jul 2015 15:19:25 +0000 (11:19 -0400)]
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.
Simon Marchi [Thu, 9 Jul 2015 15:18:59 +0000 (11:18 -0400)]
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.
Simon Marchi [Thu, 9 Jul 2015 15:18:39 +0000 (11:18 -0400)]
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.
Simon Marchi [Thu, 9 Jul 2015 15:18:12 +0000 (11:18 -0400)]
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.
Simon Marchi [Thu, 9 Jul 2015 15:17:20 +0000 (11:17 -0400)]
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.
Simon Marchi [Thu, 9 Jul 2015 15:16:22 +0000 (11:16 -0400)]
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.
Simon Marchi [Thu, 9 Jul 2015 15:15:40 +0000 (11:15 -0400)]
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.
Catherine Moore [Thu, 9 Jul 2015 15:07:47 +0000 (08:07 -0700)]
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.
Yao Qi [Thu, 9 Jul 2015 11:55:45 +0000 (12:55 +0100)]
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.
Yao Qi [Thu, 9 Jul 2015 11:47:06 +0000 (12:47 +0100)]
[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.
Markus Metzger [Thu, 2 Jul 2015 13:16:09 +0000 (15:16 +0200)]
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.
Markus Metzger [Tue, 7 Jul 2015 11:54:34 +0000 (13:54 +0200)]
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.
GDB Administrator [Thu, 9 Jul 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in
Simon Marchi [Wed, 8 Jul 2015 19:48:02 +0000 (15:48 -0400)]
Add missing spaces in previous patch
gdb/ChangeLog:
* progspace.c (delete_program_space): Add missing spaces.
Simon Marchi [Wed, 8 Jul 2015 19:41:01 +0000 (15:41 -0400)]
Delete program spaces directly when removing inferiors
When deleting an inferior, delete the associated program space as well
if it becomes unused. This replaces the "pruning" approach, with which
you could forget to call prune_program_spaces (as seen, with the
-remove-inferior command, see [1]).
This allows to remove the prune_program_spaces function. At the same
time, I was able to clean up the delete_inferior* family:
- delete_inferior is unused
- delete_inferior_silent is only used in monitor_close, but is replaced
with discard_all_inferiors [2], so it becomes unused
- All remaining calls to delete_inferior_1 are with silent=1, so the
parameter is removed
- delete_inferior_1 is renamed to delete_inferior
I renamed pspace_empty_p to program_space_empty_p. I prefer if the
"exported" functions have a more explicit and standard name.
Tested on Ubuntu 14.10.
[1] https://sourceware.org/ml/gdb-patches/2014-09/msg00717.html
[2] See https://sourceware.org/ml/gdb-patches/2015-07/msg00228.html and
follow-ups for details.
gdb/Changelog:
* inferior.c (delete_inferior_1): Rename to ...
(delete_inferior): ..., remove 'silent' parameter, delete
program space when unused and remove call to prune_program_spaces.
Remove the old, unused, delete_inferior.
(delete_inferior_silent): Remove.
(prune_inferiors): Change call from delete_inferior_1 to
delete_inferior and remove 'silent' parameter. Remove call to
prune_program_spaces.
(remove_inferior_command): Idem.
* inferior.h (delete_inferior_1): Rename to...
(delete_inferior): ..., remove 'silent' parameter and remove the
original delete_inferior.
(delete_inferior_silent): Remove.
* mi/mi-main.c (mi_cmd_remove_inferior): Change call from
delete_inferior_1 to delete_inferior and remove 'silent'
parameter.
* progspace.c (prune_program_spaces): Remove.
(pspace_empty_p): Rename to...
(program_space_empty_p): ... and make non-static.
(delete_program_space): New.
* progspace.h (prune_program_spaces): Remove declaration.
(program_space_empty_p): New declaration.
(delete_program_space): New declaration.
* monitor.c (monitor_close): Replace call to
delete_thread_silent and delete_inferior_silent with
discard_all_inferiors.
Richard Sandiford [Wed, 8 Jul 2015 19:11:03 +0000 (20:11 +0100)]
Clarify case requirements for gas pseudo-ops
gas/
2015-07-08 Ciro Santilli <ciro.santilli@gmail.com>
* doc/as.texinfo: Clarify case requirements for pseudo ops.
Patrick Palka [Thu, 2 Jul 2015 16:27:50 +0000 (12:27 -0400)]
tui: replace deprecated_register_changed_hook with observer
This is a straightforward replacement of the TUI's use of the
aforementioned hook with the register_changed observer. Since this was
the only user of the hook, this patch also removes the hook.
gdb/ChangeLog:
* defs.h (deprecated_register_changed_hook): Remove prototype.
* interps.c (clear_iterpreter_hooks): Remove reference to
deprecated_register_changed_hook.
* top.c (deprecated_register_changed_hook): Remove prototype.
* valops.c (value_assign): Remove reference to
deprecated_register_changed_hook.
* tui/tui-hooks.c (tui_register_changed): Add parameter "frame".
Add comment documenting the function.
(tui_register_changed_observer): Define.
(tui_install_hooks): Remove reference to
deprecated_register_changed_hook. Set
tui_register_changed_observer.
(tui_remove_hooks): Remove reference to
deprecated_register_changed_hook. Unset
tui_register_changed_observer.
Denis Chertykov [Wed, 8 Jul 2015 18:35:19 +0000 (21:35 +0300)]
Define DIFF_EXPR_OK for avr target to allow PC relative difference relocation.
When generating relocation (tc_gen_reloc) 32 bit relocation fixup
is changed to new 32 bit PC relative relocation if the fixup has pc-relative
flag set.
bfd/ChangeLog
2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* elf32-avr.c: Add 32 bit PC relative relocation for AVR target.
gas/ChangeLog
2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* config/tc-avr.c (tc_gen_reloc): Change 32 bit relocation to
32 bit PC relative and update offset if the fixup is pc-relative.
* config/tc-avr.h (DIFF_EXPR_OK): Define to enable PC relative diff
relocs.
gas/testsuite/ChangeLog
2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* gas/avr/pc-relative-reloc.d: New test for 32 bit pc relative reloc.
* gas/avr/per-function-debugline.s: New test source.
include/ChangeLog
2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* elf/avr.h: Add new 32 bit PC relative relocation.
ld/testsuite/ChangeLog
2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* ld-avr/gc-section-debugline.d: New test.
* ld-avr/per-function-debugline.s: Source for new test.
Andrew Burgess [Wed, 8 Jul 2015 14:02:32 +0000 (15:02 +0100)]
gdb/doc: Update 'frame' command documentation.
The documentation for the 'frame' command has gotten a little out of
date, it still mentions architecturally specific details that are no
longer relevant.
This commit removes the old details that no longer apply, and tries to
expand the existing text a little to make the usage clearer for some
cases.
gdb/doc/ChangeLog:
* gdb.texinfo (Selection): Update documentation for 'frame'
command.
Simon Marchi [Wed, 8 Jul 2015 15:40:35 +0000 (11:40 -0400)]
Revert "Delete program spaces directly when removing inferiors"
Reverted, since it causes a build failure. It turns out that
delete_inferior_silent wasn't actually unused.
This reverts commit
0560c645c02eba2828a053039dcfdf676cdd1d00.
Simon Marchi [Mon, 29 Sep 2014 20:33:10 +0000 (16:33 -0400)]
Delete program spaces directly when removing inferiors
When deleting an inferior, delete the associated program space as well
if it becomes unused. This replaces the "pruning" approach, with which
you could forget to call prune_program_spaces (as seen, with the
-remove-inferior command, see [1]).
This allows to remove the prune_program_spaces function. At the same
time, I was able to clean up the delete_inferior* family.
delete_inferior_silent and delete_inferior were unused, which allowed
renaming delete_inferior_1 to delete_inferior. Also, since all calls to
it were with silent=1, I removed that parameter completely.
I renamed pspace_empty_p to program_space_empty_p. I prefer if the
"exported" functions have a more explicit and standard name.
Tested on Ubuntu 14.10.
This obsoletes my previous patch "Add call to prune_program_spaces in
mi_cmd_remove_inferior" [1].
[1] https://sourceware.org/ml/gdb-patches/2014-09/msg00717.html
gdb/Changelog:
* inferior.c (delete_inferior_1): Rename to ...
(delete_inferior): ..., remove 'silent' parameter, delete
program space when unused and remove call to prune_program_spaces.
Remove the old, unused, delete_inferior.
(delete_inferior_silent): Remove.
(prune_inferiors): Change call from delete_inferior_1 to
delete_inferior and remove 'silent' parameter. Remove call to
prune_program_spaces.
(remove_inferior_command): Idem.
* inferior.h (delete_inferior_1): Rename to...
(delete_inferior): ..., remove 'silent' parameter and remove the
original delete_inferior.
(delete_inferior_silent): Remove.
* mi/mi-main.c (mi_cmd_remove_inferior): Change call from
delete_inferior_1 to delete_inferior and remove 'silent'
parameter.
* progspace.c (prune_program_spaces): Remove.
(pspace_empty_p): Rename to...
(program_space_empty_p): ... and make non-static.
(delete_program_space): New.
* progspace.h (prune_program_spaces): Remove declaration.
(program_space_empty_p): New declaration.
(delete_program_space): New declaration.
Jan Kratochvil [Wed, 8 Jul 2015 12:42:19 +0000 (14:42 +0200)]
compile: Warn for old GCC on cv-qualified self-reference
GDB could:
compile code struct_object.selffield = &struct_object
./compile/compile-c-types.c:83: internal-error: insert_type: Assertion `add == NULL || add->gcc_type == gcc_type' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) FAIL: gdb.compile/compile.exp: compile code struct_object.selffield = &struct_object (GDB internal
error)
The bug was not in GDB but in the GCC part interfacing with GDB.
Alexandre Oliva has fixed it the right way:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;a=commitdiff;h=
072dfdba0ea62abb65514cb3a90cdf3868efe286
git://gcc.gnu.org/git/gcc.git
aoliva/libcp1
Attaching this GDB testsuite update + info to user s/he should upgrade GCC.
After Alex upstreams the fix I can update the message to contain the specific
GCC release.
gdb/ChangeLog
2015-07-08 Jan Kratochvil <jan.kratochvil@redhat.com>
PR compile/18484
* compile/compile-c-types.c (insert_type): Change gdb_assert to error.
gdb/testsuite/ChangeLog
2015-07-08 Jan Kratochvil <jan.kratochvil@redhat.com>
PR compile/18484
* gdb.compile/compile.c (struct struct_type): Add volatile to
selffield's type.
* gdb.compile/compile.exp
(compile code struct_object.selffield = &struct_object): Skip further
struct_object tests if this one xfails.
Robert O'Callahan [Wed, 8 Jul 2015 09:53:36 +0000 (10:53 +0100)]
PR18617 - Incorrect expression bytecode generated for narrowing conversions
The existing code preserves 'from' bits, which is incorrect. E.g.
(gdb) maint agent-eval (char)255L
Scope: 0x4008d6
Reg mask: 00
0 const16 255
3 ext 64
5 end
'ext 64' should be 'ext 8'; this bytecode evaluates to 255 instead of
the correct result of -1. The fix is simple. I ran the entire test
suite on x86-64 and there were no new test failures.
gdb/ChangeLog:
2015-07-08 Robert O'Callahan <robert@ocallahan.org>
PR exp/18617
* ax-gdb.c (gen_conversion): Extend to 'to' bits, not 'from'.
gdb/testsuite/ChangeLog:
2015-07-08 Robert O'Callahan <robert@ocallahan.org>
PR exp/18617
* gdb.trace/ax.exp: Add test.
Markus Metzger [Mon, 6 Jul 2015 13:40:45 +0000 (15:40 +0200)]
add myself to write-after-approval list
gdb/
* MAINTAINERS (Write After Approval): Add Markus T. Metzger.
Markus Metzger [Mon, 6 Jul 2015 13:21:37 +0000 (15:21 +0200)]
ari: fix strerror() use
Do not use strerror(), instead use safe_strerror().
gdb/
* nat/linux-btrace.c (kernel_supports_bts, kernel_supports_pt):
Use safe_strerror() instead of strerror().
GDB Administrator [Wed, 8 Jul 2015 00:00:07 +0000 (00:00 +0000)]
Automatic date update in version.in
Han Shen [Mon, 6 Jul 2015 22:17:25 +0000 (15:17 -0700)]
Make gold aarch64 accept long form of mapping symbols.
2015-07-07 Han Shen <shenhan@google.com>
gold/ChangeLog:
2015-07-06 Han Shen <shenhan@google.com>
* aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
of mapping symbols.
Yao Qi [Tue, 7 Jul 2015 15:58:20 +0000 (16:58 +0100)]
New proc is_aarch64_target
Some tests expect the the target is aarch64, but checking target
triplet is not accurate, because target triplet can be aarch64 but
the program is in arm (or aarch32) state.
This patch addes a new proc is_aarch64_target which returns true
if the target is on aarch64 state.
gdb/testsuite:
2015-07-07 Yao Qi <yao.qi@linaro.org>
* gdb.arch/aarch64-atomic-inst.exp: Check is_aarch64_target
instead of istarget "aarch64*-*-*".
* gdb.arch/aarch64-fp.exp: Likewise.
* gdb.base/float.exp: Likewise.
* gdb.reverse/aarch64.exp: Likewise.
* lib/gdb.exp (is_aarch64_target): New proc.
Yao Qi [Tue, 7 Jul 2015 15:58:19 +0000 (16:58 +0100)]
New proc is_aarch32_target
GDB tests running on arm target should be also run on aarch32
(32-bit mode on aarch64). There should be no difference. It is not
precise to check target triplet to decide which tests should be run,
because if I compiler all the test binary in 32-bit (arm program),
but target triplet is still aarch64, so that these arm specific tests
are skipped.
This patch is to add a new proc is_aarch32_target which return true
if target triplet is arm or the test binary is compiled for arm.
gdb/testsuite:
2015-07-07 Yao Qi <yao.qi@linaro.org>
* lib/gdb.exp (is_aarch32_target): New proc.
* gdb.arch/arm-bl-branch-dest.exp: Check is_aarch32_target
instead of "istarget "arm*-*-*"".
* gdb.arch/arm-disp-step.exp: Likewise.
* gdb.arch/thumb-bx-pc.exp: Likewise.
* gdb.arch/thumb-prologue.exp: Likewise.
* gdb.arch/thumb-singlestep.exp: Likewise.
* gdb.base/disp-step-syscall.exp: Likewise.
* gdb.base/float.exp: Likewise.
Yao Qi [Tue, 7 Jul 2015 15:58:19 +0000 (16:58 +0100)]
Enable multi-arch test in catch-syscall.exp on aarch64
This patch is to enable test_catch_syscall_multi_arch on aarch64.
gdb/testsuite:
2015-07-07 Yao Qi <yao.qi@linaro.org>
* gdb.base/catch-syscall.exp (test_catch_syscall_multi_arch):
Set arch1, arch2, syscall1_name, syscall2_name and syscall_number.
Yao Qi [Tue, 7 Jul 2015 15:58:19 +0000 (16:58 +0100)]
Adjust gdb.multi tests for aarch64
Multi-arch related tests under gdb.multi are to compile programs with
the same compiler but different compiler options (-m64 vs -m32). However,
different compilers are needed to compile both aarch64 program and
arm (aarch32) program. This patch is to adjust these test cases to
compile programs in different modes with different compiler.
When we use gcc for arm-linux target, its file name can be different,
arm-linux-gnueabihf-gcc, arm-linux-gnueabi-gcc, or arm-none-linux-gnueabi-gcc,
so I add a variable ARM_CC_FOR_TARGET, so that user can set the name
of gcc for arm-linux target on aarch64, like:
$ make check RUNTESTFLAGS='ARM_CC_FOR_TARGET=arm-linux-gnueabihf-gcc multi-arch.exp'
gdb/testsuite:
2015-07-07 Yao Qi <yao.qi@linaro.org>
* gdb.multi/multi-arch-exec.exp: Set march1 and march2 to "" if target
is aarch64. If target is aarch64, set compiler=${ARM_CC_FOR_TARGET}
if it exists.
* gdb.multi/multi-arch.exp: Likewise.
Yao Qi [Tue, 7 Jul 2015 15:58:19 +0000 (16:58 +0100)]
Set architecture to arm in arm-*.xml files
This patch is to add the following line to various arm target description
xml files,
<architecture>arm</architecture>
in order to fix problems I've seen on aarch64 multi-arch debugging,
detach^M
Detaching from program: build-gdb/gdb/testsuite/gdb.base/attach, process 17145^M
(gdb) PASS: gdb.base/attach.exp: attach1 detach file^M
No executable file now.^M
Architecture of file not recognized.^M
(gdb) FAIL: gdb.base/attach.exp: attach1, purging symbols after detach
Without this patch, struct target_desc *tdesc_* are not initialised
properly, that is, fields arch and osabi in 'struct target_desc' are
not set properly. This doesn't cause any problems on single arch
debugging, because arch-utils.c:gdbarch_info_fill will guess correctly.
However, in multi-arch debugging, gdbarch_info_fill gets the aarch64
arch, but the target description is for arm (because the current
inferior is 32-bit arm).
It is a surprise to me we didn't set architecture to "arm" before in *.xml
files, and I didn't find out why didn't do so. AFAICS,
gdb/features/arm-with-iwmmxt.xml was added firstly (in patch
https://sourceware.org/ml/gdb-patches/2007-01/msg00593.html)
which had <architecture>iwmmxt</architecture>, however, afterwards,
architecture isn't set anymore in features/arm-*.xml files (in patches
https://sourceware.org/ml/gdb-patches/2009-07/msg00689.html and
https://sourceware.org/ml/gdb-patches/2010-08/msg00225.html).
gdb:
2015-07-07 Yao Qi <yao.qi@linaro.org>
* features/arm-with-m-fpa-layout.xml: Set architecture to arm.
* features/arm-with-m-fpa-layout.c: Regenerated.
* features/arm-with-m-vfp-d16.xml: Likewise.
* features/arm-with-m-vfp-d16.c: Regenerated.
* features/arm-with-m.xml: Likewise.
* features/arm-with-m.c: Regenerated.
* features/arm-with-neon.xml: Likewise.
* features/arm-with-neon.c: Regenerated.
* features/arm-with-vfpv2.xml: Likewise.
* features/arm-with-vfpv2.c: Regenerated.
* features/arm-with-vfpv3.xml: Likewise.
* features/arm-with-vfpv3.c: Regenerated.
Yao Qi [Tue, 7 Jul 2015 15:58:19 +0000 (16:58 +0100)]
Native debug arm program by aarch64 GDB
This patch is to let aarch64 GDB debug 32-bit arm program natively. In
each function for fetching and storing registers, GDB will check
gdbarch_bfd_arch_info (gdbarch)->bits_per_word, if it is 32, call
the corresponding aarch32 functions in aarch32-linux-nat.c, otherwise
fall back to aarch64 code to fetch and store registers.
aarch64_linux_read_description has to return the right target description,
but we don't have gdbarch available there, so GDB fetches auxv and gets
AT_PHENT, in order to determine whether the target is 32-bit or 64-bit.
I learned this trick from solib-svr4.c.
gdb:
2015-07-07 Yao Qi <yao.qi@linaro.org>
* aarch32-linux-nat.h (VFP_REGS_SIZE): New macro, moved from
arm-linux-nat.c.
* aarch64-linux-nat.c: Include aarch32-linux-nat.h and
elf/external.h.
(fetch_gregs_from_thread): Call aarch32_gp_regcache_supply
if target is 32-bit.
(store_gregs_to_thread): Call aarch32_gp_regcache_collect
if target is 32-bit.
(fetch_fpregs_from_thread): Call aarch32_vfp_regcache_supply
if target is 32-bit.
(store_fpregs_to_thread): Call aarch32_vfp_regcache_collect
if target is 32-bit.
(tdesc_arm_with_vfpv3, tdesc_arm_with_neon): Declare.
(aarch64_linux_read_description): Return the right target
description.
* arm-linux-nat.c (VFP_REGS_SIZE): Moved to aarch32-linux-nat.h.
* config/aarch64/linux.mh (NATDEPFILES): Add aarch32-linux-nat.o.
* configure.tgt (aarch64*-*-linux*): Add arm-tdep.o and
arm-linux-tdep.o
Yao Qi [Tue, 7 Jul 2015 15:58:19 +0000 (16:58 +0100)]
New aarch32-linux-nat.c
This patch is to move all the code about transferring
regcache <-> byte buffer for arm (aarch32) to a separate file
aarch32-linux-nat.c. Then, in the following patch, aarch64 code
can use it to do multi-arch debugging. This is a refactory patch.
gdb:
2015-07-07 Yao Qi <yao.qi@linaro.org>
* aarch32-linux-nat.c: New file.
* aarch32-linux-nat.h: New file.
* arm-linux-nat.c: Include aarch32-linux-nat.h.
(fetch_regs): Move code to aarch32-linux-nat.c. Call
aarch32_gp_regcache_supply.
(store_regs): Move code to aarch32-linux-nat.c. Call
aarch32_gp_regcache_collect.
(fetch_vfp_regs): Move code to aarch32-linux-nat.c. Call
aarch32_vfp_regcache_supply.
(store_vfp_regs): Move code to aarch32-linux-nat.c. Call
aarch32_vfp_regcache_collect.
* config/arm/linux.mh (NATDEPFILES): Add aarch32-linux-nat.o.
Yao Qi [Tue, 7 Jul 2015 15:58:19 +0000 (16:58 +0100)]
Remove {fetch,store}_fpregister and {fetch,store}_register
This patch is to remove fetch_fpregister, fech_register,
store_fpregister and store_register, and use fetch_fpregs,
fetch_regs, store_regs, and store_fpregs instead.
gdb:
2015-07-07 Yao Qi <yao.qi@linaro.org>
* arm-linux-nat.c (store_fpregister): Remove.
(store_register): Likewise.
(fetch_fpregister): Likewise.
(fetch_register): Likewise.
(arm_linux_store_inferior_registers): Call store_regs and
store_fpregs instead.
(arm_linux_fetch_inferior_registers): Call fetch_fpregs and
fetch_regs instead.
Simon Marchi [Tue, 7 Jul 2015 15:39:06 +0000 (11:39 -0400)]
Fix test for Python 3
gdb/testsuite/ChangeLog:
* gdb.python/py-lazy-string.exp: Add missing parentheses to
print.
Yao Qi [Tue, 7 Jul 2015 09:37:28 +0000 (10:37 +0100)]
[arm] Fix regression by Do not skip prologue for asm (.S) files
Patch "Do not skip prologue for asm (.S) files" [1] changes GDB's
behaviour on which test gdb.arch/thumb-singlestep.exp depends, so
it causes the fail below:
(gdb) si^M
37 blx foo^M
(gdb) FAIL: gdb.arch/thumb-singlestep.exp: step into foo
the test assumes the program will stop at the instruction after "push"
but it doesn't. The fix to this fail is to do one more single step.
[1] https://sourceware.org/ml/gdb-patches/2015-06/msg00561.html
gdb/testsuite:
2015-07-07 Yao Qi <yao.qi@linaro.org>
* gdb.arch/thumb-singlestep.exp: Do one more single step.
GDB Administrator [Tue, 7 Jul 2015 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in
Doug Kwan [Mon, 6 Jul 2015 22:02:40 +0000 (15:02 -0700)]
Align text section ends so that stub tables appears at expected addresses.
Andrew Burgess [Mon, 6 Jul 2015 10:33:31 +0000 (11:33 +0100)]
gdb: Rewrite documentation for layout and focus commands.
Changes the documentation for the layout and focus commands.
Instead of documenting each layout (or focus) sub-command as a separate
command, document a single layout (and focus) command which takes a
parameter, then list the possible parameters in a table nested under
each command.
The documentation for the layout command has been extended little to
make it clearer which windows are shown in each layout.
gdb/ChangeLog:
* doc/gdb.texinfo (TUI): Restructure documentation on TUI layout
and focus commands.
Joel Brobecker [Mon, 6 Jul 2015 20:02:47 +0000 (13:02 -0700)]
Update NEWS post GDB 7.10 branch creation.
gdb/ChangeLog:
* NEWS: Create a new section for the next release branch.
Rename the section of the current branch, now that it has
been cut.
Joel Brobecker [Mon, 6 Jul 2015 19:58:29 +0000 (12:58 -0700)]
Bump version to 7.10.50.DATE-cvs.
Now that the GDB 7.10 branch has been created, we can
bump the version number.
gdb/ChangeLog:
GDB 7.10 branch created (
66c4b3e8a628a207bc6aafef6af0c4128195f56e):
* version.in: Bump version to 7.10.50.DATE-cvs.
Luis Machado [Mon, 6 Jul 2015 19:09:21 +0000 (16:09 -0300)]
Fix problems with finishing a dummy function call on simulators.
This fixes regressions introduced with the original change to not
consider permanent breakpoints always inserted:
6ae8866180bf90e9ec76c2dd34c07fd826d11a83 is the first bad commit
commit
6ae8866180bf90e9ec76c2dd34c07fd826d11a83
Author: Luis Machado <lgustavo@codesourcery.com>
Date: Wed Jun 17 16:50:57 2015 -0300
Fix problems with finishing a dummy function call on simulators.
Some checks were mistakenly left out of the original patch, which
caused the following failures:
-PASS: gdb.base/shlib-call.exp: print mainshr1(1)
-PASS: gdb.base/shlib-call.exp: step into mainshr1
+FAIL: gdb.base/shlib-call.exp: print mainshr1(1)
+FAIL: gdb.base/shlib-call.exp: step into mainshr1
-PASS: gdb.cp/chained-calls.exp: q(p())
+FAIL: gdb.cp/chained-calls.exp: q(p())
-PASS: gdb.cp/chained-calls.exp: q(p() + r())
+FAIL: gdb.cp/chained-calls.exp: q(p() + r())
-PASS: gdb.cp/chained-calls.exp: g(f(g(f() + f())) + f())
+FAIL: gdb.cp/chained-calls.exp: g(f(g(f() + f())) + f())
-PASS: gdb.cp/chained-calls.exp: *c
-PASS: gdb.cp/chained-calls.exp: *c + *c
-PASS: gdb.cp/chained-calls.exp: q(*c + *c)
+FAIL: gdb.cp/chained-calls.exp: *c
+FAIL: gdb.cp/chained-calls.exp: *c + *c
+FAIL: gdb.cp/chained-calls.exp: q(*c + *c)
-PASS: gdb.cp/classes.exp: calling method for small class
+FAIL: gdb.cp/classes.exp: calling method for small class
The above is likely caused by GDB not removing the permanent
breakpoints from the target, leading to the inferior executing
the breakpoint instruction and tripping on a SIGSEGV.
gdb/ChangeLog:
2015-07-06 Luis Machado <lgustavo@codesourcery.com>
* breakpoint.c (remove_breakpoint_1): Don't handle permanent
breakpoints in a special way.
(remove_breakpoint): Likewise.
(mark_breakpoints_out): Likewise.
H.J. Lu [Mon, 6 Jul 2015 19:00:45 +0000 (12:00 -0700)]
Remove the merge conflict introduced by
commit
2f0c68f23bb3132cd5ac466ca8775c0d9e4960cd
Author: Catherine Moore <clm@codesourcery.com>
Date: Thu May 28 14:50:36 2015 -0700
Compact EH Support
Andrew Burgess [Mon, 6 Jul 2015 10:37:24 +0000 (11:37 +0100)]
gdb/doc: Fix incorrect use of @xref.
All uses of @xref must be followed by either '.' or ','. In commit
a4ea0946c an incorrect use of @xref was introduced. This commit
adds a comma after the use of @xref.
gdb/ChangeLog:
* doc/gdb.texinfo (TUI): Add comma after @xref.
Andrew Burgess [Mon, 6 Jul 2015 15:56:42 +0000 (16:56 +0100)]
gdb/tui: Don't cast between window types.
Instead of casting between structure types to get the 'tui_gen_win_info'
info from a 'tui_win_info' access the generic member variable. This is
inline with what is done throughout the rest of the tui code.
gdb/ChangeLog:
* tui/tui-win.c (tui_set_focus): Use structure member 'generic'
instead of casting the structure type.
Simon Marchi [Mon, 6 Jul 2015 17:10:56 +0000 (13:10 -0400)]
search_struct_field: remove OFFSET parameter
I was trying to understand what the OFFSET parameter was for, and
realized it was set to 0 in every call to search_struct_field. I
assume that it was used at some point, but some subsequent changes
made it useless.
gdb/ChangeLog:
* valops.c (search_struct_field): Remove OFFSET parameter.
(value_cast_structs): Adjust calls to search_struct_field.
(value_struct_elt): Same.
(find_overload_match): Same.
Simon Marchi [Mon, 6 Jul 2015 17:04:11 +0000 (13:04 -0400)]
Cleanup value_fetch_lazy's comment and return value
The comment for value_fetch_lazy seems outdated. It says that it's only
called from the value_contents and value_contents_all (macros!), which
is not true. Also, the return value seems useless now, despite what the
comment says.
gdb/ChangeLog:
* value.c (value_fetch_lazy): Update comment, change return
value to void.
* value.h (value_fetch_lazy): Change return value to void.
Andrew Burgess [Mon, 6 Jul 2015 14:32:11 +0000 (15:32 +0100)]
gdb: tui_win_name: Make parameter and result const.
This commit makes the parameter and the result for 'tui_win_name'
constant. There's one place in the code that is then updated as a
result of this change.
gdb/ChangeLog:
* tui/tui-data.c (tui_partial_win_by_name): Window name is const.
(tui_win_name): Make parameter and result const.
* tui/tui-data.h (tui_win_name): Make parameter and result const.
Patrick Palka [Thu, 2 Jul 2015 15:55:01 +0000 (11:55 -0400)]
Don't throw an error in "show mpx bound" implementation
"show" functions should not throw an exception in part because it causes
the output of the commands "info set" and "show" to get truncated.
This fixes the following fails:
FAIL: gdb.base/default.exp: info set
FAIL: gdb.base/default.exp: show
gdb/ChangeLog:
* i386-tdep.c (i386_mpx_info_bounds): Don't call error, instead
use printf_unfiltered.
(set_mpx_cmd): Add missing trailing space to command string
literal.
(_initialize_i386_tdep): Give the "mpx" prefix command its
correct name.