debugging enabled? (was Re: KGDB command line options not working for kernel 2.6.32)
I have one question in this context. Should we disable optimization when >building the kernel when we wish to enable kgdb or should we leave it intact.
Whenever possible, yes...disable optimization.... -O option and -g in gcc don't play nicely together according to my experience. The DWARF info will be somewhat fuzzed or even "corrupted"....so it might point to wrong source line etc -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
Hello, * On Mon, Jun 27, 2011 at 09:51:53PM +0700 Mulyadi Santosa wrote:
I have one question in this context. Should we disable optimization when building the kernel when we wish to enable kgdb or should we leave it intact.
Whenever possible, yes...disable optimization.... -O option and -g in gcc don't play nicely together according to my experience. The DWARF info will be somewhat fuzzed or even "corrupted"....so it might point to wrong source line etc
On the one hand, you are right. With optimisations on, following the code lines does not give much fun. Some locals are not visible as they are optimised out, and so on. On the other hand: With optimisations disabled, the kernel behaves differently than it would with optimisations. That's why many people prefer to keep them switched on, and only disable them partially if really, really needed. Anyway, the opinions vary a lot here. I think one should try both and find out what fits most to ones way of doing it. Best regards Spiro. -- Spiro R. Trikaliotis http://opencbm.sf.net/ http://www.trikaliotis.net/ http://www.viceteam.org/
Hi Spiro On Tue, Jun 28, 2011 at 01:40, Spiro Trikaliotis <ml-kernelnewbies@spiro.trikaliotis.net> wrote:
On the other hand: With optimisations disabled, the kernel behaves differently than it would with optimisations. That's why many people prefer to keep them switched on, and only disable them partially if really, really needed.
I agree...even I still have mixed conclusion whether to go or no go with -O when dealing with -O and debugging. I guess one of the biggest offenders are: inlining, dead code (and symbols) elimination, substitution with specific machine specific opcode (not really sure, is -march has relationship with -O)... -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
Hi Mulyadi/Spiro, Can you please help me in partially enabling/disabling optimizations, because I was consistently hitting at the below problem when building the kernel after disabling the optimization ERROR: "intel_gmbus_is_forced_bit" [drivers/gpu/drm/i915/i915.ko] undefined! ERROR: "__udivdi3" [drivers/gpu/drm/i915/i915.ko] undefined! make[2]: *** [__modpost] Error 1 make[1]: *** [modules] Error 2 make: *** [sub-make] Error 2 Can I enable optimization for this i915 driver, so that I can contine with my kernel building ? Thanks, Prabhu On Tue, Jun 28, 2011 at 7:21 AM, Mulyadi Santosa <mulyadi.santosa@gmail.com>wrote:
Hi Spiro
On Tue, Jun 28, 2011 at 01:40, Spiro Trikaliotis <ml-kernelnewbies@spiro.trikaliotis.net> wrote:
On the other hand: With optimisations disabled, the kernel behaves differently than it would with optimisations. That's why many people prefer to keep them switched on, and only disable them partially if really, really needed.
I agree...even I still have mixed conclusion whether to go or no go with -O when dealing with -O and debugging. I guess one of the biggest offenders are: inlining, dead code (and symbols) elimination, substitution with specific machine specific opcode (not really sure, is -march has relationship with -O)...
-- regards,
Mulyadi Santosa Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Hi... On Tue, Jun 28, 2011 at 13:25, Prabhu nath <gprabhunath@gmail.com> wrote:
Hi Mulyadi/Spiro,
Can you please help me in partially enabling/disabling optimizations, because I was consistently hitting at the below problem when building the kernel after disabling the optimization
ERROR: "intel_gmbus_is_forced_bit" [drivers/gpu/drm/i915/i915.ko] undefined! ERROR: "__udivdi3" [drivers/gpu/drm/i915/i915.ko] undefined! make[2]: *** [__modpost] Error 1 make[1]: *** [modules] Error 2 make: *** [sub-make] Error 2
Can I enable optimization for this i915 driver, so that I can contine with my kernel building ?
Please don't top post.... btw, I remember that someone posted the same problem about a week or two ago...kindly dig the archieve and see what the solution is there. Sorry if I can't help much. -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
Hi Prabhu, On Mon, Jun 27, 2011 at 11:25 PM, Prabhu nath <gprabhunath@gmail.com> wrote:
Hi Mulyadi/Spiro,
Can you please help me in partially enabling/disabling optimizations, because I was consistently hitting at the below problem when building the kernel after disabling the optimization
ERROR: "intel_gmbus_is_forced_bit" [drivers/gpu/drm/i915/i915.ko] undefined! ERROR: "__udivdi3" [drivers/gpu/drm/i915/i915.ko] undefined! make[2]: *** [__modpost] Error 1 make[1]: *** [modules] Error 2 make: *** [sub-make] Error 2
This is happening because some code is trying to do 64-bit division which isn't supported in the kernel. The code needs to be modified to use do_div macro (which is available in either asm/div64.h). -- Dave Hylands Shuswap, BC, Canada http://www.davehylands.com
participants (4)
-
Dave Hylands -
Mulyadi Santosa -
Prabhu nath -
Spiro Trikaliotis