From owner-freebsd-hackers@FreeBSD.ORG Sat Aug 16 16:40:07 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D27D837B401 for ; Sat, 16 Aug 2003 16:40:07 -0700 (PDT) Received: from smtp-send.myrealbox.com (smtp-send.myrealbox.com [192.108.102.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E43443F93 for ; Sat, 16 Aug 2003 16:40:07 -0700 (PDT) (envelope-from qhwt@myrealbox.com) Received: from me qhwt@smtp-send.myrealbox.com [220.13.16.139] $ on Novell NetWare; Sat, 16 Aug 2003 17:40:10 -0600 Date: Sun, 17 Aug 2003 08:40:25 +0900 From: qhwt@myrealbox.com To: Vladimir Ciobanu Message-ID: <20030816234025.GC61955@myrealbox.com> References: <3F3DCBC6.10805@rhaaw.rdsnet.ro> <20030816223252.GA61761@myrealbox.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="opJtzjQTFsWo+cga" Content-Disposition: inline In-Reply-To: <20030816223252.GA61761@myrealbox.com> User-Agent: Mutt/1.5.4i X-Content-Filtered-By: Mailman/MimeDel 2.1.1 cc: freebsd-hackers@freebsd.org Subject: Re: Debugging symbols with nasm X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2003 23:40:08 -0000 --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Aug 17, 2003 at 07:32:52AM +0900, qhwt@myrealbox.com wrote: > Hello. > > On Sat, Aug 16, 2003 at 09:14:30AM +0300, Vladimir Ciobanu wrote: > > I'm not sure whether this is the best list to post to, but it's my > > first guess. I'm using nasm to compile some code I wrote. The > > developer-handbook suggests I use "-f elf", so that's what I did. Then I > > linked it with ld. The program works as expected, but I can't debug it > > with gdb; it reports "no debugging symbols found". > > I've tried to get the possible debugging formats nasm can output, and > > I get "null" for both elf and aoutb ( ld can't even link aoutb .o files ). > > Is there a way I could debug my nasm-compiled assembler sources, > > preferably with gdb ? I don't mind any binary format that can run on > > FreeBSD, nor any other linker. > > Any suggestions are welcome. > > Nasm man page explicitly states that it doesn't support debug symbols: > $ env PAGER='less +/debug' man nasm > > However, there seem to be a patch that adds this feature. This is mentioned > in a netnews group comp.lang.asm.x86: > http://groups.google.com/groups?q=nasm+ELF+debug+symbol+group:comp.lang.asm.x86&hl=ja&lr=&ie=UTF-8&inlang=ja&group=comp.lang.asm.x86&c2coff=1&selm=k0Uga.49882$o8.1005465@twister.tampabay.rr.com&rnum=2 Ok, I've rewritten the patch for nasm-0.98.35(not sure whether the attachment goes through freebsd-hackers list though). Not used much yet, but it's funny to see NASM source code and C source code shows up in the same gdb session. --opJtzjQTFsWo+cga--