From owner-freebsd-questions@FreeBSD.ORG Mon Feb 28 02:36:56 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE0CC1065670 for ; Mon, 28 Feb 2011 02:36:56 +0000 (UTC) (envelope-from dedrick@vbnm.net) Received: from euclid.vbnm.net (euclid.vbnm.net [64.191.143.10]) by mx1.freebsd.org (Postfix) with ESMTP id 5FD598FC08 for ; Mon, 28 Feb 2011 02:36:56 +0000 (UTC) Received: from euclid.vbnm.net (localhost [127.0.0.1]) by euclid.vbnm.net (8.14.4/8.14.2) with ESMTP id p1S2asI1012505 for ; Sun, 27 Feb 2011 21:36:54 -0500 (EST) (envelope-from dedrick@vbnm.net) Received: (from dedrick@localhost) by euclid.vbnm.net (8.14.4/8.14.2/Submit) id p1S2asoK012504 for freebsd-questions@freebsd.org; Sun, 27 Feb 2011 21:36:54 -0500 (EST) (envelope-from dedrick@vbnm.net) X-Authentication-Warning: euclid.vbnm.net: dedrick set sender to dedrick@vbnm.net using -f Received: by euclid.vbnm.net (tmda-sendmail, from uid 1001); Sun, 27 Feb 2011 21:36:54 -0500 Date: Sun, 27 Feb 2011 21:36:54 -0500 To: freebsd-questions@freebsd.org Message-ID: <20110228023654.GA12469@vbnm.net> References: <20110228003038.GA4842@vbnm.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110228003038.GA4842@vbnm.net> User-Agent: Mutt/1.4.2.3i X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Eric Dedrick Subject: Re: gcc45 wrong debug info? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2011 02:36:56 -0000 Hmm. When I compile with -gstabs -ggdb, at least addr2line and gdb can at least see the correct line info. The info below is correct except I don't know what's up with the argc thing. Ideas? Thanks. ---------------------------------------------------------------------- Breakpoint 1, main (argc=Cannot access memory at address 0x8000ffffe41c ) at interreflect_driver.c:9 (gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep y 0x0000000000400fed in main at interreflect_driver.c:9 breakpoint already hit 1 time 2 breakpoint keep y 0x00000000004013bb in main at interreflect_driver.c:103 3 breakpoint keep y 0x0000000000401cd3 in reconstruction_load_points at interreflect3d.c:296 4 breakpoint keep y 0x0000000000404419 in reconstruction_prune at interreflect3d.c:1107 ---------------------------------------------------------------------- On Sun, Feb 27, 2011 at 07:30:38PM -0500, Eric Dedrick wrote: > Wondering if anyone has encountered this problem where gdb/gcc doesn't > seem to be getting the line number info right. > > I compiled code in as > ---------------------------------------------------------------------- > gcc45 -g -W -Wall -O0 -std=c99 -D_BSD_SOURCE -DDEBUG -D__BSD_VISIBLE > -DFREEBSD -c interreflect3d.c > -o x86-debug/objects/interreflections/interreflect3d.o > > gcc45 -g -W -Wall -O0 -std=c99 -D_BSD_SOURCE -DDEBUG -D__BSD_VISIBLE > -DFREEBSD interreflect_driver.c > x86-debug/objects/interreflections/interreflect3d.o > -o x86-debug/bin/interreflect_driver > -I./ > -Ix86-debug/include > -Ix86-debug/../external/include > -Lx86-debug/../external/lib > -llapack -lf77blas -lcblas -latlas -lgfortran > ---------------------------------------------------------------------- > > and then I go to debug. I seem to stop in my function ok, locals and > such seem ok, gdb seems to handle OK, except the line number > information is wrong: > > #0 0x000000000040467b in reconstruction_prune (r=0x7fffffffe420, > intensity_threshold_min=1, > intensity_threshold_max=999999, jump_discontinuity_threshold=100, > clustersize=5) > at interreflect3d.c:296 > #1 0x00000000004013ef in main (argc=26, argv=0x7fffffffe620) at > interreflect_driver.c:103 > > For #0, the correct line is 1108, not 296. #1 is correct. > > This incorrect line number info is giving me grief while I'm trying to > step through my code. > > Anyone have a hunch what's going on here? > > Thanks. >