}
static const s_mc_address_space_class_t mc_process_class = {
- .read = (mc_address_space_class_read_callback_t) &MC_process_read,
- .get_process = (mc_address_space_class_get_process_callback_t) MC_process_get_process
+ (mc_address_space_class_read_callback_t) &MC_process_read,
+ (mc_address_space_class_get_process_callback_t) MC_process_get_process
};
bool MC_is_process(mc_address_space_t p)
MC_process_open_memory_file(process);
// Read std_heap (is a struct mdesc*):
- dw_variable_t std_heap_var = MC_process_find_variable_by_name(process, "std_heap");
+ dw_variable_t std_heap_var = MC_process_find_variable_by_name(process,
+ "__mmalloc_default_mdp");
if (!std_heap_var)
xbt_die("No heap information in the target process");
if(!std_heap_var->address)
void MC_process_refresh_heap(mc_process_t process)
{
- assert(!MC_process_is_self(process));
+ xbt_assert(mc_mode == MC_MODE_SERVER);
+ xbt_assert(!MC_process_is_self(process));
// Read/dereference/refresh the std_heap pointer:
if (!process->heap) {
process->heap = (struct mdesc*) malloc(sizeof(struct mdesc));
process->heap, process->heap_address, sizeof(struct mdesc),
MC_PROCESS_INDEX_DISABLED
);
+ process->cache_flags |= MC_PROCESS_CACHE_FLAG_HEAP;
}
void MC_process_refresh_malloc_info(mc_process_t process)
{
- assert(!MC_process_is_self(process));
+ xbt_assert(mc_mode == MC_MODE_SERVER);
+ xbt_assert(!MC_process_is_self(process));
if (!(process->cache_flags & MC_PROCESS_CACHE_FLAG_HEAP))
MC_process_refresh_heap(process);
// Refresh process->heapinfo:
process->heap_info,
process->heap->heapinfo, malloc_info_bytesize,
MC_PROCESS_INDEX_DISABLED);
+ process->cache_flags |= MC_PROCESS_CACHE_FLAG_MALLOC_INFO;
}
#define SO_RE "\\.so[\\.0-9]*$"
s_xbt_dynar_t d;
MC_process_read_simple(process, &d, remote_dynar, sizeof(d));
if (i >= d.used)
- xbt_die("Out of bound index %zi/%zi", i, d.used);
+ xbt_die("Out of bound index %zi/%lu", i, d.used);
if (len != d.elmsize)
xbt_die("Bad size in MC_process_read_dynar_element");
MC_process_read_simple(process, local, xbt_dynar_get_ptr(&d, i), len);
static pthread_once_t zero_buffer_flag = PTHREAD_ONCE_INIT;
static const void* zero_buffer;
-static const int zero_buffer_size = 10 * 4096;
+static const size_t zero_buffer_size = 10 * 4096;
static void MC_zero_buffer_init(void)
{