aboutsummaryrefslogtreecommitdiff
path: root/gdb/gnu-nat.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2016-12-05 11:59:03 +0100
committerThomas Schwinge <thomas@codesourcery.com>2016-12-08 08:29:39 +0100
commit21389b7f3451a482e14fef9bd32257c4c87f4317 (patch)
treeb192b3c783433da11a906f825aa6f8b3bc5afc35 /gdb/gnu-nat.c
parent0947023d1d4b5d8803a1065d622f707010b2bcdc (diff)
downloadgdb-21389b7f3451a482e14fef9bd32257c4c87f4317.zip
gdb-21389b7f3451a482e14fef9bd32257c4c87f4317.tar.gz
gdb-21389b7f3451a482e14fef9bd32257c4c87f4317.tar.bz2
Hurd, C++: Mach/Hurd headers and MIG stubs are not yet fit for C++
..., so handle these in "C" mode still: gdb/ * config/i386/i386gnu.mh (%_S.o %_U.o): Add "-x c" to "COMPILE.post". * gnu-nat.c: #include Mach/Hurd headers before all others. Wrap Mach/Hurd headers and MIG stubs' prototypes in 'extern "C"'. * i386-gnu-nat.c: Likewise.
Diffstat (limited to 'gdb/gnu-nat.c')
-rw-r--r--gdb/gnu-nat.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index ae4430d..5fd59a2 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -20,14 +20,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include "defs.h"
-
-#include <ctype.h>
-#include <limits.h>
-#include <setjmp.h>
-#include <signal.h>
-#include <sys/ptrace.h>
-
+/* Mach/Hurd headers are not yet ready for C++ compilation. */
+extern "C"
+{
#include <mach.h>
#include <mach_error.h>
#include <mach/exception.h>
@@ -48,6 +43,15 @@
#include <hurd/sigpreempt.h>
#include <portinfo.h>
+}
+
+#include "defs.h"
+
+#include <ctype.h>
+#include <limits.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <sys/ptrace.h>
#include "inferior.h"
#include "symtab.h"
@@ -63,12 +67,16 @@
#include "gnu-nat.h"
#include "inf-child.h"
+/* MIG stubs are not yet ready for C++ compilation. */
+extern "C"
+{
#include "exc_request_S.h"
#include "notify_S.h"
#include "process_reply_S.h"
#include "msg_reply_S.h"
#include "exc_request_U.h"
#include "msg_U.h"
+}
static process_t proc_server = MACH_PORT_NULL;
@@ -1443,6 +1451,12 @@ struct inf *gnu_current_inf = 0;
multi-threaded, we don't bother to lock this. */
struct inf *waiting_inf;
+/* MIG stubs are not yet ready for C++ compilation. */
+extern "C" int exc_server (mach_msg_header_t *, mach_msg_header_t *);
+extern "C" int msg_reply_server (mach_msg_header_t *, mach_msg_header_t *);
+extern "C" int notify_server (mach_msg_header_t *, mach_msg_header_t *);
+extern "C" int process_reply_server (mach_msg_header_t *, mach_msg_header_t *);
+
/* Wait for something to happen in the inferior, returning what in STATUS. */
static ptid_t
gnu_wait (struct target_ops *ops,
@@ -1458,11 +1472,6 @@ gnu_wait (struct target_ops *ops,
struct proc *thread;
struct inf *inf = gnu_current_inf;
- extern int exc_server (mach_msg_header_t *, mach_msg_header_t *);
- extern int msg_reply_server (mach_msg_header_t *, mach_msg_header_t *);
- extern int notify_server (mach_msg_header_t *, mach_msg_header_t *);
- extern int process_reply_server (mach_msg_header_t *, mach_msg_header_t *);
-
gdb_assert (inf->task);
if (!inf->threads && !inf->pending_execs)