stmfd sp!, {r4 - r9, fp, lr} @ Save an extra register
@ to ensure 8 byte alignment
movs frame, r0 @ if frame pointer is zero
beq no_frame @ we have no stack frames
mov loglvl, r2
tst r1, #0x10 @ 26 or 32-bit mode?
moveq mask, #0xfc000003
movne mask, #0 @ mask for 32-bit
teq sv_fp, mask @ make sure next frame exists
beq no_frame
/* *sv_lristhelrfromthefunctionthatcalledthecurrentfunction.Thisis *apointertoacodeaddressinthecurrentfunction'scaller.sv_lr-4is *theinstructionusedtocallthecurrentfunction. * *Thissv_lrcanbeusedtocalculatethefunctionstartifthefunctionwas *calledusingablinstruction.Ifthefunctionstartcanberecoveredsv_pc *isoverwrittenwiththefunctionstart. * *Ifthecurrentfunctionwascalledusingafunctionpointerwecannot *recoverthefunctionstartandinsteadcontinuewithsv_pcasanarbitrary *valuewithinthecurrentfunction.Ifthisisthecasewecannotprint *registersforthecurrentfunction,butthestacktraceisstillprinted *properly.
*/ 1003: ldr sv_lr, [sv_fp, #4] @ get saved lr from next frame
1004: ldr r0, [sv_lr, #-4] @ get call instruction
ldr r3, .Lopcode+4
and r2, r3, r0 @ is this a bl call
teq r2, r3
bne finished_setup @ give up if it's not
and r0, #0xffffff @ get call offset 24-bit int
lsl r0, r0, #8 @ sign extend offset
asr r0, r0, #8
ldr sv_pc, [sv_fp, #4] @ get lr address
add sv_pc, sv_pc, #-4 @ get call instruction address
add sv_pc, sv_pc, #8 @ take care of prefetch
add sv_pc, sv_pc, r0, lsl #2@ find function start
/* *Ifweareoutofframesorifthenextframeisinvalid.
*/
teq sv_fp, #0 @ zero saved fp means
beq no_frame @ no further frames
cmp sv_fp, frame @ next frame must be
mov frame, sv_fp @ above the current frame
#ifdef CONFIG_IRQSTACKS
@
@ Kernel stacks may be discontiguous in memory. If the next
@ frame is below the previous frame, accept it as long as it
@ lives in kernel memory.
@
cmpls sv_fp, #PAGE_OFFSET
#endif
bhi for_each_frame
.Lbad: .asciz "%sBacktrace aborted due to bad frame pointer <%p>\n"
.align
.Lopcode: .word0xe92d4800 >> 11 @ stmfd sp!, {... fp, lr}
.word0x0b000000 @ bl if these bits are set
#endif
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.