[2/9] fbsd-nat: Avoid a direct write to target_waitstatus::kind.

Message ID 20230228181845.99936-3-jhb@FreeBSD.org
State New
Headers
Series Fixes for multiprocess for FreeBSD's native target |

Commit Message

John Baldwin Feb. 28, 2023, 6:18 p.m. UTC
  This is in #ifdef'd code for a workaround for FreeBSD versions older
than 11.1 which is why it wasn't caught earlier.
---
 gdb/fbsd-nat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Simon Marchi March 20, 2023, 5:45 p.m. UTC | #1
On 2/28/23 13:18, John Baldwin wrote:
> This is in #ifdef'd code for a workaround for FreeBSD versions older
> than 11.1 which is why it wasn't caught earlier.
> ---
>  gdb/fbsd-nat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
> index 4e48bfa1590..2f5b512fb33 100644
> --- a/gdb/fbsd-nat.c
> +++ b/gdb/fbsd-nat.c
> @@ -1261,7 +1261,7 @@ fbsd_nat_target::wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus,
>        wptid = fbsd_next_vfork_done ();
>        if (wptid != null_ptid)
>  	{
> -	  ourstatus->kind = TARGET_WAITKIND_VFORK_DONE;
> +	  ourstatus->set_vfork_done ();
>  	  return wptid;
>  	}
>  #endif
> -- 
> 2.38.1
> 

Approved-By: Simon Marchi <simon.marchi@efficios.com>

I think this could also be considered obvious, and you are the
maintainer of this fail anyway, so it's fine to just push fixes that are
likely not controversial.

Simon
  

Patch

diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index 4e48bfa1590..2f5b512fb33 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -1261,7 +1261,7 @@  fbsd_nat_target::wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus,
       wptid = fbsd_next_vfork_done ();
       if (wptid != null_ptid)
 	{
-	  ourstatus->kind = TARGET_WAITKIND_VFORK_DONE;
+	  ourstatus->set_vfork_done ();
 	  return wptid;
 	}
 #endif