From owner-freebsd-hackers Wed Jun 12 23:37: 8 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from sharmas.dhs.org (cpe-66-1-147-119.ca.sprintbbd.net [66.1.147.119]) by hub.freebsd.org (Postfix) with ESMTP id 9284337B419; Wed, 12 Jun 2002 23:37:04 -0700 (PDT) Received: by sharmas.dhs.org (Postfix, from userid 500) id 58EBC5E001; Wed, 12 Jun 2002 23:38:23 -0700 (PDT) Date: Wed, 12 Jun 2002 23:38:23 -0700 From: Arun Sharma To: John Baldwin Cc: freebsd-hackers@freebsd.org Subject: Re: Kernel hacking questions Message-ID: <20020613063823.GA31427@sharma-home.net> References: <20020610033520.GA7795@sharma-home.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.27i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Jun 11, 2002 at 04:36:47AM -0400, John Baldwin wrote: > > 2. How do I trace back funcname+offset to a particular line of C code ? > > I tried objdump -d and gcc -S, but it's not easy to read. I thought > > there was a way to get gcc to interleave the C code and the generated > > assembly. > > gdb's 'l *foo+0x34' works wonders. :) If you are stuck with a kernel.debug > on current that gdb doesn't grok, you can use nm to extract the address of > the function, add the offset, and use 'addr2line -e kernel.debug 0xc0yyyyyy'. I was looking for objdump -S foo.o -Arun To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message