Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Pierre Muller <muller@ics.u-strasbg.fr>
Cc: gdb-patches@sourceware.org, gpc@gnu.de, core@freepascal.org
Subject: Re: [RFA/DWARF2] Handle nested subprograms in CU pc bound calculation
Date: Wed, 01 Oct 2008 16:40:00 -0000	[thread overview]
Message-ID: <20081001163945.GI3665@adacore.com> (raw)
In-Reply-To: <003201c92399$3207f300$9617d900$@u-strasbg.fr>

> > 2008-09-30  Joel Brobecker  <brobecker@adacore.com>
> > 
> >         * dwarf2read.c (dwarf2_handle_nested_subprograms_p): New
> > function.
> >         (add_partial_subprogram): Replace check of Ada language by call
> >         to dwarf2_handle_nested_subprograms_p.
> >         (dwarf2_get_subprogram_pc_bounds, load_partial_dies): Likewise.
> 
>  This looks fine for me!

OK, I can commit this patch in a week or so to give people some time
to object.  We can deal with the other issues with a separate patch.

> I know even less about GNU pascal compiler, but as this compiler is
> base on the GNU multi-language compiler, I would except it to behave
> closer to GNU C++ or GNU Ada.

Seems reasonable.

> I must confess that I don't even know if the full specification
> would work for pascal in case the same name is used globally and as
> a nested procedure (I do know that you are allowed
> to reuse a name defined globally as a local procedure, function or variable
> inside a function, but I don't know if the
> (gdb) break GlobalFuntion.LocalFunction would work)

I think we need to answer that question first before we go and start
spending the CPU time to scan for nested subprograms. Homonyms can
happen in the case you suggested, or in the case when two nested
subprograms have the same name.  Right now, when there is an ambiguity,
I understand that the debugger chooses one at random. Until we fix that,
adding nested subprograms whose name might overshadow library-level
subprograms is a bad idea in my opinion.

The answer to the question above lies in the Pascal parser. But when
there are homonyms, how do you specify in your program exactly which
one you mean? And does GDB provide the same method for distinguishing
these homonyms?

(need to relearn Pascal one of these days...)
-- 
Joel


  parent reply	other threads:[~2008-10-01 16:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-30 15:28 Joel Brobecker
2008-09-30 15:43 ` Pierre Muller
2008-09-30 17:07   ` Joel Brobecker
2008-09-30 17:39     ` Daniel Jacobowitz
2008-10-01  1:16       ` Joel Brobecker
2008-10-01  7:43         ` Pierre Muller
2008-10-01  8:33           ` [Core] " Jonas Maebe
2008-10-01 16:40           ` Joel Brobecker [this message]
2008-10-01 21:56             ` Jonas Maebe
2008-10-02  6:45             ` Daniël Mantione
2008-10-02  9:07               ` Pierre Muller
2008-10-02 10:36                 ` Daniël Mantione
2008-10-03  0:31                   ` Joel Brobecker
2008-09-30 15:43 ` Daniel Jacobowitz
2008-09-30 16:56   ` Joel Brobecker
2008-09-30 17:05     ` Daniel Jacobowitz
2008-09-30 16:58 ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081001163945.GI3665@adacore.com \
    --to=brobecker@adacore.com \
    --cc=core@freepascal.org \
    --cc=gdb-patches@sourceware.org \
    --cc=gpc@gnu.de \
    --cc=muller@ics.u-strasbg.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox