From: Aditya Kamath1 <Aditya.Kamath1@ibm.com>
To: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
Aditya Kamath1 via Gdb-patches <gdb-patches@sourceware.org>
Cc: Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>
Subject: [PATCH] Remove unnecessary return and unused variable in aix-thread.c
Date: Fri, 1 Dec 2023 07:57:53 +0000 [thread overview]
Message-ID: <CH2PR15MB35448046A94529E9564D1AD4D681A@CH2PR15MB3544.namprd15.prod.outlook.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 527 bytes --]
Hi all,
Please find attached a patch. {See: Remove-unnecessary-returns-and-unused-variables-in-A.patch}
This patch is a simple removal of unnecessary return that was missed while we fixed a bug last week in AIX.
Also, I removed unused variable and a shadow declaration warning coming due to the two for loops also using thread_info *tp variable.
Kindly let me know your views. If not requesting you to kindly push this patch. Apologies for missing the same.
Have a nice day ahead.
Thanks and regards,
Aditya.
[-- Attachment #2: 0001-Remove-unnecessary-returns-and-unused-variables-in-A.patch --]
[-- Type: application/octet-stream, Size: 2008 bytes --]
From 24b8db603f0ae8b7f3b4efe04cc2298413765eb4 Mon Sep 17 00:00:00 2001
From: Aditya Vidyadhar Kamath <Aditya.Kamath1@ibm.com>
Date: Fri, 1 Dec 2023 01:43:04 -0600
Subject: [PATCH] Remove unnecessary returns and unused variables in AIX.
This is a patch to simplify the pd_activate () in aix-thread.c incase of a failure to start a thread session
, since pd_activate () now has return type void.
Also this patch fixes the shadow declarartion warning in sync-threadlists.
---
gdb/aix-thread.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index c8147defc04..3eb8f57422c 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -829,7 +829,6 @@ sync_threadlists (pid_t pid)
pthread_t pthid;
pthdb_tid_t tid;
process_stratum_target *proc_target = current_inferior ()->process_target ();
- thread_info *tp;
struct aix_thread_variables *data;
data = get_thread_data_helper_for_pid (pid);
@@ -931,7 +930,7 @@ sync_threadlists (pid_t pid)
if (gptid.is_pid ())
{
- tp = proc_target->find_thread (gptid);
+ thread_info *tp = proc_target->find_thread (gptid);
thread_change_ptid (proc_target, gptid, pptid);
aix_thread_info *priv = new aix_thread_info;
priv->pdtid = pbuf[pi].pdtid;
@@ -1027,12 +1026,8 @@ pd_activate (pid_t pid)
status = pthdb_session_init (pid, data->arch64 ? PEM_64BIT : PEM_32BIT,
PTHDB_FLAG_REGS, &pd_callbacks,
&data->pd_session);
- if (status != PTHDB_SUCCESS)
- {
- return ptid_t (pid);
- }
- data->pd_active = 1;
- return;
+ if (status == PTHDB_SUCCESS)
+ data->pd_active = 1;
}
/* AIX implementation of update_thread_list. */
@@ -1746,7 +1741,6 @@ store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid)
uint64_t int64;
struct aix_thread_variables *data;
data = get_thread_data_helper_for_ptid (inferior_ptid);
- int ret;
__vmx_context_t vmx;
__vsx_context_t vsx;
--
2.41.0
next reply other threads:[~2023-12-01 7:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-01 7:57 Aditya Kamath1 [this message]
2023-12-01 10:10 ` Ulrich Weigand
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=CH2PR15MB35448046A94529E9564D1AD4D681A@CH2PR15MB3544.namprd15.prod.outlook.com \
--to=aditya.kamath1@ibm.com \
--cc=Ulrich.Weigand@de.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=sangamesh.swamy@in.ibm.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).