From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13904 invoked by alias); 31 Oct 2011 17:43:23 -0000 Received: (qmail 13886 invoked by uid 22791); 31 Oct 2011 17:43:22 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 31 Oct 2011 17:43:07 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RKvt4-0003rQ-SE from pedro_alves@mentor.com ; Mon, 31 Oct 2011 10:43:07 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 31 Oct 2011 17:43:04 +0000 From: Pedro Alves To: gdb@sourceware.org Subject: Re: How "can't compute CFA for this frame" and "no enough registers or memory available to further unwind" happen? Date: Mon, 31 Oct 2011 20:54:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-12-generic; KDE/4.7.2; x86_64; ; ) Cc: zhihua che References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201110311743.03721.pedro@codesourcery.com> 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: 2011-10/txt/msg00242.txt.bz2 On Monday 31 October 2011 17:25:46, zhihua che wrote: > Hi, everyone > > I'm not sure this is right place for the help. I'm writing a > toy os and coding with mixed assembly and C language, debugging with > GDB. But I'm trapped with an annoying problem. This is my situation: > During the os booting time, after the os control transfers from real > mode assembly codes to real mode C codes, I wish I can exam the stack > frames and local variable as I do in regular application program, but > I always get "can't compute CFA for this frame" or "No enough > registers or memory available to further unwind" if I issue "print > xxx" or "backtrace" command respectivelly. You'll need to debug gdb. Check what is it that gdb is finding unavailable. Put a breakpoint at `throw_error' and then do that "print XXX". You should hit a call like `throw_error (NOT_AVAILABLE_ERROR...'. Get a backtrace. Do "continue" on the top gdb, and see if further hits appear. GDB has an exception handling mechanism, and that exception may be thrown more than once during a command run. > The codes seem work, but I > can only exam registers or memory using "info reg" or "x" command, > it's way unfriendly and time-consuming. I have searched a lot but > don't figure out how these happen. I need your help. Thanks. What's the output of "info all-registers"? -- Pedro Alves