/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "src/mc/mc_private.h"
+#include "src/mc/mc_private.hpp"
+
+#include "src/mc/inspect/ObjectInformation.hpp"
+#include "src/mc/inspect/Type.hpp"
+#include "src/mc/inspect/Variable.hpp"
+#include "src/mc/remote/RemoteClient.hpp"
-} test_some_struct;
-
-static simgrid::mc::Type* find_type_by_name(simgrid::mc::ObjectInformation* info, const char* name)
-{
- for (auto& entry : info->types)
- if(entry.second.name == name)
- return &entry.second;
- return nullptr;
-}
+};
+some_struct test_some_struct;
static simgrid::mc::Frame* find_function_by_name(
simgrid::mc::ObjectInformation* info, const char* name)
static simgrid::mc::Frame* find_function_by_name(
simgrid::mc::ObjectInformation* info, const char* name)
xbt_assert(location.address() == address, "Bad resolution of local variable %s of %s", variable, function);
}
xbt_assert(location.address() == address, "Bad resolution of local variable %s of %s", variable, function);
}
-static simgrid::mc::Variable* test_global_variable(
- simgrid::mc::Process& process, simgrid::mc::ObjectInformation* info,
- const char* name, void* address, long byte_size)
+static const simgrid::mc::Variable* test_global_variable(simgrid::mc::RemoteClient& process,
+ simgrid::mc::ObjectInformation* info, const char* name,
+ void* address, long byte_size)
xbt_assert(variable, "Global variable %s was not found", name);
xbt_assert(variable->name == name, "Name mismatch for %s", name);
xbt_assert(variable->global, "Variable %s is not global", name);
xbt_assert(variable, "Global variable %s was not found", name);
xbt_assert(variable->name == name, "Name mismatch for %s", name);
xbt_assert(variable->global, "Variable %s is not global", name);
auto i = process.binary_info->types.find(variable->type_id);
xbt_assert(i != process.binary_info->types.end(), "Missing type for %s", name);
simgrid::mc::Type* type = &i->second;
auto i = process.binary_info->types.find(variable->type_id);
xbt_assert(i != process.binary_info->types.end(), "Missing type for %s", name);
simgrid::mc::Type* type = &i->second;
}
int main(int argc, char** argv)
{
SIMIX_global_init(&argc, argv);
}
int main(int argc, char** argv)
{
SIMIX_global_init(&argc, argv);
process.init();
test_global_variable(process, process.binary_info.get(), "some_local_variable", &some_local_variable, sizeof(int));
process.init();
test_global_variable(process, process.binary_info.get(), "some_local_variable", &some_local_variable, sizeof(int));
int lexical_block_variable = 50;
test_local_variable(process.binary_info.get(), "main", "lexical_block_variable", &lexical_block_variable, &cursor);
int lexical_block_variable = 50;
test_local_variable(process.binary_info.get(), "main", "lexical_block_variable", &lexical_block_variable, &cursor);