Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3CA9DC4A.698D216A@cern.ch> Date: Tue, 02 Apr 2002 18:28:58 +0200 From: "Lassi A. Tuura" Organization: Northeastern University, Boston, USA X-Accept-Language: en MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: stacktrace from withn an exec upon error condition References: <20020328153930 DOT GF11781 AT redhat DOT com> <20020328221751 DOT GK16757 AT redhat DOT com> <5 DOT 1 DOT 0 DOT 14 DOT 2 DOT 20020328161017 DOT 0274f2c8 AT pop3 DOT cris DOT com> <20020329010609 DOT GB19845 AT redhat DOT com> <20020329040532 DOT GA22205 AT redhat DOT com> <3CA9B414 DOT 89D685ED AT cern DOT ch> <20020402154047 DOT GF17969 AT redhat DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > I haven't looked at it recently, but I really doubt that the code would > deal with the stabs symbol table that gcc/gas/ld use and allow symbolic > representation of symbols. My code certainly doesn't, it only deals with basic Win32. You get symbols for addresses only if imagehlp library can get them. IIRC this means anything exported from a DLL if no other info is available, and I'd assume it works the same on cygwin since the export mechanism doesn't change. > The hints I gave in my previous email really are the best way to go on > this. Quite right. One addition: address-to-symbol look-up gets complicated with dynamically loaded shared libraries. Post-mortem analysis (say addr2line) doesn't combine well with dynamic loading, which may or may not matter, depending on how much grief you are ready to get into. It does matter to me, hence I use imagehlp, and it has worked for so far (but I haven't used the code on gcc/cygwin, only for native Win32, and virtually all our code is in DLLs and is exported, so most gets mapped correctly; I should check what it actually does on MSVC++, it is a long time I looked at that). To read read symbols from a running program with bfd, look at mpatrol; it has code to fetch symbols from the program itself and any shared libraries currently mapped in. However, the version of mpatrol I used only reads symbols at program start-up, which isn't so great for dynamic loading. (On the other hand, reading symbol data in fatal signal handler is not the greatest of ideas either :-) //lat -- Real programmers don't document. Documentation is for simps who can't read the listings or the object deck. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/