Go to file
Joel Brobecker 7c647d6155 warn if "source" fails to open the file when from_tty == 0
Consider the following example:

    % gdb -q -batch -ex 'source nonexistant-file'
    [nothing]

One would have at least expected the debugger to warn about
not finding the file, similar to the error shown when using
a more interactive mode. Eg:

    (gdb) source nonexistant-file
    nonexistant-file: No such file or directory.

Not raising an error appears to be intentional, presumably in order
to prevent this situation from stoping the execution of a GDB script.
But the lack of at least a warning makes it harder for a user to
diagnose any issue, if the file was expected to be there and readable.

This patch adds a warning in that case:

    % gdb -q -batch -ex 'source nonexistant-file'
    warning: nonexistant-file: No such file or directory.

gdb/ChangeLog:

        * utils.h (perror_warning_with_name): Add declaration.
        * utils.c (perror_warning_with_name): New function.
        * cli/cli-cmds.c (source_script_with_search): Add call to
        perror_warning_with_name if from_tty is nul.

gdb/testsuite/ChangeLog:

        * gdb.base/source-nofile.gdb: New file.
        * gdb.base/source.exp: Add two tests verifying the behavior when
        the "source" command is given a non-existant filename.
2013-10-11 08:23:11 +00:00
bfd daily update 2013-10-10 23:00:05 +00:00
binutils Fix typo in previous delta. 2013-10-09 16:37:44 +00:00
config
cpu
elfcpp
etc
gas * Removed short_hand field from opcode table and 2013-10-11 04:55:42 +00:00
gdb warn if "source" fails to open the file when from_tty == 0 2013-10-11 08:23:11 +00:00
gold gold/ 2013-10-07 17:08:34 +00:00
gprof PR gprof/16027 2013-10-09 16:34:30 +00:00
include * Removed short_hand field from opcode table and 2013-10-11 04:55:42 +00:00
intl
ld ld/ 2013-10-10 22:50:40 +00:00
libdecnumber
libiberty
opcodes * Removed short_hand field from opcode table and 2013-10-11 04:55:42 +00:00
readline
sim sim/erc32/ChangeLog: 2013-10-09 21:42:11 +00:00
texinfo
.cvsignore
.gitignore
ChangeLog 2013-10-08 Jan-Benedict Glaw <jbglaw@lug-owl.de> 2013-10-08 14:14:12 +00:00
compile
config-ml.in
config.guess
config.rpath
config.sub
configure 2013-10-08 Jan-Benedict Glaw <jbglaw@lug-owl.de> 2013-10-08 14:14:12 +00:00
configure.ac 2013-10-08 Jan-Benedict Glaw <jbglaw@lug-owl.de> 2013-10-08 14:14:12 +00:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
depcomp
djunpack.bat
install-sh
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
README
README-maintainer-mode
setup.com
src-release
symlink-tree
ylwrap

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.