Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [patch 2/2] Assert leftover cleanups in TRY_CATCH
Date: Tue, 07 May 2013 06:23:00 -0000	[thread overview]
Message-ID: <20130507062305.GH5278@adacore.com> (raw)
In-Reply-To: <87obcoyot3.fsf@fleche.redhat.com>

> Thanks for doing this.  I think it is a nice addition.

I agree. My only additional comment, after having hit this assertion,
is that it seems a bit harsh to be doing an abort in this case.
The problem showed up during a testsuite run, and so I would
investigate it regardless. But I can imagine the same issue
occurring during a real debugging session trying to chase a bug -
I'd be pretty upset to see my session ended like that.

Should we consider changing it into an internal_warning?

> We could do this for all cleanup-creating functions, at least when using
> GCC, if we didn't mind putting a declaration at the start of each such
> function:
> 
> #if ... gcc ..
> #define CHECK_CLEANUP \
>   struct cleanup *__dummy ## __LINE__ \
>      __attribute__ ((cleanup (check_cleanup))) \
>      = get_checking_cleanup_pointer ();
> #endif
> 
> 
> This would call check_cleanup when the function exited normally, so we
> could verify that the cleanup chain was properly reset.

That would have helped my investigation, because the error
was raised in a frame long after the function causing the problem
had returned. Looking at the contents of the cleanup_chain,
you get a hint of what it might be, but in my case, it was
a null_cleanup, so not so helpful...

> I think it would be possible to automate adding this declaration in
> all needed spots.  I'm curious what you think about it.

I'm certainly curious about the suggestion. How would the current
code be adapted to make this work?

-- 
Joel


  parent reply	other threads:[~2013-05-07  6:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-01 16:57 Jan Kratochvil
2013-05-02 17:02 ` Pedro Alves
2013-05-05 16:56   ` [commit] " Jan Kratochvil
2013-05-06 17:57 ` Tom Tromey
2013-05-06 18:18   ` Jan Kratochvil
2013-05-06 18:50     ` Tom Tromey
2013-05-07  1:47       ` Jan Kratochvil
2013-05-07  4:37         ` Doug Evans
2013-05-07  4:49           ` Doug Evans
2013-05-07 15:24           ` Jan Kratochvil
2013-05-15  0:13             ` Benchmarking (was Re: [patch 2/2] Assert leftover cleanups in TRY_CATCH) Stan Shebs
2013-05-15 17:00               ` Doug Evans
2013-05-22 20:51                 ` Tom Tromey
2013-05-07 14:36         ` [patch 2/2] Assert leftover cleanups in TRY_CATCH Tom Tromey
2013-05-07 18:00           ` Jan Kratochvil
2013-05-07  6:23   ` Joel Brobecker [this message]
2013-05-07 14:20     ` [patch] " Jan Kratochvil
2013-05-14 20:39       ` [commit] " Jan Kratochvil
2013-05-07 14:40     ` Tom Tromey
2013-05-07 14:55       ` Jan Kratochvil
2013-05-07 15:26       ` Tom Tromey
2013-05-08  5:54       ` 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=20130507062305.GH5278@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=tromey@redhat.com \
    /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