public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Questions about GCC MIPS R5900's mdebug section
@ 1999-11-18 14:23 Thomas Peng
  1999-11-18 23:23 ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Peng @ 1999-11-18 14:23 UTC (permalink / raw)
  To: gdb, binutils; +Cc: tpeng

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 775 bytes --]

We are using GCC MIPS R5900 for SonyÂ’s Play Station 2 on Linux/NT. We have
ELF executables with  a .mdebug section using stabs-in-ecoff. 

1. Is there
a way to force the GCC MIPS compiler to emit the .stab and .stabstr
sections instead of the .mdebug section? Based on my knowledge, it looks
like GCC is emitting stabs and the assembler is transforming that into
.mdebug section. Shall we build GAS for MIPS with or without .mdebug stabs
conversion disabled? if possible, many thanks for your suggestions in
advance! 

2. If the GCC MIPS compiler can't generate the .stab and
.stabstr sections, is there any documentation or source file or dump tool
that descibles the .mdebug section in detail? 

Any help on this is
appreciated.

Thomas Peng
email:tpeng@metrowerks.com


^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: Questions about GCC MIPS R5900's mdebug section
@ 1999-11-18 20:21 David B Anderson
  0 siblings, 0 replies; 5+ messages in thread
From: David B Anderson @ 1999-11-18 20:21 UTC (permalink / raw)
  To: tpeng; +Cc: binutils, gdb

>2. If the GCC MIPS compiler can't generate the .stab and
>.stabstr sections, is there any documentation or source file or dump tool
>that descibles the .mdebug section in detail? 

I hope there is better documentation, somewhere, but there is a
(rather old) description of mdebug  I wrote long ago on:

   http://reality.sgi.com/davea/objectinfo.html

Maybe it will help.  Maybe not.  Take a look.

   Shift click on the 'here' in 
   "one part of the old 32bit ABI for MIPS is the 
   mdebug debugging information 
   A postscript file with the only currently available
   description of this data is here (119Kbytes)."

The document says nothing about the stuff defined by SGI for
C++ (which I presume that gcc sort of follows: I did not
check).  Basically the idea there was to follow  a normal
stStruct stEnd is followed immediately
by stTag and the c++ set of things
followed by stEnd. So the C++ classes are described
twice (yuck).


Corrections/ flames to:
David B. Anderson davea@sgi.com danderson@acm.org http://reality.sgi.com/davea/
Y2K conversion simplified: Januark, Februark, March, April, Mak, June,
Julk, August, September, October, November, December.

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: Questions about GCC MIPS R5900's mdebug section
@ 1999-11-19  8:13 Bob Zulawnik
  1999-11-19 13:57 ` Stan Shebs
  0 siblings, 1 reply; 5+ messages in thread
From: Bob Zulawnik @ 1999-11-19  8:13 UTC (permalink / raw)
  To: tpeng; +Cc: gdb, binutils, bob.zulawnik

Here is what appears to be a problem when running gdb
on MIPS executables that use stabs for debug info (e.g.
ECOFF/stabs or ELF/stabs), rather than 'original'
ECOFF/mdebug format. If somebody could confirm/refute
this, it would be very helpful indeed.

When unwinding stack (or on other occasions) find_proc_desc()
will be called with a particular PC value. It will first
attempt to do it 'in a scientific way' by calling
non_heuristic_proc_desc() (both defined in mips-tdep.c).
non_heuristic_proc_desc() will look for a block that
that particular PC values falls into (block_for_pc(pc))
and then it will attempt to find a particular symbol
for than block :

    sym = lookup_symbol (MIPS_EFI_SYMBOL_NAME, b,
                         LABEL_NAMESPACE, 0, NULL);

where MIPS_EFI_SYMBOL_NAME is defined this way in
config/mips/tm-mips.h :

    #define MIPS_EFI_SYMBOL_NAME "__GDB_EFI_INFO__"


This particular symbol ("__GDB_EFI_INFO__") will not
be found for the files with stabs debug info (ECOFF/stabs,
ELF/stabs), as it is only created when reading in
debug info from an ECOFF/mdebug executable. It is
built based upon info in PDRs (Procedure Description
Records) that live in .mdebug section. From mdebugread.c :

/* Parse a procedure descriptor record PR.  Note that the procedure
   is parsed _after_ the local symbols, now we just insert the extra
   information we need into a MIPS_EFI_SYMBOL_NAME symbol
   that has already been placed in the procedure's main block. ...
   ...
    parse_symbol (..) {
    ...
    /* Make up special symbol to contain procedure specific
       info */
     s = new_symbol (MIPS_EFI_SYMBOL_NAME);

The problem as I understand it is that these symbols
(__GDB_EFI_INFO__) are not created when reading in stabs
because stabs sections simply do not contain all that info
(gathered in one record, no less) that a PDR has (e.g. things like
frame size, register mask etc).

What happens next is that find_proc_desc() reverts to
heuristics :

    proc_desc =
        heuristic_proc_desc (startaddr, pc, next_frame);

which means that it starts reading function prologue
(i.e. it reads instructions from inferior's memory) and it
attempts to figure out information about it that way.
While inelegant, it might work OK in native configurations
(i.e. when gdb and inferior are running on the same host).
However, the biggest problem will occur in remote configurations,
where those memory reads have go through remote link. (A hack
would make gdb read the executable file on the host side,
rather than inferior's memory in a situation like that, just
for speed's sake).

As mips-tdep.c contains MIPS target-dependent code, regardless
of the particulars of debug info scheme in use, I would guess
that the same problem should affect MIPS ELF/Dwarf files ? Or
am I totally confused here ?

Regards,
Bob Zulawnik

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1999-11-19 13:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-18 14:23 Questions about GCC MIPS R5900's mdebug section Thomas Peng
1999-11-18 23:23 ` Ian Lance Taylor
1999-11-18 20:21 David B Anderson
1999-11-19  8:13 Bob Zulawnik
1999-11-19 13:57 ` Stan Shebs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).