ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ltib] turning off -O2


From: Kallol Biswas
Subject: Re: [Ltib] turning off -O2
Date: Fri, 10 Dec 2010 10:54:52 -0800



(gdb) target remote bdip4080:2001
Remote debugging using bdip4080:2001
start_kernel () at init/main.c:529
529    {
(gdb) b rtc_init            <== this break does not work, I had to set breakpoint from bdi with bi 0xc063a93c
Breakpoint 1 at 0xc063a93c: file drivers/rtc/class.c, line 214.
(gdb) list
524        pgtable_cache_init();
525        vmalloc_init();
526    }
527   
528    asmlinkage void __init start_kernel(void)
529    {
530        char * command_line;
531        extern struct kernel_param __start___param[], __stop___param[];
532   
533        smp_setup_processor_id();
(gdb) next
rtc_init () at drivers/rtc/class.c:213
213    {
(gdb) list
208        }
209    }
210    EXPORT_SYMBOL_GPL(rtc_device_unregister);
211   
212    static int __init rtc_init(void)
213    {
214        rtc_class = class_create(THIS_MODULE, "rtc");
215        if (IS_ERR(rtc_class)) {
216            printk(KERN_ERR "%s: couldn't create class\n", __FILE__);
217            return PTR_ERR(rtc_class);
(gdb) next
214        rtc_class = class_create(THIS_MODULE, "rtc");
(gdb)    <== enter
213    {
(gdb)
214        rtc_class = class_create(THIS_MODULE, "rtc");
(gdb)  <=enter the excution continues and does not stop at line 215.
^C
Program received signal SIGSTOP, Stopped (signal).
ppc_wait () at arch/powerpc/kernel/idle.c:133
133    }
(gdb) list rtc_init
208        }
209    }
210    EXPORT_SYMBOL_GPL(rtc_device_unregister);
211   
212    static int __init rtc_init(void)
213    {
214        rtc_class = class_create(THIS_MODULE, "rtc");
215        if (IS_ERR(rtc_class)) {
216            printk(KERN_ERR "%s: couldn't create class\n", __FILE__);
217            return PTR_ERR(rtc_class);
(gdb)
218        }
219        rtc_class->suspend = rtc_suspend;
220        rtc_class->resume = rtc_resume;
221        rtc_dev_init();
222        rtc_sysfs_init(rtc_class);
223        return 0;
224    }
225   
226    static void __exit rtc_exit(void)
227    {
(gdb) bt
#0  ppc_wait () at arch/powerpc/kernel/idle.c:133
#1  0xc0007d9c in cpu_idle_simple () at arch/powerpc/kernel/idle.c:117
#2  0x01000000 in ?? ()
(gdb)


On Fri, Dec 10, 2010 at 10:42 AM, Kallol Biswas <address@hidden> wrote:
I use vmlinux with powerpc-gnu-gdb.

However can not single step linux kernel code from gdb prompt properly or set breakpoint. Breakpoint works from bdi prompt.

Looks like optimization issue.


On Fri, Dec 10, 2010 at 10:23 AM, Stuart Hughes <address@hidden> wrote:
Hi Kallol,

If you have the kernel building (by enabling debug in the kernel config)
then for use with BDI2000 you need vmlinux (the elf image) not the
normal image IIRC.

Failing this, you probably need some help from the kernel experts at
Freescale.

Regards, Stuart

Kallol Biswas wrote:
> There is an issue with removing -O2. Dead codes are not eliminated
> resulting undefined references in linking phase.
>
> I have compiled manually in linux directory after checking out with ltib
> -m prep -p kernel.
>
> Even after fixing unresolved symbols the kernel did not boot, while
> inflating uboot complained saying  "Error: Inflate returned -5".
> So to get -g version of kernel working more work in necessary. Do not
> know how people use gdb with BDI2000 for the powerpc
> p4080 platforms.
>
> On Fri, Dec 10, 2010 at 4:29 AM, Stuart Hughes <address@hidden
> <mailto:address@hidden>> wrote:
>
>     Hi Kallol,
>
>     If you don't mind turning it off for all applications and getting a full
>     rebuild, you can run:
>
>     ./ltib --configure
>
>     and then under "Enter any CFLAGS for gcc/g++" click enter and then add
>     -O0 or whatever you need.
>
>     Another option to adjust just the kernel may be to run ./ltib
>     --configure and then select: [*] Configure the kernel
>
>     This will then build the kernel and drop you to the kernel's config
>     system.  If you enable debugging that will add -g and it may drop the
>     optimisation level down (I don't know though, depends on your
>     source/platform).  There could be other kernel config options that let
>     you do what you want (again kernel dependent).
>
>     Failing that, Matt's advice is good, edit the appropriate Makefile under
>      arch/powerpc after running ./ltib -p kernel -m prep
>     and then complete the build with ./ltib -p kernel -m scdeploy
>
>     Regards, Stuart
>
>
>     Kallol Biswas wrote:
>     > Hi,
>     >     I would like to turn off -O2 while compiling kernel with ltib.
>     >
>     > The target processor is p4080.
>     >
>     > What is the best way to achieve this?
>     >
>     > Kallol
>     >
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]