All of lore.kernel.org
 help / color / mirror / Atom feed
* How to build the kernel without any optimization?
@ 2010-08-21  6:59 Shawn Jin
  2010-08-21  7:31 ` Nicholas Mc Guire
  0 siblings, 1 reply; 3+ messages in thread
From: Shawn Jin @ 2010-08-21  6:59 UTC (permalink / raw)
  To: ppcdev

Hi,

I'm tracing the execution of ds1307_probe() and find that some of
variables or function arguments cannot be printed in gdb because they
are optimized out or not in the current context. This really gives
some headache. Is there a way to build the kernel without any
optimization? What gcc option shall I disable or add?

I already added the following to arch/powerpc/Makefile.

# Prevent GDB from jumping around in the code when trying to single step
ifeq ($(CONFIG_DEBUG_KERNEL),y)
KBUILD_CFLAGS           += -fno-schedule-insns -fno-schedule-insns2
endif

Thanks,
-Shawn.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to build the kernel without any optimization?
  2010-08-21  6:59 How to build the kernel without any optimization? Shawn Jin
@ 2010-08-21  7:31 ` Nicholas Mc Guire
  2010-08-23 18:18   ` Shawn Jin
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Mc Guire @ 2010-08-21  7:31 UTC (permalink / raw)
  To: Shawn Jin; +Cc: ppcdev

On Fri, 20 Aug 2010, Shawn Jin wrote:

> Hi,
> 
> I'm tracing the execution of ds1307_probe() and find that some of
> variables or function arguments cannot be printed in gdb because they
> are optimized out or not in the current context. This really gives
> some headache. Is there a way to build the kernel without any
> optimization? What gcc option shall I disable or add?
> 
> I already added the following to arch/powerpc/Makefile.
> 
> # Prevent GDB from jumping around in the code when trying to single step
> ifeq ($(CONFIG_DEBUG_KERNEL),y)
> KBUILD_CFLAGS           += -fno-schedule-insns -fno-schedule-insns2
> endif
>

much of the kernel can not be build without optimization - what you 
can do though is slectively try to disable optimization for specific
files by putting 

 CFLAGS_REMOVE_objfilenam.o = -SOME_OPT

in the Makefile. I think that is safer than what you did above as this would
always depend on the order of options that ultimately get passed to gcc.

hofrat 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to build the kernel without any optimization?
  2010-08-21  7:31 ` Nicholas Mc Guire
@ 2010-08-23 18:18   ` Shawn Jin
  0 siblings, 0 replies; 3+ messages in thread
From: Shawn Jin @ 2010-08-23 18:18 UTC (permalink / raw)
  To: Nicholas Mc Guire; +Cc: ppcdev

>> I already added the following to arch/powerpc/Makefile.
>>
>> # Prevent GDB from jumping around in the code when trying to single step
>> ifeq ($(CONFIG_DEBUG_KERNEL),y)
>> KBUILD_CFLAGS =A0 =A0 =A0 =A0 =A0 +=3D -fno-schedule-insns -fno-schedule=
-insns2
>> endif
>>
>
> much of the kernel can not be build without optimization - what you
> can do though is slectively try to disable optimization for specific
> files by putting
>
> =A0CFLAGS_REMOVE_objfilenam.o =3D -SOME_OPT
>
> in the Makefile. I think that is safer than what you did above as this wo=
uld
> always depend on the order of options that ultimately get passed to gcc.

With this CLAGS_REMOVE, building the objfilenam.o uses only the
-SOME_OPT instead of the default CFLAGS defined? The most I found for
-SOME_OPT is the -pg.

Thanks,
-Shawn.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-23 18:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-21  6:59 How to build the kernel without any optimization? Shawn Jin
2010-08-21  7:31 ` Nicholas Mc Guire
2010-08-23 18:18   ` Shawn Jin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.