This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [[RFC] DWARF2 debug support for HP-UX SOM target

On Wed, Aug 02, 2006 at 03:21:56PM -0400, Daniel Jacobowitz wrote:
> On Wed, Aug 02, 2006 at 03:16:56PM -0400, John David Anglin wrote:
> > > > I have a question, though, which I think I've asked before.  GCC on
> > > > HP/UX uses stabs, so only requires basic SOM support from GDB.  That
> > > 
> > > There have been requests for ELF debug support.  The main issue as
> > > far as I can see is the lack of named sections and where to put stuff.
> Do you mean DWARF-2 here?  If so, I completely agree.  It seems like
> SOM has some named sections - at least we're managing to get objdump to
> tell me there's a GDB_STRINGS section - so I don't know what the
> problem is.

> I'd be much happier working on support for GCC :-)  Especially if that
> means DWARF-2 debug information!

I've attached a couple of preliminary patches to GCC and binutils
to implement DWARF2 debugging on the HP-UX RA-RISC SOM target.  It
builds and I don't see any testsuite regressions so far.  What I need
to know is whether GDB can successfully access the DWARF2 subspaces
and whether this actually works.

What I did was to enable the target define to create named sections.
Then, I disabled use of named sections for functions, data, profiling,
etc.  I confirmed with a full bootstrap and check that named sections
weren't being used.  This part was easy.

Next, I added the code to create the DWARF2 sections (subspaces) and
enabled DWARF2.  This is when I discovered that GAS didn't support
label differences in different segments.  Ok, so I define DIFF_EXPR_OK
in tc-hppa.h in spite of the comment that says it doesn't work.  I
think I may have fixed this problem last fall when I corrected data

Then, I discover that HP ld can't do unaligned symbol differences.
Well, I knew that but I didn't realize that dwarf2out.c needs this
capability.  The HP linker can do unaligned fixups for absolute
addresses.  I see that defining have_multiple_function_sections to
true in dwarf2out.c causes it to use absolute references.  The
code in dwarf2out.c can't detect our unnamed subspace changes in
the $TEXT$ space.  Even with a single function we have multiple text
subspaces, so I decided to just provide a mechanism to initialize
have_multiple_function_sections to true.

So, the fundamental problem is that the HP linker can't handle
unaligned symbol differences.  I haven't detected any further problems
with this in the test build, but I don't understand the DWARF
machinary sufficiently well to know if there are other circumstances
where unaligned symbol differences might occur.

There are minor problems with the section flags printed by objdump.
However, odump tells me they are correct.  I tried to setup the
DWARF2 debug space and subspaces in a manner similar to HP's debug
format.  I at first used the $DEBUG$ space but discovered that HP
also uses this space for their debug information.  Putting the
DWARF2 info in this space confuses pxdb, so I changes the name to


J. David Anglin                        
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

Attachment: pa-named.d.3
Description: Text document

Attachment: tc-hppa.h.d
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]