From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8836 invoked by alias); 16 Oct 2007 04:39:55 -0000 Received: (qmail 8822 invoked by uid 22791); 16 Oct 2007 04:39:54 -0000 X-Spam-Check-By: sourceware.org Received: from smtpoutm.mac.com (HELO smtpoutm.mac.com) (17.148.16.78) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 16 Oct 2007 04:39:51 +0000 Received: from mac.com (asmtp003-s [10.150.69.66]) by smtpoutm.mac.com (Xserve/smtpout015/MantshX 4.0) with ESMTP id l9G4dot0011885 for ; Mon, 15 Oct 2007 21:39:50 -0700 (PDT) Received: from [192.168.1.200] (cpe-75-82-34-156.socal.res.rr.com [75.82.34.156]) (authenticated bits=0) by mac.com (Xserve/asmtp003/MantshX 4.0) with ESMTP id l9G4dn0K014698 for ; Mon, 15 Oct 2007 21:39:49 -0700 (PDT) Message-Id: From: Rene Limberger To: gdb@sourceware.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v907) Subject: implementation of backtrace on OSX? Date: Tue, 16 Oct 2007 04:39:00 -0000 X-Mailer: Apple Mail (2.907) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-10/txt/msg00114.txt.bz2 hi, can anyone give me some pointers to where in the source code the gdb backtrace is generated? ion linux, there is backtrace() via execinfo.h, unfortunately this is not available on OSX and i would like to take a peak at how gdb implements what we get when we type "bt". so for example: Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x00000000 [Switching to process 31347 thread 0x3303] 0x001e9f1d in somefnc () (gdb) bt #0 0x001e9f1d in somefnc () #1 0x003291ac in call_something (n=0x611ca0, something=0xb02267b4) at somefile.c:47 ... #11 0x93b853a1 in _pthread_start () #12 0x93b8525e in thread_start () i am specifically interested in how gdb resolves the file and line number from the debug info. thanks, -r