[3/9] fbsd-nat: Use correct constant for target_waitstatus::sig.

Message ID 20230228181845.99936-4-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
  Use GDB_SIGNAL_TRAP instead of SIGTRAP.  This is a no-op since the
value of SIGTRAP on FreeBSD matches the value of GDB_SIGNAL_TRAP, but
it is more correct.
---
 gdb/fbsd-nat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Simon Marchi March 20, 2023, 5:47 p.m. UTC | #1
On 2/28/23 13:18, John Baldwin wrote:
> Use GDB_SIGNAL_TRAP instead of SIGTRAP.  This is a no-op since the
> value of SIGTRAP on FreeBSD matches the value of GDB_SIGNAL_TRAP, but
> it is more correct.
> ---
>  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 2f5b512fb33..04d67fc5278 100644
> --- a/gdb/fbsd-nat.c
> +++ b/gdb/fbsd-nat.c
> @@ -1439,7 +1439,7 @@ fbsd_nat_target::wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus,
>  	     SIGTRAP, so only treat SIGTRAP events as system call
>  	     entry/exit events.  */
>  	  if (pl.pl_flags & (PL_FLAG_SCE | PL_FLAG_SCX)
> -	      && ourstatus->sig () == SIGTRAP)
> +	      && ourstatus->sig () == GDB_SIGNAL_TRAP)
>  	    {
>  #ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
>  	      if (catch_syscall_enabled ())
> -- 
> 2.38.1
> 

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

Simon
  

Patch

diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index 2f5b512fb33..04d67fc5278 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -1439,7 +1439,7 @@  fbsd_nat_target::wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus,
 	     SIGTRAP, so only treat SIGTRAP events as system call
 	     entry/exit events.  */
 	  if (pl.pl_flags & (PL_FLAG_SCE | PL_FLAG_SCX)
-	      && ourstatus->sig () == SIGTRAP)
+	      && ourstatus->sig () == GDB_SIGNAL_TRAP)
 	    {
 #ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
 	      if (catch_syscall_enabled ())