New flag OBJF_NOT_FILENAME

gdb/
2013-10-09  Jan Kratochvil  <jan.kratochvil@redhat.com>

	New flag OBJF_NOT_FILENAME.
	* auto-load.c (auto_load_objfile_script): Check also OBJF_NOT_FILENAME.
	* jit.c (jit_object_close_impl): Use OBJF_NOT_FILENAME for
	allocate_objfile.
	(jit_bfd_try_read_symtab): Use OBJF_NOT_FILENAME for
	symbol_file_add_from_bfd.
	* jv-lang.c (get_dynamics_objfile): Use OBJF_NOT_FILENAME for
	allocate_objfile.
	* objfiles.c (allocate_objfile): Assert OBJF_NOT_FILENAME if NAME is
	NULL.
	* objfiles.h (OBJF_NOT_FILENAME): New.
bfd
	* bfd-in2.h: Rebuild.
	* opncls.c (bfd_get_alt_debug_link_info): Change type of
	buildid_len to bfd_size_type.
gdb
	* dwarf2read.c (dwarf2_get_dwz_file): Update for type change in
	bfd_get_alt_debug_link_info.
Uniquefy gdb.base/catch-syscall.exp test names.

catch-syscall.exp has a series of duplicated output in gdb.sum.  This
patch makes sure all test names are unique, using with_test_prefix.

Tested on x86_64 Fedora 17.

gdb/testsuite/
2013-10-09  Pedro Alves  <palves@redhat.com>

	* gdb.base/catch-syscall.exp (test_catch_syscall_without_args)
	(test_catch_syscall_with_args, test_catch_syscall_with_many_args)
	(test_catch_syscall_with_wrong_args)
	(test_catch_syscall_restarting_inferior)
	(test_catch_syscall_fail_nodatadir)
	(test_catch_syscall_without_args_noxml)
	(test_catch_syscall_with_args_noxml)
	(test_catch_syscall_with_wrong_args_noxml): Use with_test_prefix.
	PR ld/16021
	* elf32-rl78.c (rl78_dump_symtab): Delete.
	(rl78_get_reloc): Delete.
	* opncls.c (get_alt_debug_link_info_shim): Update type of 'len'.
monitor.c: Don't install a deprecated_xfer_memory method.

This removes another yet instance of a deprecated_xfer_memory user.

Tested by building a --enable-targets=all gdb, on x86-64 Fedora 17.

gdb/
2013-10-09  Pedro Alves  <palves@redhat.com>

	* monitor.c (monitor_write_memory, monitor_write_memory_bytes)
	(monitor_write_memory_longlongs, monitor_write_memory_block):
	Constify 'myaddr' parameter.
	(monitor_xfer_memory): Adjust interface as monitor_xfer_partial
	helper.
	(monitor_xfer_partial): New function.
	(init_base_monitor_ops): Don't install a deprecated_xfer_memory
	hook.  Install a to_xfer_partial hook.
Minor O_CLOEXEC optimization, "regression" fix

gdb/
2013-10-09  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* common/filestuff.c (gdb_fopen_cloexec): Remove initialization of
	result variable.  Rename variable fopen_e_ever_failed to
	fopen_e_ever_failed_einval.  Retry fopen only for errno EINVAL.
	PR binutils/16022
	* elf32-rx.c (rx_dump_symtab): Add missing break statements.
Stop using errno values around target_xfer interfaces and memory errors.

target_read_memory & friends build on top of target_read (thus on top
of the target_xfer machinery), but turn all errors to EIO, an errno
value.  I think we'd better convert all these to return a
target_xfer_error too, like target_xfer_partial in a previous patch.
The patch starts by doing that.

(The patch does not add a enum target_xfer_error value for '0'/no
error, and likewise does not change the return type of several of
these functions to enum target_xfer_error, because different functions
return '0' with different semantics.)

I audited the tree for memory_error calls, EIO checks, places where
GDB hardcodes 'errno = EIO', and also for strerror calls.  What I
found is that nowadays there's really no need to handle random errno
values, other than the EIOs gdb itself hardcodes.  No doubt errno
values would appear in common code back in the day when
target_xfer_memory was the main interface to access memory, but
nowadays, any errno value that deprecated interface could return is
just absorved by default_xfer_partial:

      else if (xfered == 0 && errno == 0)
	/* "deprecated_xfer_memory" uses 0, cross checked against
           ERRNO as one indication of an error.  */
	return 0;
      else
	return -1;

There are two places in the code that check for EIO and print "out of
bounds", and defer to strerror for other errors.  That's
c-lang.c:c_get_string, and valprint.c.:val_print_string.  AFAICT, the
strerror branch can never be reached nowadays, as the only error
possible to get at those points is EIO, given that it's GDB itself
that set that errno value (in target_read_memory, etc.).

breakpoint.c:insert_bp_location always prints the error val as if an
errno, returned by target_insert_breakpoint, with strerr.  Now the
error here is either always EIO for mem-break.c targets (again
hardcoded by the target_read_memory/target_write_memory functions), so
this always prints "Input/output error" or similar (depending on
host), or, for remote targets (and probably others), this gem:

  Error accessing memory address 0x80200400: Unknown error -1.

This patch makes these 3 places print the exact same error
memory_error prints.  This changes output, but I think this is better,
for making memory error output consistent with other commands, and, it
means we have a central place to tweak for memory errors.

E.g., this changes:

 Cannot insert breakpoint 1.
 Error accessing memory address 0x5fc660: Input/output error.

to:

 Cannot insert breakpoint 1.
 Cannot access memory at address 0x5fc660

Which I find pretty much acceptable.

Surprisingly, only py-prettyprint.exp had a regression, for needing an
adjustment.  I also grepped the testsuite for the old errors, and
found no other hits.

Now that errno values aren't used anywhere in any of these memory
access related routines, I made memory_error itself take a
target_xfer_error instead of an errno.  The new
target_xfer_memory_error function added recently is no longer
necessary, and is thus removed.

Tested on x86_64 Fedora 17, native and gdbserver.

gdb/
2013-10-09  Pedro Alves  <palves@redhat.com>

	* breakpoint.c (insert_bp_location): Use memory_error_message to
	build the memory error string.
	* c-lang.c: Include "gdbcore.h".
	(c_get_string): Use memory_error to throw error.
	(target_xfer_memory_error): Delete.
	(memory_error_message): New, factored out from
	target_xfer_memory_error.
	(memory_error): Change parameter type to target_xfer_error.
	Rewrite.
	(read_memory): Use memory_error instead of
	target_xfer_memory_error.
	* gdbcore.h: Include "target.h".
	(memory_error): Change parameter type to target_xfer_error.
	(memory_error_message): Declare function.
	* target.c (target_read_memory, target_read_stack)
	(target_write_memory, target_write_raw_memory): Return
	TARGET_XFER_E_IO on error.  Adjust comments.
	(get_target_memory): Pass TARGET_XFER_E_IO to memory_error,
	instead of EIO.
	* target.h (target_read, target_insert_breakpoint)
	(target_remove_breakpoint): Adjust comments.
	* valprint.c (partial_memory_read): Rename parameter, and adjust
	comment.
	(val_print_string): Use memory_error_message to build the memory
	error string.

gdb/testsuite/
2013-10-09  Pedro Alves  <palves@redhat.com>

	* gdb.python/py-prettyprint.exp (run_lang_tests): Adjust expected
	output.
bfd/
	* elfxx-tilegx.c (tilegx32_plt_tail_entry, tilegx32_plt_tail_entry):
	Move second const qualifier so it applies to the pointer.
bfd/
	* xcofflink.c (_bfd_xcoff_bfd_final_link): Don't touch EREL in
	loop that doesn't use (or initialize) it.
bfd/
	* elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Cast switch
	expression to int to silence over-eager compiler warnings.
sim/erc32/ChangeLog:
2013-10-09  Sergio Durigan Junior  <sergiodj@redhat.com>

	PR sim/16018:
	* float.c (set_fsr): Add missing "break" statements.  Reindent
	code.
daily update
Rename "set/show remotebaud" command into "set/show serial baud"

This patch renames the "set/show remotebaud" commands into
"set/show serial baud", and moves its implementation into serial.c.
It also moves the "baud_rate" global from top.c to serial.c, where
the new code is being added (the alternative was to add an include
of target.h).

And to facilitate the transition to the new setting name, this
patch also preserves the old commands, and marks them as deprecated
to alert the users of the change.

gdb/ChangeLog:

        * cli/cli-cmds.c (show_baud_rate): Moved to serial.c as
        serial_baud_show_cmd.
        (_initialize_cli_cmds): Delete the code creating the
        "set/show remotebaud" commands.
        * serial.c (baud_rate): Move here from top.c.
        (serial_baud_show_cmd): Move here from cli/cli-cmds.c.
        (_initialize_serial): Create "set/show serial baud" commands.
        Add "set/show remotebaud" command aliases.
        * top.c (baud_rate): Moved to serial.c.
        * NEWS: Document the new "set/show serial baud" commands,
        replacing "set/show remotebaud".

gdb/doc/ChangeLog:

        * gdb.texinfo: Replace "set remotebaud" and "show remotebaud"
        by "set serial baud" and "show serial baud" (resp) throughout.
Remove unnecessary @w{} in gdb.texinfo

gdb/doc/ChangeLog:

        * gdb.texinfo (Connecting): Remove unnecessary @w{}.