]> AND Public Git Repository - simgrid.git/blobdiff - src/mc/mc_unw.h
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / src / mc / mc_unw.h
index 9f85f72d1ebb6d9db2437dd969b9e7a614c03adc..d27fbd1ce9ffc582edfd6bcc280b3b1881ccc02b 100644 (file)
  *  much here.
  */
 
-#include "mc_process.h"
+#include <sys/types.h>
+
+#include <xbt/base.h>
+
+#include <libunwind.h>
+
+#include "src/mc/mc_forward.hpp"
+
+namespace simgrid {
+namespace unw {
+
+XBT_PRIVATE unw_addr_space_t create_addr_space();
+XBT_PRIVATE void* create_context(unw_addr_space_t as, pid_t pid);
+
+}
+}
 
 SG_BEGIN_DECL()
 
 // ***** Libunwind namespace
 
-/** Virtual table for our `libunwind-process_vm_readv` implementation.
- *
- *  This implementation reuse most the code of `libunwind-ptrace` but
- *  does not use ptrace() to read the target process memory by
- *  `process_vm_readv()` or `/dev/${pid}/mem` if possible.
- *
- *  Does not support any MC-specific behaviour (privatisation, snapshots)
- *  and `ucontext_t`.
- *
- *  It works with `void*` contexts allocated with `_UPT_create(pid)`.
- */
-extern unw_accessors_t mc_unw_vmread_accessors;
-
 /** Virtual table for our `libunwind` implementation
  *
  *  Stack unwinding on a `simgrid::mc::Process*` (for memory, unwinding information)
@@ -52,26 +54,26 @@ extern unw_accessors_t mc_unw_vmread_accessors;
  *
  *  It works with the `s_mc_unw_context_t` context.
  */
-extern XBT_INTERNAL unw_accessors_t mc_unw_accessors;
+extern XBT_PRIVATE unw_accessors_t mc_unw_accessors;
 
 // ***** Libunwind context
 
 /** A `libunwind` context
  */
-typedef struct s_mc_unw_context {
+typedef struct XBT_PRIVATE s_mc_unw_context {
   simgrid::mc::AddressSpace* address_space;
   simgrid::mc::Process*       process;
   unw_context_t      context;
 } s_mc_unw_context_t, *mc_unw_context_t;
 
 /** Initialises an already allocated context */
-XBT_INTERNAL int mc_unw_init_context(
+XBT_PRIVATE int mc_unw_init_context(
   mc_unw_context_t context, simgrid::mc::Process* process, unw_context_t* c);
 
 // ***** Libunwind cursor
 
 /** Initialises a `libunwind` cursor */
-XBT_INTERNAL int mc_unw_init_cursor(unw_cursor_t *cursor, mc_unw_context_t context);
+XBT_PRIVATE int mc_unw_init_cursor(unw_cursor_t *cursor, mc_unw_context_t context);
 
 SG_END_DECL()