Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 May 2014 11:10:01 GMT
From:      svn-freebsd-gecko@chruetertee.ch
To:        freebsd-gecko@freebsd.org
Subject:   [SVN-Commit] r1589 - in trunk: mail/thunderbird/files www/firefox-esr/files www/firefox-nightly/files www/firefox/files www/libxul/files www/seamonkey/files
Message-ID:  <201405261110.s4QBA1V8080107@trillian.chruetertee.ch>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Mon May 26 11:10:00 2014
New Revision: 1589

Log:
add BSD impl. of GetIsDebuggerAttached(), used by Telemetry and slow script dialog

Added:
   trunk/mail/thunderbird/files/patch-bug1013675
   trunk/www/firefox-esr/files/patch-bug1013675
   trunk/www/firefox-nightly/files/patch-bug1013675
   trunk/www/firefox/files/patch-bug1013675
   trunk/www/libxul/files/patch-bug1013675
   trunk/www/seamonkey/files/patch-bug1013675

Added: trunk/mail/thunderbird/files/patch-bug1013675
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/mail/thunderbird/files/patch-bug1013675	Mon May 26 11:10:00 2014	(r1589)
@@ -0,0 +1,89 @@
+diff --git xpcom/base/nsDebugImpl.cpp xpcom/base/nsDebugImpl.cpp
+index 13a286f..293bd73 100644
+--- mozilla/xpcom/base/nsDebugImpl.cpp
++++ mozilla/xpcom/base/nsDebugImpl.cpp
+@@ -45,13 +45,44 @@
+ #endif
+ #endif
+ 
+-#if defined(XP_MACOSX)
++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++ || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <stdbool.h>
+ #include <sys/types.h>
+ #include <unistd.h>
++#include <sys/param.h>
+ #include <sys/sysctl.h>
+ #endif
+ 
++#if defined(__OpenBSD__)
++#include <sys/proc.h>
++#endif
++
++#if defined(__DragonFly__) || defined(__FreeBSD__)
++#include <sys/user.h>
++#endif
++
++#if defined(__NetBSD__)
++#undef KERN_PROC
++#define KERN_PROC KERN_PROC2
++#define KINFO_PROC struct kinfo_proc2
++#else
++#define KINFO_PROC struct kinfo_proc
++#endif
++
++#if defined(XP_MACOSX)
++#define KP_FLAGS kp_proc.p_flag
++#elif defined(__DragonFly__)
++#define KP_FLAGS kp_flags
++#elif defined(__FreeBSD__)
++#define KP_FLAGS ki_flag
++#elif defined(__OpenBSD__) && !defined(_P_TRACED)
++#define KP_FLAGS p_psflags
++#define P_TRACED PS_TRACED
++#else
++#define KP_FLAGS p_flag
++#endif
++
+ #include "mozilla/mozalloc_abort.h"
+ 
+ static void
+@@ -144,16 +175,22 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
+ 
+ #if defined(XP_WIN)
+   *aResult = ::IsDebuggerPresent();
+-#elif defined(XP_MACOSX)
++#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++   || defined(__NetBSD__) || defined(__OpenBSD__)
+   // Specify the info we're looking for
+-  int mib[4];
+-  mib[0] = CTL_KERN;
+-  mib[1] = KERN_PROC;
+-  mib[2] = KERN_PROC_PID;
+-  mib[3] = getpid();
++  int mib[] = {
++    CTL_KERN,
++    KERN_PROC,
++    KERN_PROC_PID,
++    getpid(),
++#if defined(__NetBSD__) || defined(__OpenBSD__)
++    sizeof(KINFO_PROC),
++    1,
++#endif
++  };
+   size_t mibSize = sizeof(mib) / sizeof(int);
+ 
+-  struct kinfo_proc info;
++  KINFO_PROC info;
+   size_t infoSize = sizeof(info);
+   memset(&info, 0, infoSize);
+ 
+@@ -163,7 +200,7 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
+     return NS_OK;
+   }
+ 
+-  if (info.kp_proc.p_flag & P_TRACED) {
++  if (info.KP_FLAGS & P_TRACED) {
+     *aResult = true;
+   }
+ #endif

Added: trunk/www/firefox-esr/files/patch-bug1013675
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/www/firefox-esr/files/patch-bug1013675	Mon May 26 11:10:00 2014	(r1589)
@@ -0,0 +1,89 @@
+diff --git xpcom/base/nsDebugImpl.cpp xpcom/base/nsDebugImpl.cpp
+index 13a286f..293bd73 100644
+--- xpcom/base/nsDebugImpl.cpp
++++ xpcom/base/nsDebugImpl.cpp
+@@ -45,13 +45,44 @@
+ #endif
+ #endif
+ 
+-#if defined(XP_MACOSX)
++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++ || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <stdbool.h>
+ #include <sys/types.h>
+ #include <unistd.h>
++#include <sys/param.h>
+ #include <sys/sysctl.h>
+ #endif
+ 
++#if defined(__OpenBSD__)
++#include <sys/proc.h>
++#endif
++
++#if defined(__DragonFly__) || defined(__FreeBSD__)
++#include <sys/user.h>
++#endif
++
++#if defined(__NetBSD__)
++#undef KERN_PROC
++#define KERN_PROC KERN_PROC2
++#define KINFO_PROC struct kinfo_proc2
++#else
++#define KINFO_PROC struct kinfo_proc
++#endif
++
++#if defined(XP_MACOSX)
++#define KP_FLAGS kp_proc.p_flag
++#elif defined(__DragonFly__)
++#define KP_FLAGS kp_flags
++#elif defined(__FreeBSD__)
++#define KP_FLAGS ki_flag
++#elif defined(__OpenBSD__) && !defined(_P_TRACED)
++#define KP_FLAGS p_psflags
++#define P_TRACED PS_TRACED
++#else
++#define KP_FLAGS p_flag
++#endif
++
+ #include "mozilla/mozalloc_abort.h"
+ 
+ static void
+@@ -144,16 +175,22 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
+ 
+ #if defined(XP_WIN)
+   *aResult = ::IsDebuggerPresent();
+-#elif defined(XP_MACOSX)
++#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++   || defined(__NetBSD__) || defined(__OpenBSD__)
+   // Specify the info we're looking for
+-  int mib[4];
+-  mib[0] = CTL_KERN;
+-  mib[1] = KERN_PROC;
+-  mib[2] = KERN_PROC_PID;
+-  mib[3] = getpid();
++  int mib[] = {
++    CTL_KERN,
++    KERN_PROC,
++    KERN_PROC_PID,
++    getpid(),
++#if defined(__NetBSD__) || defined(__OpenBSD__)
++    sizeof(KINFO_PROC),
++    1,
++#endif
++  };
+   size_t mibSize = sizeof(mib) / sizeof(int);
+ 
+-  struct kinfo_proc info;
++  KINFO_PROC info;
+   size_t infoSize = sizeof(info);
+   memset(&info, 0, infoSize);
+ 
+@@ -163,7 +200,7 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
+     return NS_OK;
+   }
+ 
+-  if (info.kp_proc.p_flag & P_TRACED) {
++  if (info.KP_FLAGS & P_TRACED) {
+     *aResult = true;
+   }
+ #endif

Added: trunk/www/firefox-nightly/files/patch-bug1013675
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/www/firefox-nightly/files/patch-bug1013675	Mon May 26 11:10:00 2014	(r1589)
@@ -0,0 +1,88 @@
+diff --git xpcom/base/nsDebugImpl.cpp xpcom/base/nsDebugImpl.cpp
+index 13a286f..293bd73 100644
+--- xpcom/base/nsDebugImpl.cpp
++++ xpcom/base/nsDebugImpl.cpp
+@@ -45,12 +45,43 @@
+ #endif
+ #endif
+ 
+-#if defined(XP_MACOSX)
++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++ || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <stdbool.h>
+ #include <unistd.h>
++#include <sys/param.h>
+ #include <sys/sysctl.h>
+ #endif
+ 
++#if defined(__OpenBSD__)
++#include <sys/proc.h>
++#endif
++
++#if defined(__DragonFly__) || defined(__FreeBSD__)
++#include <sys/user.h>
++#endif
++
++#if defined(__NetBSD__)
++#undef KERN_PROC
++#define KERN_PROC KERN_PROC2
++#define KINFO_PROC struct kinfo_proc2
++#else
++#define KINFO_PROC struct kinfo_proc
++#endif
++
++#if defined(XP_MACOSX)
++#define KP_FLAGS kp_proc.p_flag
++#elif defined(__DragonFly__)
++#define KP_FLAGS kp_flags
++#elif defined(__FreeBSD__)
++#define KP_FLAGS ki_flag
++#elif defined(__OpenBSD__) && !defined(_P_TRACED)
++#define KP_FLAGS p_psflags
++#define P_TRACED PS_TRACED
++#else
++#define KP_FLAGS p_flag
++#endif
++
+ #include "mozilla/mozalloc_abort.h"
+ 
+ static void
+@@ -144,16 +175,22 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
+ 
+ #if defined(XP_WIN)
+   *aResult = ::IsDebuggerPresent();
+-#elif defined(XP_MACOSX)
++#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++   || defined(__NetBSD__) || defined(__OpenBSD__)
+   // Specify the info we're looking for
+-  int mib[4];
+-  mib[0] = CTL_KERN;
+-  mib[1] = KERN_PROC;
+-  mib[2] = KERN_PROC_PID;
+-  mib[3] = getpid();
++  int mib[] = {
++    CTL_KERN,
++    KERN_PROC,
++    KERN_PROC_PID,
++    getpid(),
++#if defined(__NetBSD__) || defined(__OpenBSD__)
++    sizeof(KINFO_PROC),
++    1,
++#endif
++  };
+   size_t mibSize = sizeof(mib) / sizeof(int);
+ 
+-  struct kinfo_proc info;
++  KINFO_PROC info;
+   size_t infoSize = sizeof(info);
+   memset(&info, 0, infoSize);
+ 
+@@ -163,7 +200,7 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
+     return NS_OK;
+   }
+ 
+-  if (info.kp_proc.p_flag & P_TRACED) {
++  if (info.KP_FLAGS & P_TRACED) {
+     *aResult = true;
+   }
+ #endif

Added: trunk/www/firefox/files/patch-bug1013675
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/www/firefox/files/patch-bug1013675	Mon May 26 11:10:00 2014	(r1589)
@@ -0,0 +1,88 @@
+diff --git xpcom/base/nsDebugImpl.cpp xpcom/base/nsDebugImpl.cpp
+index 13a286f..293bd73 100644
+--- xpcom/base/nsDebugImpl.cpp
++++ xpcom/base/nsDebugImpl.cpp
+@@ -45,12 +45,43 @@
+ #endif
+ #endif
+ 
+-#if defined(XP_MACOSX)
++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++ || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <stdbool.h>
+ #include <unistd.h>
++#include <sys/param.h>
+ #include <sys/sysctl.h>
+ #endif
+ 
++#if defined(__OpenBSD__)
++#include <sys/proc.h>
++#endif
++
++#if defined(__DragonFly__) || defined(__FreeBSD__)
++#include <sys/user.h>
++#endif
++
++#if defined(__NetBSD__)
++#undef KERN_PROC
++#define KERN_PROC KERN_PROC2
++#define KINFO_PROC struct kinfo_proc2
++#else
++#define KINFO_PROC struct kinfo_proc
++#endif
++
++#if defined(XP_MACOSX)
++#define KP_FLAGS kp_proc.p_flag
++#elif defined(__DragonFly__)
++#define KP_FLAGS kp_flags
++#elif defined(__FreeBSD__)
++#define KP_FLAGS ki_flag
++#elif defined(__OpenBSD__) && !defined(_P_TRACED)
++#define KP_FLAGS p_psflags
++#define P_TRACED PS_TRACED
++#else
++#define KP_FLAGS p_flag
++#endif
++
+ #include "mozilla/mozalloc_abort.h"
+ 
+ static void
+@@ -144,16 +175,22 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
+ 
+ #if defined(XP_WIN)
+   *aResult = ::IsDebuggerPresent();
+-#elif defined(XP_MACOSX)
++#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++   || defined(__NetBSD__) || defined(__OpenBSD__)
+   // Specify the info we're looking for
+-  int mib[4];
+-  mib[0] = CTL_KERN;
+-  mib[1] = KERN_PROC;
+-  mib[2] = KERN_PROC_PID;
+-  mib[3] = getpid();
++  int mib[] = {
++    CTL_KERN,
++    KERN_PROC,
++    KERN_PROC_PID,
++    getpid(),
++#if defined(__NetBSD__) || defined(__OpenBSD__)
++    sizeof(KINFO_PROC),
++    1,
++#endif
++  };
+   size_t mibSize = sizeof(mib) / sizeof(int);
+ 
+-  struct kinfo_proc info;
++  KINFO_PROC info;
+   size_t infoSize = sizeof(info);
+   memset(&info, 0, infoSize);
+ 
+@@ -163,7 +200,7 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
+     return NS_OK;
+   }
+ 
+-  if (info.kp_proc.p_flag & P_TRACED) {
++  if (info.KP_FLAGS & P_TRACED) {
+     *aResult = true;
+   }
+ #endif

Added: trunk/www/libxul/files/patch-bug1013675
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/www/libxul/files/patch-bug1013675	Mon May 26 11:10:00 2014	(r1589)
@@ -0,0 +1,89 @@
+diff --git xpcom/base/nsDebugImpl.cpp xpcom/base/nsDebugImpl.cpp
+index 13a286f..293bd73 100644
+--- xpcom/base/nsDebugImpl.cpp
++++ xpcom/base/nsDebugImpl.cpp
+@@ -45,13 +45,44 @@
+ #endif
+ #endif
+ 
+-#if defined(XP_MACOSX)
++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++ || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <stdbool.h>
+ #include <sys/types.h>
+ #include <unistd.h>
++#include <sys/param.h>
+ #include <sys/sysctl.h>
+ #endif
+ 
++#if defined(__OpenBSD__)
++#include <sys/proc.h>
++#endif
++
++#if defined(__DragonFly__) || defined(__FreeBSD__)
++#include <sys/user.h>
++#endif
++
++#if defined(__NetBSD__)
++#undef KERN_PROC
++#define KERN_PROC KERN_PROC2
++#define KINFO_PROC struct kinfo_proc2
++#else
++#define KINFO_PROC struct kinfo_proc
++#endif
++
++#if defined(XP_MACOSX)
++#define KP_FLAGS kp_proc.p_flag
++#elif defined(__DragonFly__)
++#define KP_FLAGS kp_flags
++#elif defined(__FreeBSD__)
++#define KP_FLAGS ki_flag
++#elif defined(__OpenBSD__) && !defined(_P_TRACED)
++#define KP_FLAGS p_psflags
++#define P_TRACED PS_TRACED
++#else
++#define KP_FLAGS p_flag
++#endif
++
+ #include "mozilla/mozalloc_abort.h"
+ 
+ static void
+@@ -144,16 +175,22 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
+ 
+ #if defined(XP_WIN)
+   *aResult = ::IsDebuggerPresent();
+-#elif defined(XP_MACOSX)
++#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++   || defined(__NetBSD__) || defined(__OpenBSD__)
+   // Specify the info we're looking for
+-  int mib[4];
+-  mib[0] = CTL_KERN;
+-  mib[1] = KERN_PROC;
+-  mib[2] = KERN_PROC_PID;
+-  mib[3] = getpid();
++  int mib[] = {
++    CTL_KERN,
++    KERN_PROC,
++    KERN_PROC_PID,
++    getpid(),
++#if defined(__NetBSD__) || defined(__OpenBSD__)
++    sizeof(KINFO_PROC),
++    1,
++#endif
++  };
+   size_t mibSize = sizeof(mib) / sizeof(int);
+ 
+-  struct kinfo_proc info;
++  KINFO_PROC info;
+   size_t infoSize = sizeof(info);
+   memset(&info, 0, infoSize);
+ 
+@@ -163,7 +200,7 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
+     return NS_OK;
+   }
+ 
+-  if (info.kp_proc.p_flag & P_TRACED) {
++  if (info.KP_FLAGS & P_TRACED) {
+     *aResult = true;
+   }
+ #endif

Added: trunk/www/seamonkey/files/patch-bug1013675
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/www/seamonkey/files/patch-bug1013675	Mon May 26 11:10:00 2014	(r1589)
@@ -0,0 +1,88 @@
+diff --git xpcom/base/nsDebugImpl.cpp xpcom/base/nsDebugImpl.cpp
+index 13a286f..293bd73 100644
+--- mozilla/xpcom/base/nsDebugImpl.cpp
++++ mozilla/xpcom/base/nsDebugImpl.cpp
+@@ -45,12 +45,43 @@
+ #endif
+ #endif
+ 
+-#if defined(XP_MACOSX)
++#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++ || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <stdbool.h>
+ #include <unistd.h>
++#include <sys/param.h>
+ #include <sys/sysctl.h>
+ #endif
+ 
++#if defined(__OpenBSD__)
++#include <sys/proc.h>
++#endif
++
++#if defined(__DragonFly__) || defined(__FreeBSD__)
++#include <sys/user.h>
++#endif
++
++#if defined(__NetBSD__)
++#undef KERN_PROC
++#define KERN_PROC KERN_PROC2
++#define KINFO_PROC struct kinfo_proc2
++#else
++#define KINFO_PROC struct kinfo_proc
++#endif
++
++#if defined(XP_MACOSX)
++#define KP_FLAGS kp_proc.p_flag
++#elif defined(__DragonFly__)
++#define KP_FLAGS kp_flags
++#elif defined(__FreeBSD__)
++#define KP_FLAGS ki_flag
++#elif defined(__OpenBSD__) && !defined(_P_TRACED)
++#define KP_FLAGS p_psflags
++#define P_TRACED PS_TRACED
++#else
++#define KP_FLAGS p_flag
++#endif
++
+ #include "mozilla/mozalloc_abort.h"
+ 
+ static void
+@@ -144,16 +175,22 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
+ 
+ #if defined(XP_WIN)
+   *aResult = ::IsDebuggerPresent();
+-#elif defined(XP_MACOSX)
++#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
++   || defined(__NetBSD__) || defined(__OpenBSD__)
+   // Specify the info we're looking for
+-  int mib[4];
+-  mib[0] = CTL_KERN;
+-  mib[1] = KERN_PROC;
+-  mib[2] = KERN_PROC_PID;
+-  mib[3] = getpid();
++  int mib[] = {
++    CTL_KERN,
++    KERN_PROC,
++    KERN_PROC_PID,
++    getpid(),
++#if defined(__NetBSD__) || defined(__OpenBSD__)
++    sizeof(KINFO_PROC),
++    1,
++#endif
++  };
+   size_t mibSize = sizeof(mib) / sizeof(int);
+ 
+-  struct kinfo_proc info;
++  KINFO_PROC info;
+   size_t infoSize = sizeof(info);
+   memset(&info, 0, infoSize);
+ 
+@@ -163,7 +200,7 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
+     return NS_OK;
+   }
+ 
+-  if (info.kp_proc.p_flag & P_TRACED) {
++  if (info.KP_FLAGS & P_TRACED) {
+     *aResult = true;
+   }
+ #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405261110.s4QBA1V8080107>