]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 446251 TARGET_SIGNAL_THR added to enum target_signal
authorPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 29 Nov 2021 21:44:17 +0000 (22:44 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Mon, 29 Nov 2021 21:44:17 +0000 (22:44 +0100)
gdb considers FreeBSD SIGTHR to be the evuivalent if SIGLWP
not a signal in its own right. Remove the extra enum entry
(which fixes errors in converting signals from number to
string) and map TARGET_SIGNAL_LWP to SIGTHR.

coregrind/m_gdbserver/gdb/signals.h
coregrind/m_gdbserver/signals.c

index 4857475fa38e675261e665f125e9e66f23a53c83..81f373ae7820025a32405af0185dd3428d4cb728 100644 (file)
@@ -137,9 +137,6 @@ enum target_signal
     /* Used internally by Solaris threads.  See signal(5) on Solaris.  */
     TARGET_SIGNAL_CANCEL = 76,
 
-    /* Similar to the above, but for FreeBSD */
-    TARGET_SIGNAL_THR = 77,
-
     /* Yes, this pains me, too.  But LynxOS didn't have SIG32, and now
        GNU/Linux does, and we can't disturb the numbering, since it's
        part of the remote protocol.  Note that in some GDB's
@@ -235,6 +232,8 @@ enum target_signal
 
     /* If you are adding a new signal, add it just above this comment.  */
 
+
+
     /* Last and unused enum value, for sizing arrays, etc.  */
     TARGET_SIGNAL_LAST
   };
index 9aee90fcba8a979ece4344ef5c3be004327ba09e..fc4cdf21787d418b12c7682e88340c8e6c4f8ce8 100644 (file)
@@ -78,7 +78,7 @@ static struct {
       {"SIGWIND", "SIGWIND"},
       {"SIGPHONE", "SIGPHONE"},
       {"SIGWAITING", "Process's LWPs are blocked"},
-      {"SIGLWP", "Signal LWP"},
+      {"SIGLWP", "Signal LWP"}, /* FreeBSD SIGTHR */
       {"SIGDANGER", "Swap space dangerously low"},
       {"SIGGRANT", "Monitor mode granted"},
       {"SIGRETRACT", "Need to relinquish monitor mode"},
@@ -404,10 +404,6 @@ enum target_signal target_signal_from_host (int hostsig)
    if (hostsig == VKI_SIGCANCEL)
       return TARGET_SIGNAL_CANCEL;
 #endif
-#if defined(VKI_SIGTHR)
-   if (hostsig == VKI_SIGTHR)
-      return TARGET_SIGNAL_THR;
-#endif
 #if defined (VKI_SIGLWP)
    if (hostsig == VKI_SIGLWP)
       return TARGET_SIGNAL_LWP;
@@ -475,6 +471,10 @@ enum target_signal target_signal_from_host (int hostsig)
    if (hostsig == VKI_SIGLIBRT)
       return TARGET_SIGNAL_LIBRT;
 #endif
+#if defined(VKI_SIGTHR)
+   if (hostsig == VKI_SIGTHR)
+      return TARGET_SIGNAL_LWP;
+#endif
 
 #if defined (VKI_SIGRTMIN)
    if (hostsig >= VKI_SIGRTMIN && hostsig < VKI_SIGRTMAX) {
@@ -661,10 +661,6 @@ int do_target_signal_to_host (enum target_signal oursig,
    case TARGET_SIGNAL_CANCEL:
       return VKI_SIGCANCEL;
 #endif
-#if defined (VKI_SIGTHR)
-   case TARGET_SIGNAL_THR:
-      return VKI_SIGTHR;
-#endif
 #if defined (VKI_SIGLWP)
    case TARGET_SIGNAL_LWP:
       return VKI_SIGLWP;
@@ -732,6 +728,10 @@ int do_target_signal_to_host (enum target_signal oursig,
    case TARGET_SIGNAL_LIBRT:
       return SIGLIBRT;
 #endif
+#if defined (VKI_SIGTHR)
+   case TARGET_SIGNAL_LWP:
+      return VKI_SIGTHR;
+#endif
 
    default:
 #if defined (VKI_SIGRTMIN)