Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [pushed 1/4] gdb/aix-thread: make state2str return const char *
@ 2026-11-24 16:38 Simon Marchi
  2026-11-24 16:38 ` [pushed 2/4] gdb/aix-thread: rename lambda parameter in pd_update Simon Marchi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Simon Marchi @ 2026-11-24 16:38 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Building aix-thread.c on AIX fails with:

    ../../../src/binutils-gdb/gdb/aix-thread.c:752:16: error: ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings]
    ../../../src/binutils-gdb/gdb/aix-thread.c:755:16: error: ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings]
    ../../../src/binutils-gdb/gdb/aix-thread.c:758:16: error: ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings]
    ../../../src/binutils-gdb/gdb/aix-thread.c:761:16: error: ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings]
    ../../../src/binutils-gdb/gdb/aix-thread.c:764:16: error: ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings]
    ../../../src/binutils-gdb/gdb/aix-thread.c:767:16: error: ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings]

Make state2str return `const char *`.  Its only caller passes the result
to a printf-like function, so it doesn't need a non-const pointer.

Change-Id: I686245abdfe6a4e3b40a8c467ea736a6bf18dd4b
---
 gdb/aix-thread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index ff41791acd28..96fd09a1b626 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -742,7 +742,7 @@ pdc_dealloc (pthdb_user_t user_current_pid, void *buf)
 
 /* Return a printable representation of pthread STATE.  */
 
-static char *
+static const char *
 state2str (pthdb_state_t state)
 {
   switch (state)

base-commit: 00c604b72792b914b93de07468f2a470b3d2cf4f
-- 
2.56.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pushed 2/4] gdb/aix-thread: rename lambda parameter in pd_update
  2026-11-24 16:38 [pushed 1/4] gdb/aix-thread: make state2str return const char * Simon Marchi
@ 2026-11-24 16:38 ` Simon Marchi
  2026-11-24 16:38 ` [pushed 3/4] gdb/aix-thread: remove unused priv variables Simon Marchi
  2026-11-24 16:38 ` [pushed 4/4] gdb/aix-thread: fix misleading indentation in store_regs_user_thread Simon Marchi
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Marchi @ 2026-11-24 16:38 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Building aix-thread.c on AIX fails with:

    ../../../src/binutils-gdb/gdb/aix-thread.c:932:45: error: declaration of 'thread' shadows a previous local [-Werror=shadow=compatible-local]

Rename the parameter of the lambda passed to find_thread from `thread`
to `tp`.

Change-Id: If9727c1d55ac33a9f3bce40003b2e48147cce3e0
---
 gdb/aix-thread.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 96fd09a1b626..8823b36509f2 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -929,9 +929,9 @@ pd_update (pid_t pid)
 
   tid = get_signaled_thread (pid);
   if (tid != 0)
-    thread = find_thread ([&] (thread_info *thread)
+    thread = find_thread ([&] (thread_info *tp)
       {
-	return thread->ptid.lwp () == tid;
+	return tp->ptid.lwp () == tid;
       });
   if (!thread)
     ptid = ptid_t (pid);
-- 
2.56.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pushed 3/4] gdb/aix-thread: remove unused priv variables
  2026-11-24 16:38 [pushed 1/4] gdb/aix-thread: make state2str return const char * Simon Marchi
  2026-11-24 16:38 ` [pushed 2/4] gdb/aix-thread: rename lambda parameter in pd_update Simon Marchi
@ 2026-11-24 16:38 ` Simon Marchi
  2026-11-24 16:38 ` [pushed 4/4] gdb/aix-thread: fix misleading indentation in store_regs_user_thread Simon Marchi
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Marchi @ 2026-11-24 16:38 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Building aix-thread.c on AIX fails with:

    ../../../src/binutils-gdb/gdb/aix-thread.c:1108:24: error: unused variable 'priv' [-Werror=unused-variable]
    ../../../src/binutils-gdb/gdb/aix-thread.c:2029:24: error: unused variable 'priv' [-Werror=unused-variable]

Remove them.  In aix_thread_target::pid_to_str, also remove the braces
that are now unnecessary.

Change-Id: Ie5820009a66332e20d583e5dec1a0f753b8d2723
---
 gdb/aix-thread.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 8823b36509f2..8f2c626c1641 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -1105,8 +1105,6 @@ aix_thread_target::resume (ptid_t ptid, int step, enum gdb_signal sig)
 	error (_("aix-thread resume: unknown pthread %ld"),
 	       ptid.lwp ());
 
-      aix_thread_info *priv = get_aix_thread_info (thread);
-
       tid[0] = ptid.lwp ();
       if (tid[0] == PTHDB_INVALID_TID)
 	error (_("aix-thread resume: no tid for pthread %ld"),
@@ -2025,12 +2023,8 @@ aix_thread_target::pid_to_str (ptid_t ptid)
   thread_info *thread_info = current_inferior ()->find_thread (ptid);
 
   if (thread_info != NULL && thread_info->priv != NULL)
-    {
-      aix_thread_info *priv = get_aix_thread_info (thread_info);
-
-      return string_printf (_("Thread %s (tid %s)"), pulongest (ptid.tid ()),
-			    pulongest (ptid.lwp ()));
-    }
+    return string_printf (_("Thread %s (tid %s)"), pulongest (ptid.tid ()),
+			  pulongest (ptid.lwp ()));
 
   return beneath ()->pid_to_str (ptid);
 }
-- 
2.56.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pushed 4/4] gdb/aix-thread: fix misleading indentation in store_regs_user_thread
  2026-11-24 16:38 [pushed 1/4] gdb/aix-thread: make state2str return const char * Simon Marchi
  2026-11-24 16:38 ` [pushed 2/4] gdb/aix-thread: rename lambda parameter in pd_update Simon Marchi
  2026-11-24 16:38 ` [pushed 3/4] gdb/aix-thread: remove unused priv variables Simon Marchi
@ 2026-11-24 16:38 ` Simon Marchi
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Marchi @ 2026-11-24 16:38 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Building aix-thread.c on AIX fails with:

    ../../../src/binutils-gdb/gdb/aix-thread.c:1699:7: error: this 'for' clause does not guard... [-Werror=misleading-indentation]

The checks for the vrsave and vscr registers are indented as if they
were part of the for loop body, but they are not.  Fix the indentation.

Change-Id: Ib2c6df20937779b4edd339a0d14076f1891ae185
---
 gdb/aix-thread.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 8f2c626c1641..967175e6682f 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -1701,10 +1701,11 @@ store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid)
 				   &(vmx.__vr[i]));
 	    ctx.vmx.__vr[i] = vmx.__vr[i];
 	  }
-	if (REG_VALID == regcache->get_register_status (tdep->ppc_vrsave_regnum))
-	  ctx.vmx.__vrsave = vmx.__vrsave;
-	if (REG_VALID == regcache->get_register_status (tdep->ppc_vrsave_regnum - 1))
-	  ctx.vmx.__vscr = vmx.__vscr;
+      if (REG_VALID == regcache->get_register_status (tdep->ppc_vrsave_regnum))
+	ctx.vmx.__vrsave = vmx.__vrsave;
+      if (REG_VALID
+	  == regcache->get_register_status (tdep->ppc_vrsave_regnum - 1))
+	ctx.vmx.__vscr = vmx.__vscr;
     }
 
   /* Fill vsx registers. */
-- 
2.56.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-24 16:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-24 16:38 [pushed 1/4] gdb/aix-thread: make state2str return const char * Simon Marchi
2026-11-24 16:38 ` [pushed 2/4] gdb/aix-thread: rename lambda parameter in pd_update Simon Marchi
2026-11-24 16:38 ` [pushed 3/4] gdb/aix-thread: remove unused priv variables Simon Marchi
2026-11-24 16:38 ` [pushed 4/4] gdb/aix-thread: fix misleading indentation in store_regs_user_thread Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox