X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0c69daa2ab4a3b7d034934a2a2d53138b9333f06..ad5ee977c604c3348f24ef6f27e2ba160c87ae7b:/testsuite/mc/dwarf.c diff --git a/testsuite/mc/dwarf.c b/testsuite/mc/dwarf.c index 08b93a39e6..c6b1fe5565 100644 --- a/testsuite/mc/dwarf.c +++ b/testsuite/mc/dwarf.c @@ -87,7 +87,7 @@ static dw_variable_t test_global_variable(mc_object_info_t info, const char* nam return variable; } -static dw_type_t find_type(mc_object_info_t info, const char* name, dw_type_t type) { +static dw_type_t find_member(mc_object_info_t info, const char* name, dw_type_t type) { unsigned int cursor = 0; dw_type_t member; xbt_dynar_foreach(type->members, cursor, member){ @@ -99,6 +99,8 @@ static dw_type_t find_type(mc_object_info_t info, const char* name, dw_type_t ty int some_local_variable = 0; +typedef struct foo {int i;} s_foo; + int main(int argc, char** argv) { // xbt_init(&argc, argv); @@ -117,8 +119,8 @@ int main(int argc, char** argv) { var = test_global_variable(mc_binary_info, "test_some_struct", &test_some_struct, sizeof(test_some_struct)); type = xbt_dict_get_or_null(mc_binary_info->types, var->type_origin); - assert(find_type(mc_binary_info, "first", type)->offset == 0); - assert(find_type(mc_binary_info, "second", type)->offset + assert(find_member(mc_binary_info, "first", type)->offset == 0); + assert(find_member(mc_binary_info, "second", type)->offset == ((const char*)&test_some_struct.second) - (const char*)&test_some_struct); unw_context_t context; @@ -128,5 +130,9 @@ int main(int argc, char** argv) { test_local_variable(mc_binary_info, "main", "argc", &argc, &cursor); + s_foo my_foo; + + assert(xbt_dict_get_or_null(mc_binary_info->full_types_by_name, "struct foo")); + _exit(0); }