aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Stump <mrs@gcc.gnu.org>1994-11-29 01:33:07 +0000
committerMike Stump <mrs@gcc.gnu.org>1994-11-29 01:33:07 +0000
commit56031823208468f061281130a7e67d6ccf1b5fd2 (patch)
tree73402b2bca23eb75b3ea14960fd1b2d5ee1479f8
parentdb5ae43ff2ce49f1cbe66a0e16f4e079b702580b (diff)
downloadgcc-56031823208468f061281130a7e67d6ccf1b5fd2.zip
gcc-56031823208468f061281130a7e67d6ccf1b5fd2.tar.gz
gcc-56031823208468f061281130a7e67d6ccf1b5fd2.tar.bz2
libgcc2.c (__register_exceptions): Find max ending of a segment for end, not min.
* libgcc2.c (__register_exceptions): Find max ending of a segment for end, not min. * libgcc2.c (__unwind_function): New function to support stack unwinding on i[34]86 for g++ exception handling. From-SVN: r8571
-rw-r--r--gcc/libgcc2.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index 44b4de5..5df5278 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -2254,13 +2254,39 @@ __register_exceptions (exception_table *table)
{
if (range->start < node->start)
node->start = range->start;
- if (range->end < node->end)
+ if (range->end > node->end)
node->end = range->end;
}
node->next = exception_table_list;
exception_table_list = node;
}
+
+#ifdef __i386
+void
+__unwind_function(void *ptr)
+{
+ asm("movl 8(%esp),%ecx");
+ /* Undo current frame */
+ asm("movl %ebp,%esp");
+ asm("popl %ebp");
+ asm("# like ret, but stay here");
+ asm("addl $4,%esp");
+
+ /* Now, undo previous frame. */
+ /* This is a test routine, as we have to dynamically probe to find out
+ what to pop for certain, this is just a guess. */
+ asm("leal -16(%ebp),%esp");
+ asm("pop %eax # really for popl %ebx");
+ asm("pop %eax # really for popl %esi");
+ asm("pop %eax # really for popl %edi");
+ asm("movl %ebp,%esp");
+ asm("popl %ebp");
+
+ asm("movl %ecx,0(%esp)");
+ asm("ret");
+}
+#endif
#endif /* L_eh */
#ifdef L_pure