From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20945 invoked by alias); 9 Jul 2010 15:56:43 -0000 Received: (qmail 20935 invoked by uid 22791); 9 Jul 2010 15:56:42 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-gy0-f169.google.com (HELO mail-gy0-f169.google.com) (209.85.160.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Jul 2010 15:56:38 +0000 Received: by gyf1 with SMTP id 1so1670945gyf.0 for ; Fri, 09 Jul 2010 08:56:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.84.1 with SMTP id h1mr5535810agb.138.1278690995910; Fri, 09 Jul 2010 08:56:35 -0700 (PDT) Received: by 10.90.56.11 with HTTP; Fri, 9 Jul 2010 08:56:35 -0700 (PDT) In-Reply-To: <20100709130708.GA13468@host0.dyn.jankratochvil.net> References: <20100709130708.GA13468@host0.dyn.jankratochvil.net> Date: Fri, 09 Jul 2010 15:56:00 -0000 Message-ID: Subject: Re: some questions about kernel debugging From: loody To: Jan Kratochvil Cc: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-07/txt/msg00038.txt.bz2 hi: thanks for your kind reply :) 2010/7/9 Jan Kratochvil : > On Fri, 09 Jul 2010 13:52:31 +0200, loody wrote: >> I enable kernel hacking options about kernel debugging on my mips platfo= rm. >> I can successfully connect to the target board. >> My question is: >> 1. why I cannot p/x the value of variable? >> =A0 =A0 I have enabled CONFIG_ARCH_WANT_FRAME_POINTERS and CONFIG_FRAME_= POINTER >> =A0 =A0 but I still get the message which tell me "value optimized out". >> =A0 =A0 did I miss anything? >> =A0 =A0 my kernel version is 2.6.30.9? > > This is not a GDB problem, you should report it to GCC (you need a minimal > reproducer for the bugreport). > > The problem is Linux kernel cannot (at least could not) compile with -O0,= it > requires -O2 to successfully build. =A0-O2 was always mostly unsupported > together with -g (=3Ddebuggingo information). =A0For -O2 -g you should us= e the > latest GCC - SVN HEAD best - and definitely at least 4.5 (for VTA > - var-tracking-assignments). > > Besides resolving this -O2 -g problem at GCC the easy way is always to ju= st > `disassemble' the code in GDB, guess from the code+source in which > register/memory is the value probably located and access it directly ther= e. I tried compile the kernel with -O1 -g but it still fail. does that mean only program compiled with -O0 -g will not get the error message when trying to see the variable? appreciate your help, miloody