Hi, I'm trying to use this hashmap as a global variable but I can't figure out how the variable can be seen outside of the scope of where it's declared. I've loaded the hashmap correctly:
(gdb) p map $499 = {map_base = {table_size_init = 128, table_size = 2048, size = 1466, table = 0x555558c909b0, hash = 0x55555556a12f <hashmap_hash_string>, compare = 0x7ffff70a9c50, key_dup = 0x0, key_free = 0x0}, map_types = 0x7fffffffb550}
But when I enter into a function, the map has a different address and is empty:
(gdb) p map $501 = (struct hashmap_base *) 0x0
The struct also seems to be different and the two maps have different addresses. I've used the macro HASHMAP in the main function because I couldn't get the program to compile using a typedef in the header file. Any ideas on how I can get this to work?
Hi, I'm trying to use this hashmap as a global variable but I can't figure out how the variable can be seen outside of the scope of where it's declared. I've loaded the hashmap correctly:
(gdb) p map $499 = {map_base = {table_size_init = 128, table_size = 2048, size = 1466, table = 0x555558c909b0, hash = 0x55555556a12f <hashmap_hash_string>, compare = 0x7ffff70a9c50, key_dup = 0x0, key_free = 0x0}, map_types = 0x7fffffffb550}But when I enter into a function, the map has a different address and is empty:
(gdb) p map $501 = (struct hashmap_base *) 0x0The struct also seems to be different and the two maps have different addresses. I've used the macro HASHMAP in the main function because I couldn't get the program to compile using a
typedefin the header file. Any ideas on how I can get this to work?