Go to file
Nick Alcock 9323dd869d libctf: make ctf_dump not crash on OOM
ctf_dump calls ctf_str_append extensively but never checks to see if it
returns NULL (on OOM).  If it ever does, we truncate the string we are
appending to and leak it!

Instead, create a variant of ctf_str_append that returns the *original
string* on OOM, and use it in ctf-dump.  It is far better to omit a tiny
piece of a dump on OOM than to omit a bigger piece, and it is also
better to do this in what is after all purely debugging code than it is
to uglify ctf-dump.c with huge numbers of checks for the out-of-memory
case.  Slightly truncated debugging output is better than no debugging
output at all and an out-of-memory message.

New in v4.

libctf/
	* ctf-impl.h (ctf_str_append_noerr): Declare.
	* ctf-util.c (ctf_str_append_noerr): Define in terms of
	ctf_str_append.
	* ctf-dump.c (str_append): New, call it.
	(ctf_dump_format_type): Use str_append, not ctf_str_append.
	(ctf_dump_label): Likewise.
	(ctf_dump_objts): Likewise.
	(ctf_dump_funcs): Likewise.
	(ctf_dump_var): Likewise.
	(ctf_dump_member): Likewise.
	(ctf_dump_type): Likewise.
	(ctf_dump): Likewise.
2019-10-03 17:04:56 +01:00
bfd bfd, ld: add CTF section linking 2019-10-03 17:04:56 +01:00
binutils objdump: get CTF parent importing right 2019-10-03 17:04:56 +01:00
config
contrib
cpu
elfcpp
etc
gas
gdb gdb: Don't ignore all SIGSTOP when the signal handler is set to pass 2019-10-03 16:12:02 +01:00
gnulib
gold
gprof
include libctf: remove ctf_malloc, ctf_free and ctf_strdup 2019-10-03 17:04:56 +01:00
intl
ld libctf: installable libctf as a shared library 2019-10-03 17:04:56 +01:00
libctf libctf: make ctf_dump not crash on OOM 2019-10-03 17:04:56 +01:00
libdecnumber
libiberty
opcodes
readline
sim
texinfo
zlib
.cvsignore
.gitattributes
.gitignore
ar-lib
ChangeLog libctf: installable libctf as a shared library 2019-10-03 17:04:56 +01:00
compile
config-ml.in
config.guess
config.rpath
config.sub
configure
configure.ac
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 libctf: installable libctf as a shared library 2019-10-03 17:04:56 +01:00
Makefile.in libctf: installable libctf as a shared library 2019-10-03 17:04:56 +01:00
Makefile.tpl
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
README-maintainer-mode
setup.com
src-release.sh
symlink-tree
test-driver
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.