kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: ablacktshirt@gmail.com (Yubin Ruan)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How can I disable compile optimization in kernel for friendly debugging, Thanks
Date: Fri, 20 Apr 2018 23:39:10 +0800	[thread overview]
Message-ID: <20180420153909.r3cjaytzmxnttswz@HP> (raw)
In-Reply-To: <25804.1524158893@turing-police.cc.vt.edu>

On 2018-04-19 13:28, valdis.kletnieks at vt.edu wrote:
> On Thu, 19 Apr 2018 16:58:40 +0800, sizel said:
> >  How can I disable compile optimization in kernel for friendly  debugging, Thanks
> 
> First off, there are parts of the kernel that *WILL* explode if you try to build
> with -O0 - in particular, any code that expects static inlines to be treated as
> part of the unit they are inlined into for the purposes of __builtin_return_address()
> and similar.

Can you elaborate more on that?
 
> Second, modern gdb is perfectly able to deal with -O2 optimization,
> especially if you build with -g.  (In the kernel build, CONFIG_DEBUG_INFO=y
> will do the right thing for this).

I don't think so. According to my experience, GDB is not good enough to deal
with -O2 optimization.

Maybe my gdb is not modern enough? I am using gdb7.11 (Ubuntu 7.11.1-0ubuntu1~16.5)

Yubin

  reply	other threads:[~2018-04-20 15:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19  8:58 How can I disable compile optimization in kernel for friendly debugging, Thanks sizel
2018-04-19 17:28 ` valdis.kletnieks at vt.edu
2018-04-20 15:39   ` Yubin Ruan [this message]
2018-04-20 15:44     ` Greg KH
2018-04-20 16:30       ` Yubin Ruan
2018-04-20 20:08     ` valdis.kletnieks at vt.edu
2018-04-21 13:15       ` Yubin Ruan
2018-04-21 20:06         ` valdis.kletnieks at vt.edu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180420153909.r3cjaytzmxnttswz@HP \
    --to=ablacktshirt@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).