aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1991-08-20 03:02:39 +0000
committerJohn Gilmore <gnu@cygnus>1991-08-20 03:02:39 +0000
commit5e5215eba77007511fb040ac842a935ec624b4a6 (patch)
treef658e7a0e4541ed5640fb9e5c5f998f272b19498 /gdb/utils.c
parent24e2462158f159377ed7f0c2fe96683c3e1063c9 (diff)
downloadgdb-5e5215eba77007511fb040ac842a935ec624b4a6.zip
gdb-5e5215eba77007511fb040ac842a935ec624b4a6.tar.gz
gdb-5e5215eba77007511fb040ac842a935ec624b4a6.tar.bz2
* mcheck.c: Avoid warning about undeclared abort fn.
* tm-sparc.h (PC_ADJUST): Avoid calling error() from this; it causes recursive calls to error() when used in cleanups. To do so requires that we make it a function, so we do. * sparc-tdep.c (sparc_pc_adjust): New implem of PC_ADJUST. * utils.c (do_cleanups): Remove the current cleanup from the chain *before* calling it, in case error() is called from it. The result won't be pretty, but won't be an infinite loop either.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 5fe3b1e..28a723b 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -134,8 +134,8 @@ do_cleanups (old_chain)
register struct cleanup *ptr;
while ((ptr = cleanup_chain) != old_chain)
{
+ cleanup_chain = ptr->next; /* Do this first incase recursion */
(*ptr->function) (ptr->arg);
- cleanup_chain = ptr->next;
free (ptr);
}
}