Commit Graph

93656 Commits

Author SHA1 Message Date
Andreas Arnez f69c5afb18 S390: Correct brace style in s390_get_wordsize
This corrects bad formatting in the newly introduced function
s390_get_wordsize.

gdb/gdbserver/ChangeLog:

	* linux-s390-low.c (s390_get_wordsize): Correct brace style.
2018-03-22 10:02:18 +01:00
Jan Beulich 32546502f3 x86: use local variable in check_VecOperands()
This is just to make a subsequent change a little easier to read.
2018-03-22 08:47:16 +01:00
Jan Beulich b8c169f359 x86: drop pointless VecESize
The attribute is meaningful only in templates allowing embedded
broadcast. Drop them everywhere else.
2018-03-22 08:46:25 +01:00
Jan Beulich 96bc132a73 x86: drop remaining redundant DispN
A few of them were missed in commit 7ac2002247 ("x86: derive DispN
from BaseIndex") and also couldn't be removed by subsequent commits
touching certain templates anyway.
2018-03-22 08:34:24 +01:00
Jan Beulich 1212781b35 ix86: allow HLE store of accumulator to absolute address
Since they're shorter to encode, the 0xa0...0xa3 encodings are preferred
for moves between accumulator and absolute address outside of 64-bit
mode. With HLE release semantics this encoding is unsupported though,
with the assembler raising an error. The operation is valid though, we
merely need to pick the longer encoding in that case.
2018-03-22 08:33:38 +01:00
Jan Beulich 9f79e88693 x86: fix swapped operand handling for BNDMOV
The wrong placement of the Load attribute in the templates prevented
this from working. The disassembler also didn't handle this consistently
with other similar dual-encoding insns.
2018-03-22 08:32:50 +01:00
Jan Beulich d6793fa1ac x86/Intel: fix fallout from earlier template folding
While many templates allowing multiple suitably matching XMM/YMM/ZMM
operand sizes can be folded, a few need to be split in order to not
wrongly accept "xmmword ptr" operands when only XMM registers are
permitted (and memory operands are more narrow). Add a test case
validating this.
2018-03-22 08:31:43 +01:00
Jan Beulich f776822506 x86: fold a few XOP templates
Also add a new test case verifying that mixed operands of SIMD insns
with a size-less memory operand in the middle are properly rejected.
2018-03-22 08:29:45 +01:00
Simon Marchi 5d9310c4b8 Get rid of VEC(static_tracepoint_marker_p)
This patch replaces VEC(static_tracepoint_marker_p) with std::vector,
and does some c++ification around that.  I thought a new overload of
hex2str was useful, so I added it as well as corresponding unit tests.
I also added an overload of ui_out::field_string that takes an
std::string directly.

gdb/ChangeLog:

	* tracepoint.h (struct static_tracepoint_marker): Initialize
	fields, define default constructor, move constructor and move
	assignment, disable the rest.
	<str_id, extra>: Make std::string.
	(release_static_tracepoint_marker): Remove.
	(free_current_marker): Remove.
	* tracepoint.c (free_current_marker): Remove.
	(parse_static_tracepoint_marker_definition): Adjust to
	std::string, use new hex2str overload.
	(release_static_tracepoint_marker): Remove.
	(print_one_static_tracepoint_marker): Get marker by reference
	and adjust to std::string.
	(info_static_tracepoint_markers_command): Adjust to std::vector
	changes
	* target.h (static_tracepoint_marker_p): Remove typedef.
	(DEF_VEC_P(static_tracepoint_marker_p)): Remove.
	(struct target_ops) <to_static_tracepoint_marker_at>: Return
	bool.
	<to_static_tracepoint_markers_by_strid>: Return std::vector.
	* target-debug.h
	(target_debug_print_VEC_static_tracepoint_marker_p_p): Remove.
	(target_debug_print_std_vector_static_tracepoint_marker): New.
	(target_debug_print_struct_static_tracepoint_marker_p): Rename
	to...
	(target_debug_print_static_tracepoint_marker_p): ... this.
	* target-delegates.c: Re-generate.
	* breakpoint.h (struct tracepoint) <static_trace_marker_id>:
	Make std::string.
	* breakpoint.c (init_breakpoint_sal): Adjust to std::string.
	(decode_static_tracepoint_spec): Adjust to std::vector.
	(tracepoint_print_one_detail): Adjust to std::string.
	(strace_marker_decode_location): Adjust to std::string.
	(update_static_tracepoint): Adjust to std::string, remove call
	to release_static_tracepoint_marker.
	* linux-nat.c (linux_child_static_tracepoint_markers_by_strid):
	Adjust to std::vector.
	* remote.c (remote_static_tracepoint_marker_at): Return bool.
	(remote_static_tracepoint_markers_by_strid): Adjust to
	std::vector.
	* common/rsp-low.h (hex2str): New overload with explicit count
	of bytes.
	* common/rsp-low.c (hex2str): New overload with explicit count
	of bytes.
	* unittests/rsp-low-selftests.c (test_hex2str): New function.
	(_initialize_rsp_low_selftests): Add test_hex2str test.
	* unittests/tracepoint-selftests.c
	(test_parse_static_tracepoint_marker_definition): Adjust to
	std::string.
2018-03-22 00:27:19 -04:00
Simon Marchi 62c222b6d9 Make parse_static_tracepoint_marker_definition work with multiple static tracepoint definitions
Since I modify the parse_static_tracepoint_marker_definition function in
the next patch, I wanted to write a unit test for it.  Doing so showed
that it doesn't handle multiple consecutive static tracepoint
definitions separated by commas.  However, the RSP documentation [1]
states that servers may return multiple definitions, like:

  1234:6d61726b657231:6578747261207374756666,abba:6d61726b657232:

The problem is that the function uses strlen to compute the length of
the last field (the extra field).  If there are additional definitions
in addition to the one we are currently parsing, the returned length
will include those definitions, and we'll try to hex-decode past the
extra field.

This patch changes parse_static_tracepoint_marker_definition to consider
the case where the current definition is followed by a comma and more
definitions.  It also adds the unit test that found the issue in the
first place.

I don't think this causes any backwards compatibility issues, because
the previous code only handled single static tracepoint definitions, and
the new code handles that correctly.

gdb/ChangeLog:

	* tracepoint.c (parse_static_tracepoint_marker_definition):
	Consider case where the definition is followed by more
	definitions.
	* Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
	tracepoint-selftests.c.
	* unittests/tracepoint-selftests.c: New.

[1] https://sourceware.org/gdb/onlinedocs/gdb/Tracepoint-Packets.html#qTfSTM
2018-03-22 00:26:39 -04:00
GDB Administrator 92c00f4228 Automatic date update in version.in 2018-03-22 00:00:35 +00:00
Pedro Franco de Carvalho 7eb2418fa4 Add myself as a write-after-approval GDB maintainer.
gdb/ChangeLog:

2018-03-21  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>

	* MAINTAINERS (Write After Approval): Add Pedro Franco de
	Carvalho.
2018-03-21 17:24:02 -03:00
H.J. Lu b1202ffa53 DT_FLAGS_1: Add Solaris bits
The following bits in DT_FLAGS_1 are used by Solaris:

 #define DF_1_KMOD       0x10000000 /* kernel module */
 #define DF_1_WEAKFILTER 0x20000000 /* apply weak binding to DT_FILTER */
 #define DF_1_NOCOMMON   0x40000000 /* no COMMON symbols exist */

binutils/

	* readelf.c (process_dynamic_section): Also dump DF_1_KMOD,
	DF_1_WEAKFILTER and DF_1_NOCOMMON.

include/

	* elf/common.h (DF_1_KMOD): New.
	(DF_1_WEAKFILTER): Likewise.
	(DF_1_NOCOMMON): Likewise.
2018-03-21 12:55:52 -07:00
Andreas Arnez ce29f8439f S390: Make IPA recognize tdescs with guarded storage
The in-process agent does not handle tdescs with guarded storage yet.
This is fixed.

gdb/gdbserver/ChangeLog:

	* linux-s390-ipa.c (get_ipa_tdesc): Add handling for
	S390_TDESC_GS.
	* linux-s390-low.c (s390_get_ipa_tdesc_idx): Likewise.
	(initialize_low_tracepoint): Call init_registers_s390x_gs_linux64
	and init_registers_s390_gs_linux64.
2018-03-21 17:41:45 +01:00
Andreas Arnez c49bd90bdb S390: gdbserver: Don't write guarded storage registers
On S390, the guarded storage register set is only valid if guarded storage
is active.  Reading/writing the register set yields errors if this is not
the case.  Then gdbserver emits warnings like these:

  Warning: ptrace(regsets_store_inferior_registers): No data available

Apart from confusing the user, this can also lead to test case failures
due to unexpected output.  To suppress this, make the guarded storage
regsets read-only for now.

gdb/gdbserver/ChangeLog:

	* linux-s390-low.c (s390_fill_gs): Remove function.
	(s390_fill_gsbc): Remove function.
	(s390_regsets): Set fill functions for the guarded storage regsets
	to NULL.
2018-03-21 17:41:45 +01:00
Andreas Arnez 7edb9bd32b S390: Enable re-attaching with native-extended-gdbserver
On s390x, when running attach.exp with native-extended-gdbserver,
gdbserver crashes in find_regno like this:

  .../regcache.c:252: A problem internal to GDBserver has been detected.
  Unknown register tdb0 requested

On the GDB side it looks like this:

  (gdb) attach 31568
  Attaching to process 31568
  Remote connection closed

The test case attempts to attach to a new process via the already running
gdbserver.  Thus s390_arch_setup is called a second time, and that's where
the problem occurs.  In order to determine the word width (32 or 64 bits),
s390_arch_setup reads the pswm register through the regcache.  For that it
uses a temporary tdesc which is supposed to work for all s390 targets,
since the actual tdesc has not been determined yet.  But in this second
round this doesn't work, because s390_regsets has been updated already and
now contains regsets not described by the temporary tdesc, such as the one
containing tdb0.

This is fixed by rearranging the logic in s390_arch_setup.

gdb/gdbserver/ChangeLog:

	* linux-s390-low.c (s390_get_hwcap): Replace tdesc parameter by
	the word size.  Add comment.
	(s390_get_wordsize): New function.
	(s390_arch_setup): No longer select a temporary tdesc to fetch the
	pswm with it.  Instead, use s390_get_wordsize to determine the
	word size first and derive the correct tdesc from that directly.
2018-03-21 17:41:44 +01:00
Alan Modra 0ccf57bd81 PowerPC64 synthetic symbols
STT_FILE and a bunch of other symbol types aren't proper symbols to
mark the start of a function's code.

	* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Trim uninteresting
	symbols.  Use size_t counts.  Delete redundant opd test.
2018-03-21 21:44:01 +10:30
Alan Modra 4bad6366a7 Delete unused elf32-ppc.c code
Local symbols were being read but not used.

	* elf32-ppc.c (ppc_elf_tls_optimize): Delete locsyms.
2018-03-21 21:43:38 +10:30
Alan Modra bac3c8c5e7 Make tls_mask unsigned in elf32-ppc.c
* elf32-ppc.c (struct ppc_elf_link_hash_entry): Make tls_mask
	field unsigned.
	(update_local_sym_info): Likewise for local_got_tls_masks.
	(ppc_elf_tls_optimize): Likewise for lgot_masks.
2018-03-21 21:43:13 +10:30
Alan Modra 6a3858a69e Correct multi-toc tprel relocs
Commit f15d0b545b trimmed some unnecessary TPREL relocs, but missed
changing another place where they are allocated.

	* elf64-ppc.c (ppc_size_one_stub): Fix comment typo.
	(ppc64_elf_layout_multitoc): Allocate relocs for tprel as we
	do in size_dynamic_sections.
2018-03-21 21:42:48 +10:30
Alan Modra 675e28092f Don't exceed reloc array bounds
* elf64-ppc.c (ppc64_elf_relocate_section): Don't access rel[1]
	without first checking array bounds.
	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2018-03-21 21:42:17 +10:30
GDB Administrator dca9fbc845 Automatic date update in version.in 2018-03-21 00:00:41 +00:00
Roland McGrath cbac223123 ld/testsuite: XFAIL pr20995-2 on aarch64*-*-elf*
ld/
	* testsuite/ld-elf/shared.exp (pr20995-2): XFAIL on aarch64*-*-elf*,
	another target without RELRO.
2018-03-20 13:31:05 -07:00
Stephen Roberts 7cbe16e99d Fix misleading indentation error.
This patch fixes a compile error introduced by my previous change, which
caused the indentation of the following code block to become incorrect.

ChangeLog:

2018-03-20  Stephen Roberts  <stephen.roberts@arm.com>

        * gdb/symtab.c (find_pc_sect_line): fixed indentation.
2018-03-20 16:24:37 +00:00
H.J. Lu 8c5b71ad6d Adjust testsuite/ld-plugin/pr22983.d
* testsuite/ld-plugin/pr22983.d: Allow leading underscore as
	well as extra lines between symbols.
2018-03-20 09:21:35 -07:00
Stephen Roberts 4ee89e903d Replace the linear search in find_pc_sect_line with a binary search.
This patch addresses slowness when setting breakpoints, especially in
heavily templatized code. Profiling showed that find_pc_sect_line in
symtab.c was the performance bottleneck.  The original logic performed a
linear search over ordered data. This patch uses a binary search, as
suggested by comments around the function.  There are no behavioural
changes, but gdb is now faster at setting breakpoints in template code.
Tested using on make check on an x86 target. The optimisation speeds up
the included template-breakpoints.py performance test by a factor of 7
on my machine.

ChangeLog:

2018-03-20  Stephen Roberts  <stephen.roberts@arm.com>

        * gdb/symtab.c (find_pc_sect_line): now uses binary search.

gdb/testsuite/

        * gdb.perf/template-breakpoints.cc: New file.
        * gdb.perf/template-breakpoints.exp: New file.
        * gdb.perf/template-breakpoints.py: New file.
2018-03-20 14:04:17 +00:00
Maciej W. Rozycki ed38187755 gc.exp: Remove extraneous LD flags from the personality test
Complement commit 8988502d75 ("MIPS/LD/testsuite: Correct dynamic
links with VR4100, VR4300 and VR5000") and commit bf48520113 ("gc.exp:
Fix a typo: $LFLAGS -> $LDFLAGS"), and remove extraneous additional LD
flags explicitly passed to the personality test on invocation.  This
passing has accidentally leaked from a WIP version of the former change.

With the actual version committed the $LDFLAGS global variable is used
instead for `run_dump_test' to use implicitly, so that `-call_shared'
precedes `-lpersonality' on the linker's command line, as otherwise a
shared `libpersonality.so' library wouldn't be considered for linking,
causing the test to fail.

	ld/
	* testsuite/ld-gc/gc.exp: Remove extraneous LD flags from the
	personality test.
2018-03-20 11:48:59 +00:00
Nick Clifton 7e1001406d Updated Russian and Spanish translations for the binutils/ sub-directory.
* po/es.po: Updated Spanish translation.
	* po/ru.po: Updated Russian translation.
2018-03-20 11:05:18 +00:00
H.J. Lu 416c34d683 Set non_ir_ref_dynamic if a symbol is made dynamic
If a symbol is made dynamic by --dynamic-list, it has non-IR reference.

bfd/

	PR ld/22983
	* elflink.c (bfd_elf_link_mark_dynamic_symbol): Set
	non_ir_ref_dynamic if a symbol is made dynamic by --dynamic-list.

ld/

	PR ld/22983
	* testsuite/ld-plugin/lto.exp: Run PR ld/22983 test.
	* testsuite/ld-plugin/pr22983.d: New file.
	* testsuite/ld-plugin/pr22983.t: Likewise.
	* testsuite/ld-plugin/pr22983a.c: Likewise.
	* testsuite/ld-plugin/pr22983b.c: Likewise.
2018-03-20 03:51:48 -07:00
GDB Administrator 9d6aac5354 Automatic date update in version.in 2018-03-20 00:00:38 +00:00
Tom Tromey 926300415b Support bare-identifier field initializers in Rust
In Rust one can initialize a struct member from an identically-named
local variable by simply mentioning the member name in the
initializer, like:

    let x = 0;
    let y = Struct { x };

This initializes "Struct::x" from "x".

This patch adds this form of initializer to the Rust expression parser
and adds a test.

Tested on x86-64 Fedora 26 using rustc 1.23.

2018-03-19  Tom Tromey  <tom@tromey.com>

	* rust-exp.y (struct_expr_tail, struct_expr_list): Add plain
	"IDENT" production.

2018-03-19  Tom Tromey  <tom@tromey.com>

	* gdb.rust/simple.rs (main): Add local variables field1, field2,
	y0.
	* gdb.rust/simple.exp: Test bare identifier form of struct
	initializer.
2018-03-19 11:01:31 -06:00
Tom Tromey 76727919ce Convert observers to C++
This converts observers from using a special source-generating script
to be plain C++.  This version of the patch takes advantage of C++11
by using std::function and variadic templates; incorporates Pedro's
patches; and renames the header file to "observable.h" (this change
eliminates the need for a clean rebuild).

Note that Pedro's patches used a template lambda in tui-hooks.c, but
this failed to compile on some buildbot instances (presumably due to
differing C++ versions); I replaced this with an ordinary template
function.

Regression tested on the buildbot.

gdb/ChangeLog
2018-03-19  Pedro Alves  <palves@redhat.com>
	    Tom Tromey  <tom@tromey.com>

	* unittests/observable-selftests.c: New file.
	* common/observable.h: New file.
	* observable.h: New file.
	* ada-lang.c, ada-tasks.c, agent.c, aix-thread.c, annotate.c,
	arm-tdep.c, auto-load.c, auxv.c, break-catch-syscall.c,
	breakpoint.c, bsd-uthread.c, cli/cli-interp.c, cli/cli-setshow.c,
	corefile.c, dummy-frame.c, event-loop.c, event-top.c, exec.c,
	extension.c, frame.c, gdbarch.c, guile/scm-breakpoint.c,
	infcall.c, infcmd.c, inferior.c, inflow.c, infrun.c, jit.c,
	linux-tdep.c, linux-thread-db.c, m68klinux-tdep.c,
	mi/mi-cmd-break.c, mi/mi-interp.c, mi/mi-main.c, objfiles.c,
	ppc-linux-nat.c, ppc-linux-tdep.c, printcmd.c, procfs.c,
	python/py-breakpoint.c, python/py-finishbreakpoint.c,
	python/py-inferior.c, python/py-unwind.c, ravenscar-thread.c,
	record-btrace.c, record-full.c, record.c, regcache.c, remote.c,
	riscv-tdep.c, sol-thread.c, solib-aix.c, solib-spu.c, solib.c,
	spu-multiarch.c, spu-tdep.c, stack.c, symfile-mem.c, symfile.c,
	symtab.c, thread.c, top.c, tracepoint.c, tui/tui-hooks.c,
	tui/tui-interp.c, valops.c: Update all users.
	* tui/tui-hooks.c (tui_bp_created_observer)
	(tui_bp_deleted_observer, tui_bp_modified_observer)
	(tui_inferior_exit_observer, tui_before_prompt_observer)
	(tui_normal_stop_observer, tui_register_changed_observer):
	Remove.
	(tui_observers_token): New global.
	(attach_or_detach, tui_attach_detach_observers): New functions.
	(tui_install_hooks, tui_remove_hooks): Use
	tui_attach_detach_observers.
	* record-btrace.c (record_btrace_thread_observer): Remove.
	(record_btrace_thread_observer_token): New global.
	* observer.sh: Remove.
	* observer.c: Rename to observable.c.
	* observable.c (namespace gdb_observers): Define new objects.
	(observer_debug): Move into gdb_observers namespace.
	(struct observer, struct observer_list, xalloc_observer_list_node)
	(xfree_observer_list_node, generic_observer_attach)
	(generic_observer_detach, generic_observer_notify): Remove.
	(_initialize_observer): Update.
	Don't include observer.inc.
	* Makefile.in (generated_files): Remove observer.h, observer.inc.
	(clean mostlyclean): Likewise.
	(observer.h, observer.inc): Remove targets.
	(SUBDIR_UNITTESTS_SRCS): Add observable-selftests.c.
	(COMMON_SFILES): Use observable.c, not observer.c.
	* .gitignore: Remove observer.h.

gdb/doc/ChangeLog
2018-03-19  Tom Tromey  <tom@tromey.com>

	* observer.texi: Remove.

gdb/testsuite/ChangeLog
2018-03-19  Tom Tromey  <tom@tromey.com>

	* gdb.gdb/observer.exp: Remove.
2018-03-19 09:37:49 -06:00
Andreas Arnez 194ed4130d Testsuite: Fix ambiguous "break" due to libinproctrace
Some of GDB's trace test cases define a function end() and place a
breakpoint there with "break end".  However, when libinproctrace is linked
to the binary, there are multiple methods named "end", such as
std::string::end() from the C++ library or format_pieces::end() from
common/format.h.  GDB then creates multiple breakpoints instead of just a
single one, and some FAILs result, such as these:

  FAIL: gdb.trace/trace-mt.exp: ftrace on: break end
  FAIL: gdb.trace/trace-mt.exp: ftrace off: break end

Fix this by adding the "-qualified" option to the break commands.  For
consistency, change all occurrences of "break end" (and similar) in all
trace test cases, even if the current behavior does not cause problems.
Also, consequently use the gdb_breakpoint convenience proc.

gdb/testsuite/ChangeLog:

	* gdb.trace/actions-changed.exp: Call gdb_breakpoint with the
	"qualified" option when setting breakpoints.
	* gdb.trace/backtrace.exp: Likewise.
	* gdb.trace/circ.exp: Likewise.
	* gdb.trace/collection.exp: Likewise.
	* gdb.trace/disconnected-tracing.exp: Likewise.
	* gdb.trace/ftrace-lock.exp: Likewise.
	* gdb.trace/ftrace.exp: Likewise.
	* gdb.trace/infotrace.exp: Likewise.
	* gdb.trace/packetlen.exp: Likewise.
	* gdb.trace/passc-dyn.exp: Likewise.
	* gdb.trace/qtro.exp: Likewise.
	* gdb.trace/read-memory.exp: Likewise.
	* gdb.trace/report.exp: Likewise.
	* gdb.trace/signal.exp: Likewise.
	* gdb.trace/status-stop.exp: Likewise.
	* gdb.trace/strace.exp: Likewise.
	* gdb.trace/tfind.exp: Likewise.
	* gdb.trace/trace-break.exp: Likewise.
	* gdb.trace/trace-condition.exp: Likewise.
	* gdb.trace/trace-mt.exp: Likewise.
	* gdb.trace/tstatus.exp: Likewise.
	* gdb.trace/tsv.exp: Likewise.
	* gdb.trace/unavailable-dwarf-piece.exp: Likewise.
	* gdb.trace/unavailable.exp: Likewise.
	* gdb.trace/while-dyn.exp: Likewise.
2018-03-19 13:13:09 +01:00
Nick Clifton 315aa1cf83 Updated Spanish translation for the bfd/ sub-directory, and updated Ukranian translation for the gas/ sub-directory.
bfd	* po/es.po: Updated Spanish translation.
gas	* po/uk.po: Updated Ukranian translation.
2018-03-19 10:49:13 +00:00
Tom Tromey 1cb1f3dae7 Remove some cleanups from solib.c
This removes some cleanups from solib.c, replacing them with
gdb::def_vector.

Regression tested by the buildbot.

gdb/ChangeLog
2018-03-18  Tom Tromey  <tom@tromey.com>

	* solib.c (gdb_bfd_lookup_symbol_from_symtab): Use
	gdb::def_vector.
	(bfd_lookup_symbol_from_dyn_symtab): Likewise.
2018-03-18 21:50:00 -06:00
GDB Administrator c820f6a44d Automatic date update in version.in 2018-03-19 00:00:24 +00:00
GDB Administrator 2e1d1be528 Automatic date update in version.in 2018-03-18 00:01:24 +00:00
Tom Tromey a06ab151cb Change auto_load_objfile_script_1 to use std::string
This replaces some manual string manipulation in
auto_load_objfile_script_1 with std::string, simplifying the code and
allowing the removal of some cleanups.

Tested by the buildbot.

2018-03-17  Tom Tromey  <tom@tromey.com>

	* auto-load.c (auto_load_objfile_script_1): Use std::string.
2018-03-17 13:28:56 -06:00
Tom Tromey 770623f79f Remove target_fileio_close_cleanup
This removes target_fileio_close_cleanup in favor of a new RAII class.
The new class is similar to scoped_fd but calls
target_fileio_close_cleanup rather than close.

Regression tested by the buildbot.

gdb/ChangeLog
2018-03-17  Tom Tromey  <tom@tromey.com>

	* target.c (class scoped_target_fd): New.
	(target_fileio_close_cleanup): Remove.
	(target_fileio_read_alloc_1): Use scoped_target_fd.
2018-03-17 09:22:15 -06:00
GDB Administrator 04153a3e04 Automatic date update in version.in 2018-03-17 00:00:16 +00:00
Simon Marchi 39be3c7e98 Add silent Makefile rules
Many projects (e.g. the Linux kernel) and build systems use "silent"
rules, which means that they'll only print a summary of what's being
done instead of printing all the detailed command lines.  While chatting
on the #gdb IRC channel, I realized a few people (including me) thought
it would be nice to have it in GDB too.

The idea is that too much text is not useful, the important information
gets lost.  If there's only the essential information, it's more likely
to be useful.  Most of the time, when I look at the build output, it's
to see how it's progressing.  By just printing a brief summary of each
operation, I can easily spot what's currently being compiled and
therefore how the build progresses (with time you know the order in
which files are compiled almost by heart).

As with other projects (Linux, automake-based things, probably others),
it's possible to print the complete command lines by passing V=1 to make
(or any other non-zero value).

I had one hesitation about this: when people report build failures, we
are more likely to miss the full compile command line.  We'll probably
sometimes need to ask people to include the build log with "make V=1".
I don't think it's a big downside, if other projects the size of the
Linux kernel can live with it, I'm sure we can too.

gdb/ChangeLog:

	* silent-rules.mk: New.
	* Makefile.in: Include silent-rules.mk
	(srcdir, VPATH, top_srcdir): Move up.
	(COMPILE): Add ECHO_CXX.
	(test-cp-name-parser$(EXEEXT)): Add ECHO_CXXLD.
	(init.c): Add ECHO_INIT_C.
	(gdb$(EXEEXT)): Add SILENCE and ECHO_CXXLD.
	(version.c): Add ECHO_GEN.
	(printcmd.o): Add ECHO_CXX.
	(target-float.o): Add ECHO_CXX.
	(ada-exp.o): Add ECHO_CXX.
	(stamp-xml): Add SILENCE and ECHO_GEN_XML_BUILTIN.
	(insight$(EXEEXT)): Add ECHO_CXXLD.
	* gnulib/configure.ac: Add AM_SILENT_RULES.
	* gnulib/aclocal.m4: Re-generate.
	* gnulib/configure: Re-generate.
	* gnulib/import/Makefile.in: Re-generate.

gdb/gdbserver/ChangeLog:

	* Makefile.in: Include silent-rules.mk.
	(srcdir, abs_top_srcdir, abs_srcdir, VPATH): Move up.
	(COMPILE): Add ECHO_CXX.
	(gdbserver$(EXEEXT)): Add SILENCE and ECHO_CXXLD.
	(gdbreplay$(EXEEXT)): Add SILENCE and ECHO_CXXLD.
	($(IPA_LIB)): Add SILENCE and ECHO_CXXLD.
	(version-generated.c): Add ECHO_GEN.
	(stamp-xml): Add SILENCE and ECHO_GEN_XML_BUILTIN_GENERATED.
	(IPAGENT_COMPILE): Add ECHO_CXX.
	(%-generated.c): Add ECHO_REGDAT.
2018-03-16 16:30:25 -04:00
Tom Tromey 37e136b168 Remove make_cleanup_free_section_addr_info
This removes make_cleanup_free_section_addr_info.  Instead -- per
Simon's suggestion -- this changes section_addr_info to be a
std::vector.

Regression tested by the buildbot.

gdb/ChangeLog
2018-03-16  Tom Tromey  <tom@tromey.com>

	* xcoffread.c (xcoff_symfile_offsets): Change type of "addrs".
	* utils.h (make_cleanup_free_section_addr_info): Don't declare.
	* utils.c (do_free_section_addr_info)
	(make_cleanup_free_section_addr_info): Remove.
	* symfile.h (struct other_sections): Add constructor.
	(struct section_addr_info): Remove.
	(section_addr_info): New typedef.
	(struct sym_fns) <sym_offsets>: Change type of parameter.
	(build_section_addr_info_from_objfile)
	(relative_addr_info_to_section_offsets, addr_info_make_relative)
	(default_symfile_offsets, symbol_file_add)
	(symbol_file_add_from_bfd)
	(build_section_addr_info_from_section_table): Update.
	(alloc_section_addr_info, free_section_addr_info): Don't declare.
	* symfile.c (alloc_section_addr_info): Remove.
	(build_section_addr_info_from_section_table): Change return type.
	Update.
	(build_section_addr_info_from_bfd)
	(build_section_addr_info_from_objfile): Likewise.
	(free_section_addr_info): Remove.
	(relative_addr_info_to_section_offsets): Change type of "addrs".
	(addrs_section_compar): Now a std::sort comparator.
	(addrs_section_sort): Change return type.
	(addr_info_make_relative): Change type of "addrs".  Update.
	(default_symfile_offsets, syms_from_objfile_1)
	(syms_from_objfile, symbol_file_add_with_addrs): Likewise.
	(symbol_file_add_separate): Update.
	(symbol_file_add): Change type of "addrs".  Update.
	(add_symbol_file_command): Update.  Remove cleanups.
	* symfile-mem.c (symbol_file_add_from_memory): Update.  Remove
	cleanups.
	* symfile-debug.c (debug_sym_offsets): Change type of "info".
	* solib.c (solib_read_symbols): Update.
	* objfiles.c (objfile_relocate): Update.  Remove cleanups.
	* machoread.c (macho_symfile_offsets): Update.
	* jit.c (jit_bfd_try_read_symtab): Update.
2018-03-16 14:22:13 -06:00
Andreas Arnez 8b067d2cf5 Fix tspeed test case: copy libinproctrace to target
The tspeed test case does not execute correctly because libinproctrace.so
is not copied to the target.  This is fixed.

gdb/testsuite/ChangeLog:

	* gdb.trace/tspeed.exp: Add invocation of gdb_load_shlib to ensure
	that libinproctrace is copied to the target.
2018-03-16 20:40:38 +01:00
Jim Wilson ca2fd32c55 RISC-V: Emit better warning for unknown CSR.
gas/
	* config/tc-riscv.c (check_absolute_expr): Expand comment.  New
	parameter maybe_csr.  If maybe_csr and O_symbol, print CSR name.
	(riscv_ip): Add new argument to check_absolute_expr calls.
	* testsuite/gas/riscv/bad-csr.d: New.
	* testsuite/gas/riscv/bad-csr.l: New.
	* testsuite/gas/riscv/bad-csr.s: New.
2018-03-16 10:03:57 -07:00
Simon Marchi 03afa6ef8a Add selftest for substitute_path_component
This patch add some unit tests for the substitute_path_component
function.

gdb/ChangeLog:

	* Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
	unittests/utils-selftests.c.
	* unittests/utils-selftests.c: New file.
2018-03-15 22:04:42 -04:00
GDB Administrator acc834c7ab Automatic date update in version.in 2018-03-16 00:00:29 +00:00
Max Filippov 0854d50445 xtensa: bfd: fix assertion in xlate_offset_with_removed_text
Linking objects containing jumps targeting the end of a section triggers
assertion in the xlate_offset_with_removed_text. Such jumps may be
generated by a compiler as a dead code and not removed at -O0. Allow
such jumps.
While at it make bsearch argument match comparison function expectations
and use bfd_vma for address fields in the struct xlate_map_entry.

bfd/
2018-03-15  Max Filippov  <jcmvbkbc@gmail.com>

	* elf32-xtensa.c (xlate_map_entry): Change types of address
	fields from 'unsigned' to 'bfd_vma'.
	(xlate_offset_with_removed_text): Use struct xlate_map_entry as
	the key argument to bsearch. Allow offsets past the end of a
	section, use the last map entry for translation of such offsets.
2018-03-15 13:53:33 -07:00
Andreas Schwab 202d116e57 RISC-V: Don't enable relaxation in relocatable link
PR ld/22949
	* emultempl/riscvelf.em (riscv_elf_before_allocation): Don't
	enable relaxation in relocatable link.
2018-03-15 09:54:51 +01:00
Kuan-Lin Chen f967164095 nds32: Remove the unsupported target feature. 2018-03-15 14:50:51 +08:00
GDB Administrator 8bb251a84a Automatic date update in version.in 2018-03-15 00:00:38 +00:00