File tree Expand file tree Collapse file tree 3 files changed +34
-24
lines changed Expand file tree Collapse file tree 3 files changed +34
-24
lines changed Original file line number Diff line number Diff line change @@ -53,8 +53,8 @@ MORESTACK:
53
53
54
54
pushl %ebp
55
55
#if defined(__linux__) || defined(__APPLE__)
56
- .cfi_def_cfa_offset 8
57
- .cfi_offset %ebp , -8
56
+ .cfi_def_cfa_offset 20
57
+ .cfi_offset %ebp , -20
58
58
#endif
59
59
movl %esp , %ebp
60
60
#if defined(__linux__) || defined(__APPLE__)
@@ -79,16 +79,6 @@ MORESTACK:
79
79
testl %eax ,%eax
80
80
jz .L$bail
81
81
82
- // During unwinding we want to skip our caller.
83
- #if defined(__linux__) || defined(__APPLE__)
84
- // Don't understand this line. I think it means that
85
- // the next frame's pc is the return address of our caller.
86
- .cfi_offset 8 , 8
87
- // The next frame's esp is stored at our CFA - 12
88
- // (by the code below)
89
- .cfi_offset %esp , -12
90
- #endif
91
-
92
82
// Save the the correct %esp value for our grandparent frame,
93
83
// for the unwinder
94
84
leal 20 (%ebp ), %eax
@@ -156,7 +146,7 @@ MORESTACK:
156
146
popl %ebp
157
147
#if defined(__linux__) || defined(__APPLE__)
158
148
.cfi_restore %ebp
159
- .cfi_def_cfa %esp , 4
149
+ .cfi_def_cfa %esp , 16
160
150
#endif
161
151
retl $8
162
152
Original file line number Diff line number Diff line change @@ -54,19 +54,11 @@ MORESTACK:
54
54
55
55
// Set up a normal backtrace
56
56
pushq %rbp
57
- .cfi_def_cfa_offset 16
58
- .cfi_offset %rbp , -16
57
+ .cfi_def_cfa_offset 24
58
+ .cfi_offset %rbp , -24
59
59
movq %rsp , %rbp
60
60
.cfi_def_cfa_register %rbp
61
61
62
- // During unwinding we want to skip our caller since it's not
63
- // a complete frame and will make the unwinder sad
64
- // Don't understand this line
65
- .cfi_offset 16 , 0
66
- // Tell the unwinding where to get the stack pointer for
67
- // our grandparent frame
68
- .cfi_offset %rsp , -24
69
-
70
62
// Save the grandparent stack pointer for the unwinder
71
63
leaq 24 (%rbp ), %rax
72
64
pushq %rax
@@ -140,7 +132,7 @@ MORESTACK:
140
132
addq $8 , %rsp
141
133
popq %rbp
142
134
.cfi_restore %rbp
143
- .cfi_def_cfa %rsp , 8
135
+ .cfi_def_cfa %rsp , 16
144
136
ret
145
137
146
138
.cfi_endproc
Original file line number Diff line number Diff line change
1
+ // xfail-test
2
+ // error-pattern:explicit failure
3
+ // compile-flags:--stack-growth
4
+
5
+ // Just testing unwinding
6
+
7
+ use std;
8
+
9
+ native mod rustrt {
10
+ fn set_min_stack ( size : uint ) ;
11
+ }
12
+
13
+ fn getbig_and_fail ( & & i: int ) {
14
+ let r = and_then_get_big_again ( @0 ) ;
15
+ if i != 0 {
16
+ getbig_and_fail ( i - 1 ) ;
17
+ } else {
18
+ fail;
19
+ }
20
+ }
21
+
22
+ resource and_then_get_big_again ( _i: @int) {
23
+ }
24
+
25
+ fn main ( ) {
26
+ rustrt:: set_min_stack ( 256 u) ;
27
+ task:: spawn ( 1 , getbig_and_fail) ;
28
+ }
You can’t perform that action at this time.
0 commit comments