freebsd-ports/devel/valgrind-snapshot/files/patch-coregrind-vg_signals.c
Simon Barner d711a485a0 - Fix on FreeBSD 6 and above: [1] [2]
Valgrind did not handle the following sysarch calls, and thus crashed
  immediately
    o get_fsbase
    o set_fsbase
    o get_gsbase
    o set_fsbase

- Valgrind no longer dumps core when its client application does. [2]

  Valgrind-snapshot does contain for safing the client's core dump,
  but it does not work (it resulted in a crash) and has therefore been
  disabled.

- Fix crash with valgrind-snapshot when the application to debug
  does not exists or cannot be accessed.

- Fix symlink farms for threading libraries. FreeBSD 4-7 are
  handled. [2]

- Bump PORTREVISION

Reported by:	Ulrich Spoerlein <q@galgenberg.net> [1],
		Chris Gilbert <Chris@lainos.org> [2]
PR:		ports/86007 [1]
2005-09-20 00:40:08 +00:00

26 lines
923 B
C

--- coregrind/vg_signals.c.orig Sun May 9 13:00:57 2004
+++ coregrind/vg_signals.c Mon Sep 19 18:18:07 2005
@@ -1374,6 +1374,12 @@
#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */
#endif /* NT_PRXFPREG */
+// FIXME: Needed for FreeBSD 4, same ugly hack as in coregrind/ume.c XXX
+#ifndef ELFMAG
+#define ELFMAG "\177ELF"
+#define SELFMAG 4
+#endif
+
/* If true, then this Segment may be mentioned in the core */
static Bool may_dump(const Segment *seg)
{
@@ -1900,8 +1906,8 @@
if (core) {
static struct vki_rlimit zero = { 0, 0 };
- make_coredump(tid, info, corelim.rlim_cur);
-
+ // make_coredump(tid, info, corelim.rlim_cur);
+ VG_(message) (Vg_UserMsg, "Core dumping is broken on FreeBSD. Please re-run valgrind after fixing the crash.");
/* make sure we don't get a confusing kernel-generated coredump */
VG_(setrlimit)(VKI_RLIMIT_CORE, &zero);
}