Index: gdb/cleanups.c |
diff --git a/gdb/cleanups.c b/gdb/cleanups.c |
index d2f70fc404060f419af8958b18ffe5c0db6e0b64..898e526e278b2aa0591349b4e41b21cd52f0c558 100644 |
--- a/gdb/cleanups.c |
+++ b/gdb/cleanups.c |
@@ -1,6 +1,6 @@ |
/* Cleanup routines for GDB, the GNU debugger. |
- Copyright (C) 1986, 1988-2012 Free Software Foundation, Inc. |
+ Copyright (C) 1986-2013 Free Software Foundation, Inc. |
This file is part of GDB. |
@@ -261,6 +261,10 @@ save_final_cleanups (void) |
static void |
restore_my_cleanups (struct cleanup **pmy_chain, struct cleanup *chain) |
{ |
+ if (*pmy_chain != SENTINEL_CLEANUP) |
+ internal_warning (__FILE__, __LINE__, |
+ _("restore_my_cleanups has found a stale cleanup")); |
+ |
*pmy_chain = chain; |
} |