From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25192 invoked by alias); 4 Oct 2004 17:23:35 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 25174 invoked from network); 4 Oct 2004 17:23:35 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 4 Oct 2004 17:23:35 -0000 Received: from drow by nevyn.them.org with local (Exim 4.34 #1 (Debian)) id 1CEWYf-0003wo-RU; Mon, 04 Oct 2004 13:23:33 -0400 Date: Mon, 04 Oct 2004 17:23:00 -0000 From: Daniel Jacobowitz To: "Amit S. Kale" Cc: Andrew Cagney , gdb-patches@sources.redhat.com Subject: Re: kgdb support for gdb Message-ID: <20041004172333.GA15074@nevyn.them.org> Mail-Followup-To: "Amit S. Kale" , Andrew Cagney , gdb-patches@sources.redhat.com References: <200410011314.33157.amitkale@linsyssoft.com> <4161725C.6050009@gnu.org> <200410042205.24596.amitkale@linsyssoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200410042205.24596.amitkale@linsyssoft.com> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-10/txt/msg00059.txt.bz2 On Mon, Oct 04, 2004 at 10:05:24PM +0530, Amit S. Kale wrote: > I don't suppress any frames. I insert a fake frame so that the fake frame can > do the job of reporting correct registers to the previous frame. IT works > more or less like inline functions. At present inline functions don't insert > fake frames, but I believe it's being worked on. FYI, I have inline frames mostly working. They are sort of "fake" frames... but I haven't taken a look at your code, so I'm not sure whether what you did is comparable. > Let me state the problem I am trying to solve. You may be able to provide a > better solution to that. > > schedule() function has a call to macro switch_to. The switch_to macro is an > architecture specific macro. It has hand written assembly code that does a > part of the context switching job. This code manipulates eip and esp in a > non-standard way. Present gdb can't produce backtraces correctly if the frame > 0 is inside switch_to. That's obvious since gdb doesn't have dwarf > information for those instructions. > > A few things have been tried to help gdb with this problem. This one is worth > mentioning: We report the esp as it would be when switch_to is complete. > Since gdb doesn't look into switch_to code, it starts interpretations where > switch_to ends. So this works ok for most part. It doesn't solve the problem > of all registers, though. The switch_to code has been written intelligently > (read over-engineered) to save only those registers which would be expected > by gcc to be correct when schedule() function returns. So this task becomes > unmanageable and error-prone. Can you explain why this can't be done with additional DWARF annotation? -- Daniel Jacobowitz