From: Nicholas Nethercote Date: Fri, 26 Nov 2004 14:07:24 +0000 (+0000) Subject: Disable core dumps, and remove the previous attempts at factoring out X-Git-Tag: svn/VALGRIND_3_0_0~1203 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8c0f0e619ce444258e19f91cbe2abd294fb4aa1;p=thirdparty%2Fvalgrind.git Disable core dumps, and remove the previous attempts at factoring out the arch-specific bits, which were just plain wrong. This is a problem for a later day. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3115 --- diff --git a/coregrind/core.h b/coregrind/core.h index 5f33c67b23..7d131eab07 100644 --- a/coregrind/core.h +++ b/coregrind/core.h @@ -1779,14 +1779,6 @@ extern Bool VGA_(setup_pointercheck) ( void ); // For attaching the debugger extern Int VGA_(ptrace_setregs_from_tst) ( Int pid, ThreadArchState* arch ); -// Making coredumps -extern void VGA_(fill_elfregs_from_tst) ( struct vki_user_regs_struct* regs, - ThreadArchState* arch ); -extern void VGA_(fill_elffpregs_from_tst) ( vki_elf_fpregset_t* fpu, - const ThreadArchState* arch ); -extern void VGA_(fill_elffpxregs_from_tst) ( vki_elf_fpxregset_t* xfpu, - const ThreadArchState* arch ); - // Signal stuff extern void VGA_(push_signal_frame) ( ThreadId tid, Addr sp_top_of_frame, const vki_siginfo_t *siginfo, diff --git a/coregrind/vg_signals.c b/coregrind/vg_signals.c index 4613afd957..0093c4dfa3 100644 --- a/coregrind/vg_signals.c +++ b/coregrind/vg_signals.c @@ -979,6 +979,9 @@ void VG_(kill_self)(Int sigNo) VG_(sigprocmask)(VKI_SIG_SETMASK, &origmask, NULL); } +// Core dumping is disabled until someone can work out how to abstract out +// the arch-specific and word-size-specific parts neatly. +#if 0 /* Dump core @@ -1300,6 +1303,7 @@ static void make_coredump(ThreadId tid, const vki_siginfo_t *si, UInt max_size) VG_(close)(core_fd); } +#endif /* Perform the default action of a signal. Returns if the default @@ -1433,6 +1437,8 @@ static void vg_default_action(const vki_siginfo_t *info, ThreadId tid) VG_(start_debugger)( tid ); } + // See comment above about this temporary disabling of core dumps. + #if 0 if (core) { static struct vki_rlimit zero = { 0, 0 }; @@ -1441,6 +1447,7 @@ static void vg_default_action(const vki_siginfo_t *info, ThreadId tid) /* make sure we don't get a confusing kernel-generated coredump */ VG_(setrlimit)(VKI_RLIMIT_CORE, &zero); } + #endif VG_(scheduler_handle_fatal_signal)( sigNo ); } diff --git a/coregrind/x86/signal.c b/coregrind/x86/signal.c index 6c49969114..f021b695c0 100644 --- a/coregrind/x86/signal.c +++ b/coregrind/x86/signal.c @@ -301,6 +301,9 @@ Int VGA_(pop_signal_frame)(ThreadId tid) /*--- Making coredumps ---*/ /*------------------------------------------------------------*/ +// Nb: these functions do *not* represent the right way to abstract out the +// arch-specific parts of coredumps. Some rethinking is required. +#if 0 void VGA_(fill_elfregs_from_tst)(struct vki_user_regs_struct* regs, ThreadArchState* arch) { @@ -324,7 +327,6 @@ void VGA_(fill_elfregs_from_tst)(struct vki_user_regs_struct* regs, regs->gs = arch->vex.guest_GS; } -#if 0 static void fill_fpu(vki_elf_fpregset_t *fpu, const Char *from) { if (VG_(have_ssestate)) { @@ -342,29 +344,29 @@ static void fill_fpu(vki_elf_fpregset_t *fpu, const Char *from) } else VG_(memcpy)(fpu, from, sizeof(*fpu)); } -#endif void VGA_(fill_elffpregs_from_BB)( vki_elf_fpregset_t* fpu ) { - //fill_fpu(fpu, (const Char *)&VG_(baseBlock)[VGOFF_(m_ssestate)]); + fill_fpu(fpu, (const Char *)&VG_(baseBlock)[VGOFF_(m_ssestate)]); } void VGA_(fill_elffpregs_from_tst)( vki_elf_fpregset_t* fpu, const ThreadArchState* arch) { - //fill_fpu(fpu, (const Char *)&arch->m_sse); + fill_fpu(fpu, (const Char *)&arch->m_sse); } void VGA_(fill_elffpxregs_from_BB) ( vki_elf_fpxregset_t* xfpu ) { - //VG_(memcpy)(xfpu, &VG_(baseBlock)[VGOFF_(m_ssestate)], sizeof(*xfpu)); + VG_(memcpy)(xfpu, &VG_(baseBlock)[VGOFF_(m_ssestate)], sizeof(*xfpu)); } void VGA_(fill_elffpxregs_from_tst) ( vki_elf_fpxregset_t* xfpu, const ThreadArchState* arch ) { - //VG_(memcpy)(xfpu, arch->m_sse, sizeof(*xfpu)); + VG_(memcpy)(xfpu, arch->m_sse, sizeof(*xfpu)); } +#endif /*--------------------------------------------------------------------*/ /*--- end ---*/