From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7030 invoked by alias); 9 Jul 2010 13:07:21 -0000 Received: (qmail 7019 invoked by uid 22791); 9 Jul 2010 13:07:20 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Jul 2010 13:07:16 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o69D7E0I016816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 9 Jul 2010 09:07:14 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o69D7AJn008019 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 9 Jul 2010 09:07:12 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o69D79Xr013959; Fri, 9 Jul 2010 15:07:09 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o69D79DH013958; Fri, 9 Jul 2010 15:07:09 +0200 Date: Fri, 09 Jul 2010 13:07:00 -0000 From: Jan Kratochvil To: loody Cc: gdb@sourceware.org Subject: Re: some questions about kernel debugging Message-ID: <20100709130708.GA13468@host0.dyn.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) 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/msg00037.txt.bz2 On Fri, 09 Jul 2010 13:52:31 +0200, loody wrote: > I enable kernel hacking options about kernel debugging on my mips platform. > I can successfully connect to the target board. > My question is: > 1. why I cannot p/x the value of variable? > I have enabled CONFIG_ARCH_WANT_FRAME_POINTERS and CONFIG_FRAME_POINTER > but I still get the message which tell me "value optimized out". > did I miss anything? > 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. -O2 was always mostly unsupported together with -g (=debuggingo information). For -O2 -g you should use 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 just `disassemble' the code in GDB, guess from the code+source in which register/memory is the value probably located and access it directly there. Regards, Jan