A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[mc] Remove Process.is_self()
[simgrid.git]
/
src
/
mc
/
mc_unw.cpp
diff --git
a/src/mc/mc_unw.cpp
b/src/mc/mc_unw.cpp
index
6df54b8
..
c537850
100644
(file)
--- a/
src/mc/mc_unw.cpp
+++ b/
src/mc/mc_unw.cpp
@@
-19,8
+19,11
@@
#include <libunwind.h>
#include "mc_object_info.h"
#include <libunwind.h>
#include "mc_object_info.h"
-#include "mc
_process.h
"
+#include "mc
/Process.hpp
"
#include "mc_unw.h"
#include "mc_unw.h"
+#include "mc/Frame.hpp"
+
+using simgrid::mc::remote;
extern "C" {
extern "C" {
@@
-72,7
+75,7
@@
static int get_dyn_info_list_addr(unw_addr_space_t as,
/** Read from the target address space memory (libunwind method)
*
/** Read from the target address space memory (libunwind method)
*
- * Delegates to the `
mc_process_t
`.
+ * Delegates to the `
simgrid::mc::Process*
`.
*/
static int access_mem(unw_addr_space_t as,
unw_word_t addr, unw_word_t *valp,
*/
static int access_mem(unw_addr_space_t as,
unw_word_t addr, unw_word_t *valp,
@@
-81,7
+84,7
@@
static int access_mem(unw_addr_space_t as,
mc_unw_context_t context = (mc_unw_context_t) arg;
if (write)
return - UNW_EREADONLYREG;
mc_unw_context_t context = (mc_unw_context_t) arg;
if (write)
return - UNW_EREADONLYREG;
- context->address_space->read_bytes(valp, sizeof(unw_word_t),
addr
);
+ context->address_space->read_bytes(valp, sizeof(unw_word_t),
remote(addr)
);
return 0;
}
return 0;
}
@@
-162,12
+165,12
@@
static int get_proc_name(unw_addr_space_t as,
void* arg)
{
mc_unw_context_t context = (mc_unw_context_t) arg;
void* arg)
{
mc_unw_context_t context = (mc_unw_context_t) arg;
-
dw_frame_t frame = MC_process_find_function(context->process, (void*) addr
);
+
simgrid::mc::Frame* frame = context->process->find_function(remote(addr)
);
if (!frame)
return - UNW_ENOINFO;
*offp = (unw_word_t) frame->low_pc - addr;
if (!frame)
return - UNW_ENOINFO;
*offp = (unw_word_t) frame->low_pc - addr;
- strncpy(bufp, frame->name, buf_len);
+ strncpy(bufp, frame->name
.c_str()
, buf_len);
if (bufp[buf_len - 1]) {
bufp[buf_len - 1] = 0;
return -UNW_ENOMEM;
if (bufp[buf_len - 1]) {
bufp[buf_len - 1] = 0;
return -UNW_ENOMEM;
@@
-193,7
+196,7
@@
unw_accessors_t mc_unw_accessors =
// ***** Context management
int mc_unw_init_context(
// ***** Context management
int mc_unw_init_context(
- mc_unw_context_t context,
mc_process_t
process, unw_context_t* c)
+ mc_unw_context_t context,
simgrid::mc::Process*
process, unw_context_t* c)
{
context->address_space = process;
context->process = process;
{
context->address_space = process;
context->process = process;
@@
-215,25
+218,12
@@
int mc_unw_init_context(
return 0;
}
return 0;
}
-int mc_unw_destroy_context(mc_unw_context_t context)
-{
- context->address_space = NULL;
- context->process = NULL;
- return 0;
-}
-
// ***** Cursor management
int mc_unw_init_cursor(unw_cursor_t *cursor, mc_unw_context_t context)
{
if (!context->process || !context->address_space)
return -UNW_EUNSPEC;
// ***** Cursor management
int mc_unw_init_cursor(unw_cursor_t *cursor, mc_unw_context_t context)
{
if (!context->process || !context->address_space)
return -UNW_EUNSPEC;
- mc_address_space_t as = context->address_space;
-
- mc_process_t process = dynamic_cast<mc_process_t>(as);
- if (process && MC_process_is_self(process))
- return unw_init_local(cursor, &context->context);
-
return unw_init_remote(cursor, context->process->unw_addr_space, context);
}
return unw_init_remote(cursor, context->process->unw_addr_space, context);
}