From: Aditya Vidyadhar Kamath <akamath996@gmail.com>
To: ulrich.weigand@de.ibm.com, simon.marchi@polymtl.ca, tom@tromey.com
Cc: gdb-patches@sourceware.org, Aditya.Kamath1@ibm.com,
sangamesh.swamy@in.ibm.com,
Aditya Vidyadhar Kamath <aditya.kamath1@ibm.com>
Subject: [PATCH 2/2] Fix uninitialised fields in aix_thread_variables structure.
Date: Fri, 18 Sep 2026 17:50:05 +0530 [thread overview]
Message-ID: <20260918122004.37424-2-akamath996@gmail.com> (raw)
From: Aditya Vidyadhar Kamath <aditya.kamath1@ibm.com>
The fields in aix_thread_variables structure were never initialised.
So we initialise them and also change to bool since they are
purely flags.
This patch updates all assignment sites to use true or false
accordingly.
---
gdb/aix-thread.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index b4b9efca5d4..0602fc3a8f3 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -165,21 +165,21 @@ static pthdb_callbacks_t pd_callbacks = {
struct aix_thread_variables
{
/* Whether the current application is debuggable by pthdb. */
- int pd_able;
+ bool pd_able = false;
/* Whether a threaded application is being debugged. */
- int pd_active;
+ bool pd_active = false;
/* Current pthdb session. */
- pthdb_session_t pd_session;
+ pthdb_session_t pd_session = 0;
/* Address of the function that libpthread will call when libpthdebug
is ready to be initialized. */
- CORE_ADDR pd_brk_addr;
+ CORE_ADDR pd_brk_addr = 0;
/* Whether the current architecture is 64-bit.
Only valid when pd_able is true. */
- int arch64;
+ bool arch64 = false;
/* Describes the number of thread exit events reported. */
std::unordered_set<pthdb_pthread_t> exited_threads;
@@ -839,7 +839,7 @@ pd_activate (pid_t pid)
PTHDB_FLAG_REGS, &pd_callbacks,
&data->pd_session);
if (status == PTHDB_SUCCESS)
- data->pd_active = 1;
+ data->pd_active = true;
}
/* AIX implementation of update_thread_list. */
@@ -904,7 +904,7 @@ pd_enable (inferior *inf)
/* Prepare for thread debugging. */
current_inferior ()->push_target (&aix_thread_ops);
- data->pd_able = 1;
+ data->pd_able = true;
/* If we're debugging a core file or an attached inferior, the
pthread library may already have been initialized, so try to
@@ -927,8 +927,8 @@ pd_disable (inferior *inf)
pthdb_session_destroy (data->pd_session);
pid_to_prc (&inferior_ptid);
- data->pd_active = 0;
- data->pd_able = 0;
+ data->pd_active = false;
+ data->pd_able = false;
current_inferior ()->unpush_target (&aix_thread_ops);
}
--
2.51.2
next reply other threads:[~2026-09-18 12:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 12:20 Aditya Vidyadhar Kamath [this message]
2026-09-18 13:48 ` 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=20260918122004.37424-2-akamath996@gmail.com \
--to=akamath996@gmail.com \
--cc=Aditya.Kamath1@ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=sangamesh.swamy@in.ibm.com \
--cc=simon.marchi@polymtl.ca \
--cc=tom@tromey.com \
--cc=ulrich.weigand@de.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