From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10506 invoked by alias); 2 Dec 2004 17:43:31 -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 10493 invoked from network); 2 Dec 2004 17:43:27 -0000 Received: from unknown (HELO relay0.EECS.Berkeley.EDU) (169.229.60.163) by sourceware.org with SMTP; 2 Dec 2004 17:43:27 -0000 Received: from gateway2.EECS (gateway2.EECS.Berkeley.EDU [169.229.60.39]) by relay0.EECS.Berkeley.EDU (8.13.1/8.12.10) with ESMTP id iB2HhQ9u001612; Thu, 2 Dec 2004 09:43:26 -0800 (PST) Received: from eecs.berkeley.edu (markov.EECS.Berkeley.EDU [128.32.33.224]) by gateway2.EECS.Berkeley.EDU (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPSA id <0I83004CWVWEZY@gateway2.EECS.Berkeley.EDU>; Thu, 02 Dec 2004 09:43:26 -0800 (PST) Date: Thu, 02 Dec 2004 17:43:00 -0000 From: Allen Hopkins Subject: bogus bkpt, using #line directives To: gdb Message-id: <41AF543D.9060804@eecs.berkeley.edu> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0 X-SW-Source: 2004-12/txt/msg00016.txt.bz2 I'm using gdb (6.1.1) to debug applications that are compiled from C++ code which is, in turn, generated from special higher-level code (whose source files have ".mmm" extensions). I've inserted "#line" directives at each .cpp line that claim that that line is really from the .mmm file it was generated from. Here's a snippet of code from P.cpp to talk about: > #line 39 "/tmp/allenh/metro/examples/mgdb/P.mmm" > try { > #line 41 "/tmp/allenh/metro/examples/mgdb/P.mmm" > port1->writeInt(this, w); > #line 42 "/tmp/allenh/metro/examples/mgdb/P.mmm" > w = w + 1; > #line 42 "/tmp/allenh/metro/examples/mgdb/P.mmm" > } catch (STUCK) { > ... A breakpoint set at line 42 ends up in a bogus place: (gdb) b P.mmm:41 Breakpoint 6 at 0x805edde: file P.mmm, line 41. (gdb) b P.mmm:42 Breakpoint 7 at 0x804d54a: file P.mmm, line 42. (gdb) info b Num Type Disp Enb Address What 6 breakpoint keep y 0x0805edde in P::thread() at P.mmm:41 7 breakpoint keep y 0x0804d54a in ~node at P.mmm:42 The breakpoint at "~node" is just plain wrong. The breakpoint is set correctly if the "#line" directives are removed and the breakpoints are set on the actual .cpp line numbers. The program is very complex & I haven't yet been able to make a simple test case to demonstrate this. I'm sort of desperately hoping this looks familiar to somebody who can offer me some hope, or suggestions. I'm left wondering if I have to debug gdb, but I'd be in really unfamiliar territory. -Allen