From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20886 invoked by alias); 9 Mar 2006 15:00:27 -0000 Received: (qmail 20877 invoked by uid 22791); 9 Mar 2006 15:00:26 -0000 X-Spam-Check-By: sourceware.org Received: from svr68.ehostpros.com (HELO svr68.ehostpros.com) (67.15.48.48) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 09 Mar 2006 15:00:26 +0000 Received: from [59.95.9.128] (helo=titan.linsyssoft.com) by svr68.ehostpros.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.52) id 1FHMcm-0003e9-BY for gdb@sources.redhat.com; Thu, 09 Mar 2006 07:00:21 -0800 Received: from krypton (krypton [192.168.1.13] (may be forged)) by titan.linsyssoft.com (8.13.1/8.13.1) with ESMTP id k29Ejbo3013439 for ; Thu, 9 Mar 2006 20:15:37 +0530 Subject: CFI macros for PXA270 From: Girish Shilamkar To: gdb@sources.redhat.com Content-Type: text/plain Date: Thu, 09 Mar 2006 15:00:00 -0000 Message-Id: <1141916167.6019.25.camel@krypton> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00051.txt.bz2 Hi, I am facing a problem while printing backtrace for kgdb. I am using: GDB: gdb-6.4 Kernel: 2.6.15 Processor: PXA270 Even though cfi macros have been added just before call to asm_do_IRQ in arch/arm/kernel/entry-armv.S. The backtrace doesn't traverse beyond __irq_svc gdb) bt #0 0xc0052814 in $d () at kernel/kgdb.c:1880 #1 0xc005284c in kgdb_tasklet_bpt (ing=0) at kernel/kgdb.c:1752 #2 0xc003a5e8 in tasklet_action (a=0x0) at kernel/softirq.c:267 #3 0xc003a1c8 in __do_softirq () at kernel/softirq.c:95 #4 0xc003a350 in irq_exit () at kernel/softirq.c:169 #5 0xc0020d0c in asm_do_IRQ (irq=1, regs=0xc01e9f58) at arch/arm/kernel/irq.c:560 #6 0xc001f9a4 in __irq_svc () at proc_fs.h:188 (gdb) CFI macro added to entry-armv.S -------------------------------------------------------------------------- .macro irq_handler 1: get_irqnr_and_base r0, r6, r5, lr movne r1, sp @ @ routine called with r0 = irq number, r1 = struct pt_regs * @ adrne lr, 1b .cfi_def_cfa r13, 72 /* Debug information for the registers */ .cfi_offset r0, 72 .cfi_offset r1, 68 .cfi_offset r2, 64 .cfi_offset r3, 60 .cfi_offset r4, 56 .cfi_offset r5, 52 .cfi_offset r6, 48 .cfi_offset r7, 44 .cfi_offset r8, 40 .cfi_offset r9, 36 .cfi_offset r10, 32 .cfi_offset fp, 28 .cfi_offset ip, 24 .cfi_offset sp, 20 .cfi_offset pc, 16 bne asm_do_IRQ --------------------------------------------------------------------------- One more thing, from frame 5 one can see that the call is been made from code at 0xc001f9a0 as saved pc is at 0xc001f9a4. ----------------------------------------------------------------- (gdb) info fr 5 Stack frame at 0xc01e9f58: pc = 0xc0020d0c in asm_do_IRQ (arch/arm/kernel/irq.c:560); saved pc 0xc001f9a4 called by frame at 0x0, caller of frame at 0xc01e9f28 source language c. Arglist at 0xc01e9f54, args: irq=1, regs=0xc01e9f58 Locals at 0xc01e9f54, Previous frame's sp at 0xc01e9f4c Saved registers: r4 at 0xc01e9f30, r5 at 0xc01e9f34, r6 at 0xc01e9f38, r7 at 0xc01e9f3c, r8 at 0xc01e9f40, r10 at 0xc01e9f44, r11 at 0xc01e9f48, lr at 0xc01e9f50, pc at 0xc01e9f50 (gdb) ------------------------------------------------------------- Shouldn't the call be made from 0xc001f9cc instead of 0xc001f9a0. Or am I missing something. 0xc001f998 <__irq_svc+24>: str r1, [sp] 0xc001f99c <__irq_svc+28>: mov r1, lr 0xc001f9a0 <__irq_svc+32>: stmia r5, {r0, r1, r2, r3, r4} 0xc001f9a4 <__irq_svc+36>: mrc 6, 0, r6, cr0, cr0, {0} 0xc001f9a8 <__irq_svc+40>: mrc 6, 0, r0, cr1, cr0, {0} 0xc001f9ac <__irq_svc+44>: ands r0, r6, r0 0xc001f9b0 <__irq_svc+48>: beq 0xc001f9c4 <__irq_svc+68> 0xc001f9b4 <__irq_svc+52>: rsb r6, r0, #0 ; 0x0 0xc001f9b8 <__irq_svc+56>: and r6, r6, r0 0xc001f9bc <__irq_svc+60>: clz r0, r6 0xc001f9c0 <__irq_svc+64>: rsb r0, r0, #31 ; 0x1f 0xc001f9c4 <__irq_svc+68>: movne r1, sp 0xc001f9c8 <__irq_svc+72>: subne lr, pc, #44 ; 0x2c 0xc001f9cc <__irq_svc+76>: bne 0xc0020c04 Kindly let me know where I should look, for solving this problem. Thanks in advance. Regards, -Girish.