[RFC,3/3,gdb/procfs.c] Build failure in find_stop_signal.

Message ID MWHPR1001MB2224780013FEA56210238395FF139@MWHPR1001MB2224.namprd10.prod.outlook.com
State New
Headers show
Series
  • [RFC,1/3] Fix parsing of auxiliary vector on Solaris.
Related show

Commit Message

Simon Marchi via Gdb-patches July 14, 2021, 1:19 p.m.
From fee608e1297bd24c4c32a3a8a56b08d85abac397 Mon Sep 17 00:00:00 2001
From: Libor Bukata <libor.bukata@oracle.com>
Date: Wed, 14 Jul 2021 05:38:46 -0700
Subject: [PATCH 3/3] [gdb/procfs.c] Build failure in find_stop_signal.

It fixes a regression caused by commit
1edb66d856c82c389edfd7610143236a68c76846
where thread_info::suspend was made private.

The public thread_info API has to be used
to get stop signal and avoid build failures.

gdb/ChangeLog:

2021-07-14  Libor Bukata <libor.bukata@oracle.com>

  * gdb/procfs.c (find_stop_signal): Use thread_info API.
---
 gdb/procfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Simon Marchi via Gdb-patches July 15, 2021, 12:48 a.m. | #1
On 2021-07-14 9:19 a.m., Libor Bukata via Gdb-patches wrote:
> From fee608e1297bd24c4c32a3a8a56b08d85abac397 Mon Sep 17 00:00:00 2001

> From: Libor Bukata <libor.bukata@oracle.com>

> Date: Wed, 14 Jul 2021 05:38:46 -0700

> Subject: [PATCH 3/3] [gdb/procfs.c] Build failure in find_stop_signal.

> 

> It fixes a regression caused by commit

> 1edb66d856c82c389edfd7610143236a68c76846

> where thread_info::suspend was made private.

> 

> The public thread_info API has to be used

> to get stop signal and avoid build failures.

> 

> gdb/ChangeLog:

> 

> 2021-07-14  Libor Bukata <libor.bukata@oracle.com>

> 

>   * gdb/procfs.c (find_stop_signal): Use thread_info API.

> ---

>  gdb/procfs.c | 4 ++--

>  1 file changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/gdb/procfs.c b/gdb/procfs.c

> index 529ee33df90..8343865e447 100644

> --- a/gdb/procfs.c

> +++ b/gdb/procfs.c

> @@ -3576,7 +3576,7 @@ procfs_corefile_thread_callback (procinfo *pi, procinfo *thread, void *data)

>  static int

>  find_signalled_thread (struct thread_info *info, void *data)

>  {

> -  if (info->suspend.stop_signal != GDB_SIGNAL_0

> +  if (info->stop_signal () != GDB_SIGNAL_0

>        && info->ptid.pid () == inferior_ptid.pid ())

>      return 1;

>  

> @@ -3590,7 +3590,7 @@ find_stop_signal (void)

>      iterate_over_threads (find_signalled_thread, NULL);

>  

>    if (info)

> -    return info->suspend.stop_signal;

> +    return info->stop_signal ();

>    else

>      return GDB_SIGNAL_0;

>  }

> 


Oh, my bad, sorry.  I pushed your fix to the master branch, thanks.

Simon

Patch

diff --git a/gdb/procfs.c b/gdb/procfs.c
index 529ee33df90..8343865e447 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -3576,7 +3576,7 @@  procfs_corefile_thread_callback (procinfo *pi, procinfo *thread, void *data)
 static int
 find_signalled_thread (struct thread_info *info, void *data)
 {
-  if (info->suspend.stop_signal != GDB_SIGNAL_0
+  if (info->stop_signal () != GDB_SIGNAL_0
       && info->ptid.pid () == inferior_ptid.pid ())
     return 1;
 
@@ -3590,7 +3590,7 @@  find_stop_signal (void)
     iterate_over_threads (find_signalled_thread, NULL);
 
   if (info)
-    return info->suspend.stop_signal;
+    return info->stop_signal ();
   else
     return GDB_SIGNAL_0;
 }