From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: move some variables to an inner scope in save_waitstatus
Date: Thu, 29 Apr 2021 10:17:26 -0400 [thread overview]
Message-ID: <cc85c3bd-6ce7-65b4-1a08-4fc30962bb8c@polymtl.ca> (raw)
In-Reply-To: <20210429074622.GD2364578@embecosm.com>
On 2021-04-29 3:46 a.m., Andrew Burgess wrote:
> * Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> [2021-04-28 23:54:51 -0400]:
>
>> These two variables:
>>
>> struct regcache *regcache = get_thread_regcache (tp);
>> const address_space *aspace = regcache->aspace ();
>>
>> are only needed inside the "if". Getting a thread's regcache is a
>> somewhat expensive operation, so it's good to avoid it if not necessary.
>> Move the variable declarations and their initialization to the "if"
>> scope.
>>
>> gdb/ChangeLog:
>>
>> * infrun.c (save_waitstatus): Move variables to inner scope.
>
> LGTM.
>
> Thanks,
> Andrew
Pushed, thanks.
Simon
prev parent reply other threads:[~2021-04-29 14:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-29 3:54 Simon Marchi via Gdb-patches
2021-04-29 7:46 ` Andrew Burgess
2021-04-29 14:17 ` Simon Marchi via Gdb-patches [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=cc85c3bd-6ce7-65b4-1a08-4fc30962bb8c@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=andrew.burgess@embecosm.com \
--cc=simon.marchi@polymtl.ca \
/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