public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: "Aktemur, Tankut Baris" <tankut.baris.aktemur@intel.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH 2/3] gdb: remove push_target free functions
Date: Mon, 22 Mar 2021 14:21:16 -0400	[thread overview]
Message-ID: <6cb24e96-b8b7-6828-6673-cc06f04a0796@polymtl.ca> (raw)
In-Reply-To: <8c904425-6606-d227-ab67-876ee74211ee@polymtl.ca>

On 2021-03-22 1:31 p.m., Simon Marchi via Gdb-patches wrote:
>>> index bcc54bd966fe..b737bcf6e0f3 100644
>>> --- a/gdb/exec.c
>>> +++ b/gdb/exec.c
>>> @@ -616,7 +616,7 @@ program_space::add_target_sections (void *owner,
>>>  	    continue;
>>>
>>>  	  switch_to_inferior_no_thread (inf);
>>> -	  push_target (&exec_ops);
>>> +	  inf->push_target (&exec_ops);
>>
>> Similar to the previous patch, it should be OK to also remove the 
>> switch_to_inferior_no_thread here.
> 
> Similarly, pushing a target can cause another (at the same stratum) to
> get unpushed, and some target_ops::close implementations refer to the
> current inferior.  So out of caution I would leave it.  I'll also add
> a note to the commit message here.

Here too, it should be safe to remove it, now that I think about it.
We check just before that the exec target isn't pushed on the inferior's
stack, and there isn't any other file_stratum that could be there.  So
I'll remove it.  Thanks for making me double check that.

>>> @@ -1183,7 +1183,7 @@ follow_exec (ptid_t ptid, const char *exec_file_target)
>>>
>>>        inferior *org_inferior = current_inferior ();
>>>        switch_to_inferior_no_thread (inf);
>>
>> And here.
> 
> Same.  Although here it's a brand new inferior, so we know there isn't
> an existing process target that is going to get unpushed.  But also
> here, is it maybe important for the current inferior to be correctly set
> for the remainder of the follow_exec function?

I'll leave this one, because I still think it's important for the
remainder of the follow_exec function.

Simon

  reply	other threads:[~2021-03-22 18:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22  3:20 [PATCH 1/3] gdb: remove unpush_target free function Simon Marchi
2021-03-22  3:20 ` [PATCH 2/3] gdb: remove push_target free functions Simon Marchi
2021-03-22 16:30   ` Aktemur, Tankut Baris
2021-03-22 17:31     ` Simon Marchi
2021-03-22 18:21       ` Simon Marchi [this message]
2021-03-23 10:25         ` Aktemur, Tankut Baris
2021-03-23 13:50         ` Simon Marchi
2021-03-22  3:20 ` [PATCH 3/3] gdb: remove target_is_pushed free function Simon Marchi
2021-03-22 16:22 ` [PATCH 1/3] gdb: remove unpush_target " Aktemur, Tankut Baris
2021-03-22 17:25   ` Simon Marchi
2021-03-22 18:11     ` Simon Marchi

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=6cb24e96-b8b7-6828-6673-cc06f04a0796@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tankut.baris.aktemur@intel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).