Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Simon Marchi <simon.marchi@efficios.com>, gdb-patches@sourceware.org
Cc: Laurent <Laurent.Morichetti@amd.com>
Subject: Re: [PATCH 3/4] gdb: pass target to thread_ptid_changed observable
Date: Wed, 5 Aug 2020 23:29:12 +0100	[thread overview]
Message-ID: <7667e73f-9c79-1913-437d-1b6bc0ec0e8d@palves.net> (raw)
In-Reply-To: <73072472-2115-0c9a-1e28-7b554bc2e4e6@efficios.com>

On 8/5/20 8:08 PM, Simon Marchi wrote:
> On 2020-08-05 10:50 a.m., Pedro Alves wrote:
>> I don't see why we shouldn't.
> 
> I'd say because it's not worth the trouble.

But there's really no trouble.

> 
>> Assuming that the regcaches are empty
>> like in the current patch can also fail is someone inserts some test
>> before this new test that ends up filling in the regcache.  I see it as
>> your new test being fragile because of that, and running the
>> "maint selftest" while some program is running is just a way
>> to trigger it.  To me, not allowing selftests while the
>> program is running is just an admission that the tests
>> aren't well isolated enough.
>>
> 
> I think it would make more sense to require that each test cleans up
> properly after itself.

scoped_mock_context creates a new inferior list, adds a new inferior
to it with its own test target, adds new thread, and switches to it.  
The destructor restores the previous state.  When we switch to the mock
context, the running inferior is not reachable in the inferior list.
Whether an inferior was running or not, it shouldn't make a difference.
Maybe it should be both scoped_mock_context's constructor and destructor
that call registers_changed.  But I do think we should put a call to
registers_changed somewhere, to maintain invariants properly.

> But anyhow, I'll do as you suggest, I don't mind.

Thanks.


  reply	other threads:[~2020-08-05 22:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20 20:40 [PATCH 0/4] Regcache fix and optimization Simon Marchi
2020-07-20 20:40 ` [PATCH 1/4] gdb: rename regcache::current_regcache to regcache::regcaches Simon Marchi
2020-07-23 20:01   ` Pedro Alves
2020-07-20 20:40 ` [PATCH 2/4] gdb: move regcache::regcaches to regcache.c Simon Marchi
2020-07-23 20:03   ` Pedro Alves
2020-07-20 20:41 ` [PATCH 3/4] gdb: pass target to thread_ptid_changed observable Simon Marchi
2020-07-23 20:42   ` Pedro Alves
2020-07-30 15:27     ` Simon Marchi
2020-08-05 14:50       ` Pedro Alves
2020-08-05 19:08         ` Simon Marchi
2020-08-05 22:29           ` Pedro Alves [this message]
2020-07-20 20:41 ` [PATCH 4/4] gdb: change regcache list to be a map Simon Marchi
2020-07-24  1:53   ` Pedro Alves
2020-07-24 16:59     ` John Baldwin
2020-07-30 16:26       ` Simon Marchi
2020-07-30 16:58     ` Simon Marchi
2020-07-30 17:03       ` Simon Marchi
2020-08-05 18:02         ` Pedro Alves
2020-08-05 20:25           ` Simon Marchi
2020-07-30 17:07       ` Simon Marchi
2020-07-30 18:17     ` Simon Marchi
2020-08-05 18:14       ` Pedro Alves
2020-08-10 19:15   ` Tom Tromey
2020-08-10 19:25     ` Simon Marchi
2020-08-12 12:52   ` Tom Tromey
2020-08-12 15:17     ` Tom Tromey
2020-08-06 20:27 ` [PATCH 0/4] Regcache fix and optimization 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=7667e73f-9c79-1913-437d-1b6bc0ec0e8d@palves.net \
    --to=pedro@palves.net \
    --cc=Laurent.Morichetti@amd.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.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