]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Modularised vg_signals.c as m_signals.c.
authorNicholas Nethercote <njn@valgrind.org>
Tue, 31 May 2005 01:00:08 +0000 (01:00 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Tue, 31 May 2005 01:00:08 +0000 (01:00 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3820

coregrind/Makefile.am
coregrind/core.h
coregrind/linux/core_os.c
coregrind/m_main.c
coregrind/m_scheduler/scheduler.c
coregrind/m_sigframe/sigframe-amd64-linux.c
coregrind/m_sigframe/sigframe-x86-linux.c
coregrind/m_signals.c [moved from coregrind/vg_signals.c with 99% similarity]
coregrind/m_syscalls/priv_syscalls.h
coregrind/m_translate.c
coregrind/pub_core_signals.h [new file with mode: 0644]

index 7c52a537345cad788da0619d6463745ae3209e32..ecd58773c3b7ca2e6d9902bfd7e5d1ffb01784e7 100644 (file)
@@ -51,6 +51,7 @@ noinst_HEADERS = \
        pub_core_replacemalloc.h\
        pub_core_scheduler.h    \
        pub_core_sigframe.h     \
+       pub_core_signals.h      \
        pub_core_skiplist.h     \
        pub_core_stacktrace.h   \
        pub_core_syscalls.h     \
@@ -89,6 +90,7 @@ stage2_SOURCES = \
        m_mallocfree.c \
        m_options.c \
        m_redir.c \
+       m_signals.c \
        m_skiplist.c \
        m_stacktrace.c \
        m_tooliface.c \
@@ -99,7 +101,6 @@ stage2_SOURCES = \
        vg_messages.c \
        vg_mylibc.c \
        vg_dummy_profile.c \
-       vg_signals.c \
        vg_symtab2.c \
        vg_threadmodel.c \
        vg_pthreadmodel.c \
index 3f8aec31a603f20dac216705923cbbf4c97e1300..33881020cb756d6c880e8e334a224abd9ecc30be 100644 (file)
@@ -137,51 +137,6 @@ extern void VG_(done_profiling) ( void );
 #define VG_WRAPPER_ALIAS(name) "_vgw_" #name
 
 
-/* ---------------------------------------------------------------------
-   Exports of vg_signals.c
-   ------------------------------------------------------------------ */
-
-/* Highest signal the kernel will let us use */
-extern Int VG_(max_signal);
-
-extern void VG_(sigstartup_actions) ( void );
-
-/* Poll a thread's set of pending signals, and update the Thread's context to deliver one */
-extern void VG_(poll_signals) ( ThreadId );
-
-/* Fake system calls for signal handling. */
-extern Int VG_(do_sys_sigaltstack) ( ThreadId tid, vki_stack_t* ss,
-                                                   vki_stack_t* oss );
-extern Int VG_(do_sys_sigaction)   ( Int signo, 
-                                     const struct vki_sigaction *new_act, 
-                                     struct vki_sigaction *old_act );
-extern Int VG_(do_sys_sigprocmask) ( ThreadId tid, Int how, 
-                                     vki_sigset_t* set,
-                                     vki_sigset_t* oldset );
-
-extern void VG_(clear_out_queued_signals) 
-                  ( ThreadId tid, /* OUT */ vki_sigset_t* saved_mask );
-
-extern void VG_(kill_self)(Int sigNo);
-
-/* These function synthesize a fault, as if the running instruction
-   had had a fault.  These functions do not return - they longjmp back
-   into the scheduler so the signal can be delivered. */
-extern void VG_(synth_fault)        (ThreadId tid);
-extern void VG_(synth_fault_mapping)(ThreadId tid, Addr addr);
-extern void VG_(synth_fault_perms)  (ThreadId tid, Addr addr);
-extern void VG_(synth_sigill)       (ThreadId tid, Addr addr);
-
-/* Extend the stack to cover addr, if possible */
-extern Bool VG_(extend_stack)(Addr addr, UInt maxsize);
-
-/* Returns True if the signal is OK for the client to use */
-extern Bool VG_(client_signal_OK)(Int sigNo);
-
-/* Forces the client's signal handler to SIG_DFL - generally just
-   before using that signal to kill the process. */
-extern void VG_(set_default_handler)(Int sig);
-
 /* ---------------------------------------------------------------------
    Exports of vg_mylibc.c
    ------------------------------------------------------------------ */
index 5247db38a8280425d54c2f66d8c4e7eaa0eab6ea..1c65a296027d67be548925ec2ce9100237b9c5f8 100644 (file)
@@ -31,6 +31,7 @@
 #include "core.h"
 #include "pub_core_debuglog.h"
 #include "pub_core_options.h"
+#include "pub_core_signals.h"
 #include "pub_core_tooliface.h"
 
 void VGO_(os_state_clear)(ThreadState *tst)
index 0709cd36d88c7f389c1db05ad6d69e1776bcc13f..dac1c15f5e7edf9ac77d581ca2353cc3cfb4dcc5 100644 (file)
@@ -39,6 +39,7 @@
 #include "pub_core_main.h"
 #include "pub_core_options.h"
 #include "pub_core_redir.h"
+#include "pub_core_signals.h"
 #include "pub_core_syscalls.h"
 #include "pub_core_tooliface.h"
 #include "pub_core_transtab.h"
index ab07a947ca436fa1b724dbcffbeb5943a897fdc5..1e2c2a3610e4bdba5b28024bec0f476a3178d2e8 100644 (file)
@@ -67,6 +67,7 @@
 #include "pub_core_options.h"
 #include "pub_core_replacemalloc.h"
 #include "pub_core_scheduler.h"
+#include "pub_core_signals.h"
 #include "pub_core_stacktrace.h"
 #include "pub_core_syscalls.h"
 #include "pub_core_tooliface.h"
index a4e0ce3bf0e7f8c84a520e524a7131467b00dc95..5509b1bdd23615201865717a68e058bf71f502f0 100644 (file)
@@ -33,6 +33,7 @@
 #include "pub_core_aspacemgr.h"
 #include "pub_core_options.h"
 #include "pub_core_sigframe.h"
+#include "pub_core_signals.h"
 #include "pub_core_tooliface.h"
 
 #include "libvex_guest_amd64.h"
index 884f41b98f74f044fd8f617ba87b750957f14f53..58012eed4f0f733e63bc9c311ae151269cb995a6 100644 (file)
@@ -33,6 +33,7 @@
 #include "pub_core_aspacemgr.h" /* find_segment */
 #include "pub_core_options.h"
 #include "pub_core_sigframe.h"
+#include "pub_core_signals.h"
 #include "pub_core_tooliface.h"
 
 #include "libvex_guest_x86.h"
similarity index 99%
rename from coregrind/vg_signals.c
rename to coregrind/m_signals.c
index ec8d5ff2c98e11c185f0465548e373f34e0ce294..1cc579537c793b87f840ca4c7f5021c2feabf753 100644 (file)
@@ -85,6 +85,7 @@
 #include "pub_core_errormgr.h"
 #include "pub_core_main.h"
 #include "pub_core_options.h"
+#include "pub_core_signals.h"
 #include "pub_core_sigframe.h"
 #include "pub_core_syscalls.h"
 #include "pub_core_tooliface.h"
index 146228eb4f7e03dccbbd59a5ce3d3d66ac9d1d53..c60b57933f837dd2bd28f9c15625b4043879b9e2 100644 (file)
@@ -31,6 +31,7 @@
 #define __PRIV_SYSCALLS_H
 
 #include "pub_core_options.h"
+#include "pub_core_signals.h"
 
 #if defined(VGO_linux)
 #  include "priv_syscalls-linux.h"
index 0526067bed7dd1806b6a5d14e7f40741679cd240..74c3207284e5cb074b2af70f4254ec6bcafcba10 100644 (file)
@@ -34,6 +34,7 @@
 #include "pub_core_main.h"       // for VG_(bbs_done)
 #include "pub_core_options.h"
 #include "pub_core_redir.h"
+#include "pub_core_signals.h"
 #include "pub_core_tooliface.h"
 #include "pub_core_translate.h"
 #include "pub_core_transtab.h"
diff --git a/coregrind/pub_core_signals.h b/coregrind/pub_core_signals.h
new file mode 100644 (file)
index 0000000..ac64054
--- /dev/null
@@ -0,0 +1,83 @@
+
+/*--------------------------------------------------------------------*/
+/*--- POSIX signals.                            pub_core_signals.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   Copyright (C) 2000-2005 Julian Seward
+      jseward@acm.org
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307, USA.
+
+   The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_CORE_SIGNALS_H
+#define __PUB_CORE_SIGNALS_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module implements all the signal handling stuff.
+//--------------------------------------------------------------------
+
+/* Highest signal the kernel will let us use */
+extern Int VG_(max_signal);
+
+extern void VG_(sigstartup_actions) ( void );
+
+/* Poll a thread's set of pending signals, and update the Thread's context to deliver one */
+extern void VG_(poll_signals) ( ThreadId );
+
+/* Fake system calls for signal handling. */
+extern Int VG_(do_sys_sigaltstack) ( ThreadId tid, vki_stack_t* ss,
+                                                   vki_stack_t* oss );
+extern Int VG_(do_sys_sigaction)   ( Int signo, 
+                                     const struct vki_sigaction *new_act, 
+                                     struct vki_sigaction *old_act );
+extern Int VG_(do_sys_sigprocmask) ( ThreadId tid, Int how, 
+                                     vki_sigset_t* set,
+                                     vki_sigset_t* oldset );
+
+extern void VG_(clear_out_queued_signals) 
+                  ( ThreadId tid, /* OUT */ vki_sigset_t* saved_mask );
+
+extern void VG_(kill_self)(Int sigNo);
+
+/* These function synthesize a fault, as if the running instruction
+   had had a fault.  These functions do not return - they longjmp back
+   into the scheduler so the signal can be delivered. */
+extern void VG_(synth_fault)        (ThreadId tid);
+extern void VG_(synth_fault_mapping)(ThreadId tid, Addr addr);
+extern void VG_(synth_fault_perms)  (ThreadId tid, Addr addr);
+extern void VG_(synth_sigill)       (ThreadId tid, Addr addr);
+
+/* Extend the stack to cover addr, if possible */
+extern Bool VG_(extend_stack)(Addr addr, UInt maxsize);
+
+/* Returns True if the signal is OK for the client to use */
+extern Bool VG_(client_signal_OK)(Int sigNo);
+
+/* Forces the client's signal handler to SIG_DFL - generally just
+   before using that signal to kill the process. */
+extern void VG_(set_default_handler)(Int sig);
+
+#endif   // __PUB_CORE_SIGNALS_H
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/