diff options
-rw-r--r-- | lib/debugobjects.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/debugobjects.c b/lib/debugobjects.c index a78b7c6e042c..b7a530504b38 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c | |||
@@ -268,12 +268,16 @@ static void debug_print_object(struct debug_obj *obj, char *msg) | |||
268 | * Try to repair the damage, so we have a better chance to get useful | 268 | * Try to repair the damage, so we have a better chance to get useful |
269 | * debug output. | 269 | * debug output. |
270 | */ | 270 | */ |
271 | static void | 271 | static int |
272 | debug_object_fixup(int (*fixup)(void *addr, enum debug_obj_state state), | 272 | debug_object_fixup(int (*fixup)(void *addr, enum debug_obj_state state), |
273 | void * addr, enum debug_obj_state state) | 273 | void * addr, enum debug_obj_state state) |
274 | { | 274 | { |
275 | int fixed = 0; | ||
276 | |||
275 | if (fixup) | 277 | if (fixup) |
276 | debug_objects_fixups += fixup(addr, state); | 278 | fixed = fixup(addr, state); |
279 | debug_objects_fixups += fixed; | ||
280 | return fixed; | ||
277 | } | 281 | } |
278 | 282 | ||
279 | static void debug_object_is_on_stack(void *addr, int onstack) | 283 | static void debug_object_is_on_stack(void *addr, int onstack) |
@@ -386,6 +390,9 @@ void debug_object_activate(void *addr, struct debug_obj_descr *descr) | |||
386 | struct debug_bucket *db; | 390 | struct debug_bucket *db; |
387 | struct debug_obj *obj; | 391 | struct debug_obj *obj; |
388 | unsigned long flags; | 392 | unsigned long flags; |
393 | struct debug_obj o = { .object = addr, | ||
394 | .state = ODEBUG_STATE_NOTAVAILABLE, | ||
395 | .descr = descr }; | ||
389 | 396 | ||
390 | if (!debug_objects_enabled) | 397 | if (!debug_objects_enabled) |
391 | return; | 398 | return; |
@@ -425,8 +432,9 @@ void debug_object_activate(void *addr, struct debug_obj_descr *descr) | |||
425 | * let the type specific code decide whether this is | 432 | * let the type specific code decide whether this is |
426 | * true or not. | 433 | * true or not. |
427 | */ | 434 | */ |
428 | debug_object_fixup(descr->fixup_activate, addr, | 435 | if (debug_object_fixup(descr->fixup_activate, addr, |
429 | ODEBUG_STATE_NOTAVAILABLE); | 436 | ODEBUG_STATE_NOTAVAILABLE)) |
437 | debug_print_object(&o, "activate"); | ||
430 | } | 438 | } |
431 | 439 | ||
432 | /** | 440 | /** |