From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14944 invoked by alias); 22 Apr 2005 17:51:26 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 14911 invoked from network); 22 Apr 2005 17:51:21 -0000 Received: from unknown (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org with SMTP; 22 Apr 2005 17:51:21 -0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id j3MHpEgo012210; Fri, 22 Apr 2005 19:51:14 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id j3MHpEwJ017907; Fri, 22 Apr 2005 19:51:14 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id j3MHpEB0002453; Fri, 22 Apr 2005 19:51:14 +0200 (CEST) Date: Fri, 22 Apr 2005 17:51:00 -0000 Message-Id: <200504221751.j3MHpEB0002453@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: roland.schwingel@onevision.de CC: gdb@sourceware.org In-reply-to: <4268B942.5080300@onevision.de> (message from Roland Schwingel on Fri, 22 Apr 2005 10:43:46 +0200) Subject: Re: gdb stack trace problems (Addendum) References: <4264BAA5.2050600@onevision.de> <4268B942.5080300@onevision.de> X-SW-Source: 2005-04/txt/msg00156.txt.bz2 Date: Fri, 22 Apr 2005 10:43:46 +0200 From: Roland Schwingel Hi Mark... Have you already had some time to look into it? I did, but I didn't have find the time to reply yet ;-). Anyway, there is a serious problem here. The code you show is basically undebuggable. SleepEx is basically what we call a frameless function; it doesn't set up its own stack frame. This means the debugger has to track all changes of the stack frame in this function in order to be able to unwind the stack and provide a useful backtrace. However, since this Windows uses the convention that the caller pushes function arguments on the stack, and the callee is repsonsible for restoring the stack. this gets basically impossible. I'm wondering whether Microsoft provides debug versions of its DLLs that don't have this problem. The only thing we can do here is trust the frame pointer, like we used to do in the old days. The problem with that is that it's very likely to (silently) skip some function calls. In your particular example it probably would appear as if your code called SleepEx directly and there would be no trace of Sleep at all. That can be quite puzzling. I'm thinking about adding an option to instruct gdb to "trust" the frame pointer. I'm not going to make it the default though. I really prefer seeing an abviously wrong backtrace over gdb silently skipping function calls in its backtraces. Mark