Fix bug 69872.  This change adds a coredumper to vg_signal.c.  This means
that when the client is killed by a coredumping signal, Valgrind will
generate the coredump itself, which is full of client state, rather than
Valgrind state; this core file will therefore be useful to the developer
in debugging their program.

The corefile generated is named vgcore.pidNNNNN (and maybe with .M on
the end in case of duplicates).  If you set a logfile with --logfile,
then this name will be used as the basename for the core file, so that
both the core and the logs will be next to each other.

Valgrind respects the RLIMIT_CORE limit when generating the file; if the
limit is set to 0, then it will not generate one.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2312 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_memory.c b/coregrind/vg_memory.c
index 7f5121b..629837f 100644
--- a/coregrind/vg_memory.c
+++ b/coregrind/vg_memory.c
@@ -551,6 +551,11 @@
    return VG_(SkipList_Find)(&sk_segments, &a);
 }
 
+Segment *VG_(first_segment)(void)
+{
+   return VG_(SkipNode_First)(&sk_segments);
+}
+
 Segment *VG_(next_segment)(Segment *s)
 {
    return VG_(SkipNode_Next)(&sk_segments, s);