Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Re: gdb can't handle a DIE with both sibling and children
@ 2003-07-31 20:37 Michael Elizabeth Chastain
  0 siblings, 0 replies; 15+ messages in thread
From: Michael Elizabeth Chastain @ 2003-07-31 20:37 UTC (permalink / raw)
  To: carlton, hjl; +Cc: gdb

David Carlton asks:

> So: what does it mean for a subroutine to have another entry point?  I
> see that that entry point has a name; is that name visible to other
> compilation units, or only to the compilation unit in question?

The former.  The entry point is globally visible, just like the
main function name.

I never actually wrote an ENTRY statement, but here's a classic
FORTRAN example, where the body of "sine" and "cosine" would be
the same:

       double function sine (angle)
       double angle
       goto 10
       entry cosine (angle)
       angle = (3.14159265358979/4) - angle
       goto 10
    10 ... calculate the sine here ...
       return
       end

Of course, one could have implemented this as:

       double entry cosine (angle)
       return sine (3.14159265358979/4 - angle)
       end

But that's a waste of CPU time, back when the CPU was running
at 0.1 MHz.

For a modern example, it would be possible to implement those
pesky in-charge/not-in-charge constructors with one body of code
with 2 or 3 entry points.

> If it's only visible to the compilation unit in question, then the
> partial symtab probably doesn't have to know about it at all.  If it's
> visible outside the compilation unit (and if the compiler really is
> correct in putting DW_TAG_entry_points as children of
> DW_TAG_subroutines), then the partial symtab probably does have to know
> about it.

The main name and the entry names have the same visibility.
To the caller, 'sine' and 'cosine' are peers.

Michael C


^ permalink raw reply	[flat|nested] 15+ messages in thread
* gdb can't handle a DIE with both sibling and children
@ 2003-07-31 18:13 H. J. Lu
  2003-07-31 18:19 ` David Carlton
  2003-07-31 18:20 ` Daniel Jacobowitz
  0 siblings, 2 replies; 15+ messages in thread
From: H. J. Lu @ 2003-07-31 18:13 UTC (permalink / raw)
  To: GDB

It is entirely possible for a DIE with both sibling and children. But
scan_partial_symbols () has

      /* If the die has a sibling, skip to the sibling.  Do not skip
         enumeration types, we want to record their enumerators.  Do
         not skip namespaces, we want to record symbols inside
         them.  */
      if (pdi.sibling
          && pdi.tag != DW_TAG_enumeration_type
          && pdi.tag != DW_TAG_namespace)
        {
          info_ptr = pdi.sibling;
        }
      else if (pdi.has_children)
        {
          /* Die has children, but either the optional DW_AT_sibling
             attribute is missing or we want to look at them.  */
          nesting_level++;
        }

That is we can't handle a DIE with both sibling and children. How
should we fix that?


H.J.


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

end of thread, other threads:[~2003-07-31 21:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-31 20:37 gdb can't handle a DIE with both sibling and children Michael Elizabeth Chastain
  -- strict thread matches above, loose matches on Subject: below --
2003-07-31 18:13 H. J. Lu
2003-07-31 18:19 ` David Carlton
2003-07-31 18:20 ` Daniel Jacobowitz
2003-07-31 18:27   ` H. J. Lu
2003-07-31 18:47     ` Daniel Jacobowitz
2003-07-31 19:36   ` David Carlton
2003-07-31 19:56     ` H. J. Lu
2003-07-31 20:02       ` Daniel Jacobowitz
2003-07-31 20:22         ` H. J. Lu
2003-07-31 20:29           ` David Carlton
2003-07-31 20:29           ` Daniel Jacobowitz
2003-07-31 20:58             ` H. J. Lu
2003-07-31 21:01               ` Daniel Jacobowitz
2003-07-31 20:13       ` David Carlton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox