Commit Graph

90180 Commits

Author SHA1 Message Date
Pedro Alves 9f33b8b7c1 -Wwrite-strings: Constify mi_cmd_argv_ftype's 'command' parameter
-Wwrite-strings flags this attempt to pass a literal to a "char *":

	mi_cmd_interpreter_exec ("-interpreter-exec", argv, 2);

Fix that by constifying mi_cmd_argv_ftype's 'command' parameter and
adjusting all MI commands.

gdb/ChangeLog:
2017-04-05  Pedro Alves  <palves@redhat.com>

	* mi/mi-cmd-break.c (mi_cmd_break_insert_1, mi_cmd_break_insert)
	(mi_cmd_dprintf_insert, mi_cmd_break_passcount)
	(mi_cmd_break_watch, mi_cmd_break_commands): Constify 'command'
	parameter.
	* mi/mi-cmd-catch.c (mi_cmd_catch_assert, mi_cmd_catch_exception)
	(mi_cmd_catch_load, mi_cmd_catch_unload): Constify cmd' parameter.
	* mi/mi-cmd-disas.c (mi_cmd_disassemble): Constify 'command'
	parameter.
	* mi/mi-cmd-env.c (mi_cmd_env_pwd, mi_cmd_env_cd, mi_cmd_env_path)
	(mi_cmd_env_dir, mi_cmd_inferior_tty_set, _cmd_inferior_tty_show)
	* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file)
	(mi_cmd_file_list_exec_source_files)
	(mi_cmd_file_list_shared_libraries): Constify 'command' parameter.
	* mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions)
	(mi_cmd_info_gdb_mi_command, mi_cmd_info_os): Constify 'command'
	parameter.
	* mi/mi-cmd-stack.c (mi_cmd_enable_frame_filters)
	(mi_cmd_stack_list_frames, mi_cmd_stack_info_depth)
	(mi_cmd_stack_list_locals, mi_cmd_stack_list_args)
	(mi_cmd_stack_list_variables, mi_cmd_stack_select_frame)
	(mi_cmd_stack_info_frame): Constify 'command' parameter.
	* mi/mi-cmd-target.c (mi_cmd_target_file_get)
	(mi_cmd_target_file_put, mi_cmd_target_file_delete): Constify
	'command' parameter.
	* mi/mi-cmd-var.c (mi_cmd_var_create, mi_cmd_var_delete)
	(mi_cmd_var_set_format, mi_cmd_var_set_visualizer)
	(mi_cmd_var_set_frozen, mi_cmd_var_show_format)
	(mi_cmd_var_info_num_children, mi_cmd_var_list_children)
	(mi_cmd_var_info_type, mi_cmd_var_info_path_expression)
	(mi_cmd_var_info_expression, mi_cmd_var_show_attributes)
	(mi_cmd_var_evaluate_expression, mi_cmd_var_assign)
	(mi_cmd_var_update, mi_cmd_enable_pretty_printing)
	(mi_cmd_var_set_update_range): Constify 'command' parameter.
	* mi/mi-cmds.h (mi_cmd_argv_ftype): Constify 'command' parameter.
	* mi/mi-interp.c (mi_cmd_interpreter_exec): Constify 'command'
	parameter.
	* mi/mi-main.c (mi_cmd_gdb_exit, mi_cmd_exec_next)
	(mi_cmd_exec_next_instruction, mi_cmd_exec_step)
	(mi_cmd_exec_step_instruction, mi_cmd_exec_finish)
	(mi_cmd_exec_return ,mi_cmd_exec_jump, mi_cmd_exec_continue)
	(mi_cmd_exec_interrupt, mi_cmd_exec_run, mi_cmd_target_detach)
	(mi_cmd_target_flash_erase, mi_cmd_thread_select)
	(mi_cmd_thread_list_ids, mi_cmd_thread_info)
	(mi_cmd_list_thread_groups, mi_cmd_data_list_register_names)
	(mi_cmd_data_list_changed_registers)
	(mi_cmd_data_write_register_values)
	(mi_cmd_data_evaluate_expression, mi_cmd_data_read_memory)
	(mi_cmd_data_read_memory_bytes, mi_cmd_data_write_memory)
	(mi_cmd_data_write_memory_bytes, mi_cmd_enable_timings)
	(mi_cmd_list_features, mi_cmd_list_target_features)
	(mi_cmd_add_inferior, mi_cmd_remove_inferior)
	(mi_cmd_trace_define_variable, mi_cmd_trace_list_variables)
	(mi_cmd_trace_find, mi_cmd_trace_save, mi_cmd_trace_start)
	(mi_cmd_trace_status, mi_cmd_trace_stop, mi_cmd_ada_task_info)
	(mi_cmd_trace_frame_collected): Constify 'command'
	parameter.
	* mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Constify
	'command' parameter.
2017-04-05 19:21:34 +01:00
Pedro Alves 67cb5b2da2 -Wwrite-strings: Constify word break character arrays
-Wwrite-strings flags several cases of missing casts around
initializations like:

   static char *gdb_completer_command_word_break_characters =
    " \t\n!@#$%^&*()+=|~`}{[]\"';:?/>.<,";

Obviously these could/should be const.  However, while at it, there's
no need for these variables to be pointers instead of arrays.  They
are never changed to point to anything else.

Unfortunately, readline's rl_completer_word_break_characters is
"char *", not "const char *".  So we always need a cast somewhere.  The
approach taken here is to add a new
set_rl_completer_word_break_characters function that becomes the only
place that writes to rl_completer_word_break_characters, and thus the
single place that needs the cast.

gdb/ChangeLog:
2017-04-05  Pedro Alves  <palves@redhat.com>

	* ada-lang.c (ada_completer_word_break_characters): Now a const
	array.
	(ada_get_gdb_completer_word_break_characters): Constify.
	* completer.c (gdb_completer_command_word_break_characters)
	(gdb_completer_file_name_break_characters)
	(gdb_completer_quote_characters): Now const arrays.
	(get_gdb_completer_quote_characters): Constify.
	(set_rl_completer_word_break_characters): New function.
	(set_gdb_completion_word_break_characters)
	(complete_line_internal): Use it.
	* completer.h (get_gdb_completer_quote_characters): Constify.
	(set_rl_completer_word_break_characters): Declare.
	* f-lang.c (f_word_break_characters): Constify.
	* language.c (default_word_break_characters): Constify.
	* language.h (language_defn::la_word_break_characters): Constify.
	(default_word_break_characters): Constify.
	* top.c (init_main): Use set_rl_completer_word_break_characters.
2017-04-05 19:21:34 +01:00
Pedro Alves 7a1149643d -Wwrite-strings: Constify target_pid_to_str and target_thread_extra_thread_info
-Wwrite-strings flagged a missing cast for example here:

   static char *
   ravenscar_extra_thread_info (struct target_ops *self, struct thread_info *tp)
   {
     return "Ravenscar task";

Since callers are not supposed to free the string returned by these
methods, change the methods' signature to return const strings.

gdb/ChangeLog:
2017-04-05  Pedro Alves  <palves@redhat.com>

	* aix-thread.c (aix_thread_pid_to_str)
	(aix_thread_extra_thread_info): Constify.
	* bsd-kvm.c (bsd_kvm_pid_to_str): Constify.
	* bsd-uthread.c (bsd_uthread_extra_thread_info)
	(bsd_uthread_pid_to_str): Constify.
	* corelow.c (core_pid_to_str): Constify.
	* darwin-nat.c (darwin_pid_to_str): Constify.
	* fbsd-nat.c (fbsd_pid_to_str): Constify.
	* fbsd-tdep.c (fbsd_core_pid_to_str, gdbarch_core_pid_to_str):
	Constify.
	* gnu-nat.c (gnu_pid_to_str): Constify.
	* go32-nat.c (go32_pid_to_str): Constify.
	* i386-cygwin-tdep.c (i386_windows_core_pid_to_str): Constify.
	* inf-ptrace.c (inf_ptrace_pid_to_str): Constify.
	* inferior.c (inferior_pid_to_str): Constify.
	* linux-nat.c (linux_nat_pid_to_str): Constify.
	* linux-tdep.c (linux_core_pid_to_str): Constify.
	* linux-thread-db.c (thread_db_pid_to_str)
	(thread_db_extra_thread_info): Constify.
	* nto-tdep.c (nto_extra_thread_info): Constify.
	* nto-tdep.h (nto_extra_thread_info): Constify.
	* obsd-nat.c (obsd_pid_to_str): Constify.
	* procfs.c (procfs_pid_to_str): Constify.
	* ravenscar-thread.c (ravenscar_extra_thread_info)
	(ravenscar_pid_to_str): Constify.
	* remote-sim.c (gdbsim_pid_to_str): Constify.
	* remote.c (remote_threads_extra_info, remote_pid_to_str):
	Constify.
	* sol-thread.c (solaris_pid_to_str): Constify.
	* sol2-tdep.c (sol2_core_pid_to_str): Constify.
	* sol2-tdep.h (sol2_core_pid_to_str): Constify.
	* target.c (default_pid_to_str, target_pid_to_str)
	(normal_pid_to_str, default_pid_to_str): Constify.
	* target.h (target_ops::to_pid_to_str)
	(target_ops::to_extra_thread_info): Constify.
	(target_pid_to_str, normal_pid_to_str): Constify.
	* windows-nat.c (windows_pid_to_str): Constify.
	* gdbarch.sh (core_pid_to_str): Constify.
	* target-delegates.c: Regenerate.
	* gdbarch.h, gdbarch.c: Regenerate.
2017-04-05 19:21:34 +01:00
Pedro Alves 69bbf46523 -Wwrite-strings: Constify warning_pre_print
-Wwrite-strings flags a warning here:

  char *warning_pre_print = "\nwarning: ";

gdb/ChangeLog:
2017-04-05  Pedro Alves	 <palves@redhat.com>

	* main.c (captured_main_1): Use gdb::unique_xmalloc_ptr to manage
	the memory of the temporary warning_pre_print override.
	* utils.c (warning_pre_print): Constify.
	* utils.h (warning_pre_print): Constify.
2017-04-05 19:21:34 +01:00
Pedro Alves be47f9e818 -Wwrite-strings: Constify shell_escape and plug make_command leak
gdb/ChangeLog:
2017-04-05  Pedro Alves	 <palves@redhat.com>

	* cli/cli-cmds.c (shell_escape): Constify 'arg' parameter.
	(shell_command): New function.
	(make_command): Use std::string.
	(init_cli_cmds): Register shell_command instead of shell_escape.
2017-04-05 19:21:34 +01:00
Pedro Alves bde6261aed -Wwrite-strings: Don't initialize string command variables to empty string
-Wwrite-strings flags these initializations as requiring a cast.
However, these variables are command variables, and as such point to
heap-allocated memory.  The initial allocation is always done when the
corresponding command is registered.  E.g.,:

    dprintf_function = xstrdup ("printf");
    add_setshow_string_cmd ("dprintf-function", class_support,
			    &dprintf_function, _("\
  Set the function to use for dynamic printf"), _("\
  Show the function to use for dynamic printf"), NULL,
			    update_dprintf_commands, NULL,
			    &setlist, &showlist);

That's why we never reach a bogus attempt to free these string
literals.

So, just drop the incorrect initializations.

gdb/ChangeLog:
2017-04-05  Pedro Alves  <palves@redhat.com>

	* breakpoint.c (dprintf_function, dprintf_channel): Don't initialize.
	* tracepoint.c (default_collect): Don't initialize.
2017-04-05 19:21:33 +01:00
Pedro Alves b38ef47f47 -Wwrite-strings: Constify macroexp.c:init_shared_buffer
There's one call in the file that passes a string literal, like:

	init_shared_buffer (&va_arg_name, "__VA_ARGS__",
				  strlen ("__VA_ARGS__"));

Instead of adding a cast here, make init_shared_buffer take a 'const
char *', and remove the several casts in the file that are made
obsolete.

gdb/ChangeLog:
2017-04-05  Pedro Alves  <palves@redhat.com>

	* macroexp.c (macro_buffer::shared): Now a bool.
	(init_buffer): Update.
	(init_shared_buffer): Constify 'addr' parameter.
	(substitute_args, expand, macro_expand, macro_expand_next): Remove
	casts.
2017-04-05 19:21:33 +01:00
Pedro Alves f995bbe8e6 -Wwrite-strings: Constify struct disassemble_info's disassembler_options field
The memory disassemble_info::disassembler_options points to is always
owned by the client.  I.e., that field is an non-owning, observing
pointer.  Thus const makes sense.

Are the include/ and opcodes/ bits OK?

Tested on x86_64 Fedora 23, built with --enable-targets=all.

include/ChangeLog:
2017-04-05  Pedro Alves  <palves@redhat.com>

	* dis-asm.h (disassemble_info) <disassembler_options>: Now a
	"const char *".
	(next_disassembler_option): Constify.

opcodes/ChangeLog:
2017-04-05  Pedro Alves  <palves@redhat.com>

	* arc-dis.c (parse_option, parse_disassembler_options): Constify.
	* arm-dis.c (parse_arm_disassembler_options): Constify.
	* ppc-dis.c (powerpc_init_dialect): Constify local.
	* vax-dis.c (parse_disassembler_options): Constify.

gdb/ChangeLog:
2017-04-05  Pedro Alves  <palves@redhat.com>

	* arm-tdep.c (show_disassembly_style_sfunc): Constify local.
	* disasm.c (set_disassembler_options): Constify local.
	* i386-tdep.c (i386_print_insn): Remove cast and FIXME comment.
2017-04-05 19:21:33 +01:00
Sergio Durigan Junior 0ad9d8c734 PR 21352: Add testsuite for "tsave -r" command
This commit adds a test for the fix of PR 21352.

gdb/testsuite/ChangeLog:
2017-04-05  Sergio Durigan Junior  <sergiodj@redhat.com>

	PR gdb/21352
	* gdb.trace/tsv.exp: Add test for "tsave -r".
2017-04-05 12:43:52 -04:00
Sergio Durigan Junior 4a596fe20e Fix PR 21352: Command tsave does not support -r argument
This is an obvious fix for PR 21352.  The problem is that the argument
parsing loop is not using an "else if" where it should, and therefore
the '-r' option ends up unrecognized by GDB.

gdb/ChangeLog:
2017-04-05  Sergio Durigan Junior  <sergiodj@redhat.com>

	PR gdb/21352
	* tracefile.c (tsave_command): Fix argument parsing for '-r'
	option.
2017-04-05 12:28:30 -04:00
Yao Qi 2cad08ea7d Use frame_unwind_register_value in frame_unwind_register_unsigned
gdb:

2017-04-05  Yao Qi  <yao.qi@linaro.org>

	* frame.c (frame_unwind_register_unsigned): Call
	frame_unwind_register_value.
2017-04-05 14:55:43 +01:00
Yao Qi 55a9897675 Fix racy test in gdb.threads/thread-specific-bp.exp
I see the following test fail from time to time, due to the racy test
in gdb.threads/thread-specific-bp.exp.

continue -a^M
Continuing.^M
^M
Thread 1 "thread-specific" hit Breakpoint 4, end () at binutils-gdb/gdb/testsuite/gdb.threads/thread-specific-bp.c:29^M
29      }^M
(gdb) [Thread 0x40322460 (LWP 12950) exited]^M
Thread-specific breakpoint 3 deleted - thread 2 no longer in the thread list.^M
FAIL: gdb.threads/thread-specific-bp.exp: non-stop: continue to end (timeout)

This patch changes gdb_test to gdb_test_multiple to match prompt only
instead of both prompt and anchor.

gdb/testsuite:

2017-04-05  Yao Qi  <yao.qi@linaro.org>

	* gdb.threads/thread-specific-bp.exp (check_thread_specific_breakpoint):
	Use gdb_test_multiple, and don't match anchor.
2017-04-05 14:46:13 +01:00
Alan Modra 8dea77f025 PowerPC64le PLT reference counting
A fix for ELFv2 ABI garbage-collection.

	* elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
	reference counting.
2017-04-05 21:59:44 +09:30
Pedro Alves 4ac40124ee New global maintainer - Simon Marchi
gdb/ChangeLog:
2017-04-05  Pedro Alves  <palves@redhat.com>

	* MAINTAINERS (Global Maintainers): Add Simon Marchi.
	(Write After Approval): Remove Simon Marchi.
2017-04-05 09:39:49 +01:00
Hans-Peter Nilsson 4d5efb852b PR ld/21233: xfail failing test-parts for cris*-*-* 2017-04-05 03:00:40 +02:00
Pedro Alves c053b65441 Initialize gdb::optional empty payload to quiet false -Wmaybe-uninitialized warnings
Commit ecfb656c37 ("dwarf2read.c: Make dir_index and
file_name_index strong typedefs") added a use of gdb::optional that
triggers bogus -Wmaybe-uninitialized warnings:

GCC trunk is complaining like this:

  ../../binutils-gdb/gdb/dwarf2read.c: In function void read_formatted_entries(bfd*, const gdb_byte**, line_header*, const comp_unit_head*, void (*)(line_header*, const char*, dir_index, unsigned int, unsigned int)):
  ../../binutils-gdb/gdb/dwarf2read.c:17779:65: error: fe.file_entry::length may be used uninitialized in this function [-Werror=maybe-uninitialized]
	 callback (lh, fe.name, fe.d_index, fe.mod_time, fe.length);
								   ^
  ../../binutils-gdb/gdb/dwarf2read.c:17779:65: error: *((void*)& fe +8) may be used uninitialized in this function [-Werror=maybe-uninitialized]
  ../../binutils-gdb/gdb/dwarf2read.c:17779:65: error: fe.file_entry::mod_time may be used uninitialized in this function [-Werror=maybe-uninitialized]
  ../../binutils-gdb/gdb/dwarf2read.c:17779:65: error: fe.file_entry::name may be used uninitialized in this function [-Werror=maybe-uninitialized]

While some older GCCs are complaining like this:

  ../../binutils-gdb/gdb/dwarf2read.c: In function void read_formatted_entries(bfd*, const gdb_byte**, line_header*, const comp_unit_head*, void (*)(line_header*, const char*, dir_index, unsigned int, unsigned int)):
  ../../binutils-gdb/gdb/dwarf2read.c:17779:65: error: uint may be used uninitialized in this function [-Werror=maybe-uninitialized]
	 callback (lh, fe.name, fe.d_index, fe.mod_time, fe.length);

Looking around the web, I see that boost's optional implementation
triggers this kind of issue often too.  See:

  http://www.boost.org/doc/libs/1_63_0/libs/optional/doc/html/boost_optional/tutorial/gotchas/false_positive_with__wmaybe_uninitialized.html

I noticed that replacing the gdb::optional uses with real C++17
std::optional uses against GCC 7/trunk makes the warnings go away.
Looking at the implementation, AFAICS, libstdc++ always initializes
its "empty" union payload member (_M_empty, which is defined as an
empty class, like ours).  I.e., all payload types have this ctor:

    struct _Optional_payload.....
    {
      constexpr _Optional_payload()
	: _M_empty() {}

The constexpr makes a diference too.  Without it, GCC7 still warns.

So I'm applying the same treatment to our gdb::optional.

gdb/ChangeLog:
2017-04-05  Pedro Alves  <palves@redhat.com>

	* common/gdb_optional.h (optional::optional): Make constexpr and
	initialize m_dummy.
2017-04-05 01:28:06 +01:00
GDB Administrator f3b8f8ee35 Automatic date update in version.in 2017-04-05 00:00:36 +00:00
Maciej W. Rozycki 80070c0d34 PR ld/21233: Avoid sweeping forced-undefined symbols in section GC
Complement commit 902e9fc76a ("PR ld/20828: Move symbol version
processing ahead of GC symbol sweep"), commit b531344c34 ("PR
ld/20828: Reorder the symbol sweep stage of section GC") and commit
81ff47b3a5 ("PR ld/20828: Fix linker script symbols wrongly forced
local with section GC"), and prevent symbols forcibly entered in the
output file with the use of the `--undefined=' or `--require-defined='
linker command line options or the EXTERN linker script command from
being swept in section garbage collection and consequently recorded in
the dynamic symbol table as local entries.  This happens in certain
circumstances, where a symbol reference also exists in one of the static
input files, however only in a section which is garbage-collected and
does not make it to the output file, and the symbol is defined in a
dynamic object present in the link.

For example with the `i386-linux' target and the `pr21233.s' and
`pr21233-l.s' sources, and the `pr21233.ld' linker script included with
this change we get:

$ as -o pr21233-l.o pr21233-l.s
$ ld -shared -T pr21233.ld -o libpr21233.so pr21233-l.o
$ as -o pr21233.o pr21233.s
$ ld --gc-sections -e foo --require-defined=bar -T pr21233.ld -o pr21233 pr21233.o libpr21233.so
$ readelf --dyn-syms pr21233

Symbol table '.dynsym' contains 2 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 00000000     0 OBJECT  LOCAL  DEFAULT  UND bar
$

which makes the run-time `bar' dependency of the `pr21233' executable
different from its corresponding link-time dependency, i.e. the presence
of `libpr21233.so' and its `bar' symbol is required at the link time,
however at the run time a copy of `libpr21233.so' without `bar' will do.
Similarly with `--undefined=' and EXTERN which do not actually require
the reference to the symbol requested to be satisfied with a definition
at the link time, however once the definition has been pulled at the
link time, so it should at the dynamic load time.

Additionally with the `mips-linux' target we get:

$ ld --gc-sections -e foo --require-defined=bar -T pr21233.ld -o pr21233 pr21233.o libpr21233.so
ld: BFD (GNU Binutils) 2.28.51.20170324 assertion fail .../bfd/elfxx-mips.c:3861
$

as the target is not prepared to handle such a local dynamic symbol.

With this change in effect we get:

$ readelf --dyn-syms pr21233

Symbol table '.dynsym' contains 2 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 00000000     0 OBJECT  GLOBAL DEFAULT  UND bar
$

instead, for both targets.

	ld/
	PR ld/21233
	* ldlang.c (insert_undefined): Set `mark' for ELF symbols.
	* testsuite/ld-elf/pr21233.sd: New test.
	* testsuite/ld-elf/pr21233-l.sd: New test.
	* testsuite/ld-elf/pr21233.ld: New test linker script.
	* testsuite/ld-elf/pr21233-e.ld: New test linker script.
	* testsuite/ld-elf/pr21233.s: New test source.
	* testsuite/ld-elf/pr21233-l.s: New test source.
	* testsuite/ld-elf/shared.exp: Run the new tests.
2017-04-04 23:21:44 +01:00
John Baldwin 4c7bf4f91b Remove support for using the bsd-uthread target on FreeBSD.
The bsd-uthread target supports an old thread library ("libc_r") that
was last included in FreeBSD release 6.4 released in 2008.  However,
this library has not been used as the default library since FreeBSD
5.0 (2003) and 4.11 (2005).  Thread support for modern FreeBSD binaries
is provided via "normal" LWP support in core files and the native
FreeBSD target.

gdb/ChangeLog:

	* amd64-fbsd-tdep.c: Remove "bsd-uthread.h" include.
	(amd64fbsd_jmp_buf_reg_offset): Remove.
	(amd64fbsd_supply_uthread): Remove function.
	(amd64fbsd_collect_uthread): Remove function.
	(amd64fbsd_init_abi): Don't set bsd-uthread callbacks.
	* configure.tgt (i[34567]86-*-freebsd*): Remove bsd-uthread.o.
	(x86_64-*-freebsd*): Remove bsd-uthread.o.
	(fbsd-nat.c): Update comment.
	* i386-fbsd-tdep.c: Remove "bsd-uthread.h" include.
	(i386fbsd_jmp_buf_reg_offset): Remove.
	(i386fbsd_supply_uthread): Remove function.
	(i386fbsd_collect_uthread): Remove function.
	(i386fbsd_init_abi): Don't set bsd-uthread callbacks.
2017-04-04 14:28:07 -07:00
John Baldwin 1e1a8bef60 Remove support for FreeBSD/alpha.
FreeBSD last shipped a release for Alpha (6.3) in 2008.
This also removes support for GNU/kFreeBSD on Alpha.

gdb/ChangeLog:

	* Makefile.in (ALL_64_TARGET_OBS): Remove alpha-fbsd-tdep.o.
	(ALLDEPFILES): Remove alpha-fbsd-tdep.c
	* NEWS: Mention that support for FreeBSD/alpha was removed.
	* alpha-fbsd-tdep.c: Delete file.
	* config/alpha/fbsd.mh: Delete file.
	* configure.host: Delete alpha*-*-freebsd* and
	alpha*-*-kfreebsd*-gnu.
	* configure.tgt: Delete alpha*-*-freebsd* and
	alpha*-*-kfreebsd*-gnu.
2017-04-04 14:20:37 -07:00
John Baldwin 4990793435 Use ptid from regcache instead of inferior_ptid.
gdb/ChangeLog:

	* amd64-bsd-nat.c (amd64bsd_fetch_inferior_registers,
	amd64bsd_store_inferior_registers): Use ptid from regcache.
2017-04-04 13:57:47 -07:00
Pedro Alves 6f77053d2a dwarf2read.c: C++fy lnp_state_machine
While I was looking at the file, I noticed that this struct could be
nicely converted to a class.  As I was progressing, I ended up moving
all state machine actual internal state manipulation to methods of
lnp_state_machine, essentially decoupling DWARF parsing from state
tracking.  I also noticed that the lnp_reader_state doesn't really
serve any good use, so that's eliminated in the process.

gdb/ChangeLog:
2017-04-04  Pedro Alves  <palves@redhat.com>

	* dwarf2read.c (lnp_state_machine): Now a class.  Initialize all
	data fields, make them private and add "m_" prefixes.
	(lnp_state_machine::lnp_state_machine): New ctor.
	(record_line, check_line_address, handle_set_discriminator)
	(handle_set_address, handle_advance_pc, handle_special_opcode)
	(handle_advance_line, handle_set_file, handle_negate_stmt)
	(handle_const_add_pc, handle_fixed_advance_pc, handle_copy)
	(end_sequence, advance_line): New methods.
	(m_gdbarch, m_record_lines_p): New fields.
	(lnp_reader_state): Delete.
	(dwarf_record_line): Rename to ...
	(lnp_state_machine::record_line): ... adjust.
	(init_lnp_state_machine): Delete.
	(lnp_state_machine::lnp_state_machine): New.
	(check_line_address): Rename to ...
	(lnp_state_machine::check_line_address): This.
	(dwarf_decode_lines_1): Remove reference to "reader_state".
	Adjust lnp_state_machine having a non-default ctor.  Use bool.
	State machine internal state manipulation moved to
	lnp_state_machine methods.
2017-04-04 20:03:26 +01:00
Pedro Alves 9c54172556 Make sect_offset and cu_offset strong typedefs instead of structs
A while ago, back when GDB was a C program, the sect_offset and
cu_offset types were made structs in order to prevent incorrect mixing
of those offsets.  Now that we require C++11, we can make them
integers again, while keeping the safety, by exploiting "enum class".
We can add a bit more safety, even, by defining operators that the
types _should_ support, helping making the suspicious uses stand out
more.

Getting at the underlying type is done with the new to_underlying
function added by the previous patch, which also helps better spot
where do we need to step out of the safety net.  Mostly, that's around
parsing the DWARF, and when we print the offset for complaint/debug
purposes.  But there are other occasional uses.

Since we have to define the sect_offset/cu_offset types in a header
anyway, I went ahead and generalized/library-fied the idea of "offset"
types, making it trivial to add more such types if we find a use.  See
common/offset-type.h and the DEFINE_OFFSET_TYPE macro.

I needed a couple generaly-useful preprocessor bits (e.g., yet another
CONCAT implementation), so I started a new common/preprocessor.h file.

I included units tests covering the "offset" types API.  These are
mostly compile-time tests, using SFINAE to check that expressions that
shouldn't compile (e.g., comparing unrelated offset types) really are
invalid and would fail to compile.  This same idea appeared in my
pending enum-flags revamp from a few months ago (though this version
is a bit further modernized compared to what I had posted), and I plan
on reusing the "check valid expression" bits added here in that
series, so I went ahead and defined the CHECK_VALID_EXPR macro in its
own header -- common/valid-expr.h.  I think that's nicer regardless.

I was borderline between calling the new types "offset" types, or
"index" types, BTW.  I stuck with "offset" simply because that's what
we're already calling them, mostly.

gdb/ChangeLog:
2017-04-04  Pedro Alves  <palves@redhat.com>

	* Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
	unittests/offset-type-selftests.c.
	(SUBDIR_UNITTESTS_OBS): Add offset-type-selftests.o.
	* common/offset-type.h: New file.
	* common/preprocessor.h: New file.
	* common/traits.h: New file.
	* common/valid-expr.h: New file.
	* dwarf2expr.c: Include "common/underlying.h".  Adjust to use
	sect_offset and cu_offset strong typedefs throughout.
	* dwarf2expr.h: Adjust to use sect_offset and cu_offset strong
	typedefs throughout.
	* dwarf2loc.c: Include "common/underlying.h".  Adjust to use
	sect_offset and cu_offset strong typedefs throughout.
	* dwarf2read.c: Adjust to use sect_offset and cu_offset strong
	typedefs throughout.
	* gdbtypes.h: Include "common/offset-type.h".
	(cu_offset): Now an offset type (strong typedef) instead of a
	struct.
	(sect_offset): Likewise.
	(union call_site_parameter_u): Rename "param_offset" field to
	"param_cu_off".
	* unittests/offset-type-selftests.c: New file.
2017-04-04 20:03:26 +01:00
Pedro Alves ecfb656c37 dwarf2read.c: Make dir_index and file_name_index strong typedefs
This should help catch mistakes related to mixing the 1-based DWARF
indexes with 0-based std::vector indexes, since the new types do not
implicitly convert to anything.

The change in read_formatted_entries relates to the fact that doing
the seemingly simpler:

 -	      uintp = &fe.dir_index;
 +	      uintp = (unsigned int *) &fe.dir_index;

would be undefined C/C++.  So to address that, I made the function
extract the form before assigning to the file_entry.  It felt natural
to use gdb::optional for "do I have this value", and this is what
motivated the previous patch that added the missing observer methods
to gdb::optional.

gdb/ChangeLog:
2017-04-04  Pedro Alves  <palves@redhat.com>

	* common/underlying.h: New file.
	* dwarf2read.c: Include "common/gdb_optional.h" and
	"common/underlying.h".
	(dir_index, file_name_index): New types.
	(file_entry): Use them.
	(file_entry::include): Use to_underlying.
	(line_header::add_file_name): Use dir_index.
	(read_formatted_entries): Use gdb::optional.  Read form before
	writting to file_entry.
	(dwarf_decode_line_header): Use dir_index.
	(lnp_state_machine::current_file): Use to_underlying.
	(lnp_state_machine::file): Change type to file_name_index.
	(dwarf_record_line): Use to_underlying.
	(init_lnp_state_machine): Use file_name_index.
	(dwarf_decode_lines_1): Use dir_index and file_name_index.
2017-04-04 20:03:25 +01:00
Pedro Alves d194f1fe51 gdb::optional: Add observers
Currently, gdb::optional is really minimal and can only be used for
lazy initialization.  There's no way to get at the value contained
inside the optinal.  This commit corrects that, by adding observer
methods, mostly copied from libstdc++'s implementation of C++17
std::optional.

This will be used in the following patch.

gdb/ChangeLog:
2017-04-04  Pedro Alves  <palves@redhat.com>

	* common/gdb_optional.h (gdb::optiona): Add operator->, operator*,
	operator bool, has_value and get methods.
2017-04-04 20:03:25 +01:00
Pedro Alves fff8551cf5 dwarf2read.c: Some C++fycation, use std::vector, std::unique_ptr
This starts off as replacing a couple custom open coded vector
implementations in the file with std::vector, and then the rest falls
off of that.  I.e., use new/delete instead of XCNEW/xfree, add
ctors/dtors/initializers where appropriate.  And then use
std::unique_ptr instead of cleanups.  Some functions became methods,
and in a couple spots, some single-use callback functions that would
have to be tweaked anyway are converted to lambdas instead.

gdb/ChangeLog:
2017-04-04  Pedro Alves  <palves@redhat.com>

	* dwarf2read.c (struct file_entry): Add ctors, and initialize all
	fields.
	(line_header): Initialize all data fields.  Change type of
	standard_opcode_lengths to std::unique_ptr<unsigned char[]>.
	Change type of include_dirs to std::vector<const char *>.  Remove
	num_include_dirs, include_dirs_size.  Change type of file_names to
	std::vector<file_entry>.  Remove num_file_names, file_names_size.
	(line_header::line_header): New.
	(line_header::add_include_dir, line_header::add_file_name): New
	methods.
	(line_header::include_dir_at): Remove NULL check.
	(line_header::file_name_at): Add const overload.
	(line_header_up): New unique_ptr typedef.
	(dw2_get_file_names_reader): Use line_header_up.  Adjust to use
	std::vector.  Remove free_line_header call.
	(dwarf2_build_include_psymtabs): Use line_header_up.  Remove
	free_line_header call.
	(free_cu_line_header): Delete.
	(handle_DW_AT_stmt_list, handle_DW_AT_stmt_list)
	(setup_type_unit_groups): Use line_header_up instead of cleanups.
	Adjust to use std::vector.
	(free_line_header): Delete.
	(free_line_header_voidp): Use delete.
	(add_include_dir): Replace with ...
	(line_header::add_include_dir): ... this method.  Use std::vector.
	(add_file_name): Replace with ...
	(line_header::add_file_name): ... this method.  Use std::vector.
	(add_include_dir_stub): Delete.
	(read_formatted_entries): Remove memset.
	(dwarf_decode_line_header): Return a line_header_up instead of a
	raw pointer.  Remove cleanup handling.  Pass lambdas to
	read_formatted_entries.  Adjust to use line_header methods.
	(dwarf_decode_lines_1): Adjust to use line_header methods.
	(dwarf_decode_lines, file_file_name, file_full_name): Adjust to
	use std::vector.
2017-04-04 20:03:25 +01:00
Jon Turney 477bdd393c Use symbolic constants instead of magic numbers with add_data_entry()
Use symbolic constants from include/coff/internal.h instead of magic numbers
with add_data_entry()

bfd/ChangeLog:

2017-04-02  Jon Turney  <jon.turney@dronecode.org.uk>

	(_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
	numbers for DataDirectory entry indicies passed to
	add_data_entry().
2017-04-04 19:12:27 +01:00
H.J. Lu a91e1603af Support ELF SHF_GNU_MBIND and PT_GNU_MBIND_XXX
Mark an ALLOC section, which should be placed in special memory area,
with SHF_GNU_MBIND.  Its sh_info field indicates the special memory
type.  GNU_MBIND section names start with ".mbind" so that they are
placed as orphan sections by linker.  All input GNU_MBIND sections
with the same sh_type, sh_flags and sh_info are placed in one output
GNU_MBIND section.  In executable and shared object, create a
GNU_MBIND segment for each GNU_MBIND section and its segment type is
PT_GNU_MBIND_LO plus the sh_info value.  Each GNU_MBIND segment is
aligned at page boundary.

The assembler syntax:

    .section .mbind.foo,"adx",%progbits
                          ^             0: Special memory type.
                          |
                         'd' for SHF_GNU_MBIND.

    .section .mbind.foo,"adx",%progbits,0x1
                          ^             1: Special memory type.
                          |
                         'd' for SHF_GNU_MBIND.

    .section .mbind.bar,"adG",%progbits,.foo_group,comdat,0x2
                          ^                               2: Special memory type.
                          |
                         'd' for SHF_GNU_MBIND.

bfd/

	* elf.c (get_program_header_size): Add a GNU_MBIND segment for
	each GNU_MBIND section and align GNU_MBIND section to page size.
	(_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
	segment for each GNU_MBIND section.
	(_bfd_elf_init_private_section_data): Copy sh_info from input
	for GNU_MBIND section.

binutils/

	* NEWS: Mention support for ELF SHF_GNU_MBIND and
	PT_GNU_MBIND_XXX.
	* readelf.c (get_segment_type): Handle PT_GNU_MBIND_XXX.
	(get_elf_section_flags): Handle SHF_GNU_MBIND.
	(process_section_headers): Likewise.
	* testsuite/binutils-all/mbind1.s: New file.
	* testsuite/binutils-all/objcopy.exp: Run readelf test on
	mbind1.s.

gas/

	* NEWS: Mention support for ELF SHF_GNU_MBIND.
	* config/obj-elf.c (section_match): New.
	(get_section): Match both sh_info and group name.
	(obj_elf_change_section): Add argument for sh_info.  Pass both
	sh_info and group name to get_section. Issue an error for
	SHF_GNU_MBIND section without SHF_ALLOC.  Set sh_info.
	(obj_elf_parse_section_letters): Set SHF_GNU_MBIND for 'd'.
	(obj_elf_section): Support SHF_GNU_MBIND section info.
	* config/obj-elf.h (obj_elf_change_section): Add argument for
	sh_info.
	* config/tc-arm.c (start_unwind_section): Pass 0 as sh_info to
	obj_elf_change_section.
	* config/tc-ia64.c (obj_elf_vms_common): Likewise.
	* config/tc-microblaze.c (microblaze_s_data): Likewise.
	(microblaze_s_sdata): Likewise.
	(microblaze_s_rdata): Likewise.
	(microblaze_s_bss): Likewise.
	* config/tc-mips.c (s_change_section): Likewise.
	* config/tc-msp430.c (msp430_profiler): Likewise.
	* config/tc-rx.c (parse_rx_section): Likewise.
	* config/tc-tic6x.c (tic6x_start_unwind_section): Likewise.
	* doc/as.texinfo: Document 'd' for SHF_GNU_MBIND.
	* testsuite/gas/elf/elf.exp: Run section12a, section12b and
	section13.
	* testsuite/gas/elf/section10.d: Updated.
	* testsuite/gas/elf/section10.s: Likewise.
	* testsuite/gas/elf/section12.s: New file.
	* testsuite/gas/elf/section12a.d: Likewise.
	* testsuite/gas/elf/section12b.d: Likewise.
	* testsuite/gas/elf/section13.l: Likewise.
	* testsuite/gas/elf/section13.d: Likewise.
	* testsuite/gas/elf/section13.s: Likewise.

include/

	* elf/common.h (PT_GNU_MBIND_NUM): New.
	(PT_GNU_MBIND_LO): Likewise.
	(PT_GNU_MBIND_HI): Likewise.
	(SHF_GNU_MBIND): Likewise.

ld/

	* NEWS: Mention support for ELF SHF_GNU_MBIND and
	PT_GNU_MBIND_XXX.
	* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Place
	input GNU_MBIND sections with the same type, attributes and
	sh_info field into a single output GNU_MBIND section.
	* testsuite/ld-elf/elf.exp: Run mbind2a and mbind2b.
	* testsuite/ld-elf/mbind1.s: New file.
	* testsuite/ld-elf/mbind1a.d: Likewise.
	* testsuite/ld-elf/mbind1b.d: Likewise.
	* testsuite/ld-elf/mbind1c.d: Likewise.
	* testsuite/ld-elf/mbind2a.s: Likewise.
	* testsuite/ld-elf/mbind2b.c: Likewise.
2017-04-04 09:06:04 -07:00
Palmer Dabbelt b52920324f RISC-V: Resurrect GP-relative disassembly hints
We missed a "_gp" when changing the GP symbol.  To make sure that
doesn't happen again, we now use the same definition everywhere (thanks,
Nick).

include/ChangeLog:

2017-04-03  Palmer Dabbelt  <palmer@dabbelt.com>

        * elf/riscv.h (RISCV_GP_SYMBOL): New define.

bfd/ChangeLog:

2017-04-03  Palmer Dabbelt  <palmer@dabbelt.com>

        * elfnn-riscv.c (GP_NAME): Delete.
        (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
        (_bfd_riscv_relax_lui): Likewise.

opcodes/ChangeLog:

2017-04-03  Palmer Dabbelt  <palmer@dabbelt.com>

        * riscv-dis.c (riscv_disassemble_insn): Change "_gp" to
        RISCV_GP_SYMBOL.
2017-04-04 08:29:16 -07:00
Simon Marchi 65dd1e590e gdbserver: Clear .deps on clean
In some situations, the dependency tracking files in .deps can refer to
source files that were removed or renamed, leading to errors like:

  make: *** No rule to make target `version.c', needed by `version.o'. Stop.

This patch makes the clean target clear the .deps directory, which gives
the user a chance to recover from the error wihtout knowing about the
internals of the build system.

It is already done for GDB.  See here for more details:

  https://sourceware.org/ml/gdb-patches/2009-03/msg00000.html

gdb/gdbserver/ChangeLog:

	* Makefile.in (clean): Clear .deps.
2017-04-04 10:50:01 -04:00
Simon Marchi d62a8ae2dd remote.c: Use ptid_t instead of struct ptid
It's the only place in the codebase that uses "struct ptid", so change
it to ptid_t for consistency.

gdb/ChangeLog:

	* remote.c (set_general_thread, set_continue_thread): Use ptid_t
	instead of struct ptid.
2017-04-04 10:31:50 -04:00
Nick Clifton ad32986fdf Fix null pointer dereferences when using a link built with clang.
PR binutils/21342
	* elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
	dereference.
	(bfd_elf_final_link): Only initialize the extended symbol index
	section if there are extended symbol tables to list.
2017-04-04 11:23:36 +01:00
Alan Hayward db3a1dc7c9 Remove MAX_REGISTER_SIZE from frame.c
gdb/
	* frame.c (get_frame_register_bytes): Unwind using value.
	(put_frame_register_bytes): Likewise.
2017-04-04 08:42:30 +01:00
GDB Administrator 4c220b4625 Automatic date update in version.in 2017-04-04 00:00:42 +00:00
Palmer Dabbelt c41cf6fdf5 RISC-V: Avoid a const warning
2017-04-03  Palmer Dabbelt  <palmer@dabbelt.com>

       * config/tc-riscv.c (riscv_clear_subsets): Cast argument to free to
       avoid const warnings.
2017-04-03 09:14:50 -07:00
Andrew Jenner 2f5f29cada IA16 support
* config.sub: Handle ia16 in $basic_machine.

       bfd/
       * config.bfd: Handle ia16.

       gas/
       * configure.tgt: Handle ia16.

       ld/
       * configure.tgt: Handle ia16.
2017-04-03 09:13:19 -07:00
H.J. Lu 2514e33e01 Correct the ChangeLog entry 2017-04-03 08:25:36 -07:00
H.J. Lu 46bed6796d ld: Support ELF GNU program properties
From .note.gnu.property section in each ELF input, we build a list of
GNU properties if .note.gnu.property section isn't corrupt.  The unknown
properties are ignored.  All property lists in relocatable inputs are
merged into an output property list.  When -z stack-size=N is used and
N isn't 0, the GNU_PROPERTY_STACK_SIZE property will be merged with or
added to the output property list.  .note.gnu.property section is
generated in output from the output property list.

bfd/

	* Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
	(BFD32_BACKENDS_CFILES): Add elf-properties.c.
	* configure.ac (elf): Add elf-properties.lo.
	* Makefile.in: Regenerated.
	* configure: Likewise.
	* elf-bfd.h (elf_property_kind): New.
	(elf_property): Likewise.
	(elf_property_list): Likewise.
	(elf_properties): Likewise.
	(_bfd_elf_parse_gnu_properties): Likewise.
	(_bfd_elf_get_property): Likewise.
	(_bfd_elf_link_setup_gnu_properties): Likewise.
	(elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
	and setup_gnu_properties.
	(elf_obj_tdata): Add properties.
	* elf-properties.c: New file.
	* elf32-i386.c (elf_i386_parse_gnu_properties): New.
	(elf_i386_merge_gnu_properties): Likewise.
	(elf_backend_parse_gnu_properties): Likewise.
	(elf_backend_merge_gnu_properties): Likewise.
	* elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
	(elf_x86_64_merge_gnu_properties): Likewise.
	(elf_backend_parse_gnu_properties): Likewise.
	(elf_backend_merge_gnu_properties): Likewise.
	* elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
	(elf_backend_parse_gnu_properties): Likewise.
	(elf_backend_setup_gnu_properties): Likewise.
	(elfNN_bed): Add elf_backend_parse_gnu_properties,
	elf_backend_merge_gnu_properties and
	elf_backend_setup_gnu_properties.

ld/

	* ld/NEWS: Mention support for ELF GNU program properties.
	* emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Call
	ELF setup_gnu_properties.
	* testsuite/ld-i386/i386.exp: Run property tests for Linux/i386.
	* testsuite/ld-i386/pass.c: New file.
	* testsuite/ld-i386/property-1.r: Likewise.
	* testsuite/ld-i386/property-2.r: Likewise.
	* testsuite/ld-i386/property-3.r: Likewise.
	* testsuite/ld-i386/property-4.r: Likewise.
	* testsuite/ld-i386/property-5.r: Likewise.
	* testsuite/ld-i386/property-6.r: Likewise.
	* testsuite/ld-i386/property-6a.c: Likewise.
	* testsuite/ld-i386/property-6b.c: Likewise.
	* testsuite/ld-i386/property-6c.S: Likewise.
	* testsuite/ld-i386/property-7.r: Likewise.
	* testsuite/ld-i386/property-no-copy.S: Likewise.
	* testsuite/ld-i386/property-stack.S: Likewise.
	* testsuite/ld-i386/property-unsorted-1.S: Likewise.
	* testsuite/ld-i386/property-unsorted-2.S: Likewise.
	* testsuite/ld-i386/property-x86-1.S: Likewise.
	* testsuite/ld-i386/property-x86-2.S: Likewise.
	* testsuite/ld-x86-64/pass.c: Likewise.
	* testsuite/ld-x86-64/property-1.r: Likewise.
	* testsuite/ld-x86-64/property-2.r: Likewise.
	* testsuite/ld-x86-64/property-3.r: Likewise.
	* testsuite/ld-x86-64/property-4.r: Likewise.
	* testsuite/ld-x86-64/property-5.r: Likewise.
	* testsuite/ld-x86-64/property-6.r: Likewise.
	* testsuite/ld-x86-64/property-6a.c: Likewise.
	* testsuite/ld-x86-64/property-6b.c: Likewise.
	* testsuite/ld-x86-64/property-6c.S: Likewise.
	* testsuite/ld-x86-64/property-7.r: Likewise.
	* testsuite/ld-x86-64/property-no-copy.S: Likewise.
	* testsuite/ld-x86-64/property-stack.S: Likewise.
	* testsuite/ld-x86-64/property-unsorted-1.S: Likewise.
	* testsuite/ld-x86-64/property-unsorted-2.S: Likewise.
	* testsuite/ld-x86-64/property-x86-1.S: Likewise.
	* testsuite/ld-x86-64/property-x86-2.S: Likewise.
	* testsuite/ld-x86-64/x86-64.exp: Run property tests for
	Linux/x86-64.
2017-04-03 08:08:27 -07:00
Nick Clifton 82156ab704 readelf: Fix overlarge memory allocation when reading a binary with an excessive number of program headers.
PR binutils/21345
	* readelf.c (get_program_headers): Check for there being too many
	program headers before attempting to allocate space for them.
2017-04-03 12:14:06 +01:00
Nick Clifton 75ec1fdbb7 Fix runtime seg-fault in readelf when parsing a corrupt MIPS binary.
PR binutils/21344
	* readelf.c (process_mips_specific): Check for an out of range GOT
	entry before reading the module pointer.
2017-04-03 11:13:21 +01:00
Nick Clifton f32ba72991 readelf: Update check for invalid word offsets in ARM unwind information.
PR binutils/21343
	* readelf.c (get_unwind_section_word): Fix snafu checking for
	invalid word offsets in ARM unwind information.
2017-04-03 11:01:45 +01:00
GDB Administrator 12bfb8fec3 Automatic date update in version.in 2017-04-03 00:00:37 +00:00
GDB Administrator 450b68da01 Automatic date update in version.in 2017-04-02 00:00:36 +00:00
GDB Administrator 5e6a0e7331 Automatic date update in version.in 2017-04-01 00:00:39 +00:00
Palmer Dabbelt fecb9c4665 RISC-V: Allow ISA subsets to be disabled
Without this patch, passing "-march=rv64ic -march=rv64i" results in
you getting a "RV64IC" toolchain, which isn't expected.

gas/ChangeLog:

2017-03-30  Palmer Dabbelt  <palmer@dabbelt.com>

       * config/tc-riscv.c (riscv_clear_subsets): New function.
       (riscv_add_subset): Call riscv_clear_subsets and riscv_set_rvc to
       clear RVC when it's been previously set.
2017-03-31 09:35:21 -07:00
Andrew Waterman 858f82bf7e RISC-V: Add physical memory protection CSRs
2017-03-27  Andrew Waterman  <andrew@sifive.com>

       * opcode/riscv-opc.h (CSR_PMPCFG0): New define.
       (CSR_PMPCFG1): Likewise.
       (CSR_PMPCFG2): Likewise.
       (CSR_PMPCFG3): Likewise.
       (CSR_PMPADDR0): Likewise.
       (CSR_PMPADDR1): Likewise.
       (CSR_PMPADDR2): Likewise.
       (CSR_PMPADDR3): Likewise.
       (CSR_PMPADDR4): Likewise.
       (CSR_PMPADDR5): Likewise.
       (CSR_PMPADDR6): Likewise.
       (CSR_PMPADDR7): Likewise.
       (CSR_PMPADDR8): Likewise.
       (CSR_PMPADDR9): Likewise.
       (CSR_PMPADDR10): Likewise.
       (CSR_PMPADDR11): Likewise.
       (CSR_PMPADDR12): Likewise.
       (CSR_PMPADDR13): Likewise.
       (CSR_PMPADDR14): Likewise.
       (CSR_PMPADDR15): Likewise.
       (pmpcfg0): Declare register.
       (pmpcfg1): Likewise.
       (pmpcfg2): Likewise.
       (pmpcfg3): Likewise.
       (pmpaddr0): Likewise.
       (pmpaddr1): Likewise.
       (pmpaddr2): Likewise.
       (pmpaddr3): Likewise.
       (pmpaddr4): Likewise.
       (pmpaddr5): Likewise.
       (pmpaddr6): Likewise.
       (pmpaddr7): Likewise.
       (pmpaddr8): Likewise.
       (pmpaddr9): Likewise.
       (pmpaddr10): Likewise.
       (pmpaddr11): Likewise.
       (pmpaddr12): Likewise.
       (pmpaddr13): Likewise.
       (pmpaddr14): Likewise.
       (pmpaddr15): Likewise.
2017-03-31 09:35:11 -07:00
Simon Marchi 8fa5b77748 gdbserver: Suffix generated C files with -generated
I noticed that there were some missing files in gdbserver's gitignore
(some generated register format .c files).  Of course the easy fix would
be to add those files to .gitignore, but I think we can do a better job,
so that we don't have to worry about adding generated files to
.gitignore or the clean Makefile target.

I suggest naming all generated source files -generated.c.  This way, we
can use a single rule in .gitignore and do a "rm -f *-generated.c" to
clean them up.

New in v2:

  - Don't rename version.o and xml-builtin.o

gdb/gdbserver/ChangeLog:

	* .gitignore: Remove generated files, replace with wildcard.
	* (clean): Replace removal of generated files with wildcard.
	(version.c): Replace with...
	(version-generated.c): ...this.
	(xml-builtin.c): Replace with...
	(xml-builtin-generated.c): ...this.
	(%-ipa.o: %-generated.c, %.o: %-generated.c): New rules.
	(%.c: *regformats*): Replace with...
	(%-generated.c: *regformats*): ...this.
2017-03-31 11:19:44 -04:00
Pip Cet efdf7a02db Fix minor problems with previous wasm32 binutils commit.
binutils * NEWS: Use "WebAssembly" consistently.
	* testsuite/binutils-all/wasm32/wasm32.exp: Fix copyright notice.
2017-03-31 13:07:01 +01:00
Nick Clifton dc1e4d6ded Reduce the size of s390 symbol tables by allowing relocations in mergeable string sections (eg .debug_str) to be made section relative rather than symbol relative.
PR gas/21333
	* config/tc-s390.c (tc_s390_fix_adjustable): Allow non pc-relative
	fixups in mergeable sections to be adjusted.
2017-03-31 12:54:38 +01:00
GDB Administrator 938ec663b8 Automatic date update in version.in 2017-03-31 00:00:31 +00:00