static std::map<unsigned long long, void *> _obj_map;
void
-addObj(trace::Value &value, void *obj) {
+addObj(trace::Call &call, trace::Value &value, void *obj) {
unsigned long long address = value.toUIntPtr();
+
+ if (!address) {
+ if (obj) {
+ warning(call) << "unexpected non-null object\n";
+ }
+ return;
+ }
+
+ if (!obj) {
+ warning(call) << "got null for object 0x" << std::hex << address << std::dec << "\n";
+ }
+
_obj_map[address] = obj;
if (retrace::verbosity >= 2) {
delObj(trace::Value &value) {
unsigned long long address = value.toUIntPtr();
_obj_map.erase(address);
+ if (retrace::verbosity >= 2) {
+ std::cout << std::hex << "obj 0x" << address << " del\n";
+ }
}
void *
if (address) {
obj = _obj_map[address];
if (!obj) {
- warning(call) << "unknown object 0x" << std::hex << address << std::dec << " call\n";
+ warning(call) << "unknown object 0x" << std::hex << address << std::dec << "\n";
}
} else {
obj = NULL;