[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libunwind] libunwind and .savepsp
From: |
Anthony C Brewer |
Subject: |
[libunwind] libunwind and .savepsp |
Date: |
Mon, 13 Sep 2004 12:12:40 -0700 (PDT) |
Hi,
I've encountered a problem with unwinding through particular C functions
where gcc is saving the ar.pfs and rp on the stack instead of in registers.
The prologue code created for the affected function is below, neither gdb
nor the unwind library functions can find any of the call stack above this
function. If I patch the code to save the ar.pfs and rp in registers
instead, unwinding works find. Is this a limitation of the unwind library,
or is gcc creating bad prologue code?
(I have libunwind 0.98 and gcc 3.2.3).
.text
.align 16
.global CBL_CALL#
.proc CBL_CALL#
CBL_CALL:
[.LFB12:]
.loc 1 121 0
.prologue 2, 119
alloc r16 = ar.pfs, 8, 80, 5, 0
adds r17 = -416, r12
adds r18 = -408, r12
.vframe r119
mov r119 = r12
adds r12 = -528, r12
mov r19 = ar.unat
mov r20 = pr
;;
.savepsp pr, 416
st8 [r17] = r20, 16
.savepsp ar.unat, 408
st8 [r18] = r19, 16
;;
.savepsp ar.pfs, 400
st8 [r17] = r16, 16
mov r21 = ar.lc
;;
.savepsp ar.lc, 392
st8 [r18] = r21, 16
.save.g 0x1
.mem.offset 384, 0
st8.spill [r17] = r4, 16
;;
.save.g 0x2
.mem.offset 376, 0
st8.spill [r18] = r5, 16
.save.g 0x4
.mem.offset 368, 0
st8.spill [r17] = r6, 16
;;
.save.g 0x8
.mem.offset 360, 0
st8.spill [r18] = r7, 16
mov r22 = b0
;;
.savepsp rp, 352
st8 [r17] = r22, 16
mov r23 = b1
;;
.save.b 0x1
st8 [r18] = r23, 16
mov r24 = b2
;;
.save.b 0x2
st8 [r17] = r24, 16
mov r25 = b3
;;
.save.b 0x4
st8 [r18] = r25, 16
mov r26 = b4
;;
.save.b 0x8
st8 [r17] = r26, 16
mov r27 = b5
;;
.save.b 0x10
st8 [r18] = r27, 24
.save.f 0x1
stf.spill [r17] = f2, 32
;;
.save.f 0x2
stf.spill [r18] = f3, 32
.save.f 0x4
stf.spill [r17] = f4, 32
;;
.save.f 0x8
stf.spill [r18] = f5, 32
.save.gf 0x0, 0x10
stf.spill [r17] = f16, 32
;;
.save.gf 0x0, 0x20
stf.spill [r18] = f17, 32
.save.gf 0x0, 0x40
stf.spill [r17] = f18, 32
;;
.save.gf 0x0, 0x80
stf.spill [r18] = f19, 32
.save.gf 0x0, 0x100
stf.spill [r17] = f20, 32
;;
.save.gf 0x0, 0x200
stf.spill [r18] = f21, 32
.save.gf 0x0, 0x400
stf.spill [r17] = f22, 32
;;
.save.gf 0x0, 0x800
stf.spill [r18] = f23, 32
.save.gf 0x0, 0x1000
stf.spill [r17] = f24, 32
;;
.save.gf 0x0, 0x2000
stf.spill [r18] = f25, 32
.save.gf 0x0, 0x4000
stf.spill [r17] = f26, 32
;;
.save.gf 0x0, 0x8000
stf.spill [r18] = f27, 32
.save.gf 0x0, 0x10000
stf.spill [r17] = f28, 32
;;
.save.gf 0x0, 0x20000
stf.spill [r18] = f29, 32
.save.gf 0x0, 0x40000
stf.spill [r17] = f30
;;
.save.gf 0x0, 0x80000
stf.spill [r18] = f31
.body
--
Anthony Brewer
Micro Focus
- [libunwind] libunwind and .savepsp,
Anthony C Brewer <=