Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb@sourceware.org
Subject: Re: New Ada failure
Date: Fri, 05 Jan 2007 03:56:00 -0000	[thread overview]
Message-ID: <20070105035647.GB3434@adacore.com> (raw)
In-Reply-To: <20070104202406.GA26522@nevyn.them.org>

> (gdb) catch exception
> Cannot break on __gnat_raise_nodefer_with_msg in this configuration.
> 
> The symbol is present, in my shared libgnat.so.  I have a stripped
> libgnat, unsurprisingly.  I think the problem is that you're using
> lookup_symbol; isn't lookup_minimal_symbol sufficient?

I added a big comment in the code to explain why I use the debugging
info and not the symbol table:

  /* The symbol we're looking up is provided by a unit in the GNAT runtime
     that should be compiled with debugging information.  As a result, we
     expect to find that symbol in the symtabs.  If we don't find it, then
     the target most likely does not support Ada exceptions, or we cannot
     insert exception breakpoints yet, because the GNAT runtime hasn't been
     loaded yet.  */

  /* brobecker/2006-12-26: It is conceivable that the runtime was compiled
     in such a way that no debugging information is produced for the symbol
     we are looking for.  In this case, we could search the minimal symbols
     as a fall-back mechanism.  This would still be operating in degraded
     mode, however, as we would still be missing the debugging information
     that is needed in order to extract the name of the exception being
     raised (this name is printed in the catchpoint message, and is also
     used when trying to catch a specific exception).  We do not handle
     this case for now.  */

As Robert explained, once we hit the breakpoint, we need to evaluate
certain expressions: Either id.full_name, or e.full_name (depending
on the situation). "e" is a function parameter, but id is a local
variable.

I am open to adding a lookup in the minimal symbol table if you like.
That's going to introduce a bit of complication, however, because we
then have to reject the case where the user asks to break on a specific
exception.  We already have some code that handles evaluation failures
when trying to read the name of the exception, so we don't need to take
care of that part.

I am not sure why you stripped your libgnat.so. From your other messages,
it sounds like something that you must do. At least with GNAT Pro,
the runtime is built at -O2 and without -g, except for a few select units
which are deliberately built with -g (and often -O1 instead of -O2).
To us, if you strip the runtime, then you break the compiler-debugger
interface.

Would you consider not stripping libgnat.so?

-- 
Joel


  parent reply	other threads:[~2007-01-05  3:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-04 20:24 Daniel Jacobowitz
2007-01-04 23:09 ` Robert Dewar
2007-01-04 23:15   ` Daniel Jacobowitz
2007-01-04 23:22   ` Mark Kettenis
2007-01-04 23:26     ` Robert Dewar
2007-01-04 23:27       ` Daniel Jacobowitz
2007-01-05  3:56 ` Joel Brobecker [this message]
2007-01-05  3:59   ` Daniel Jacobowitz
2007-01-05  4:06     ` Joel Brobecker
2007-01-05 15:31     ` Joel Brobecker
2007-01-05 15:42       ` Daniel Jacobowitz
2007-01-05 16:03         ` 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=20070105035647.GB3434@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    /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