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 X-Authentication-Warning: eos.vss.fsi.com: ford owned process doing -bs Date: Tue, 14 Jan 2003 10:46:30 -0600 (CST) From: Brian Ford X-X-Sender: ford AT eos To: Nick Clifton cc: cygwin AT cygwin DOT com, , , Subject: Re: Support for DDWARF-2 debug info? (on Cygwin) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On 14 Jan 2003, Nick Clifton wrote: > Hi Brian, > > > I have built gcc 3.2.1 (just --enable-languages=c so far) with > > "#define DWARF2_DEBUGGING_INFO 1" added to config/i386/cygwin.h. > > The resulting compiler still produces stabs by default, but will > > accept "-gdwarf-2". > > > > When using "-gdwarf-2", the debug information is, I believe, > > correctly output, but the sections have incorrect attributes as > > shown by the "objdump -h" output below. > > I believe that this is a gcc problem. GCC generates ".section" > assembler directives to create these sections and it assigns the > attributes for the sections at the same time. > > I think that you need to define a "named_section" function for the > gcc_target structure which will then add the necessary flags. For an > example of this see arm_elf_asm_named_section() in > gcc/config/arm/arm.c. > While this may be partially true, it appears that there is no way for gcc to tell gas that the section is a debugging section. Thus, gas must key off the section name to produce the appropriate flags. The coff versions of sec_to_styp_flags and styp_to_sec_flag in bfd look to see if the section name begins with .debug and modify the section flags appropriately. The PE versions do not even look at the section name. /* The PE version; see above for the general comments. The non-PE case seems to be more guessing, and breaks PE format; specifically, .rdata is readonly, but it sure ain't text. Really, all this should be set up properly in gas (or whatever assembler is in use), and honor whatever objcopy/strip, etc. sent us as input. */ And, I can't seem to figure out any better way for gas to detect this. So, according to the above comment, there appears no "correct" way to do this. Any additional suggestions are more than welcome. We are porting an application that relies on reading DWARF2 debugging information to Cygwin. This seems like an easier and more usefull route for the community than us writing a stabs parser. Thanks. -- Brian Ford Senior Realtime Software Engineer VITAL - Visual Simulation Systems FlightSafety International Phone: 314-551-8460 Fax: 314-551-8444 -- 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/