Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: Tom Tromey <tom@tromey.com>,  Tom Tromey <tromey@adacore.com>,
	 gdb-patches@sourceware.org
Subject: Re: [PATCH] Destroy allocated values when exiting GDB
Date: Mon, 01 Apr 2019 14:59:00 -0000	[thread overview]
Message-ID: <871s2lvkjv.fsf@redhat.com> (raw)
In-Reply-To: <369707f4-be00-5234-cbc6-5a5d7b1c5204@redhat.com> (Pedro Alves's	message of "Mon, 1 Apr 2019 15:08:46 +0100")

On Monday, April 01 2019, Pedro Alves wrote:

> On 03/29/2019 09:43 PM, Sergio Durigan Junior wrote:
>
>> 
>> diff --git a/gdb/top.c b/gdb/top.c
>> index b10b0649e9..ffbe8e517f 100644
>> --- a/gdb/top.c
>> +++ b/gdb/top.c
>> @@ -1672,6 +1672,9 @@ quit_force (int *exit_arg, int from_tty)
>>      }
>>    END_CATCH
>>  
>> +  /* Destroy any values currently allocated.  */
>> +  finalize_values ();
>
> I think that someone reading this without context may not realize
> why we need to do that.  How about extending the comment, like:
>
>   /* Destroy any values currently allocated now instead of leaving it
>      to global destructors, because that may be too late.  For
>      example, the destructors of xmethod values call into the Python
>      runtime, which is finalized via a final cleanup.  */

Done.

>> diff --git a/gdb/value.h b/gdb/value.h
>> index d3905cc354..7853950ca3 100644
>> --- a/gdb/value.h
>> +++ b/gdb/value.h
>> @@ -1189,4 +1189,8 @@ extern struct value *call_xmethod (struct value *method,
>>  extern int value_union_variant (struct type *union_type,
>>  				const gdb_byte *contents);
>>  
>> +/* Destroy the values currently allocated.  This is mostly called when
>> +   GDB is exiting (e.g., on quit_force).  */
>
> s/mostly//

Done.

>> +extern void finalize_values ();
>> +
>>  #endif /* !defined (VALUE_H) */
>
> LGTM with those changes.

Thanks for the review.  Pushed:

9d1447e09d4aa673826039321163b5a684e8e043

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/


      reply	other threads:[~2019-04-01 14:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190320140846.13031-1-tromey@adacore.com>
2019-03-20 16:21 ` [PATCH] Merge handle_inferior_event and handle_inferior_event_1 Pedro Alves
2019-03-21 22:05 ` Sergio Durigan Junior
2019-03-22  0:01   ` Sergio Durigan Junior
2019-03-25 15:35     ` Tom Tromey
2019-03-25 16:34       ` Pedro Alves
2019-03-25 16:46         ` Tom Tromey
2019-03-25 22:20           ` Sergio Durigan Junior
2019-03-26 13:13             ` Tom Tromey
2019-03-26 16:07               ` Sergio Durigan Junior
2019-03-26 18:45                 ` Tom Tromey
2019-03-26 21:50                 ` Sergio Durigan Junior
2019-03-27 12:57                   ` Tom Tromey
2019-03-28 14:12                     ` Pedro Alves
2019-03-29 21:44                       ` [PATCH] Destroy allocated values when exiting GDB (was: Re: [PATCH] Merge handle_inferior_event and handle_inferior_event_1) Sergio Durigan Junior
2019-04-01 14:08                         ` [PATCH] Destroy allocated values when exiting GDB Pedro Alves
2019-04-01 14:59                           ` Sergio Durigan Junior [this message]

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=871s2lvkjv.fsf@redhat.com \
    --to=sergiodj@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=tom@tromey.com \
    --cc=tromey@adacore.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